Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
50c7663d
Commit
50c7663d
authored
Jun 22, 2006
by
andrey@lmy004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for bug#20624: events_logs_tests.test fails randomly
(this is a change to a faulty test file)
parent
6ed2ec68
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
6 deletions
+20
-6
mysql-test/r/events_logs_tests.result
mysql-test/r/events_logs_tests.result
+10
-3
mysql-test/t/events_logs_tests.test
mysql-test/t/events_logs_tests.test
+10
-3
No files found.
mysql-test/r/events_logs_tests.result
View file @
50c7663d
...
...
@@ -31,6 +31,8 @@ SHOW VARIABLES LIKE 'log_slow_queries';
Variable_name Value
log_slow_queries ON
DROP FUNCTION get_value;
"Make it quite long"
SET SESSION long_query_time=300;
TRUNCATE mysql.slow_log;
SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
user_host query_time db sql_text
...
...
@@ -44,7 +46,10 @@ SLEEP(2)
SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
user_host query_time db sql_text
USER_HOST SLEEPVAL events_test SELECT SLEEP(2)
SET SESSION long_query_time=300;
"Make it quite long"
TRUNCATE mysql.slow_log;
SET SESSION long_query_time=1;
CREATE TABLE slow_event_test (slo_val tinyint, val tinyint);
"This won't go to the slow log"
CREATE EVENT long_event ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(3);
...
...
@@ -63,9 +68,9 @@ slo_val val
SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
user_host query_time db sql_text
"This should go to the slow log"
DROP EVENT long_event;
SET SESSION long_query_time=10;
SET GLOBAL long_query_time=1;
DROP EVENT long_event;
CREATE EVENT long_event2 ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(2);
"Sleep some more time than the actual event run will take"
"Check our table. Should see 2 rows"
...
...
@@ -78,8 +83,10 @@ SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
user_host query_time db sql_text
USER_HOST SLEEPVAL events_test INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(2)
DROP EVENT long_event2;
SET GLOBAL long_query_time =@old_global_long_query_time;
SET SESSION long_query_time
=@old_session_long_query_time
;
"Make it quite long"
SET SESSION long_query_time
=300
;
TRUNCATE mysql.slow_log;
DROP TABLE slow_event_test;
SET GLOBAL long_query_time =@old_global_long_query_time;
SET SESSION long_query_time =@old_session_long_query_time;
drop database events_test;
mysql-test/t/events_logs_tests.test
View file @
50c7663d
...
...
@@ -51,6 +51,8 @@ SET @old_global_long_query_time:=(select get_value());
SET
@
old_session_long_query_time
:=@@
long_query_time
;
SHOW
VARIABLES
LIKE
'log_slow_queries'
;
DROP
FUNCTION
get_value
;
--
echo
"Make it quite long"
SET
SESSION
long_query_time
=
300
;
TRUNCATE
mysql
.
slow_log
;
--
replace_column
1
USER_HOST
SELECT
user_host
,
query_time
,
db
,
sql_text
FROM
mysql
.
slow_log
;
...
...
@@ -61,7 +63,10 @@ SET SESSION long_query_time=1;
SELECT
SLEEP
(
2
);
--
replace_column
1
USER_HOST
2
SLEEPVAL
SELECT
user_host
,
query_time
,
db
,
sql_text
FROM
mysql
.
slow_log
;
SET
SESSION
long_query_time
=
300
;
--
echo
"Make it quite long"
TRUNCATE
mysql
.
slow_log
;
SET
SESSION
long_query_time
=
1
;
CREATE
TABLE
slow_event_test
(
slo_val
tinyint
,
val
tinyint
);
--
echo
"This won't go to the slow log"
CREATE
EVENT
long_event
ON
SCHEDULE
EVERY
1
MINUTE
DO
INSERT
INTO
slow_event_test
SELECT
@@
long_query_time
,
SLEEP
(
3
);
...
...
@@ -75,9 +80,9 @@ SELECT * FROM slow_event_test;
--
echo
"Check slow log. Should not see anything because 3 is under the threshold of 4 for GLOBAL, though over SESSION which is 2"
SELECT
user_host
,
query_time
,
db
,
sql_text
FROM
mysql
.
slow_log
;
--
echo
"This should go to the slow log"
DROP
EVENT
long_event
;
SET
SESSION
long_query_time
=
10
;
SET
GLOBAL
long_query_time
=
1
;
DROP
EVENT
long_event
;
CREATE
EVENT
long_event2
ON
SCHEDULE
EVERY
1
MINUTE
DO
INSERT
INTO
slow_event_test
SELECT
@@
long_query_time
,
SLEEP
(
2
);
--
echo
"Sleep some more time than the actual event run will take"
--
sleep
3
...
...
@@ -87,9 +92,11 @@ SELECT * FROM slow_event_test;
--
replace_column
1
USER_HOST
2
SLEEPVAL
SELECT
user_host
,
query_time
,
db
,
sql_text
FROM
mysql
.
slow_log
;
DROP
EVENT
long_event2
;
SET
GLOBAL
long_query_time
=@
old_global_long_query_time
;
SET
SESSION
long_query_time
=@
old_session_long_query_time
;
--
echo
"Make it quite long"
SET
SESSION
long_query_time
=
300
;
TRUNCATE
mysql
.
slow_log
;
DROP
TABLE
slow_event_test
;
SET
GLOBAL
long_query_time
=@
old_global_long_query_time
;
SET
SESSION
long_query_time
=@
old_session_long_query_time
;
drop
database
events_test
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment