A Question Asker
A Question Asker

Reputation: 3321

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.

version is 5.1.42

Thanks!

Upvotes: 0

Views: 55

Answers (1)

Paul Dixon
Paul Dixon

Reputation: 300855

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.

Upvotes: 3

Related Questions