In a MySQL environment that is not strict, is there a way to test a query using strict?
I know that there is STRICT_ALL_TABLES, but I am not the admin and absolutely cannot set that on the database. However, I was wondering if I could set that for a query, kind of like select SQL_NO_CACHE, for debugging purposes.
开发者_Go百科version is 5.1.42
Thanks!
You can set strict mode just for your connection with
SET SESSION sql_mode='STRICT_ALL_TABLES';
Having set it, you can then execute your query on the same connection.
See manual for more details.
精彩评论