diff options
author | unknown <andrey@lmy004.> | 2006-02-10 15:02:57 +0100 |
---|---|---|
committer | unknown <andrey@lmy004.> | 2006-02-10 15:02:57 +0100 |
commit | 5b497b163aff1ba23af4f97528be832af55c3c21 (patch) | |
tree | 36b814f55a927eda9e28b47961f29e224033fd61 /mysql-test/r/events.result | |
parent | 094fcd2611b3a171a64b5d20a4b851cdba2c55e7 (diff) | |
download | mariadb-git-5b497b163aff1ba23af4f97528be832af55c3c21.tar.gz |
fix for bug #17289 Events: missing privilege check for drop database
Events were executed with all privileges possible on planet Earth :(
WL#1034
mysql-test/r/events.result:
update test results
mysql-test/t/events.test:
test for bug#17289 Events: missing privilege check for drop database
sql/event.h:
-add two new methods to event_timed to change and restore
the security context
sql/event_executor.cc:
- move code regarding privilieges checking to event_timed::execute()
- add a new function evex_print_warnings() which prints the notes/warnings/errors
to the console (easily capturable with logs-into-tables) so one can see what
has happened if there was an error of some sort!
sql/event_timed.cc:
- fix documentation
- add a new error code -99, EVENT was revoked from the user on the DB
- set_sec_ctx, execute, restore_sex_ctx
sql/sql_error.cc:
- make warning_level_names public to be used in event_executor.cc
- change from 2 arrays to a LEX_STRING array
Diffstat (limited to 'mysql-test/r/events.result')
-rw-r--r-- | mysql-test/r/events.result | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result index b5b1b76f1a8..9b49ea24f26 100644 --- a/mysql-test/r/events.result +++ b/mysql-test/r/events.result @@ -1,5 +1,28 @@ create database if not exists events_test; use events_test; +CREATE USER pauline@localhost; +CREATE DATABASE db_x; +GRANT EVENT ON db_x.* TO pauline@localhost; +USE db_x; +CREATE TABLE x_table(a int); +CREATE EVENT e_x1 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE db_x; +CREATE EVENT e_x2 ON SCHEDULE EVERY 1 SECOND DO DROP TABLE x_table; +SHOW DATABASES LIKE 'db_x'; +Database (db_x) +db_x +SET GLOBAL event_scheduler=1; +SHOW DATABASES LIKE 'db_x'; +Database (db_x) +db_x +SHOW TABLES FROM db_x; +Tables_in_db_x +x_table +SET GLOBAL event_scheduler=0; +DROP EVENT e_x1; +DROP EVENT e_x2; +DROP DATABASE db_x; +DROP USER pauline@localhost; +USE events_test; drop event if exists event1; Warnings: Note 1305 Event event1 does not exist @@ -166,7 +189,7 @@ show processlist; Id User Host db Command Time State Info # root localhost events_test Query # NULL show processlist # event_scheduler NULL Connect # Sleeping NULL -# root events_test Connect # User lock select get_lock("test_lock2", 20) +# root localhost events_test Connect # User lock select get_lock("test_lock2", 20) "Release the mutex, the event worker should finish." select release_lock("test_lock2"); release_lock("test_lock2") @@ -184,6 +207,8 @@ set global event_scheduler=0; show processlist; Id User Host db Command Time State Info # root localhost events_test Query # NULL show processlist +# event_scheduler NULL Connect # Sleeping NULL +# root localhost events_test Connect # User lock select get_lock("test_lock2_1", 20) "Release the lock so the child process should finish. Hence the scheduler also" select release_lock("test_lock2_1"); release_lock("test_lock2_1") |