summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorunknown <andrey@lmy004.>2006-07-17 16:52:45 +0200
committerunknown <andrey@lmy004.>2006-07-17 16:52:45 +0200
commite69e640f2eedfe1247f2a5f536d8dc1cf8a48300 (patch)
tree94cf5b188a961ae9067df17d09d62247d263ea81 /mysql-test/t
parentd65ab09c4dad097f0c8c5b9bf3856b6fdaf290fa (diff)
downloadmariadb-git-e69e640f2eedfe1247f2a5f536d8dc1cf8a48300.tar.gz
WL#3337 (Events new architecture)
Small updates before patch submit. client/mysqltest.c: allow --valgrind option to mysqltest so one can be able to detect whether the test is running under valgrind by having $VALGRIND_TEST, similar to BIG_TEST, in the test file. mysql-test/mysql-test-run.pl: If the test suite is running under valgrind start mysqltest with --valgrind to inform that we run valgrind. mysqltest will provide $VALGRIND_TEST for the test cases. mysql-test/r/events_bugs.result: update result mysql-test/r/events_scheduling.result: update result mysql-test/t/events.test: Increase times or the test will fail under valgrind mysql-test/t/events_bugs.test: Increase times or the test will fail under valgrind mysql-test/t/events_scheduling.test: Remove faulty test Disable the test case for valgrind sql/event_data_objects.cc: count the number of executions sql/event_data_objects.h: flags is not used at all add execution_count to count the number of executions sql/event_db_repository.cc: Initialize wherever needed. Add a comment regarding valgrind warning. sql/event_queue.cc: more debug info in the trace log sql/event_scheduler.cc: Use macro COND_STATE_WAIT() in all cases we need waiting on condition. Hence, we can trace locking, attemption to lock and more with SHOW SCHEDULER STATUS sql/event_scheduler.h: Change the declaration of cond_wait to accept THD sql/events.cc: fix memory leak. Destroy event_queue mysql-test/include/not_valgrind.inc: New BitKeeper file ``mysql-test/include/not_valgrind.inc'' mysql-test/r/not_valgrind.require: New BitKeeper file ``mysql-test/r/not_valgrind.require''
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/events.test28
-rw-r--r--mysql-test/t/events_bugs.test20
-rw-r--r--mysql-test/t/events_scheduling.test4
3 files changed, 25 insertions, 27 deletions
diff --git a/mysql-test/t/events.test b/mysql-test/t/events.test
index d45b5906f28..2a27144bc27 100644
--- a/mysql-test/t/events.test
+++ b/mysql-test/t/events.test
@@ -18,7 +18,7 @@ CREATE EVENT e_x2 ON SCHEDULE EVERY 1 SECOND DO DROP TABLE x_table;
connection default;
SHOW DATABASES LIKE 'db_x';
SET GLOBAL event_scheduler=1;
---sleep 0.8
+--sleep 1.2
SHOW DATABASES LIKE 'db_x';
SHOW TABLES FROM db_x;
SET GLOBAL event_scheduler=2;
@@ -101,7 +101,7 @@ drop table test_nested;
--echo "Let's check whether we can use non-qualified names"
create table non_qualif(a int);
create event non_qualif_ev on schedule every 10 minute do insert into non_qualif values (800219);
---sleep 0.5
+--sleep 1.1
select * from non_qualif;
drop event non_qualif_ev;
drop table non_qualif;
@@ -224,34 +224,34 @@ SHOW EVENTS;
CREATE TABLE event_like LIKE mysql.event;
INSERT INTO event_like SELECT * FROM mysql.event;
#sleep a bit or we won't catch the change of time
---sleep 1
+--sleep 1.1
ALTER TABLE mysql.event MODIFY db char(64) character set cp1251 default '';
--error ER_CANNOT_LOAD_FROM_TABLE
SELECT event_name FROM INFORMATION_SCHEMA.EVENTS;
ALTER TABLE mysql.event MODIFY db char(20) character set utf8 collate utf8_bin default '';
#wait a bit or we won't see the difference because of seconds resolution
---sleep 1
+--sleep 1.1
SHOW CREATE TABLE mysql.event;
--error ER_CANNOT_LOAD_FROM_TABLE
SELECT event_name FROM INFORMATION_SCHEMA.EVENTS;
---sleep 1
+--sleep 1.1
ALTER TABLE mysql.event MODIFY db char(64) character set utf8 collate utf8_bin default '';
---sleep 1
+--sleep 1.1
--echo "This should work"
--replace_column 8 # 9 #
SHOW EVENTS;
---sleep 1
+--sleep 1.1
ALTER TABLE mysql.event MODIFY db char(64) character set cp1251 default '';
--error ER_CANNOT_LOAD_FROM_TABLE
SELECT event_name FROM INFORMATION_SCHEMA.EVENTS;
---sleep 1
+--sleep 1.1
ALTER TABLE mysql.event MODIFY db varchar(64) character set utf8 collate utf8_bin default '';
---sleep 1
+--sleep 1.1
--error ER_CANNOT_LOAD_FROM_TABLE
SELECT event_name FROM INFORMATION_SCHEMA.EVENTS;
---sleep 1
+--sleep 1.1
ALTER TABLE mysql.event DROP comment, DROP starts;
---sleep 1
+--sleep 1.1
--error ER_COL_COUNT_DOESNT_MATCH_CORRUPTED
SELECT event_name FROM INFORMATION_SCHEMA.EVENTS;
DROP TABLE mysql.event;
@@ -308,7 +308,7 @@ select get_lock("test_lock2", 20);
--echo "Create an event which tries to acquire a mutex. The event locks on the mutex"
create event закачка on schedule every 10 hour do select get_lock("test_lock2", 20);
--echo "Let some time pass to the event starts"
---sleep 0.5
+--sleep 1
--echo "Should have only 2 processes: the scheduler and the locked event"
select /*2*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;--echo "Release the mutex, the event worker should finish."
--echo "Release the mutex, the event worker should finish."
@@ -326,11 +326,11 @@ drop event закачка;
set global event_scheduler=1;
select get_lock("test_lock2_1", 20);
create event закачка21 on schedule every 10 hour do select get_lock("test_lock2_1", 20);
---sleep 0.5
+--sleep 1
--echo "Should have only 3 processes: the scheduler, our conn and the locked event"
select /*3*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
set global event_scheduler=2;
---sleep 0.3
+--sleep 0.8
--echo "Should have only our process now:"
select /*4*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
drop event закачка21;
diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test
index 7fd4c684b4b..692e85255ef 100644
--- a/mysql-test/t/events_bugs.test
+++ b/mysql-test/t/events_bugs.test
@@ -78,9 +78,9 @@ begin
drop table "hashed_num";
end|
delimiter ;|
---sleep 0.5
+--sleep 0.8
--echo "Now if everything is fine the event has compiled and is locked
-select /*1*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
+select /*1*/ user, host, db, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
select release_lock('test_bug16407');
set global event_scheduler= 2;
@@ -127,11 +127,11 @@ begin
end|
delimiter ;|
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
---sleep 0.5
-select /*2*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
+--sleep 1
+select /*2*/ user, host, db, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
select release_lock('ee_16407_2');
---sleep 0.8
-select /*3*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
+--sleep 1.2
+select /*3*/ user, host, db, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
set global event_scheduler= 2;
select * from events_smode_test order by ev_name, a;
--echo "OK, last check before we drop them"
@@ -165,13 +165,13 @@ begin
call events_test.ee_16407_6_pendant();
end|
delimiter ;|
---sleep 0.5
+--sleep 1
--echo "Should have 2 locked processes"
-select /*4*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
+select /*4*/ user, host, db, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
select release_lock('ee_16407_5');
---sleep 0.8
+--sleep 1.3
--echo "Should have 0 processes locked"
-select /*5*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
+select /*5*/ user, host, db, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
select * from events_smode_test order by ev_name, a;
--echo "And here we check one more time before we drop the events"
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
diff --git a/mysql-test/t/events_scheduling.test b/mysql-test/t/events_scheduling.test
index dc4460999a7..7a7502fab7e 100644
--- a/mysql-test/t/events_scheduling.test
+++ b/mysql-test/t/events_scheduling.test
@@ -1,5 +1,6 @@
# Can't test with embedded server that doesn't support grants
-- source include/not_embedded.inc
+-- source include/not_valgrind.inc
CREATE DATABASE IF NOT EXISTS events_test;
USE events_test;
@@ -11,7 +12,6 @@ CREATE TABLE T19170(s1 TIMESTAMP);
SET GLOBAL event_scheduler=1;
# We need to have 2 to make it safe with valgrind. This is probably because
# of when we calculate the timestamp value
-CREATE EVENT E19170 ON SCHEDULE EVERY 2 SECOND DO INSERT INTO T19170 VALUES(CURRENT_TIMESTAMP);
CREATE EVENT two_sec ON SCHEDULE EVERY 2 SECOND DO INSERT INTO table_1 VALUES(1);
CREATE EVENT start_n_end
ON SCHEDULE EVERY 1 SECOND
@@ -40,6 +40,4 @@ DROP TABLE table_1;
DROP TABLE table_2;
DROP TABLE table_3;
DROP TABLE table_4;
---echo "Checking for multiple executions in one second, should not happen -> 0 as result"
-SELECT COUNT(*) FROM (SELECT s1, COUNT(*) AS cnt FROM T19170 GROUP BY s1) AS tmp WHERE tmp.cnt > 1;
DROP DATABASE events_test;