summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-10-18 18:56:28 -0700
committerSergei Golubchik <sergii@pisem.net>2013-10-18 18:56:28 -0700
commitce68878947e4435540d4eca95bd5b3f1f5968b1b (patch)
tree5cbfdd5b6f959b33441f22f4063efb8aa40943fa /sql/sql_acl.cc
parentcb9d3bec4645fc17be233d37677144926317f028 (diff)
downloadmariadb-git-ce68878947e4435540d4eca95bd5b3f1f5968b1b.tar.gz
fixes for embedded
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc27
1 files changed, 15 insertions, 12 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 241207819dd..a6429eb177b 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -311,6 +311,18 @@ public:
ulong initial_access; /* access bits present in the table */
};
+static char *safe_str(char *str)
+{ return str ? str : const_cast<char*>(""); }
+
+static const char *safe_str(const char *str)
+{ return str ? str : ""; }
+
+#ifndef DBUG_OFF
+/* status variables, only visible in SHOW STATUS after -#d,role_merge_stats */
+ulong role_global_merges= 0, role_db_merges= 0, role_table_merges= 0,
+ role_column_merges= 0, role_routine_merges= 0;
+#endif
+
#ifndef NO_EMBEDDED_ACCESS_CHECKS
static void update_hostname(acl_host_and_ip *host, const char *hostname);
static ulong get_sort(uint count,...);
@@ -328,12 +340,6 @@ static bool show_table_and_column_privileges(THD *, const char *, const char *,
static int show_routine_grants(THD *, const char *, const char *, HASH *,
const char *, int, char *, int);
-static char *safe_str(char *str)
-{ return str ? str : const_cast<char*>(""); }
-
-static const char *safe_str(const char *str)
-{ return str ? str : ""; }
-
class ACL_PROXY_USER :public ACL_ACCESS
{
acl_host_and_ip host;
@@ -4503,12 +4509,6 @@ static int count_subgraph_nodes(ACL_ROLE *role, ACL_ROLE *grantee, void *context
static int merge_role_privileges(ACL_ROLE *, ACL_ROLE *, void *);
-#ifndef DBUG_OFF
-/* status variables, only visible in SHOW STATUS after -#d,role_merge_stats */
-ulong role_global_merges= 0, role_db_merges= 0, role_table_merges= 0,
- role_column_merges= 0, role_routine_merges= 0;
-#endif
-
/**
rebuild privileges of all affected roles
@@ -10469,6 +10469,7 @@ LEX_USER *get_current_user(THD *thd, LEX_USER *user, bool lock)
if (!dup)
return 0;
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (is_invalid_role_name(user->user.str))
return 0;
@@ -10480,6 +10481,8 @@ LEX_USER *get_current_user(THD *thd, LEX_USER *user, bool lock)
dup->host= host_not_specified;
if (lock)
mysql_mutex_unlock(&acl_cache->lock);
+#endif
+
return dup;
}