summaryrefslogtreecommitdiff
path: root/sql/sql_show.h
diff options
context:
space:
mode:
authorMats Kindahl <mats@sun.com>2008-10-08 11:15:00 +0200
committerMats Kindahl <mats@sun.com>2008-10-08 11:15:00 +0200
commit70b18065d002eee1d484a0191238ea4f5594e5bf (patch)
tree94cbe80f737917af467504b82e8afb40ee9d49f8 /sql/sql_show.h
parente05be97a75bb72dde83e58d6ba6ba5472f7547db (diff)
downloadmariadb-git-70b18065d002eee1d484a0191238ea4f5594e5bf.tar.gz
Bug #34707: Row based replication: slave creates table within wrong database
The failure was caused by executing a CREATE-SELECT statement that creates a table in another database than the current one. In row-based logging, the CREATE statement was written to the binary log without the database, hence creating the table in the wrong database, causing the following inserts to fail since the table didn't exist in the given database. Fixed the bug by adding a parameter to store_create_info() that will make the function print the database name before the table name and used that in the calls that write the CREATE statement to the binary log. The database name is only printed if it is different than the currently selected database. The output of SHOW CREATE TABLE has not changed and is still printed without the database name.
Diffstat (limited to 'sql/sql_show.h')
-rw-r--r--sql/sql_show.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_show.h b/sql/sql_show.h
index d63217584b2..3baaef00a7d 100644
--- a/sql/sql_show.h
+++ b/sql/sql_show.h
@@ -33,7 +33,7 @@ find_files_result find_files(THD *thd, List<LEX_STRING> *files, const char *db,
const char *path, const char *wild, bool dir);
int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
- HA_CREATE_INFO *create_info_arg);
+ HA_CREATE_INFO *create_info_arg, bool show_database);
int view_store_create_info(THD *thd, TABLE_LIST *table, String *buff);
int copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table);