mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge mysql.com:/home/my/mysql-5.0
into mysql.com:/home/my/mysql-5.1
This commit is contained in:
@ -1233,10 +1233,13 @@ bool mysql_change_db(THD *thd, const char *name, bool no_access_check)
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
ulong db_access;
|
||||
Security_context *sctx= thd->security_ctx;
|
||||
LINT_INIT(db_access);
|
||||
#endif
|
||||
DBUG_ENTER("mysql_change_db");
|
||||
DBUG_PRINT("enter",("name: '%s'",name));
|
||||
|
||||
LINT_INIT(db_length);
|
||||
|
||||
/* dbname can only be NULL if malloc failed */
|
||||
if (!dbname || !(db_length= strlen(dbname)))
|
||||
{
|
||||
@ -1254,7 +1257,7 @@ bool mysql_change_db(THD *thd, const char *name, bool no_access_check)
|
||||
if (check_db_name(dbname))
|
||||
{
|
||||
my_error(ER_WRONG_DB_NAME, MYF(0), dbname);
|
||||
x_free(dbname);
|
||||
my_free(dbname, MYF(0));
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
DBUG_PRINT("info",("Use database: %s", dbname));
|
||||
@ -1303,8 +1306,7 @@ end:
|
||||
x_free(thd->db);
|
||||
if (dbname && dbname[0] == 0)
|
||||
{
|
||||
if (!(thd->slave_thread))
|
||||
x_free(dbname);
|
||||
my_free(dbname, MYF(0));
|
||||
thd->db= NULL;
|
||||
thd->db_length= 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user