summaryrefslogtreecommitdiff
path: root/sql/sql_db.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2019-05-04 17:04:55 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2019-05-04 17:04:55 +0200
commit8cbb14ef5d180687f131bc44a4e8fc84083d033c (patch)
tree091f11e2d20f95656a7b12294782eb0488fd4fcc /sql/sql_db.cc
parent4345868382ca3525de5eb432302b6b9b957b47c1 (diff)
parentb85aa20065504bdda4bc03c2bd7eb7de38865c5d (diff)
downloadmariadb-git-8cbb14ef5d180687f131bc44a4e8fc84083d033c.tar.gz
Merge branch '10.1' into 10.2
Diffstat (limited to 'sql/sql_db.cc')
-rw-r--r--sql/sql_db.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 0e554e29380..ebc04decbb3 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -1459,12 +1459,12 @@ static void backup_current_db_name(THD *thd,
a stack pointer set by Stored Procedures was used by replication after
the stack address was long gone.
- @return Operation status
- @retval FALSE Success
- @retval TRUE Error
+ @return error code (ER_XXX)
+ @retval 0 Success
+ @retval >0 Error
*/
-bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
+uint mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
{
LEX_STRING new_db_file_name;
@@ -1494,7 +1494,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
{
my_message(ER_NO_DB_ERROR, ER_THD(thd, ER_NO_DB_ERROR), MYF(0));
- DBUG_RETURN(TRUE);
+ DBUG_RETURN(ER_NO_DB_ERROR);
}
}
DBUG_PRINT("enter",("name: '%s'", new_db_name->str));
@@ -1520,7 +1520,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
new_db_file_name.length= new_db_name->length;
if (new_db_file_name.str == NULL)
- DBUG_RETURN(TRUE); /* the error is set */
+ DBUG_RETURN(ER_OUT_OF_RESOURCES); /* the error is set */
/*
NOTE: if check_db_name() fails, we should throw an error in any case,
@@ -1539,7 +1539,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
if (force_switch)
mysql_change_db_impl(thd, NULL, 0, thd->variables.collation_server);
- DBUG_RETURN(TRUE);
+ DBUG_RETURN(ER_WRONG_DB_NAME);
}
DBUG_PRINT("info",("Use database: %s", new_db_file_name.str));
@@ -1569,7 +1569,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
general_log_print(thd, COM_INIT_DB, ER_THD(thd, ER_DBACCESS_DENIED_ERROR),
sctx->priv_user, sctx->priv_host, new_db_file_name.str);
my_free(new_db_file_name.str);
- DBUG_RETURN(TRUE);
+ DBUG_RETURN(ER_DBACCESS_DENIED_ERROR);
}
#endif
@@ -1603,7 +1603,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
/* The operation failed. */
- DBUG_RETURN(TRUE);
+ DBUG_RETURN(ER_BAD_DB_ERROR);
}
}
@@ -1619,7 +1619,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
done:
SESSION_TRACKER_CHANGED(thd, CURRENT_SCHEMA_TRACKER, NULL);
SESSION_TRACKER_CHANGED(thd, SESSION_STATE_CHANGE_TRACKER, NULL);
- DBUG_RETURN(FALSE);
+ DBUG_RETURN(0);
}