I understand that MySQL WARNING statements, with respect to replication unsafe statements, are not 100% valid.

That is, if you know what you are doing, if you understand the schema, there are indeed many cases where the warning can safely be ignored.

However, that said, I find it particularly vexing that MySQL does not allow someone to force ALL 'unsafe' replication warnings to act as errors.

What value do such warnings have, warnings that essentially means "this query could cause your slave to have different data than the master!", when you only receive that warning AFTER the query has run.

If the query is one that does cause different data on the slave and master, well too bad, it's too late, and essentially the warning only means "Sorry buddy, you've screwed up, thought you'd like to know".

Some may suggest I turn on MIXED. However, people often choose not to use MIXED for quite a variety of reasons. And, what I am hoping for here is specific to STATEMENT based only.


Does anyone know any way to FORCE all WARNING messages about unsafe SQL statements to instead throw ERROR?

And, this MUST be server side. The problem is that even a skill DBA might accidentally write a query without fully considering things, or that a junior might make an accident.

Optimal, would be an ERROR thrown, but if someone prepended with "SET I_KNOW_THIS_IS_DANGEROUS_I_SAY_ITS_OK=1; ", then the query would run.

TL;DR what use is a warning about corruption, without even asking if it is OK to continue?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.