summaryrefslogtreecommitdiff
path: root/sql/sql_acl.h
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-03-01 08:27:39 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2017-03-07 19:07:27 +0200
commit89d80c1b0be94639d0913dee7b6a284c32787b09 (patch)
treea08340d45a09b067df4490259f68b5a3f9d2fa03 /sql/sql_acl.h
parentd2f5e624223fe502ddf4c6f42062c29edb988627 (diff)
downloadmariadb-git-89d80c1b0be94639d0913dee7b6a284c32787b09.tar.gz
Fix many -Wconversion warnings.
Define my_thread_id as an unsigned type, to avoid mismatch with ulonglong. Change some parameters to this type. Use size_t in a few more places. Declare many flag constants as unsigned to avoid sign mismatch when shifting bits or applying the unary ~ operator. When applying the unary ~ operator to enum constants, explictly cast the result to an unsigned type, because enum constants can be treated as signed. In InnoDB, change the source code line number parameters from ulint to unsigned type. Also, make some InnoDB functions return a narrower type (unsigned or uint32_t instead of ulint; bool instead of ibool).
Diffstat (limited to 'sql/sql_acl.h')
-rw-r--r--sql/sql_acl.h61
1 files changed, 31 insertions, 30 deletions
diff --git a/sql/sql_acl.h b/sql/sql_acl.h
index be206b1f86f..daa36f6c32a 100644
--- a/sql/sql_acl.h
+++ b/sql/sql_acl.h
@@ -2,6 +2,7 @@
#define SQL_ACL_INCLUDED
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,35 +21,35 @@
#include "violite.h" /* SSL_type */
#include "sql_class.h" /* LEX_COLUMN */
-#define SELECT_ACL (1L << 0)
-#define INSERT_ACL (1L << 1)
-#define UPDATE_ACL (1L << 2)
-#define DELETE_ACL (1L << 3)
-#define CREATE_ACL (1L << 4)
-#define DROP_ACL (1L << 5)
-#define RELOAD_ACL (1L << 6)
-#define SHUTDOWN_ACL (1L << 7)
-#define PROCESS_ACL (1L << 8)
-#define FILE_ACL (1L << 9)
-#define GRANT_ACL (1L << 10)
-#define REFERENCES_ACL (1L << 11)
-#define INDEX_ACL (1L << 12)
-#define ALTER_ACL (1L << 13)
-#define SHOW_DB_ACL (1L << 14)
-#define SUPER_ACL (1L << 15)
-#define CREATE_TMP_ACL (1L << 16)
-#define LOCK_TABLES_ACL (1L << 17)
-#define EXECUTE_ACL (1L << 18)
-#define REPL_SLAVE_ACL (1L << 19)
-#define REPL_CLIENT_ACL (1L << 20)
-#define CREATE_VIEW_ACL (1L << 21)
-#define SHOW_VIEW_ACL (1L << 22)
-#define CREATE_PROC_ACL (1L << 23)
-#define ALTER_PROC_ACL (1L << 24)
-#define CREATE_USER_ACL (1L << 25)
-#define EVENT_ACL (1L << 26)
-#define TRIGGER_ACL (1L << 27)
-#define CREATE_TABLESPACE_ACL (1L << 28)
+#define SELECT_ACL (1UL << 0)
+#define INSERT_ACL (1UL << 1)
+#define UPDATE_ACL (1UL << 2)
+#define DELETE_ACL (1UL << 3)
+#define CREATE_ACL (1UL << 4)
+#define DROP_ACL (1UL << 5)
+#define RELOAD_ACL (1UL << 6)
+#define SHUTDOWN_ACL (1UL << 7)
+#define PROCESS_ACL (1UL << 8)
+#define FILE_ACL (1UL << 9)
+#define GRANT_ACL (1UL << 10)
+#define REFERENCES_ACL (1UL << 11)
+#define INDEX_ACL (1UL << 12)
+#define ALTER_ACL (1UL << 13)
+#define SHOW_DB_ACL (1UL << 14)
+#define SUPER_ACL (1UL << 15)
+#define CREATE_TMP_ACL (1UL << 16)
+#define LOCK_TABLES_ACL (1UL << 17)
+#define EXECUTE_ACL (1UL << 18)
+#define REPL_SLAVE_ACL (1UL << 19)
+#define REPL_CLIENT_ACL (1UL << 20)
+#define CREATE_VIEW_ACL (1UL << 21)
+#define SHOW_VIEW_ACL (1UL << 22)
+#define CREATE_PROC_ACL (1UL << 23)
+#define ALTER_PROC_ACL (1UL << 24)
+#define CREATE_USER_ACL (1UL << 25)
+#define EVENT_ACL (1UL << 26)
+#define TRIGGER_ACL (1UL << 27)
+#define CREATE_TABLESPACE_ACL (1UL << 28)
/*
don't forget to update
1. static struct show_privileges_st sys_privileges[]
@@ -57,7 +58,7 @@
4. acl_init() or whatever - to define behaviour for old privilege tables
5. sql_yacc.yy - for GRANT/REVOKE to work
*/
-#define NO_ACCESS (1L << 30)
+#define NO_ACCESS (1UL << 30)
#define DB_ACLS \
(UPDATE_ACL | SELECT_ACL | INSERT_ACL | DELETE_ACL | CREATE_ACL | DROP_ACL | \
GRANT_ACL | REFERENCES_ACL | INDEX_ACL | ALTER_ACL | CREATE_TMP_ACL | \