diff options
author | unknown <serg@serg.mylan> | 2004-09-07 21:30:28 +0200 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2004-09-07 21:30:28 +0200 |
commit | 2f96e073d287fdf58f03eca3bf20f7467f757f81 (patch) | |
tree | e1cbd7bc7ac5fa0739864e430b898343bdfa631e /client | |
parent | 49d90b09f558b30adf1578dfcaf7d094e51609bd (diff) | |
parent | 419ca7152f30c6cbb8c8e8c4920a3d6e90e076a8 (diff) | |
download | mariadb-git-2f96e073d287fdf58f03eca3bf20f7467f757f81.tar.gz |
merged
mysql-test/r/rpl_set_charset.result:
Auto merged
mysql-test/r/select.result:
Auto merged
mysql-test/t/rpl_set_charset.test:
Auto merged
mysql-test/t/select.test:
Auto merged
sql/slave.cc:
Auto merged
Diffstat (limited to 'client')
-rw-r--r-- | client/mysql.cc | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index 0b43f9b80ec..36a2fecd661 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2602,32 +2602,31 @@ com_use(String *buffer __attribute__((unused)), char *line) put_info("USE must be followed by a database name", INFO_ERROR); return 0; } - - /* - We need to recheck the current database, because it may change - under our feet, for example if DROP DATABASE or RENAME DATABASE - (latter one not yet available by the time the comment was written) + /* + We need to recheck the current database, because it may change + under our feet, for example if DROP DATABASE or RENAME DATABASE + (latter one not yet available by the time the comment was written) */ - current_db= 0; // Let's reset current_db, assume it's gone - /* - We don't care about in case of an error below because current_db - was just set to 0. + /* Let's reset current_db, assume it's gone */ + my_free(current_db, MYF(MY_ALLOW_ZERO_PTR)); + current_db= 0; + /* + We don't care about in case of an error below because current_db + was just set to 0. */ if (!mysql_query(&mysql, "SELECT DATABASE()") && (res= mysql_use_result(&mysql))) { row= mysql_fetch_row(res); - if (row[0] && - (!current_db || cmp_database(charset_info, current_db, row[0]))) + if (row[0]) { - my_free(current_db, MYF(MY_ALLOW_ZERO_PTR)); current_db= my_strdup(row[0], MYF(MY_WME)); } - (void) mysql_fetch_row(res); // Read eof + (void) mysql_fetch_row(res); // Read eof mysql_free_result(res); } - - if (!current_db || cmp_database(charset_info, current_db, tmp)) + + if (!current_db || cmp_database(current_db,tmp)) { if (one_database) skip_updates= 1; |