Introduction
The MySQL server works in different SQL modes and can be applied in different ways for different clients. In this way, the application can tailor the server operation to suit its needs. Such patterns define the SQL syntax that MySQL should support, and what validation checks should be performed on the data. This makes it easier to use MySQL with other database servers in many different environments. Starting with MySQL 4.1 , you can also start with SET[session| Global]sql_mode= ' Mode1,mode2 ... ' statement, change the mode by setting the Sql_mode variable.
After MySQL is installed under *nux, the default Sql_mode value is empty, in which case MySQL performs a strict check, such as when the query condition is a string type, if there is no corresponding Sql_mode setting, then where column = "..." or where column = ' ... ' are allowed.
Here's a simple chestnut??, by modifying the Sql_mode to solve this problem:
In this example: Table wm_poi_dispatch_setting has a varchar-type field diff because sql_mode defaults to null, so where diff = "234" is passed and the result is obtained; When you modify the Sql_mode to ' Ansi_quotes ', when queried again, the discovery will prompt the ERROR 1054 (42S22): Unknown column ' 234 ' in ' WHERE clause '.
With the example above, the simple setup of Sql_mode can solve this problem, that is, the ability to control the SQL specification, but also to recognize the "character."
Sql_mode Common Values
Mysql--sql Mode detailed