summaryrefslogtreecommitdiff
path: root/sql/sql_acl.h
diff options
context:
space:
mode:
authorunknown <andrey@lmy004.>2005-12-15 14:12:28 +0100
committerunknown <andrey@lmy004.>2005-12-15 14:12:28 +0100
commit48405ec751ed8cbae94cc7478eb3ab19c29b7734 (patch)
tree579217e6afc4bc4bd66d6c99c412035d7f5d7389 /sql/sql_acl.h
parentb67555d5d4ff74a4abefdc08f25177d7aa28b5aa (diff)
downloadmariadb-git-48405ec751ed8cbae94cc7478eb3ab19c29b7734.tar.gz
WL#1034 update
- fix EVENT_ACL problem that GRANT ALL on some_db.* to someone@somewhere did not get to mysql.db - fix crash when the following is executed : CREATE EVENT P() CREATE EVENT E ON SCHEDULER 1 SECOND DO ROLLBACK; (creation works as well as calling P() which creates the event). mysql-test/lib/init_db.sql: - fix init_db.sql so add Event_priv to the database privs, many tests failed because of that ommision - remove the quotes from the column names mysql-test/t/events.test: - fix the small test, don't create own db scripts/mysql_fix_privilege_tables.sql: - fix that sql/event.cc: - be defensive and don't crash if outside has already has opened some table sql/event_executor.cc: - show in SHOW PROCESSLIST - "event_scheduler" as name of the user of the main thread - use "localhost" as the host where event_scheduler comes from - comment out some debug info, fix other debug info sql/event_timed.cc: - enable EVENT creation inside SP. sphead from lex->sphead goes to et->sphead. it's there only if we compile the event. OTOH when doing CREATE PROCEDURE PROC() CREATE EVENT SOME_EV ON SCHEDULE EVERY 1 SECOND DO ROLLBACK; I have only to get the body of the event which is anonymous SP. Before it being "compiled" but then freed without being used because a bit later it is compiled one more time before being put in the events cache. So it was good that the memory structures weren't reused but scrapped out. Now lex->sphead is not needed during event creation but only where the event's body starts and where it ends so to be able at later stage to compile this anonymous SP (the body of the event). sql/sp_head.cc: - copy over a fix to a crash sql/sql_acl.h: - fix privileges. There was _NO_ documentation about that. Another CHUNK had to be created to so EVENT_ACL gets shifted to it's place in the db table. So how this is calculated? EVENT_ACL is 1 << 26. Remember 26, see which poistion in the db table is EVENT_ACL, it's 17, counted from 0. 26 - 17 = 9, then shift it with 9. CHUNKS are created because in some cases some privileges are in chunks and they are shifted at once. There are few chunks of such privileges which has to be shifted to get to exactly the structure of mysql.db table. sql/sql_parse.cc: - ok, we don't care anymore about lex->sphead because our sphead is lex->et->sphead sql/sql_yacc.yy: - bail out if new event_timed returns 0x0 - enable creation of an event inside a SP CREATE PROCEDURE P() CREATE EVENT E ON SCHEDULE EVERY 1 SECOND DO SELECT 1;
Diffstat (limited to 'sql/sql_acl.h')
-rw-r--r--sql/sql_acl.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/sql_acl.h b/sql/sql_acl.h
index 44e42b961a2..993fa991eab 100644
--- a/sql/sql_acl.h
+++ b/sql/sql_acl.h
@@ -97,17 +97,20 @@
#define DB_CHUNK3 (CREATE_VIEW_ACL | SHOW_VIEW_ACL | \
CREATE_PROC_ACL | ALTER_PROC_ACL )
#define DB_CHUNK4 (EXECUTE_ACL)
+#define DB_CHUNK5 (EVENT_ACL)
#define fix_rights_for_db(A) (((A) & DB_CHUNK0) | \
(((A) << 4) & DB_CHUNK1) | \
(((A) << 6) & DB_CHUNK2) | \
(((A) << 9) & DB_CHUNK3) | \
- (((A) << 2) & DB_CHUNK4))
+ (((A) << 2) & DB_CHUNK4))| \
+ (((A) << 9) & DB_CHUNK5)
#define get_rights_for_db(A) (((A) & DB_CHUNK0) | \
(((A) & DB_CHUNK1) >> 4) | \
(((A) & DB_CHUNK2) >> 6) | \
(((A) & DB_CHUNK3) >> 9) | \
- (((A) & DB_CHUNK4) >> 2))
+ (((A) & DB_CHUNK4) >> 2))| \
+ (((A) & DB_CHUNK5) >> 9)
#define TBL_CHUNK0 DB_CHUNK0
#define TBL_CHUNK1 DB_CHUNK1
#define TBL_CHUNK2 (CREATE_VIEW_ACL | SHOW_VIEW_ACL)