diff options
Diffstat (limited to 'sql/sql_db.cc')
-rw-r--r-- | sql/sql_db.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 94be8a5f240..b4a0e5c4c7d 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -1539,12 +1539,9 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch) Security_context *sctx= thd->security_ctx; ulong db_access= sctx->db_access; CHARSET_INFO *db_default_cl; - DBUG_ENTER("mysql_change_db"); - DBUG_PRINT("enter",("name: '%s'", new_db_name->str)); - if (new_db_name == NULL || - new_db_name->length == 0) + if (new_db_name->length == 0) { if (force_switch) { @@ -1553,8 +1550,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch) after loading stored program. The thing is that loading of stored program can happen when there is no current database. - TODO: actually, new_db_name and new_db_name->str seem to be always - non-NULL. In case of stored program, new_db_name->str == "" and + In case of stored program, new_db_name->str == "" and new_db_name->length == 0. */ @@ -1569,6 +1565,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch) DBUG_RETURN(TRUE); } } + DBUG_PRINT("enter",("name: '%s'", new_db_name->str)); if (is_schema_db(new_db_name->str, new_db_name->length)) { |