1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Do not ignore sql_mode when replicating

Division by zero is a good example. sql_mode is basically ignored by
replication, see Bug#56662.

The behavior for ONLINE should remain the same as for non-ONLINE ALTER.
This commit is contained in:
Nikita Malyavin
2022-07-04 19:34:32 +03:00
committed by Sergei Golubchik
parent bdbd357362
commit b0db7239b1
3 changed files with 52 additions and 1 deletions

View File

@ -626,6 +626,7 @@ a
3
NULL
NULL
set sql_mode=default;
connection default;
drop table t1;
set debug_sync= reset;
@ -707,5 +708,24 @@ connection default;
drop table t1;
set debug_sync= reset;
#
# Do not ignore sql_mode when replicating
#
create table t1 (a int);
insert into t1 values (1);
set debug_sync= 'now wait_for downgraded';
connection con2;
set sql_mode='STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO';
set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
alter table t1 add b int as (1/a) stored, algorithm=copy, lock=none;
connection default;
update t1 set a= 0 where a=1;
set debug_sync= 'now signal goforit';
connection con2;
ERROR 22012: Division by 0
set sql_mode= default;
connection default;
drop table t1;
set debug_sync= reset;
#
# End of 11.2 tests
#