summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorunknown <andrey@lmy004.>2006-01-30 14:28:48 +0100
committerunknown <andrey@lmy004.>2006-01-30 14:28:48 +0100
commit2272e140fd1490772fa9660ece4ea91eed26cee7 (patch)
tree8ef0243df685fd27f6f69d8bcff5e5743c6a0648 /mysql-test/r
parent799129e254fca5df0fddc910c371acce7fb666dc (diff)
parentc3542cebf9c775241652ef8f0a4ed7dd788683d7 (diff)
downloadmariadb-git-2272e140fd1490772fa9660ece4ea91eed26cee7.tar.gz
post-commit merge
mysql-test/lib/init_db.sql: Auto merged scripts/mysql_create_system_tables.sh: Auto merged scripts/mysql_fix_privilege_tables.sql: Auto merged sql/event.cc: Auto merged sql/event.h: Auto merged sql/event_executor.cc: Auto merged sql/event_priv.h: Auto merged sql/event_timed.cc: Auto merged sql/mysqld.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_yacc.yy: Auto merged mysql-test/r/events.result: manual merge mysql-test/r/system_mysql_db.result: manual merge mysql-test/t/events.test: manual merge
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/events.result161
-rw-r--r--mysql-test/r/information_schema.result13
-rw-r--r--mysql-test/r/information_schema_db.result1
3 files changed, 173 insertions, 2 deletions
diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result
index 38c2d902ec1..df03cd4ec84 100644
--- a/mysql-test/r/events.result
+++ b/mysql-test/r/events.result
@@ -57,4 +57,165 @@ set event_scheduler=0;
ERROR HY000: Variable 'event_scheduler' is a GLOBAL variable and should be set with SET GLOBAL
set global event_scheduler=2;
ERROR 42000: Variable 'event_scheduler' can't be set to the value of '2'
+create event one_event on schedule every 10 second do select 123;
+SHOW EVENTS;
+Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
+events_test one_event root@localhost RECURRING NULL 10 INTERVAL_SECOND # # ENABLED
+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;
+EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
+NULL events_test one_event root@localhost select 123 RECURRING NULL 10 INTERVAL_SECOND ENABLED NOT PRESERVE
+CREATE DATABASE events_test2;
+CREATE USER ev_test@localhost;
+GRANT ALL ON events_test.* to ev_test@localhost;
+GRANT ALL on events_test2.* to ev_test@localhost;
+REVOKE EVENT ON events_test2.* FROM ev_test@localhost;
+REVOKE PROCESS on *.* from ev_test@localhost;
+select "NEW CONNECTION";
+NEW CONNECTION
+NEW CONNECTION
+SELECT USER(), DATABASE();
+USER() DATABASE()
+ev_test@localhost events_test2
+SHOW GRANTS;
+Grants for ev_test@localhost
+GRANT USAGE ON *.* TO 'ev_test'@'localhost'
+GRANT ALL PRIVILEGES ON `events_test`.* TO 'ev_test'@'localhost'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `events_test2`.* TO 'ev_test'@'localhost'
+select "Here comes an error:";
+Here comes an error:
+Here comes an error:
+SHOW EVENTS;
+ERROR 42000: Access denied for user 'ev_test'@'localhost' to database 'events_test2'
+USE events_test;
+select "Now the list should be empty:";
+Now the list should be empty:
+Now the list should be empty:
+SHOW EVENTS;
+Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
+select concat("Let's create some new events from the name of ",user());
+concat("Let's create some new events from the name of ",user())
+Let's create some new events from the name of ev_test@localhost
+create event one_event on schedule every 20 second do select 123;
+create event two_event on schedule every 20 second on completion not preserve comment "two event" do select 123;
+create event three_event on schedule every 20 second on completion preserve comment "three event" do select 123;
+select "Now we should see 3 events:";
+Now we should see 3 events:
+Now we should see 3 events:
+SHOW EVENTS;
+Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
+events_test one_event ev_test@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
+events_test three_event ev_test@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
+events_test two_event ev_test@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
+select "This should show us only 3 events:";
+This should show us only 3 events:
+This should show us only 3 events:
+SHOW FULL EVENTS;
+Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
+events_test one_event ev_test@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
+events_test three_event ev_test@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
+events_test two_event ev_test@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
+select "This should show us only 2 events:";
+This should show us only 2 events:
+This should show us only 2 events:
+SHOW FULL EVENTS LIKE 't%event';
+Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
+events_test three_event ev_test@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
+events_test two_event ev_test@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
+select "This should show us no events:";
+This should show us no events:
+This should show us no events:
+SHOW FULL EVENTS FROM test LIKE '%';
+Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
+DROP DATABASE events_test2;
+select "should see 1 event:";
+should see 1 event:
+should see 1 event:
+SHOW EVENTS;
+Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
+events_test one_event root@localhost RECURRING NULL 10 INTERVAL_SECOND # # ENABLED
+select "we should see 4 events now:";
+we should see 4 events now:
+we should see 4 events now:
+SHOW FULL EVENTS;
+Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
+events_test one_event ev_test@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
+events_test three_event ev_test@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
+events_test two_event ev_test@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
+events_test one_event root@localhost RECURRING NULL 10 INTERVAL_SECOND # # ENABLED
+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;
+EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
+NULL events_test one_event ev_test@localhost select 123 RECURRING NULL 20 INTERVAL_SECOND ENABLED NOT PRESERVE
+NULL events_test three_event ev_test@localhost select 123 RECURRING NULL 20 INTERVAL_SECOND ENABLED PRESERVE three event
+NULL events_test two_event ev_test@localhost select 123 RECURRING NULL 20 INTERVAL_SECOND ENABLED NOT PRESERVE two event
+NULL events_test one_event root@localhost select 123 RECURRING NULL 10 INTERVAL_SECOND ENABLED NOT PRESERVE
+drop event one_event;
+drop event two_event;
+drop event three_event;
+drop user ev_test@localhost;
+drop event one_event;
+set global event_scheduler=0;
+select count(*) from mysql.event;
+count(*)
+0
+select get_lock("test_lock1", 20);
+get_lock("test_lock1", 20)
+1
+create event закачка on schedule every 10 hour do select get_lock("test_lock1", 20);
+select count(*) from mysql.event;
+count(*)
+1
+select release_lock("test_lock1");
+release_lock("test_lock1")
+1
+drop event закачка;
+select count(*) from mysql.event;
+count(*)
+0
+set global event_scheduler=1;
+select get_lock("test_lock2", 20);
+get_lock("test_lock2", 20)
+1
+create event закачка on schedule every 10 hour do select get_lock("test_lock2", 20);
+select sleep(2);
+sleep(2)
+0
+select release_lock("test_lock2");
+release_lock("test_lock2")
+1
+drop event закачка;
+set global event_scheduler=1;
+select get_lock("test_lock2_1", 20);
+get_lock("test_lock2_1", 20)
+1
+create event закачка21 on schedule every 10 hour do select get_lock("test_lock2_1", 20);
+select sleep(2);
+sleep(2)
+0
+set global event_scheduler=0;
+select sleep(2);
+sleep(2)
+0
+select release_lock("test_lock2_1");
+release_lock("test_lock2_1")
+1
+select sleep(2);
+sleep(2)
+0
+drop event закачка21;
+set global event_scheduler=1;
+select get_lock("test_lock3", 20);
+get_lock("test_lock3", 20)
+1
+create event закачка on schedule every 10 hour do select get_lock("test_lock3", 20);
+select sleep(2);
+sleep(2)
+0
+drop event закачка;
+select release_lock("test_lock3");
+release_lock("test_lock3")
+1
+set global event_scheduler=0;
+select sleep(2);
+sleep(2)
+0
drop database events_test;
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index 8778ded244f..40706fd9c55 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -44,6 +44,7 @@ COLLATION_CHARACTER_SET_APPLICABILITY
COLUMNS
COLUMN_PRIVILEGES
ENGINES
+EVENTS
KEY_COLUMN_USAGE
PARTITIONS
PLUGINS
@@ -734,7 +735,7 @@ CREATE TABLE t_crashme ( f1 BIGINT);
CREATE VIEW a1 (t_CRASHME) AS SELECT f1 FROM t_crashme GROUP BY f1;
CREATE VIEW a2 AS SELECT t_CRASHME FROM a1;
count(*)
-109
+110
drop view a2, a1;
drop table t_crashme;
select table_schema,table_name, column_name from
@@ -742,6 +743,8 @@ information_schema.columns
where data_type = 'longtext';
table_schema table_name column_name
information_schema COLUMNS COLUMN_TYPE
+information_schema EVENTS EVENT_BODY
+information_schema EVENTS SQL_MODE
information_schema PARTITIONS PARTITION_EXPRESSION
information_schema PARTITIONS SUBPARTITION_EXPRESSION
information_schema PARTITIONS PARTITION_DESCRIPTION
@@ -756,6 +759,12 @@ information_schema VIEWS VIEW_DEFINITION
select table_name, column_name, data_type from information_schema.columns
where data_type = 'datetime';
table_name column_name data_type
+EVENTS EXECUTE_AT datetime
+EVENTS STARTS datetime
+EVENTS ENDS datetime
+EVENTS CREATED datetime
+EVENTS LAST_ALTERED datetime
+EVENTS LAST_EXECUTED datetime
PARTITIONS CREATE_TIME datetime
PARTITIONS UPDATE_TIME datetime
PARTITIONS CHECK_TIME datetime
@@ -817,7 +826,7 @@ flush privileges;
SELECT table_schema, count(*) FROM information_schema.TABLES GROUP BY TABLE_SCHEMA;
table_schema count(*)
cluster_replication 1
-information_schema 19
+information_schema 20
mysql 21
create table t1 (i int, j int);
create trigger trg1 before insert on t1 for each row
diff --git a/mysql-test/r/information_schema_db.result b/mysql-test/r/information_schema_db.result
index 7832e34dfd1..1ad996dedd5 100644
--- a/mysql-test/r/information_schema_db.result
+++ b/mysql-test/r/information_schema_db.result
@@ -7,6 +7,7 @@ COLLATION_CHARACTER_SET_APPLICABILITY
COLUMNS
COLUMN_PRIVILEGES
ENGINES
+EVENTS
KEY_COLUMN_USAGE
PARTITIONS
PLUGINS