Errors that appear when using SavePoint statements in mysql
Help a colleague solve a case a few days ago.In the master-slave replication environment, the version number on the slave library is 5.5.5, and the following error is encountered:
The first feeling is that I have encountered a reserved keyword, but seeing such a long string, it should not be a reserved keyword.
After trying, I finally found that the "e" character in the string may report an error if it exists.It seems that it should be a bug.
I did find this bug in the MySQL bug system, but looking at the bug description, it should have been fixed in version 5.5, it seems too unreliable~~
About this bug: Savepoint identifier is occasionally considered as floating point numbers
In fact, in addition to upgrading the version, the solution is also very simple, just quote the identifier string after the savepoint with backticks (the lower key of the tilde, called the backticks key in English).
This case also reminds us that when writing SQL, when it comes to the names of databases, tables, fields, identifiers, etc., it is best to use backticks to ensure availability.
I once saw that there is a field name in the online data table called check.This name has long been a reserved keyword in MySQL.Fortunately, the development students are more reliable, and they have added backticks.
2 bugs about savepoint:
Savepoint Identifier should be enclosed with backticks
Savepoint identifier is occasionally considered as floating point numbers