| 1 |
SET @old_log_output= @@global.log_output; |
| 2 |
SET @old_log_disable_statements= @@global.log_disabled_statements; |
| 3 |
CREATE TABLE t1 (i INT PRIMARY KEY AUTO_INCREMENT, j VARCHAR(255) ) ENGINE=MyISAM; |
| 4 |
insert into t1 (j) values ('a'),('b'),('c'),('d'); |
| 5 |
SET GLOBAL log_output = 'file,table'; |
| 6 |
CREATE PROCEDURE slow() |
| 7 |
BEGIN |
| 8 |
SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b'; |
| 9 |
SELECT count(*) from t1 where j>'a'; |
| 10 |
END |
| 11 |
$ |
| 12 |
select @@log_disabled_statements; |
| 13 |
@@log_disabled_statements |
| 14 |
sp |
| 15 |
TRUNCATE TABLE mysql.general_log; |
| 16 |
check table t1; |
| 17 |
Table Op Msg_type Msg_text |
| 18 |
test.t1 check status OK |
| 19 |
CALL slow(); |
| 20 |
count(if(sleep(1) >= 0,0,NULL)) |
| 21 |
2 |
| 22 |
count(*) |
| 23 |
3 |
| 24 |
SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part2'; |
| 25 |
count(if(sleep(1) >= 0,0,NULL)) |
| 26 |
2 |
| 27 |
--> |
| 28 |
SELECT argument FROM mysql.general_log where command_type <> "Close stmt" and command_type <> "Prepare" and argument not like "%general_log%"; |
| 29 |
argument |
| 30 |
check table t1 |
| 31 |
CALL slow() |
| 32 |
SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part2' |
| 33 |
<-- |
| 34 |
TRUNCATE TABLE mysql.general_log; |
| 35 |
SET SESSION log_disabled_statements=""; |
| 36 |
check table t1; |
| 37 |
Table Op Msg_type Msg_text |
| 38 |
test.t1 check status OK |
| 39 |
CALL slow(); |
| 40 |
count(if(sleep(1) >= 0,0,NULL)) |
| 41 |
2 |
| 42 |
count(*) |
| 43 |
3 |
| 44 |
SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part3'; |
| 45 |
count(if(sleep(1) >= 0,0,NULL)) |
| 46 |
2 |
| 47 |
--> |
| 48 |
SELECT argument FROM mysql.general_log where command_type <> "Close stmt" and command_type <> "Prepare" and argument not like "%general_log%"; |
| 49 |
argument |
| 50 |
SET SESSION log_disabled_statements="" |
| 51 |
check table t1 |
| 52 |
CALL slow() |
| 53 |
SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b' |
| 54 |
SELECT count(*) from t1 where j>'a' |
| 55 |
SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part3' |
| 56 |
<-- |
| 57 |
TRUNCATE TABLE mysql.general_log; |
| 58 |
SET SESSION log_disabled_statements="sp,slave"; |
| 59 |
check table t1; |
| 60 |
Table Op Msg_type Msg_text |
| 61 |
test.t1 check status OK |
| 62 |
CALL slow(); |
| 63 |
count(if(sleep(1) >= 0,0,NULL)) |
| 64 |
2 |
| 65 |
count(*) |
| 66 |
3 |
| 67 |
SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part4'; |
| 68 |
count(if(sleep(1) >= 0,0,NULL)) |
| 69 |
2 |
| 70 |
--> |
| 71 |
SELECT argument FROM mysql.general_log where command_type <> "Close stmt" and command_type <> "Prepare" and argument not like "%general_log%"; |
| 72 |
argument |
| 73 |
SET SESSION log_disabled_statements="sp,slave" |
| 74 |
check table t1 |
| 75 |
CALL slow() |
| 76 |
SELECT count(if(sleep(1) >= 0,0,NULL)) from t1 where j>'b and part4' |
| 77 |
<-- |
| 78 |
DROP TABLE t1; |
| 79 |
DROP PROCEDURE slow; |
| 80 |
TRUNCATE TABLE mysql.general_log; |
| 81 |
SET @@global.log_output= @old_log_output; |
| 82 |
SET @@global.log_disabled_statements= @old_log_disable_statements; |