From db6be73cf3a07cd024fca08c1fb0f37021eff7c9 Mon Sep 17 00:00:00 2001 From: Magnus Svensson Date: Fri, 5 Dec 2008 19:24:10 +0100 Subject: [PATCH] Bug#41061 analyze-warnings times out sporadically in pushbuild mysql-test/include/mtr_warnings.sql: Slice the time the takes to load the servers error log into error_log table by using a declared variable instead of user variable. Also change the while loop to only do one LOCATE per loop. Drop the temporary tables created by sp --- mysql-test/include/mtr_warnings.sql | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql index b1eb094c4ee..999f9c1dde5 100644 --- a/mysql-test/include/mtr_warnings.sql +++ b/mysql-test/include/mtr_warnings.sql @@ -218,6 +218,8 @@ INSERT INTO global_suppressions VALUES -- CREATE DEFINER=root@localhost PROCEDURE check_warnings(OUT result INT) BEGIN + DECLARE `text` text charset utf8; + DECLARE `pos` bigint unsigned; -- Don't write these queries to binlog SET SQL_LOG_BIN=0; @@ -234,15 +236,17 @@ BEGIN WHERE variable_name='LOG_ERROR'; SET @@session.max_allowed_packet= 1024*1024*1024; - SET @text= load_file(@log_error); - -- select @text; + SET text= load_file(@log_error); + -- select text; - WHILE LOCATE('\n', @text) DO + SET pos= LOCATE('\n', text); + WHILE pos DO INSERT error_log (line) VALUES ( - SUBSTR(@text, 1, LOCATE('\n', @text)-1) + SUBSTR(text, 1, pos-1) ); - SET @text= SUBSTR(@text FROM LOCATE('\n', @text)+1); + SET text= SUBSTR(text FROM pos+1); + SET pos= LOCATE('\n', text); END WHILE; -- select * from error_log; @@ -287,6 +291,7 @@ BEGIN -- Cleanup for next test TRUNCATE test_suppressions; + DROP TABLE error_log, suspect_lines; END||