Should syntax errors / script errors be corrected via edits?

Today I found an answer from a new poster that has a syntax error in it.

As far as I can tell, I have a few routes to attempt to deal with this:

1. Edit the post directly without commenting - this means the original poster of the answer doesn't get an attempt to fix the issue themselves, but does get the answer to their syntax issue given to them
2. Comment on the answer in an effort to get the original poster to fix the issue - this has actually been done already on the aforementioned post but the original poster hasn't fixed the issue - there's a risk that the user will simply never fix the problem
3. Downvote the post - this indicates to the poster that the answer isn't respected as a good answer, but may not indicate the issue and may come across as unhelpful or unfriendly

There are then combinations of the above 3 methods.

What are peoples feelings on the best way to approach this? Is this a completely personal question, or do we have/want some kind of site-level guidance?

In this case, GROUP BY should pretty clearly be PARTITION BY so an edit would be nothing but helpful.