mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Backporting slow log simulation logic details from 10.2 to 10.1
Simulate slow statements only for COM_QUERY and COM_STMT_EXECUTE commands, to exclude mysqld_stmt_prepare() and mysqld_stmt_close() entries from the log, as they are not relevant for log_slow_debug.test. This simplifies the test.
This commit is contained in:
@ -14,14 +14,6 @@ FROM mysql.slow_log
|
||||
WHERE sql_text NOT LIKE '%debug_dbug%';
|
||||
END
|
||||
$$
|
||||
CREATE PROCEDURE show_slow_log_exclude_ps()
|
||||
BEGIN
|
||||
SELECT CONCAT('[slow] ', sql_text) AS sql_text
|
||||
FROM mysql.slow_log
|
||||
WHERE sql_text NOT LIKE '%debug_dbug%'
|
||||
AND sql_text NOT IN ('Prepare','Close stmt');
|
||||
END
|
||||
$$
|
||||
#
|
||||
# Expect all admin statements in the slow log (ON,DEFAULT)
|
||||
#
|
||||
@ -41,7 +33,7 @@ PREPARE stmt FROM 'ALTER TABLE t4 MODIFY a INT DEFAULT 1';
|
||||
EXECUTE stmt;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
DROP TABLE t4;
|
||||
CALL show_slow_log_exclude_ps();
|
||||
CALL show_slow_log();
|
||||
sql_text
|
||||
[slow] TRUNCATE TABLE mysql.slow_log
|
||||
[slow] CREATE TABLE t1 (a INT)
|
||||
@ -123,7 +115,7 @@ PREPARE stmt FROM 'ALTER TABLE t4 MODIFY a INT DEFAULT 1';
|
||||
EXECUTE stmt;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
DROP TABLE t4;
|
||||
CALL show_slow_log_exclude_ps();
|
||||
CALL show_slow_log();
|
||||
sql_text
|
||||
[slow] TRUNCATE TABLE mysql.slow_log
|
||||
[slow] CREATE TABLE t1 (a INT)
|
||||
@ -143,4 +135,3 @@ SET @@global.slow_query_log= @org_slow_query_log;
|
||||
SET @@global.log_output= @org_log_output;
|
||||
SET @@global.log_slow_admin_statements= @org_log_slow_admin_statements;
|
||||
DROP PROCEDURE show_slow_log;
|
||||
DROP PROCEDURE show_slow_log_exclude_ps;
|
||||
|
Reference in New Issue
Block a user