summaryrefslogtreecommitdiff
path: root/sql/sql_acl.h
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2002-09-16 15:55:19 +0300
committerunknown <monty@mashka.mysql.fi>2002-09-16 15:55:19 +0300
commit9ce6267ebe0089e8f327bb609cacd5cda1ed8617 (patch)
treeaf207b8432596b36633c5f65e7f268ea2b076d6f /sql/sql_acl.h
parentbdf11b22cd43d07daac9a80712c1c1fc93b60a23 (diff)
downloadmariadb-git-9ce6267ebe0089e8f327bb609cacd5cda1ed8617.tar.gz
Added CREATE TEMPORARY TABLES and LOCK TABLES to db and host tables
Fixed bug in SELECT ... ORDER BY ... LIMIT Fixed bug in ALTER TABLE and RENAME TABLE with --lower-case-table-names Fixed hang when using --with-openssl Docs/manual.texi: Updated SHOW VARIABLES Changelog Moved some missplaced changelog entries include/violite.h: updated prototypes libmysqld/lib_sql.cc: Moved init_update_queries() to sql_parse.cc mysql-test/install_test_db.sh: Added CREATE TEMPORARY TABLES and LOCK TABLES to db and host tables mysql-test/r/grant.result: Added CREATE TEMPORARY TABLES and LOCK TABLES to db and host tables mysql-test/t/grant.test: Added CREATE TEMPORARY TABLES and LOCK TABLES to db and host tables scripts/mysql_fix_privilege_tables.sh: Added CREATE TEMPORARY TABLES and LOCK TABLES to db and host tables scripts/mysql_install_db.sh: Added CREATE TEMPORARY TABLES and LOCK TABLES to db and host tables sql/filesort.cc: Fixed bug in SELECT ... ORDER BY ... LIMIT sql/mysql_priv.h: New prototypes sql/mysqld.cc: Added CREATE TEMPORARY TABLES and LOCK TABLES to db and host tables sql/sql_acl.cc: Moved init_update_queries() to sql_parse.cc Added CREATE TEMPORARY TABLES and LOCK TABLES to db and host sql/sql_acl.h: Added CREATE TEMPORARY TABLES and LOCK TABLES to db and host sql/sql_parse.cc: Moved init_update_queries() to sql_parse.cc sql/sql_show.cc: Fixed wrong output in SHOW TABLE STATUS for compressed tables. sql/sql_table.cc: Fixed bug in ALTER TABLE and RENAME TABLE with --lower-case-table-names vio/viosocket.c: Fixed hang when using --with-openssl vio/viossl.c: Fixed hang when using --with-openssl
Diffstat (limited to 'sql/sql_acl.h')
-rw-r--r--sql/sql_acl.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/sql/sql_acl.h b/sql/sql_acl.h
index 0448adc8b1c..326a55ddd0c 100644
--- a/sql/sql_acl.h
+++ b/sql/sql_acl.h
@@ -40,7 +40,7 @@
#define DB_ACLS \
(UPDATE_ACL | SELECT_ACL | INSERT_ACL | DELETE_ACL | CREATE_ACL | DROP_ACL | \
- GRANT_ACL | REFERENCES_ACL | INDEX_ACL | ALTER_ACL)
+ GRANT_ACL | REFERENCES_ACL | INDEX_ACL | ALTER_ACL | CREATE_TMP_ACL | LOCK_TABLES_ACL)
#define TABLE_ACLS \
(SELECT_ACL | INSERT_ACL | UPDATE_ACL | DELETE_ACL | CREATE_ACL | DROP_ACL | \
@@ -59,10 +59,21 @@
#define EXTRA_ACL (1L << 29)
#define NO_ACCESS (1L << 30)
-/* defines to change the above bits to how things are stored in tables */
+/*
+ Defines to change the above bits to how things are stored in tables
+ This is needed as the 'host' and 'db' table is missing a few privileges
+*/
+
+/* Continius bit-segments that needs to be shifted */
+#define DB_REL1 (RELOAD_ACL | SHUTDOWN_ACL | PROCESS_ACL | FILE_ACL)
+#define DB_REL2 (GRANT_ACL | REFERENCES_ACL)
+
+/* Privileges that needs to be reallocated (in continous chunks) */
+#define DB_CHUNK1 (GRANT_ACL | REFERENCES_ACL | INDEX_ACL | ALTER_ACL)
+#define DB_CHUNK2 (CREATE_TMP_ACL | LOCK_TABLES_ACL)
-#define fix_rights_for_db(A) (((A) & 63) | (((A) & ~63) << 4))
-#define get_rights_for_db(A) (((A) & 63) | (((A) & ~63) >> 4))
+#define fix_rights_for_db(A) (((A) & 63) | (((A) & DB_REL1) << 4) | (((A) & DB_REL2) << 6))
+#define get_rights_for_db(A) (((A) & 63) | (((A) & DB_CHUNK1) >> 4) | (((A) & DB_CHUNK2) >> 6))
#define fix_rights_for_table(A) (((A) & 63) | (((A) & ~63) << 4))
#define get_rights_for_table(A) (((A) & 63) | (((A) & ~63) >> 4))
#define fix_rights_for_column(A) (((A) & COL_ACLS) | ((A & ~COL_ACLS) << 7))