mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 21:42:35 +01:00
173d29536d
Mysql server crashes because unsafe statements warning is wrongly elevated to error, which is set the error status of Diagnostics_area of the thread in THD::binlog_query(). Yet the caller believes that binary logging shouldn't touch the status, so it will set the status also later by my_ok(), my_error() or my_message() seperately according to the execution result of the statement or transaction. But the status of Diagnostics_area of the thread is allowed to set only once. Fixed to clear the error wrongly set by binary logging, but keep the warning message. mysql-test/suite/binlog/r/binlog_stm_ps.result: Change unsafe warning to NOTE level mysql-test/suite/binlog/r/binlog_unsafe.result: Test case result for unsafe statements to ensure mysql sever don't crash mysql-test/suite/binlog/t/binlog_unsafe.test: Test case for unsafe statements to ensure mysql sever don't crash mysql-test/suite/rpl/r/rpl_skip_error.result: Change unsafe warning to NOTE level mysql-test/suite/rpl/r/rpl_stm_loadfile.result: Change unsafe warning to NOTE level mysql-test/suite/rpl/r/rpl_udf.result: Change unsafe warning to NOTE level sql/sql_class.cc: the error status of the thread is cleared When a warning is elevated to an error because of unsafe warning of binary log.
22 lines
807 B
Text
22 lines
807 B
Text
drop table if exists t1;
|
|
reset master;
|
|
create table t1 (a int);
|
|
prepare s from "insert into t1 values (@a),(?)";
|
|
set @a=98;
|
|
execute s using @a;
|
|
prepare s from "insert into t1 values (?)";
|
|
set @a=99;
|
|
execute s using @a;
|
|
prepare s from "insert into t1 select 100 limit ?";
|
|
set @a=100;
|
|
execute s using @a;
|
|
Warnings:
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
show binlog events from <binlog_start>;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 # Query # # use `test`; create table t1 (a int)
|
|
master-bin.000001 # User var # # @`a`=98
|
|
master-bin.000001 # Query # # use `test`; insert into t1 values (@a),(98)
|
|
master-bin.000001 # Query # # use `test`; insert into t1 values (99)
|
|
master-bin.000001 # Query # # use `test`; insert into t1 select 100 limit 100
|
|
drop table t1;
|