Description:
Although sql_mode for the SQL thread is inherited from the @@global it
might change at handling of some of event irrecoverably.
Consider e.g:
Query_log_event::do_apply_event()
if (sql_mode_inited)
thd->variables.sql_mode=
(ulong) ((thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE) |
(sql_mode & ~(ulong) MODE_NO_DIR_IN_CREATE));
In effect of executing of the pasted code, the slave sql thread looses
the former @@session that might have set on purpose to some sensible
value (e.g bug#38173 needs it to control reaction on lack of the
default value for a field).
How to repeat:
look into source code;
gdb with br point at the forementioned code.
Suggested fix:
To make sure that sql_mode is restored each time an event handler
needs to change it from the initial value.
Description: Although sql_mode for the SQL thread is inherited from the @@global it might change at handling of some of event irrecoverably. Consider e.g: Query_log_event::do_apply_event() if (sql_mode_inited) thd->variables.sql_mode= (ulong) ((thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE) | (sql_mode & ~(ulong) MODE_NO_DIR_IN_CREATE)); In effect of executing of the pasted code, the slave sql thread looses the former @@session that might have set on purpose to some sensible value (e.g bug#38173 needs it to control reaction on lack of the default value for a field). How to repeat: look into source code; gdb with br point at the forementioned code. Suggested fix: To make sure that sql_mode is restored each time an event handler needs to change it from the initial value.