diff options
author | Sergei Golubchik <sergii@pisem.net> | 2010-11-25 18:17:28 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2010-11-25 18:17:28 +0100 |
commit | 65ca700def99289cc31a7040537f5aa6e12bf485 (patch) | |
tree | 97b3a07299b626c519da0e80c122b5b79b933914 /sql/sql_db.cc | |
parent | 2ab57de38d13d927ddff2d51aed4af34e13998f5 (diff) | |
parent | 6e5bcca7935d3c62f84bb640e5357664a210ee12 (diff) | |
download | mariadb-git-65ca700def99289cc31a7040537f5aa6e12bf485.tar.gz |
merge.
checkpoint.
does not compile.
Diffstat (limited to 'sql/sql_db.cc')
-rw-r--r-- | sql/sql_db.cc | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 517cb9139e9..8b92259573e 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -1357,13 +1357,9 @@ static inline bool cmp_db_names(const char *db1_name, const char *db2_name) { - return - /* db1 is NULL and db2 is NULL */ - (!db1_name && !db2_name) || - - /* db1 is not-NULL, db2 is not-NULL, db1 == db2. */ - (db1_name && db2_name && - my_strcasecmp(system_charset_info, db1_name, db2_name) == 0); + return ((!db1_name && !db2_name) || + (db1_name && db2_name && + my_strcasecmp(system_charset_info, db1_name, db2_name) == 0)); } @@ -1436,12 +1432,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) { @@ -1450,8 +1443,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. */ @@ -1466,6 +1458,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_infoschema_db(new_db_name->str, new_db_name->length)) { |