How to get syntax error description in mysql

My specific problem is resolved before the question is completed. But I still have a general question. This may be a duplicate, but I'm sorry I could not find it on SO or elsewhere.

I have a table called reports . There is one line containing data. When I tried to execute the update request, I get an error message:

error 1064: in your sql syntax there is an error next to 'table =' defect ', Filter =' ', dtFilter =' ', query =' Select all fields from the defect ',' da 'on line 1

My question is: is there a way to get my specific error? Because it only said that there was an error in the SQL syntax, but nothing about what type of error there is.

Should I always search Google for such errors or is there some method to get their exact concrete description locally?

Background (additional reading): after a normal Google search, I got a hint, posting a question for a better Google search and solve my specific problem, as I found out that this is a table and datetime backup word problem. The problem is resolved when I put quotes around these words. This usually happens to me. But my common problem still exists ...

Now this is useless, but I'm sharing my schema here on sqlfiddle , it might be useful

+3
source share
2 answers

MySQL cannot tell you that you are using a reserved word in the wrong place (or your place is correct, but the word used is a reserve word, it cannot differentiate), it only sees what you enter, it cannot read thoughts, so it cannot know that you accidentally used (say) an order as a field name, he just sees the right part of the request in the wrong place. For example ... syntax error. It will also not report all syntax errors in the request, because one syntax error does it all wrong. it cannot miss a word and continue analysis.

+2
source

No - it just tells you about the position, which, I hope, is a worthy clue.

+1
source

Source: https://habr.com/ru/post/1435387/


All Articles