diff options
author | unknown <konstantin@mysql.com> | 2006-06-26 18:45:46 +0400 |
---|---|---|
committer | unknown <konstantin@mysql.com> | 2006-06-26 18:45:46 +0400 |
commit | fee803af179a3adc89f5e87511489bf44df527dd (patch) | |
tree | 83857837ef8ba671f8533131cf5fb0bdbe65f750 /mysql-test/t | |
parent | a5e194ed526f6974bddc9e847f13d6a431e30b37 (diff) | |
parent | 42169376f04a575fc5b21d8c57974493a6444d5e (diff) | |
download | mariadb-git-fee803af179a3adc89f5e87511489bf44df527dd.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into mysql.com:/opt/local/work/mysql-5.1-runtime
mysql-test/r/information_schema.result:
Auto merged
sql/CMakeLists.txt:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/events.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/t/events_microsec.test:
SCCS merged
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/disabled.def | 6 | ||||
-rw-r--r-- | mysql-test/t/events.test | 9 | ||||
-rw-r--r-- | mysql-test/t/events_bugs.test | 37 | ||||
-rw-r--r-- | mysql-test/t/events_grant.test | 21 | ||||
-rw-r--r-- | mysql-test/t/events_logs_tests.test | 16 | ||||
-rw-r--r-- | mysql-test/t/events_microsec.test | 3 | ||||
-rw-r--r-- | mysql-test/t/events_scheduling.test | 3 | ||||
-rw-r--r-- | mysql-test/t/events_stress.test | 3 | ||||
-rw-r--r-- | mysql-test/t/im_instance_conf.imtest | 49 | ||||
-rw-r--r-- | mysql-test/t/im_options.imtest | 10 |
10 files changed, 128 insertions, 29 deletions
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 20462ad62cb..fb7125ceb89 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -13,9 +13,9 @@ #events_stress : BUG#17619 2006-02-21 andrey Race conditions #events : BUG#17619 2006-02-21 andrey Race conditions #events_scheduling : BUG#19170 2006-04-26 andrey Test case of 19170 fails on some platforms. Has to be checked. -im_instance_conf : Bug#20294 2006-06-06 monty Instance manager test im_instance_conf fails randomly -im_options : Bug#20294 2006-06-06 monty Instance manager test im_instance_conf fails randomly -im_life_cycle : Bug#20368 2006-06-10 alik im_life_cycle test fails +#im_instance_conf : Bug#20294 2006-06-06 monty Instance manager test im_instance_conf fails randomly +#im_options : Bug#20294 2006-06-06 monty Instance manager test im_instance_conf fails randomly +#im_life_cycle : Bug#20368 2006-06-10 alik im_life_cycle test fails ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog #ndb_binlog_discover : BUG#19395 2006-04-28 tomas/knielsen mysqld does not always detect cluster shutdown diff --git a/mysql-test/t/events.test b/mysql-test/t/events.test index a3e2bbc0998..aac13a55dd3 100644 --- a/mysql-test/t/events.test +++ b/mysql-test/t/events.test @@ -1,3 +1,6 @@ +# Can't test with embedded server that doesn't support grants +-- source include/not_embedded.inc + create database if not exists events_test; use events_test; @@ -327,15 +330,15 @@ on schedule every 10 hour disable do select 1; -select event_schema, event_name, definer, event_body from information_schema.events where event_name='white_space'; +select event_schema, event_name, definer, event_definition from information_schema.events where event_name='white_space'; drop event white_space; create event white_space on schedule every 10 hour disable do select 2; -select event_schema, event_name, definer, event_body from information_schema.events where event_name='white_space'; +select event_schema, event_name, definer, event_definition from information_schema.events where event_name='white_space'; drop event white_space; create event white_space on schedule every 10 hour disable do select 3; -select event_schema, event_name, definer, event_body from information_schema.events where event_name='white_space'; +select event_schema, event_name, definer, event_definition from information_schema.events where event_name='white_space'; drop event white_space; # # END: BUG #17453: Creating Event crash the server diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test index e3b79a6bd13..9434de7be7d 100644 --- a/mysql-test/t/events_bugs.test +++ b/mysql-test/t/events_bugs.test @@ -1,3 +1,6 @@ +# Can't test with embedded server that doesn't support grants +-- source include/not_embedded.inc + create database if not exists events_test; use events_test; @@ -172,4 +175,38 @@ set sql_mode=@old_sql_mode; # # End - 16407: Events: Changes in sql_mode won't be taken into account # + +# +# START - 18897: Events: unauthorized action possible with alter event rename +# +set global event_scheduler=2; +--disable_warnings +delete from mysql.user where User like 'mysqltest_%'; +delete from mysql.db where User like 'mysqltest_%'; +flush privileges; +drop database if exists mysqltest_db1; +--enable_warnings +create user mysqltest_user1@localhost; +create database mysqltest_db1; +grant event on events_test.* to mysqltest_user1@localhost; +connect (conn2,localhost,mysqltest_user1,,events_test); +create event mysqltest_user1 on schedule every 10 second do select 42; +--error ER_DBACCESS_DENIED_ERROR +alter event mysqltest_user1 rename to mysqltest_db1.mysqltest_user1; +--echo "Let's test now rename when there is no select DB" +disconnect conn2; +connect (conn2,localhost,mysqltest_user1,,*NO-ONE*); +select database(); +--error ER_NO_DB_ERROR +alter event events_test.mysqltest_user1 rename to mysqltest_user1; +select event_schema, event_name, definer, event_type, status from information_schema.events; +drop event events_test.mysqltest_user1; +disconnect conn2; +connection default; +drop user mysqltest_user1@localhost; +drop database mysqltest_db1; +# +# END - 18897: Events: unauthorized action possible with alter event rename +# + drop database events_test; diff --git a/mysql-test/t/events_grant.test b/mysql-test/t/events_grant.test index ba94944a3cf..3ead141c27c 100644 --- a/mysql-test/t/events_grant.test +++ b/mysql-test/t/events_grant.test @@ -1,3 +1,6 @@ +# Can't test with embedded server that doesn't support grants +-- source include/not_embedded.inc + CREATE DATABASE IF NOT EXISTS events_test; use events_test; # @@ -6,7 +9,7 @@ use events_test; CREATE EVENT one_event ON SCHEDULE EVERY 10 SECOND DO SELECT 123; --replace_column 8 # 9 # SHOW EVENTS; -SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT from information_schema.events; +SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT from information_schema.events; CREATE DATABASE events_test2; CREATE USER ev_test@localhost; GRANT ALL ON events_test.* to ev_test@localhost; @@ -52,10 +55,10 @@ CREATE EVENT four_event ON SCHEDULE EVERY 20 SECOND DO SELECT 42; connection default; USE events_test; --echo "We should see 4 events : one_event, two_event, three_event & four_event" -SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS; +SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS; DROP DATABASE events_test2; --echo "We should see 3 events : one_event, two_event, three_event" -SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS; +SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS; connection default; CREATE DATABASE events_test2; @@ -64,27 +67,27 @@ CREATE EVENT five_event ON SCHEDULE EVERY 20 SECOND DO SELECT 42; connection ev_con1; --echo "Should see 4 events - one, two, three & five" -SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS; +SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS; connection default; REVOKE EVENT ON events_test2.* FROM ev_test@localhost; connection ev_con1; USE test; --echo "Should see 3 events - one, two & three" -SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS; +SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS; --echo "Let's test ALTER EVENT which changes the definer" USE events_test; ALTER EVENT one_event ON SCHEDULE EVERY 10 SECOND; --echo "The definer should be ev_test@localhost" -SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event'; +SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event'; connection default; USE events_test; ALTER EVENT one_event COMMENT "comment"; connection ev_con1; --echo "The definer should be root@localhost" -SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event'; +SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event'; ALTER EVENT one_event DO SELECT 12; --echo "The definer should be ev_test@localhost" -SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event'; +SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event'; connection default; --echo "make the definer again root@localhost" ALTER EVENT one_event COMMENT "new comment"; @@ -93,7 +96,7 @@ connection ev_con1; DROP EVENT one_event; connection default; --echo "One event should not be there" -SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS; +SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS; disconnect ev_con1; connection default; DROP USER ev_test@localhost; diff --git a/mysql-test/t/events_logs_tests.test b/mysql-test/t/events_logs_tests.test index 6d3b3292630..5f4ec852cd3 100644 --- a/mysql-test/t/events_logs_tests.test +++ b/mysql-test/t/events_logs_tests.test @@ -1,3 +1,6 @@ +# Can't test with embedded server that doesn't support grants +-- source include/not_embedded.inc + create database if not exists events_test; use events_test; --echo "We use procedure here because its statements won't be logged into the general log" @@ -51,6 +54,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 +66,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 +83,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 +95,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; diff --git a/mysql-test/t/events_microsec.test b/mysql-test/t/events_microsec.test index e4d57bf4ae1..3e9abf6ec56 100644 --- a/mysql-test/t/events_microsec.test +++ b/mysql-test/t/events_microsec.test @@ -1,3 +1,6 @@ +# Can't test with embedded server that doesn't support grants +-- source include/not_embedded.inc + --disable_warnings create database if not exists events_test; --enable_warnings diff --git a/mysql-test/t/events_scheduling.test b/mysql-test/t/events_scheduling.test index c688864a1e6..987939bc162 100644 --- a/mysql-test/t/events_scheduling.test +++ b/mysql-test/t/events_scheduling.test @@ -1,3 +1,6 @@ +# Can't test with embedded server that doesn't support grants +-- source include/not_embedded.inc + CREATE DATABASE IF NOT EXISTS events_test; USE events_test; CREATE TABLE table_1(a int); diff --git a/mysql-test/t/events_stress.test b/mysql-test/t/events_stress.test index 8d0034c232e..cf6cc73df8a 100644 --- a/mysql-test/t/events_stress.test +++ b/mysql-test/t/events_stress.test @@ -1,3 +1,6 @@ +# Can't test with embedded server that doesn't support grants +-- source include/not_embedded.inc + CREATE DATABASE IF NOT EXISTS events_test; # # DROP DATABASE test start (bug #16406) diff --git a/mysql-test/t/im_instance_conf.imtest b/mysql-test/t/im_instance_conf.imtest index 17703fdd303..3d254b16ca5 100644 --- a/mysql-test/t/im_instance_conf.imtest +++ b/mysql-test/t/im_instance_conf.imtest @@ -21,6 +21,9 @@ # - DROP INSTANCE fails for active instance. # - DROP INSTANCE updates both config file and internal configuration cache; # +# NOTE: each CREATE INSTANCE statement must specify socket-file-name, otherwise +# this results of the test can be affected by another running test suite. +# ########################################################################### --source include/im_check_os.inc @@ -69,7 +72,9 @@ SHOW VARIABLES LIKE 'server_id'; # Check that CREATE INSTANCE succeeds for non-existing instance and also check # that both config file and internal configuration cache have been updated. -CREATE INSTANCE mysqld3; +CREATE INSTANCE mysqld3 + server_id = 3, + socket = "$MYSQL_TMP_DIR/mysqld_3.sock"; SHOW INSTANCES; @@ -99,7 +104,10 @@ CREATE INSTANCE mysqld3; --exec grep nonguarded $MYSQLTEST_VARDIR/im.cnf; --echo -------------------------------------------------------------------- -CREATE INSTANCE mysqld4 nonguarded; +CREATE INSTANCE mysqld4 + nonguarded, + server_id = 4, + socket = "$MYSQL_TMP_DIR/mysqld_4.sock"; SHOW INSTANCES; @@ -115,7 +123,11 @@ SHOW INSTANCES; --exec grep test-B $MYSQLTEST_VARDIR/im.cnf || true; --echo -------------------------------------------------------------------- -CREATE INSTANCE mysqld5 test-A = 000, test-B = test; +CREATE INSTANCE mysqld5 + test-A = 000, + test-B = test, + server_id = 5, + socket = "$MYSQL_TMP_DIR/mysqld_5.sock"; SHOW INSTANCES; @@ -135,7 +147,11 @@ SHOW INSTANCES; --exec grep test-C $MYSQLTEST_VARDIR/im.cnf || true; --echo -------------------------------------------------------------------- -CREATE INSTANCE mysqld6 test-C1 = 10 , test-C2 = 02 ; +CREATE INSTANCE mysqld6 + test-C1 = 10 , + test-C2 = 02 , + server_id = 6, + socket = "$MYSQL_TMP_DIR/mysqld_6.sock"; SHOW INSTANCES; @@ -183,22 +199,37 @@ SHOW INSTANCES; --exec grep test-4 $MYSQLTEST_VARDIR/im.cnf || true; --echo -------------------------------------------------------------------- -CREATE INSTANCE mysqld9 test-1=" hello world ", test-2=' '; +CREATE INSTANCE mysqld9 + test-1=" hello world ", + test-2=' ', + server_id = 9, + socket = "$MYSQL_TMP_DIR/mysqld_9.sock"; SHOW INSTANCES; -CREATE INSTANCE mysqld9a test-3='\b\babc\sdef'; +CREATE INSTANCE mysqld10 + test-3='\b\babc\sdef', + server_id = 10, + socket = "$MYSQL_TMP_DIR/mysqld_10.sock"; # test-3='abc def' SHOW INSTANCES; -CREATE INSTANCE mysqld9b test-4='abc\tdef', test-5='abc\ndef'; +CREATE INSTANCE mysqld11 + test-4='abc\tdef', + test-5='abc\ndef', + server_id = 11, + socket = "$MYSQL_TMP_DIR/mysqld_11.sock"; SHOW INSTANCES; -CREATE INSTANCE mysqld9c test-6="abc\rdef", test-7="abc\\def"; +CREATE INSTANCE mysqld12 + test-6="abc\rdef", + test-7="abc\\def", + server_id = 12, + socket = "$MYSQL_TMP_DIR/mysqld_12.sock"; # test-6=abc SHOW INSTANCES; --error ER_SYNTAX_ERROR -CREATE INSTANCE mysqld10 test-bad=' \ '; +CREATE INSTANCE mysqld13 test-bad=' \ '; SHOW INSTANCES; --echo -------------------------------------------------------------------- diff --git a/mysql-test/t/im_options.imtest b/mysql-test/t/im_options.imtest index cd905416cda..55bd29c9ee1 100644 --- a/mysql-test/t/im_options.imtest +++ b/mysql-test/t/im_options.imtest @@ -21,12 +21,15 @@ # - server_id # - port # - nonguarded - +# # Let's test SET statement on the option 'server_id'. It's expected that # originally the instances have the following server ids and states: # - mysqld1: server_id: 1; running (online) # - mysqld2: server_id: 2; stopped (offline) # +# NOTE: each CREATE INSTANCE statement must specify socket-file-name, otherwise +# this results of the test can be affected by another running test suite. +# ########################################################################### --source include/im_check_os.inc @@ -76,7 +79,10 @@ SET mysqld1.server_id = 11; # - start it; # - try to set/unset options; -CREATE INSTANCE mysqld3 datadir = '/'; +CREATE INSTANCE mysqld3 + datadir = '/', + server_id = 3, + socket = "$MYSQL_TMP_DIR/mysqld_3.sock"; START INSTANCE mysqld3; # FIXME: START INSTANCE should be synchronous. |