diff options
author | unknown <jani@ua141d10.elisa.omakaista.fi> | 2007-03-29 21:11:17 +0300 |
---|---|---|
committer | unknown <jani@ua141d10.elisa.omakaista.fi> | 2007-03-29 21:11:17 +0300 |
commit | 9d8c3c61004483f1734c9a7f24924081e493fb78 (patch) | |
tree | b931193692f1cf128130b65c64be0083c17e62b0 /sql/sql_db.cc | |
parent | 883cc12ad9b06d01b88a753ee2910e0392a5cbed (diff) | |
download | mariadb-git-9d8c3c61004483f1734c9a7f24924081e493fb78.tar.gz |
Manual merge from 5.0
Diffstat (limited to 'sql/sql_db.cc')
-rw-r--r-- | sql/sql_db.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 4e96a987d99..f529a21b109 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -22,6 +22,7 @@ #include "events.h" #include <my_dir.h> #include <m_ctype.h> +#include "log.h" #ifdef __WIN__ #include <direct.h> #endif @@ -1420,7 +1421,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch) to be sure. */ - if (check_db_name(new_db_file_name.str)) + 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)); @@ -1454,8 +1455,9 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch) sctx->priv_user, sctx->priv_host, new_db_file_name.str); - mysql_log.write(thd, COM_INIT_DB, ER(ER_DBACCESS_DENIED_ERROR), - sctx->priv_user, sctx->priv_host, 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)); DBUG_RETURN(TRUE); } @@ -1801,7 +1803,7 @@ bool mysql_rename_db(THD *thd, LEX_STRING *old_db, LEX_STRING *new_db) /* Step9: Let's do "use newdb" if we renamed the current database */ if (change_to_newdb) - error|= mysql_change_db(thd, new_db->str, 0); + error|= mysql_change_db(thd, new_db, 0); exit: pthread_mutex_lock(&LOCK_lock_db); |