mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
Backport into build-200906240007-5.1.34sp1
> ------------------------------------------------------------ > revno: 2852.2.1 > revision-id: gni@mysql.com-20090403182157-de6ecrtzlgvpl5mk > parent: timothy.smith@sun.com-20090402083720-b7i3jr4dmvwjakcj > committer: Guangbao Ni <gni@mysql.com> > branch nick: bugteam-5.1-bug42640 > timestamp: Fri 2009-04-03 18:21:57 +0000 > message: > BUG#42640 mysqld crashes when unsafe statements are executed (STRICT_TRANS_TABLESmode) > > 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.
This commit is contained in:
parent
f5883e8d69
commit
cf1f35a1e1
7 changed files with 105 additions and 64 deletions
|
@ -11,7 +11,7 @@ prepare s from "insert into t1 select 100 limit ?";
|
||||||
set @a=100;
|
set @a=100;
|
||||||
execute s using @a;
|
execute s using @a;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
show binlog events from <binlog_start>;
|
show binlog events from <binlog_start>;
|
||||||
Log_name Pos Event_type Server_id End_log_pos Info
|
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 # Query # # use `test`; create table t1 (a int)
|
||||||
|
|
|
@ -10,25 +10,25 @@ INSERT DELAYED INTO t1 VALUES (5);
|
||||||
---- Insert directly ----
|
---- Insert directly ----
|
||||||
INSERT INTO t1 VALUES (@@global.sync_binlog);
|
INSERT INTO t1 VALUES (@@global.sync_binlog);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
INSERT INTO t1 VALUES (@@session.insert_id);
|
INSERT INTO t1 VALUES (@@session.insert_id);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
INSERT INTO t1 VALUES (@@global.auto_increment_increment);
|
INSERT INTO t1 VALUES (@@global.auto_increment_increment);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
INSERT INTO t2 SELECT UUID();
|
INSERT INTO t2 SELECT UUID();
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
INSERT INTO t2 VALUES (@@session.sql_mode);
|
INSERT INTO t2 VALUES (@@session.sql_mode);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
INSERT INTO t2 VALUES (@@global.init_slave);
|
INSERT INTO t2 VALUES (@@global.init_slave);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
INSERT INTO t2 VALUES (@@hostname);
|
INSERT INTO t2 VALUES (@@hostname);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
---- Insert from stored procedure ----
|
---- Insert from stored procedure ----
|
||||||
CREATE PROCEDURE proc()
|
CREATE PROCEDURE proc()
|
||||||
BEGIN
|
BEGIN
|
||||||
|
@ -42,13 +42,13 @@ INSERT INTO t2 VALUES (@@hostname);
|
||||||
END|
|
END|
|
||||||
CALL proc();
|
CALL proc();
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
---- Insert from stored function ----
|
---- Insert from stored function ----
|
||||||
CREATE FUNCTION func()
|
CREATE FUNCTION func()
|
||||||
RETURNS INT
|
RETURNS INT
|
||||||
|
@ -66,13 +66,13 @@ SELECT func();
|
||||||
func()
|
func()
|
||||||
0
|
0
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
---- Insert from trigger ----
|
---- Insert from trigger ----
|
||||||
CREATE TRIGGER trig
|
CREATE TRIGGER trig
|
||||||
BEFORE INSERT ON trigger_table
|
BEFORE INSERT ON trigger_table
|
||||||
|
@ -88,14 +88,14 @@ INSERT INTO t2 VALUES (@@hostname);
|
||||||
END|
|
END|
|
||||||
INSERT INTO trigger_table VALUES ('bye.');
|
INSERT INTO trigger_table VALUES ('bye.');
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
---- Insert from prepared statement ----
|
---- Insert from prepared statement ----
|
||||||
PREPARE p1 FROM 'INSERT INTO t1 VALUES (@@global.sync_binlog)';
|
PREPARE p1 FROM 'INSERT INTO t1 VALUES (@@global.sync_binlog)';
|
||||||
PREPARE p2 FROM 'INSERT INTO t1 VALUES (@@session.insert_id)';
|
PREPARE p2 FROM 'INSERT INTO t1 VALUES (@@session.insert_id)';
|
||||||
|
@ -106,25 +106,25 @@ PREPARE p6 FROM 'INSERT INTO t2 VALUES (@@global.init_slave)';
|
||||||
PREPARE p7 FROM 'INSERT INTO t2 VALUES (@@hostname)';
|
PREPARE p7 FROM 'INSERT INTO t2 VALUES (@@hostname)';
|
||||||
EXECUTE p1;
|
EXECUTE p1;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
EXECUTE p2;
|
EXECUTE p2;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
EXECUTE p3;
|
EXECUTE p3;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
EXECUTE p4;
|
EXECUTE p4;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
EXECUTE p5;
|
EXECUTE p5;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
EXECUTE p6;
|
EXECUTE p6;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
EXECUTE p7;
|
EXECUTE p7;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
---- Insert from nested call of triggers / functions / procedures ----
|
---- Insert from nested call of triggers / functions / procedures ----
|
||||||
CREATE PROCEDURE proc1()
|
CREATE PROCEDURE proc1()
|
||||||
INSERT INTO trigger_table VALUES ('ha!')|
|
INSERT INTO trigger_table VALUES ('ha!')|
|
||||||
|
@ -154,13 +154,13 @@ EXECUTE prep6;
|
||||||
func5()
|
func5()
|
||||||
0
|
0
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
==== Variables that should *not* be unsafe ====
|
==== Variables that should *not* be unsafe ====
|
||||||
INSERT INTO t1 VALUES (@@session.pseudo_thread_id);
|
INSERT INTO t1 VALUES (@@session.pseudo_thread_id);
|
||||||
INSERT INTO t1 VALUES (@@session.pseudo_thread_id);
|
INSERT INTO t1 VALUES (@@session.pseudo_thread_id);
|
||||||
|
@ -195,16 +195,16 @@ DROP TABLE t1, t2, t3, trigger_table, trigger_table2;
|
||||||
CREATE TABLE t1(a INT, b INT, KEY(a), PRIMARY KEY(b));
|
CREATE TABLE t1(a INT, b INT, KEY(a), PRIMARY KEY(b));
|
||||||
INSERT INTO t1 SELECT * FROM t1 LIMIT 1;
|
INSERT INTO t1 SELECT * FROM t1 LIMIT 1;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
REPLACE INTO t1 SELECT * FROM t1 LIMIT 1;
|
REPLACE INTO t1 SELECT * FROM t1 LIMIT 1;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
UPDATE t1 SET a=1 LIMIT 1;
|
UPDATE t1 SET a=1 LIMIT 1;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
DELETE FROM t1 LIMIT 1;
|
DELETE FROM t1 LIMIT 1;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
CREATE PROCEDURE p1()
|
CREATE PROCEDURE p1()
|
||||||
BEGIN
|
BEGIN
|
||||||
INSERT INTO t1 SELECT * FROM t1 LIMIT 1;
|
INSERT INTO t1 SELECT * FROM t1 LIMIT 1;
|
||||||
|
@ -214,10 +214,10 @@ DELETE FROM t1 LIMIT 1;
|
||||||
END|
|
END|
|
||||||
CALL p1();
|
CALL p1();
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
DROP PROCEDURE p1;
|
DROP PROCEDURE p1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
DROP TABLE IF EXISTS t1;
|
DROP TABLE IF EXISTS t1;
|
||||||
|
@ -225,7 +225,7 @@ CREATE TABLE t1 (a VARCHAR(100), b VARCHAR(100));
|
||||||
INSERT INTO t1 VALUES ('a','b');
|
INSERT INTO t1 VALUES ('a','b');
|
||||||
UPDATE t1 SET b = '%s%s%s%s%s%s%s%s%s%s%s%s%s%s' WHERE a = 'a' LIMIT 1;
|
UPDATE t1 SET b = '%s%s%s%s%s%s%s%s%s%s%s%s%s%s' WHERE a = 'a' LIMIT 1;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
DROP TABLE IF EXISTS t1, t2;
|
DROP TABLE IF EXISTS t1, t2;
|
||||||
CREATE TABLE t1(i INT PRIMARY KEY);
|
CREATE TABLE t1(i INT PRIMARY KEY);
|
||||||
|
@ -234,7 +234,7 @@ CREATE TABLE t3(i INT, ch CHAR(50));
|
||||||
"Should issue message Statement is not safe to log in statement format."
|
"Should issue message Statement is not safe to log in statement format."
|
||||||
INSERT INTO t1 SELECT * FROM t2 LIMIT 1;
|
INSERT INTO t1 SELECT * FROM t2 LIMIT 1;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
CREATE FUNCTION func6()
|
CREATE FUNCTION func6()
|
||||||
RETURNS INT
|
RETURNS INT
|
||||||
BEGIN
|
BEGIN
|
||||||
|
@ -246,7 +246,7 @@ END|
|
||||||
"Should issue message Statement is not safe to log in statement format only once"
|
"Should issue message Statement is not safe to log in statement format only once"
|
||||||
INSERT INTO t3 VALUES(func6(), UUID());
|
INSERT INTO t3 VALUES(func6(), UUID());
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
"Check whether SET @@SQL_LOG_BIN = 0/1 doesn't work in substatements"
|
"Check whether SET @@SQL_LOG_BIN = 0/1 doesn't work in substatements"
|
||||||
CREATE FUNCTION fun_check_log_bin() RETURNS INT
|
CREATE FUNCTION fun_check_log_bin() RETURNS INT
|
||||||
BEGIN
|
BEGIN
|
||||||
|
@ -259,7 +259,7 @@ SELECT fun_check_log_bin();
|
||||||
fun_check_log_bin()
|
fun_check_log_bin()
|
||||||
100
|
100
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
"SQL_LOG_BIN should be ON still"
|
"SQL_LOG_BIN should be ON still"
|
||||||
SHOW VARIABLES LIKE "SQL_LOG_BIN";
|
SHOW VARIABLES LIKE "SQL_LOG_BIN";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
|
@ -309,4 +309,22 @@ DROP FUNCTION func7;
|
||||||
DROP TRIGGER trig;
|
DROP TRIGGER trig;
|
||||||
DROP TABLE t1, t2, t3, trigger_table;
|
DROP TABLE t1, t2, t3, trigger_table;
|
||||||
set @@SESSION.SQL_LOG_BIN = @save_log_bin;
|
set @@SESSION.SQL_LOG_BIN = @save_log_bin;
|
||||||
|
SET @save_sql_mode = @@SESSION.SQL_MODE;
|
||||||
|
SET @@SESSION.SQL_MODE = STRICT_ALL_TABLES;
|
||||||
|
CREATE TABLE t1(i INT PRIMARY KEY);
|
||||||
|
CREATE TABLE t2(i INT PRIMARY KEY);
|
||||||
|
INSERT INTO t1 SELECT * FROM t2 LIMIT 1;
|
||||||
|
Warnings:
|
||||||
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
|
INSERT INTO t1 VALUES(@@global.sync_binlog);
|
||||||
|
Warnings:
|
||||||
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
|
UPDATE t1 SET i = 999 LIMIT 1;
|
||||||
|
Warnings:
|
||||||
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
|
DELETE FROM t1 LIMIT 1;
|
||||||
|
Warnings:
|
||||||
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
|
DROP TABLE t1, t2;
|
||||||
|
SET @@SESSION.SQL_MODE = @save_sql_mode;
|
||||||
"End of tests"
|
"End of tests"
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
# BUG#34732: mysqlbinlog does not print default values for auto_increment variables
|
# BUG#34732: mysqlbinlog does not print default values for auto_increment variables
|
||||||
# BUG#34768: nondeterministic INSERT using LIMIT logged in stmt mode if binlog_format=mixed
|
# BUG#34768: nondeterministic INSERT using LIMIT logged in stmt mode if binlog_format=mixed
|
||||||
# BUG#41980, SBL, INSERT .. SELECT .. LIMIT = ERROR, even when @@SQL_LOG_BIN is 0
|
# BUG#41980, SBL, INSERT .. SELECT .. LIMIT = ERROR, even when @@SQL_LOG_BIN is 0
|
||||||
|
# BUG#42640: mysqld crashes when unsafe statements are executed (STRICT_TRANS_TABLES mode)
|
||||||
#
|
#
|
||||||
# ==== Related test cases ====
|
# ==== Related test cases ====
|
||||||
#
|
#
|
||||||
|
@ -369,4 +370,22 @@ DROP FUNCTION func7;
|
||||||
DROP TRIGGER trig;
|
DROP TRIGGER trig;
|
||||||
DROP TABLE t1, t2, t3, trigger_table;
|
DROP TABLE t1, t2, t3, trigger_table;
|
||||||
set @@SESSION.SQL_LOG_BIN = @save_log_bin;
|
set @@SESSION.SQL_LOG_BIN = @save_log_bin;
|
||||||
|
|
||||||
|
#
|
||||||
|
# For BUG#42640: mysqld crashes when unsafe statements are executed (STRICT_TRANS_TABLES mode)
|
||||||
|
#
|
||||||
|
SET @save_sql_mode = @@SESSION.SQL_MODE;
|
||||||
|
SET @@SESSION.SQL_MODE = STRICT_ALL_TABLES;
|
||||||
|
|
||||||
|
CREATE TABLE t1(i INT PRIMARY KEY);
|
||||||
|
CREATE TABLE t2(i INT PRIMARY KEY);
|
||||||
|
|
||||||
|
INSERT INTO t1 SELECT * FROM t2 LIMIT 1;
|
||||||
|
INSERT INTO t1 VALUES(@@global.sync_binlog);
|
||||||
|
|
||||||
|
UPDATE t1 SET i = 999 LIMIT 1;
|
||||||
|
DELETE FROM t1 LIMIT 1;
|
||||||
|
|
||||||
|
DROP TABLE t1, t2;
|
||||||
|
SET @@SESSION.SQL_MODE = @save_sql_mode;
|
||||||
--echo "End of tests"
|
--echo "End of tests"
|
||||||
|
|
|
@ -76,7 +76,7 @@ create table t1(a int primary key);
|
||||||
insert into t1 values (1),(2);
|
insert into t1 values (1),(2);
|
||||||
delete from t1 where @@server_id=1;
|
delete from t1 where @@server_id=1;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
set sql_mode=strict_trans_tables;
|
set sql_mode=strict_trans_tables;
|
||||||
insert into t1 values (7), (8), (9);
|
insert into t1 values (7), (8), (9);
|
||||||
[on slave]
|
[on slave]
|
||||||
|
|
|
@ -10,7 +10,7 @@ CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
|
||||||
INSERT INTO test.t1 VALUES(1,'test');
|
INSERT INTO test.t1 VALUES(1,'test');
|
||||||
UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=1;
|
UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=1;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
create procedure test.p1()
|
create procedure test.p1()
|
||||||
begin
|
begin
|
||||||
INSERT INTO test.t1 VALUES(2,'test');
|
INSERT INTO test.t1 VALUES(2,'test');
|
||||||
|
@ -18,7 +18,7 @@ UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=2;
|
||||||
end|
|
end|
|
||||||
CALL test.p1();
|
CALL test.p1();
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
SELECT * FROM test.t1 ORDER BY blob_column;
|
SELECT * FROM test.t1 ORDER BY blob_column;
|
||||||
a blob_column
|
a blob_column
|
||||||
1 abase
|
1 abase
|
||||||
|
|
|
@ -182,19 +182,19 @@ CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM;
|
||||||
affected rows: 0
|
affected rows: 0
|
||||||
INSERT INTO t1 VALUES(myfunc_int(100), myfunc_double(50.00));
|
INSERT INTO t1 VALUES(myfunc_int(100), myfunc_double(50.00));
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
affected rows: 1
|
affected rows: 1
|
||||||
INSERT INTO t1 VALUES(myfunc_int(10), myfunc_double(5.00));
|
INSERT INTO t1 VALUES(myfunc_int(10), myfunc_double(5.00));
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
affected rows: 1
|
affected rows: 1
|
||||||
INSERT INTO t1 VALUES(myfunc_int(200), myfunc_double(25.00));
|
INSERT INTO t1 VALUES(myfunc_int(200), myfunc_double(25.00));
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
affected rows: 1
|
affected rows: 1
|
||||||
INSERT INTO t1 VALUES(myfunc_int(1), myfunc_double(500.00));
|
INSERT INTO t1 VALUES(myfunc_int(1), myfunc_double(500.00));
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1592 Statement is not safe to log in statement format.
|
Note 1592 Statement is not safe to log in statement format.
|
||||||
affected rows: 1
|
affected rows: 1
|
||||||
SELECT * FROM t1 ORDER BY sum;
|
SELECT * FROM t1 ORDER BY sum;
|
||||||
sum price
|
sum price
|
||||||
|
|
|
@ -3676,7 +3676,11 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg,
|
||||||
if (sql_log_bin_toplevel && lex->is_stmt_unsafe() &&
|
if (sql_log_bin_toplevel && lex->is_stmt_unsafe() &&
|
||||||
variables.binlog_format == BINLOG_FORMAT_STMT)
|
variables.binlog_format == BINLOG_FORMAT_STMT)
|
||||||
{
|
{
|
||||||
push_warning(this, MYSQL_ERROR::WARN_LEVEL_WARN,
|
/*
|
||||||
|
A warning can be elevated a error when STRICT sql mode.
|
||||||
|
But we don't want to elevate binlog warning to error here.
|
||||||
|
*/
|
||||||
|
push_warning(this, MYSQL_ERROR::WARN_LEVEL_NOTE,
|
||||||
ER_BINLOG_UNSAFE_STATEMENT,
|
ER_BINLOG_UNSAFE_STATEMENT,
|
||||||
ER(ER_BINLOG_UNSAFE_STATEMENT));
|
ER(ER_BINLOG_UNSAFE_STATEMENT));
|
||||||
if (!(binlog_flags & BINLOG_FLAG_UNSAFE_STMT_PRINTED))
|
if (!(binlog_flags & BINLOG_FLAG_UNSAFE_STMT_PRINTED))
|
||||||
|
|
Loading…
Add table
Reference in a new issue