diff options
Diffstat (limited to 'libmysqld/lib_sql.cc')
-rw-r--r-- | libmysqld/lib_sql.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 2bbca220db9..0adf9aeb86a 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -23,6 +23,11 @@ #define mysql_unix_port mysql_inix_port1 #define mysql_port mysql_port1 +extern "C" +{ + extern unsigned long max_allowed_packet, net_buffer_length; +} + static int fake_argc= 1; static char *fake_argv[]= {(char *)"", 0}; static const char *fake_groups[] = { "server", "embedded", 0 }; @@ -351,6 +356,7 @@ int init_embedded_server(int argc, char **argv, char **groups) int fake_argc = 1; char *fake_argv[] = { (char *)"", 0 }; const char *fake_groups[] = { "server", "embedded", 0 }; + my_bool acl_error; if (argc) { argcp= &argc; @@ -392,16 +398,17 @@ int init_embedded_server(int argc, char **argv, char **groups) error_handler_hook = my_message_sql; + acl_error= 0; #ifndef NO_EMBEDDED_ACCESS_CHECKS - if (acl_init((THD *)0, opt_noacl)) + if (!(acl_error= acl_init((THD *)0, opt_noacl)) && + !opt_noacl) + (void) grant_init((THD *)0); +#endif + if (acl_error || my_tz_init((THD *)0, default_tz_name, opt_bootstrap)) { mysql_server_end(); return 1; } - if (!opt_noacl) - (void) grant_init((THD *)0); - -#endif init_max_user_conn(); init_update_queries(); @@ -506,6 +513,7 @@ int check_embedded_connection(MYSQL *mysql) thd->host= (char*)my_localhost; thd->host_or_ip= thd->host; thd->user= my_strdup(mysql->user, MYF(0)); + thd->priv_user= thd->user; return check_user(thd, COM_CONNECT, NULL, 0, thd->db, true); } |