mariadb/mysql-test/r/events_grant.result

122 lines
9.8 KiB
Text
Raw Normal View History

2006-05-29 13:16:29 +02:00
CREATE DATABASE IF NOT EXISTS events_test;
use events_test;
CREATE EVENT one_event ON SCHEDULE EVERY 10 SECOND DO SELECT 123;
SHOW EVENTS;
Merge cbell@bk-internal.mysql.com:/home/bk/mysql-5.1-new-rpl into mysql_cab_desk.:C:/source/c++/mysql-5.1-new-rpl mysql-test/t/events.test: Auto merged sql/event_queue.cc: Auto merged sql/events.cc: Auto merged sql/lex.h: Auto merged sql/slave.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_yacc.yy: Auto merged BitKeeper/deleted/.del-init_db.sql~a77d572c39d5a1f8: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. BitKeeper/deleted/.del-mysql_create_system_tables.sh: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/r/events.result: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/r/events_grant.result: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/r/events_restart_phase1.result: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/r/system_mysql_db.result: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/t/events_restart_phase1.test: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. scripts/mysql_system_tables.sql: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. scripts/mysql_system_tables_fix.sql: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/event_data_objects.cc: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/event_data_objects.h: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/event_db_repository.cc: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/event_db_repository.h: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/sql_udf.cc: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches.
2007-03-29 15:54:59 +02:00
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
events_test one_event root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1
Better fix for bug#22830 Events: crash with procedure which alters events with function Post-review CS This fix also changes the handling of KILL command combined with subquery. It changes the error message given back to "not supported", from parse error. The error for CREATE|ALTER EVENT has also been changed to generate "not supported yet" instead of parse error. In case of a SP call, the error is "not supported yet". This change cleans the parser from code which should not belong to there. Still LEX::expr_allows_subselect is existant because it simplifies the handling of SQLCOM_HA_READ which forbids subselects. mysql-test/r/events_bugs.result: update resut mysql-test/r/events_grant.result: update result mysql-test/r/kill.result: the error message has been changed for KILL mysql-test/t/events_bugs.test: Update old tests with the new emitted error Add a test case for BUG#22830 Events: crash with procedure which alters events with function mysql-test/t/events_grant.test: add ORDER BY clause to keep the result deterministic. mysql-test/t/kill.test: use name of the error, and change the error from parse error, to not supported sql/sql_lex.cc: Add an auxiliary function that checks whether SP and/or tables are used in the statement. This function is helpful for statements that cannot handle subqueries ans SP calls. Adding out of the parser cleans the latter of handling of special cases and letting it do its job of parsing. sql/sql_lex.h: helper function to check whether a table or SP was used sql/sql_parse.cc: Use LEX::table_or_sp_used() for SQLCOM_CREATE_EVENT, SQLCOM_ALTER_EVENT and SQLCOM_KILL. SQLCOM_DROP event does not use `expr` rule and thus a check is not needed. sql/sql_yacc.yy: Remove usage of LEX::expr_allows_subselect for CREATE|ALTER EVENT and KILL. There is only one left occurence - SQLCOM_HAREAD, but it adds one table to the list of tables
2006-11-02 13:51:43 +01:00
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 ORDER BY EVENT_SCHEMA, EVENT_NAME;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
2006-05-29 13:16:29 +02:00
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;
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, TRIGGER ON `events_test2`.* TO 'ev_test'@'localhost'
"Here comes an error:";
SHOW EVENTS;
ERROR 42000: Access denied for user 'ev_test'@'localhost' to database 'events_test2'
USE events_test;
"We should see one event";
SHOW EVENTS;
Merge cbell@bk-internal.mysql.com:/home/bk/mysql-5.1-new-rpl into mysql_cab_desk.:C:/source/c++/mysql-5.1-new-rpl mysql-test/t/events.test: Auto merged sql/event_queue.cc: Auto merged sql/events.cc: Auto merged sql/lex.h: Auto merged sql/slave.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_yacc.yy: Auto merged BitKeeper/deleted/.del-init_db.sql~a77d572c39d5a1f8: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. BitKeeper/deleted/.del-mysql_create_system_tables.sh: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/r/events.result: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/r/events_grant.result: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/r/events_restart_phase1.result: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/r/system_mysql_db.result: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/t/events_restart_phase1.test: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. scripts/mysql_system_tables.sql: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. scripts/mysql_system_tables_fix.sql: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/event_data_objects.cc: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/event_data_objects.h: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/event_db_repository.cc: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/event_db_repository.h: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/sql_udf.cc: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches.
2007-03-29 15:54:59 +02:00
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
events_test one_event root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1
2006-05-29 13:16:29 +02:00
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;
ERROR HY000: Event 'one_event' already exists
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;
"Now we should see 3 events:";
SHOW EVENTS;
Merge cbell@bk-internal.mysql.com:/home/bk/mysql-5.1-new-rpl into mysql_cab_desk.:C:/source/c++/mysql-5.1-new-rpl mysql-test/t/events.test: Auto merged sql/event_queue.cc: Auto merged sql/events.cc: Auto merged sql/lex.h: Auto merged sql/slave.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_yacc.yy: Auto merged BitKeeper/deleted/.del-init_db.sql~a77d572c39d5a1f8: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. BitKeeper/deleted/.del-mysql_create_system_tables.sh: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/r/events.result: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/r/events_grant.result: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/r/events_restart_phase1.result: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/r/system_mysql_db.result: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/t/events_restart_phase1.test: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. scripts/mysql_system_tables.sql: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. scripts/mysql_system_tables_fix.sql: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/event_data_objects.cc: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/event_data_objects.h: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/event_db_repository.cc: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/event_db_repository.h: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/sql_udf.cc: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches.
2007-03-29 15:54:59 +02:00
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
events_test one_event root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1
events_test three_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED 1
events_test two_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED 1
2006-05-29 13:16:29 +02:00
"This should show us only 2 events:";
SHOW EVENTS LIKE 't%event';
Merge cbell@bk-internal.mysql.com:/home/bk/mysql-5.1-new-rpl into mysql_cab_desk.:C:/source/c++/mysql-5.1-new-rpl mysql-test/t/events.test: Auto merged sql/event_queue.cc: Auto merged sql/events.cc: Auto merged sql/lex.h: Auto merged sql/slave.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_yacc.yy: Auto merged BitKeeper/deleted/.del-init_db.sql~a77d572c39d5a1f8: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. BitKeeper/deleted/.del-mysql_create_system_tables.sh: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/r/events.result: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/r/events_grant.result: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/r/events_restart_phase1.result: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/r/system_mysql_db.result: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/t/events_restart_phase1.test: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. scripts/mysql_system_tables.sql: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. scripts/mysql_system_tables_fix.sql: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/event_data_objects.cc: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/event_data_objects.h: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/event_db_repository.cc: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/event_db_repository.h: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/sql_udf.cc: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches.
2007-03-29 15:54:59 +02:00
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
events_test three_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED 1
events_test two_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED 1
2006-05-29 13:16:29 +02:00
"This should show us no events:";
SHOW EVENTS FROM test LIKE '%';
Merge cbell@bk-internal.mysql.com:/home/bk/mysql-5.1-new-rpl into mysql_cab_desk.:C:/source/c++/mysql-5.1-new-rpl mysql-test/t/events.test: Auto merged sql/event_queue.cc: Auto merged sql/events.cc: Auto merged sql/lex.h: Auto merged sql/slave.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_yacc.yy: Auto merged BitKeeper/deleted/.del-init_db.sql~a77d572c39d5a1f8: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. BitKeeper/deleted/.del-mysql_create_system_tables.sh: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/r/events.result: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/r/events_grant.result: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/r/events_restart_phase1.result: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/r/system_mysql_db.result: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. mysql-test/t/events_restart_phase1.test: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. scripts/mysql_system_tables.sql: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. scripts/mysql_system_tables_fix.sql: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/event_data_objects.cc: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/event_data_objects.h: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/event_db_repository.cc: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/event_db_repository.h: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches. sql/sql_udf.cc: WL#3629 : Replication of Invocation and Invoked Features Manual merge prior to pushing patches.
2007-03-29 15:54:59 +02:00
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
2006-05-29 13:16:29 +02:00
GRANT EVENT ON events_test2.* TO ev_test@localhost;
USE events_test2;
CREATE EVENT four_event ON SCHEDULE EVERY 20 SECOND DO SELECT 42;
USE events_test;
"We should see 4 events : one_event, two_event, three_event & four_event"
Better fix for bug#22830 Events: crash with procedure which alters events with function Post-review CS This fix also changes the handling of KILL command combined with subquery. It changes the error message given back to "not supported", from parse error. The error for CREATE|ALTER EVENT has also been changed to generate "not supported yet" instead of parse error. In case of a SP call, the error is "not supported yet". This change cleans the parser from code which should not belong to there. Still LEX::expr_allows_subselect is existant because it simplifies the handling of SQLCOM_HA_READ which forbids subselects. mysql-test/r/events_bugs.result: update resut mysql-test/r/events_grant.result: update result mysql-test/r/kill.result: the error message has been changed for KILL mysql-test/t/events_bugs.test: Update old tests with the new emitted error Add a test case for BUG#22830 Events: crash with procedure which alters events with function mysql-test/t/events_grant.test: add ORDER BY clause to keep the result deterministic. mysql-test/t/kill.test: use name of the error, and change the error from parse error, to not supported sql/sql_lex.cc: Add an auxiliary function that checks whether SP and/or tables are used in the statement. This function is helpful for statements that cannot handle subqueries ans SP calls. Adding out of the parser cleans the latter of handling of special cases and letting it do its job of parsing. sql/sql_lex.h: helper function to check whether a table or SP was used sql/sql_parse.cc: Use LEX::table_or_sp_used() for SQLCOM_CREATE_EVENT, SQLCOM_ALTER_EVENT and SQLCOM_KILL. SQLCOM_DROP event does not use `expr` rule and thus a check is not needed. sql/sql_yacc.yy: Remove usage of LEX::expr_allows_subselect for CREATE|ALTER EVENT and KILL. There is only one left occurence - SQLCOM_HAREAD, but it adds one table to the list of tables
2006-11-02 13:51:43 +01:00
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 ORDER BY EVENT_SCHEMA, EVENT_NAME;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
NULL events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
Better fix for bug#22830 Events: crash with procedure which alters events with function Post-review CS This fix also changes the handling of KILL command combined with subquery. It changes the error message given back to "not supported", from parse error. The error for CREATE|ALTER EVENT has also been changed to generate "not supported yet" instead of parse error. In case of a SP call, the error is "not supported yet". This change cleans the parser from code which should not belong to there. Still LEX::expr_allows_subselect is existant because it simplifies the handling of SQLCOM_HA_READ which forbids subselects. mysql-test/r/events_bugs.result: update resut mysql-test/r/events_grant.result: update result mysql-test/r/kill.result: the error message has been changed for KILL mysql-test/t/events_bugs.test: Update old tests with the new emitted error Add a test case for BUG#22830 Events: crash with procedure which alters events with function mysql-test/t/events_grant.test: add ORDER BY clause to keep the result deterministic. mysql-test/t/kill.test: use name of the error, and change the error from parse error, to not supported sql/sql_lex.cc: Add an auxiliary function that checks whether SP and/or tables are used in the statement. This function is helpful for statements that cannot handle subqueries ans SP calls. Adding out of the parser cleans the latter of handling of special cases and letting it do its job of parsing. sql/sql_lex.h: helper function to check whether a table or SP was used sql/sql_parse.cc: Use LEX::table_or_sp_used() for SQLCOM_CREATE_EVENT, SQLCOM_ALTER_EVENT and SQLCOM_KILL. SQLCOM_DROP event does not use `expr` rule and thus a check is not needed. sql/sql_yacc.yy: Remove usage of LEX::expr_allows_subselect for CREATE|ALTER EVENT and KILL. There is only one left occurence - SQLCOM_HAREAD, but it adds one table to the list of tables
2006-11-02 13:51:43 +01:00
NULL events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
NULL events_test2 four_event ev_test@localhost SQL SELECT 42 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE
2006-05-29 13:16:29 +02:00
DROP DATABASE events_test2;
"We should see 3 events : one_event, two_event, three_event"
Better fix for bug#22830 Events: crash with procedure which alters events with function Post-review CS This fix also changes the handling of KILL command combined with subquery. It changes the error message given back to "not supported", from parse error. The error for CREATE|ALTER EVENT has also been changed to generate "not supported yet" instead of parse error. In case of a SP call, the error is "not supported yet". This change cleans the parser from code which should not belong to there. Still LEX::expr_allows_subselect is existant because it simplifies the handling of SQLCOM_HA_READ which forbids subselects. mysql-test/r/events_bugs.result: update resut mysql-test/r/events_grant.result: update result mysql-test/r/kill.result: the error message has been changed for KILL mysql-test/t/events_bugs.test: Update old tests with the new emitted error Add a test case for BUG#22830 Events: crash with procedure which alters events with function mysql-test/t/events_grant.test: add ORDER BY clause to keep the result deterministic. mysql-test/t/kill.test: use name of the error, and change the error from parse error, to not supported sql/sql_lex.cc: Add an auxiliary function that checks whether SP and/or tables are used in the statement. This function is helpful for statements that cannot handle subqueries ans SP calls. Adding out of the parser cleans the latter of handling of special cases and letting it do its job of parsing. sql/sql_lex.h: helper function to check whether a table or SP was used sql/sql_parse.cc: Use LEX::table_or_sp_used() for SQLCOM_CREATE_EVENT, SQLCOM_ALTER_EVENT and SQLCOM_KILL. SQLCOM_DROP event does not use `expr` rule and thus a check is not needed. sql/sql_yacc.yy: Remove usage of LEX::expr_allows_subselect for CREATE|ALTER EVENT and KILL. There is only one left occurence - SQLCOM_HAREAD, but it adds one table to the list of tables
2006-11-02 13:51:43 +01:00
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 ORDER BY EVENT_SCHEMA, EVENT_NAME;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
NULL events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
Better fix for bug#22830 Events: crash with procedure which alters events with function Post-review CS This fix also changes the handling of KILL command combined with subquery. It changes the error message given back to "not supported", from parse error. The error for CREATE|ALTER EVENT has also been changed to generate "not supported yet" instead of parse error. In case of a SP call, the error is "not supported yet". This change cleans the parser from code which should not belong to there. Still LEX::expr_allows_subselect is existant because it simplifies the handling of SQLCOM_HA_READ which forbids subselects. mysql-test/r/events_bugs.result: update resut mysql-test/r/events_grant.result: update result mysql-test/r/kill.result: the error message has been changed for KILL mysql-test/t/events_bugs.test: Update old tests with the new emitted error Add a test case for BUG#22830 Events: crash with procedure which alters events with function mysql-test/t/events_grant.test: add ORDER BY clause to keep the result deterministic. mysql-test/t/kill.test: use name of the error, and change the error from parse error, to not supported sql/sql_lex.cc: Add an auxiliary function that checks whether SP and/or tables are used in the statement. This function is helpful for statements that cannot handle subqueries ans SP calls. Adding out of the parser cleans the latter of handling of special cases and letting it do its job of parsing. sql/sql_lex.h: helper function to check whether a table or SP was used sql/sql_parse.cc: Use LEX::table_or_sp_used() for SQLCOM_CREATE_EVENT, SQLCOM_ALTER_EVENT and SQLCOM_KILL. SQLCOM_DROP event does not use `expr` rule and thus a check is not needed. sql/sql_yacc.yy: Remove usage of LEX::expr_allows_subselect for CREATE|ALTER EVENT and KILL. There is only one left occurence - SQLCOM_HAREAD, but it adds one table to the list of tables
2006-11-02 13:51:43 +01:00
NULL events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
2006-05-29 13:16:29 +02:00
CREATE DATABASE events_test2;
USE events_test2;
CREATE EVENT five_event ON SCHEDULE EVERY 20 SECOND DO SELECT 42;
"Should see 4 events - one, two, three & five"
Better fix for bug#22830 Events: crash with procedure which alters events with function Post-review CS This fix also changes the handling of KILL command combined with subquery. It changes the error message given back to "not supported", from parse error. The error for CREATE|ALTER EVENT has also been changed to generate "not supported yet" instead of parse error. In case of a SP call, the error is "not supported yet". This change cleans the parser from code which should not belong to there. Still LEX::expr_allows_subselect is existant because it simplifies the handling of SQLCOM_HA_READ which forbids subselects. mysql-test/r/events_bugs.result: update resut mysql-test/r/events_grant.result: update result mysql-test/r/kill.result: the error message has been changed for KILL mysql-test/t/events_bugs.test: Update old tests with the new emitted error Add a test case for BUG#22830 Events: crash with procedure which alters events with function mysql-test/t/events_grant.test: add ORDER BY clause to keep the result deterministic. mysql-test/t/kill.test: use name of the error, and change the error from parse error, to not supported sql/sql_lex.cc: Add an auxiliary function that checks whether SP and/or tables are used in the statement. This function is helpful for statements that cannot handle subqueries ans SP calls. Adding out of the parser cleans the latter of handling of special cases and letting it do its job of parsing. sql/sql_lex.h: helper function to check whether a table or SP was used sql/sql_parse.cc: Use LEX::table_or_sp_used() for SQLCOM_CREATE_EVENT, SQLCOM_ALTER_EVENT and SQLCOM_KILL. SQLCOM_DROP event does not use `expr` rule and thus a check is not needed. sql/sql_yacc.yy: Remove usage of LEX::expr_allows_subselect for CREATE|ALTER EVENT and KILL. There is only one left occurence - SQLCOM_HAREAD, but it adds one table to the list of tables
2006-11-02 13:51:43 +01:00
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 ORDER BY EVENT_SCHEMA, EVENT_NAME;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
NULL events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
Better fix for bug#22830 Events: crash with procedure which alters events with function Post-review CS This fix also changes the handling of KILL command combined with subquery. It changes the error message given back to "not supported", from parse error. The error for CREATE|ALTER EVENT has also been changed to generate "not supported yet" instead of parse error. In case of a SP call, the error is "not supported yet". This change cleans the parser from code which should not belong to there. Still LEX::expr_allows_subselect is existant because it simplifies the handling of SQLCOM_HA_READ which forbids subselects. mysql-test/r/events_bugs.result: update resut mysql-test/r/events_grant.result: update result mysql-test/r/kill.result: the error message has been changed for KILL mysql-test/t/events_bugs.test: Update old tests with the new emitted error Add a test case for BUG#22830 Events: crash with procedure which alters events with function mysql-test/t/events_grant.test: add ORDER BY clause to keep the result deterministic. mysql-test/t/kill.test: use name of the error, and change the error from parse error, to not supported sql/sql_lex.cc: Add an auxiliary function that checks whether SP and/or tables are used in the statement. This function is helpful for statements that cannot handle subqueries ans SP calls. Adding out of the parser cleans the latter of handling of special cases and letting it do its job of parsing. sql/sql_lex.h: helper function to check whether a table or SP was used sql/sql_parse.cc: Use LEX::table_or_sp_used() for SQLCOM_CREATE_EVENT, SQLCOM_ALTER_EVENT and SQLCOM_KILL. SQLCOM_DROP event does not use `expr` rule and thus a check is not needed. sql/sql_yacc.yy: Remove usage of LEX::expr_allows_subselect for CREATE|ALTER EVENT and KILL. There is only one left occurence - SQLCOM_HAREAD, but it adds one table to the list of tables
2006-11-02 13:51:43 +01:00
NULL events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
NULL events_test2 five_event root@localhost SQL SELECT 42 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE
2006-05-29 13:16:29 +02:00
REVOKE EVENT ON events_test2.* FROM ev_test@localhost;
USE test;
"Should see 3 events - one, two & three"
Better fix for bug#22830 Events: crash with procedure which alters events with function Post-review CS This fix also changes the handling of KILL command combined with subquery. It changes the error message given back to "not supported", from parse error. The error for CREATE|ALTER EVENT has also been changed to generate "not supported yet" instead of parse error. In case of a SP call, the error is "not supported yet". This change cleans the parser from code which should not belong to there. Still LEX::expr_allows_subselect is existant because it simplifies the handling of SQLCOM_HA_READ which forbids subselects. mysql-test/r/events_bugs.result: update resut mysql-test/r/events_grant.result: update result mysql-test/r/kill.result: the error message has been changed for KILL mysql-test/t/events_bugs.test: Update old tests with the new emitted error Add a test case for BUG#22830 Events: crash with procedure which alters events with function mysql-test/t/events_grant.test: add ORDER BY clause to keep the result deterministic. mysql-test/t/kill.test: use name of the error, and change the error from parse error, to not supported sql/sql_lex.cc: Add an auxiliary function that checks whether SP and/or tables are used in the statement. This function is helpful for statements that cannot handle subqueries ans SP calls. Adding out of the parser cleans the latter of handling of special cases and letting it do its job of parsing. sql/sql_lex.h: helper function to check whether a table or SP was used sql/sql_parse.cc: Use LEX::table_or_sp_used() for SQLCOM_CREATE_EVENT, SQLCOM_ALTER_EVENT and SQLCOM_KILL. SQLCOM_DROP event does not use `expr` rule and thus a check is not needed. sql/sql_yacc.yy: Remove usage of LEX::expr_allows_subselect for CREATE|ALTER EVENT and KILL. There is only one left occurence - SQLCOM_HAREAD, but it adds one table to the list of tables
2006-11-02 13:51:43 +01:00
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 ORDER BY EVENT_SCHEMA, EVENT_NAME;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
NULL events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
Better fix for bug#22830 Events: crash with procedure which alters events with function Post-review CS This fix also changes the handling of KILL command combined with subquery. It changes the error message given back to "not supported", from parse error. The error for CREATE|ALTER EVENT has also been changed to generate "not supported yet" instead of parse error. In case of a SP call, the error is "not supported yet". This change cleans the parser from code which should not belong to there. Still LEX::expr_allows_subselect is existant because it simplifies the handling of SQLCOM_HA_READ which forbids subselects. mysql-test/r/events_bugs.result: update resut mysql-test/r/events_grant.result: update result mysql-test/r/kill.result: the error message has been changed for KILL mysql-test/t/events_bugs.test: Update old tests with the new emitted error Add a test case for BUG#22830 Events: crash with procedure which alters events with function mysql-test/t/events_grant.test: add ORDER BY clause to keep the result deterministic. mysql-test/t/kill.test: use name of the error, and change the error from parse error, to not supported sql/sql_lex.cc: Add an auxiliary function that checks whether SP and/or tables are used in the statement. This function is helpful for statements that cannot handle subqueries ans SP calls. Adding out of the parser cleans the latter of handling of special cases and letting it do its job of parsing. sql/sql_lex.h: helper function to check whether a table or SP was used sql/sql_parse.cc: Use LEX::table_or_sp_used() for SQLCOM_CREATE_EVENT, SQLCOM_ALTER_EVENT and SQLCOM_KILL. SQLCOM_DROP event does not use `expr` rule and thus a check is not needed. sql/sql_yacc.yy: Remove usage of LEX::expr_allows_subselect for CREATE|ALTER EVENT and KILL. There is only one left occurence - SQLCOM_HAREAD, but it adds one table to the list of tables
2006-11-02 13:51:43 +01:00
NULL events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
2006-05-29 13:16:29 +02:00
"Let's test ALTER EVENT which changes the definer"
USE events_test;
ALTER EVENT one_event ON SCHEDULE EVERY 10 SECOND;
"The definer should be ev_test@localhost"
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';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
NULL events_test one_event ev_test@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
2006-05-29 13:16:29 +02:00
USE events_test;
ALTER EVENT one_event COMMENT "comment";
"The definer should be root@localhost"
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';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE comment
2006-05-29 13:16:29 +02:00
ALTER EVENT one_event DO SELECT 12;
"The definer should be ev_test@localhost"
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';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
NULL events_test one_event ev_test@localhost SQL SELECT 12 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE comment
2006-05-29 13:16:29 +02:00
"make the definer again root@localhost"
ALTER EVENT one_event COMMENT "new comment";
"test DROP by another user"
DROP EVENT one_event;
"One event should not be there"
Better fix for bug#22830 Events: crash with procedure which alters events with function Post-review CS This fix also changes the handling of KILL command combined with subquery. It changes the error message given back to "not supported", from parse error. The error for CREATE|ALTER EVENT has also been changed to generate "not supported yet" instead of parse error. In case of a SP call, the error is "not supported yet". This change cleans the parser from code which should not belong to there. Still LEX::expr_allows_subselect is existant because it simplifies the handling of SQLCOM_HA_READ which forbids subselects. mysql-test/r/events_bugs.result: update resut mysql-test/r/events_grant.result: update result mysql-test/r/kill.result: the error message has been changed for KILL mysql-test/t/events_bugs.test: Update old tests with the new emitted error Add a test case for BUG#22830 Events: crash with procedure which alters events with function mysql-test/t/events_grant.test: add ORDER BY clause to keep the result deterministic. mysql-test/t/kill.test: use name of the error, and change the error from parse error, to not supported sql/sql_lex.cc: Add an auxiliary function that checks whether SP and/or tables are used in the statement. This function is helpful for statements that cannot handle subqueries ans SP calls. Adding out of the parser cleans the latter of handling of special cases and letting it do its job of parsing. sql/sql_lex.h: helper function to check whether a table or SP was used sql/sql_parse.cc: Use LEX::table_or_sp_used() for SQLCOM_CREATE_EVENT, SQLCOM_ALTER_EVENT and SQLCOM_KILL. SQLCOM_DROP event does not use `expr` rule and thus a check is not needed. sql/sql_yacc.yy: Remove usage of LEX::expr_allows_subselect for CREATE|ALTER EVENT and KILL. There is only one left occurence - SQLCOM_HAREAD, but it adds one table to the list of tables
2006-11-02 13:51:43 +01:00
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 ORDER BY EVENT_SCHEMA, EVENT_NAME;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
NULL events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
Better fix for bug#22830 Events: crash with procedure which alters events with function Post-review CS This fix also changes the handling of KILL command combined with subquery. It changes the error message given back to "not supported", from parse error. The error for CREATE|ALTER EVENT has also been changed to generate "not supported yet" instead of parse error. In case of a SP call, the error is "not supported yet". This change cleans the parser from code which should not belong to there. Still LEX::expr_allows_subselect is existant because it simplifies the handling of SQLCOM_HA_READ which forbids subselects. mysql-test/r/events_bugs.result: update resut mysql-test/r/events_grant.result: update result mysql-test/r/kill.result: the error message has been changed for KILL mysql-test/t/events_bugs.test: Update old tests with the new emitted error Add a test case for BUG#22830 Events: crash with procedure which alters events with function mysql-test/t/events_grant.test: add ORDER BY clause to keep the result deterministic. mysql-test/t/kill.test: use name of the error, and change the error from parse error, to not supported sql/sql_lex.cc: Add an auxiliary function that checks whether SP and/or tables are used in the statement. This function is helpful for statements that cannot handle subqueries ans SP calls. Adding out of the parser cleans the latter of handling of special cases and letting it do its job of parsing. sql/sql_lex.h: helper function to check whether a table or SP was used sql/sql_parse.cc: Use LEX::table_or_sp_used() for SQLCOM_CREATE_EVENT, SQLCOM_ALTER_EVENT and SQLCOM_KILL. SQLCOM_DROP event does not use `expr` rule and thus a check is not needed. sql/sql_yacc.yy: Remove usage of LEX::expr_allows_subselect for CREATE|ALTER EVENT and KILL. There is only one left occurence - SQLCOM_HAREAD, but it adds one table to the list of tables
2006-11-02 13:51:43 +01:00
NULL events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
NULL events_test2 five_event root@localhost SQL SELECT 42 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE
2006-05-29 13:16:29 +02:00
DROP USER ev_test@localhost;
DROP DATABASE events_test2;
DROP DATABASE events_test;