mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
merge from mysql-trunk-bugfixing
This commit is contained in:
@@ -107,7 +107,7 @@ extern "C" void free_dbopt(void *dbopt);
|
||||
|
||||
void free_dbopt(void *dbopt)
|
||||
{
|
||||
my_free((uchar*) dbopt, MYF(0));
|
||||
my_free(dbopt);
|
||||
}
|
||||
|
||||
#ifdef HAVE_PSI_INTERFACE
|
||||
@@ -264,7 +264,7 @@ static my_bool put_dbopt(const char *dbname, HA_CREATE_INFO *create)
|
||||
|
||||
if ((error= my_hash_insert(&dboptions, (uchar*) opt)))
|
||||
{
|
||||
my_free(opt, MYF(0));
|
||||
my_free(opt);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
@@ -1290,8 +1290,7 @@ static void mysql_change_db_impl(THD *thd,
|
||||
we just call THD::reset_db(). Since THD::reset_db() does not releases
|
||||
the previous database name, we should do it explicitly.
|
||||
*/
|
||||
|
||||
x_free(thd->db);
|
||||
my_free(thd->db);
|
||||
|
||||
thd->reset_db(new_db_name->str, new_db_name->length);
|
||||
}
|
||||
@@ -1504,7 +1503,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
|
||||
if (check_db_name(&new_db_file_name))
|
||||
{
|
||||
my_error(ER_WRONG_DB_NAME, MYF(0), new_db_file_name.str);
|
||||
my_free(new_db_file_name.str, MYF(0));
|
||||
my_free(new_db_file_name.str);
|
||||
|
||||
if (force_switch)
|
||||
mysql_change_db_impl(thd, NULL, 0, thd->variables.collation_server);
|
||||
@@ -1534,7 +1533,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
|
||||
new_db_file_name.str);
|
||||
general_log_print(thd, COM_INIT_DB, ER(ER_DBACCESS_DENIED_ERROR),
|
||||
sctx->priv_user, sctx->priv_host, new_db_file_name.str);
|
||||
my_free(new_db_file_name.str, MYF(0));
|
||||
my_free(new_db_file_name.str);
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
#endif
|
||||
@@ -1549,7 +1548,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
|
||||
ER_BAD_DB_ERROR, ER(ER_BAD_DB_ERROR),
|
||||
new_db_file_name.str);
|
||||
|
||||
my_free(new_db_file_name.str, MYF(0));
|
||||
my_free(new_db_file_name.str);
|
||||
|
||||
/* Change db to NULL. */
|
||||
|
||||
@@ -1564,7 +1563,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
|
||||
/* Report an error and free new_db_file_name. */
|
||||
|
||||
my_error(ER_BAD_DB_ERROR, MYF(0), new_db_file_name.str);
|
||||
my_free(new_db_file_name.str, MYF(0));
|
||||
my_free(new_db_file_name.str);
|
||||
|
||||
/* The operation failed. */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user