diff options
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r-- | sql/sql_insert.cc | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 2b68f7766ac..71a1983878f 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1,6 +1,6 @@ /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. - Copyright (c) 2009, 2013, Monty Program Ab. + Copyright (c) 2010, 2014, SkySQL Ab. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -4148,15 +4148,14 @@ select_create::binlog_show_create_table(TABLE **tables, uint count) { /* Note 1: In RBR mode, we generate a CREATE TABLE statement for the - created table by calling store_create_info() (behaves as SHOW - CREATE TABLE). In the event of an error, nothing should be - written to the binary log, even if the table is non-transactional; - therefore we pretend that the generated CREATE TABLE statement is - for a transactional table. The event will then be put in the - transaction cache, and any subsequent events (e.g., table-map - events and binrow events) will also be put there. We can then use - ha_autocommit_or_rollback() to either throw away the entire - kaboodle of events, or write them to the binary log. + created table by calling show_create_table(). In the event of an error, + nothing should be written to the binary log, even if the table is + non-transactional; therefore we pretend that the generated CREATE TABLE + statement is for a transactional table. The event will then be put in the + transaction cache, and any subsequent events (e.g., table-map events and + binrow events) will also be put there. We can then use + ha_autocommit_or_rollback() to either throw away the entire kaboodle of + events, or write them to the binary log. We write the CREATE TABLE statement here and not in prepare() since there potentially are sub-selects or accesses to information @@ -4175,12 +4174,9 @@ select_create::binlog_show_create_table(TABLE **tables, uint count) tmp_table_list.table = *tables; query.length(0); // Have to zero it since constructor doesn't - result= store_create_info(thd, &tmp_table_list, &query, create_info, - /* show_database */ TRUE, - MY_TEST(create_info->org_options & - HA_LEX_CREATE_REPLACE) || - create_info->table_was_deleted); - DBUG_ASSERT(result == 0); /* store_create_info() always return 0 */ + result= show_create_table(thd, &tmp_table_list, &query, create_info, + WITH_DB_NAME); + DBUG_ASSERT(result == 0); /* show_create_table() always return 0 */ if (WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open()) { |