summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorunknown <aelkin/elkin@dsl-hkigw8-feb9fb00-191.dhcp.inet.fi>2006-09-28 18:51:27 +0300
committerunknown <aelkin/elkin@dsl-hkigw8-feb9fb00-191.dhcp.inet.fi>2006-09-28 18:51:27 +0300
commit61c9a7d55c8238c2aeb95db0260992f936f1fe4a (patch)
treed4eee94fa2b07add1f4f9367b0ac1ab98950866e /sql/sql_show.cc
parentcd1eb67292e93fe0fd2643ff8b036f9c0e39e390 (diff)
downloadmariadb-git-61c9a7d55c8238c2aeb95db0260992f936f1fe4a.tar.gz
bug#22027: CREATE TABLE IF NOT EXISTS SELECT logged improperly with rbr binlog,
and #22762: create talbe if not exists like a-temp-table binlogged w/o "if not exists" These are rbr bugs. store_create_info, which generates the create statement e.g for binlogging, did not account a lex option HA_LEX_CREATE_IF_NOT_EXISTS. The fix makes the generated query to include the parent's statement option if that was supplied. mysql-test/extra/binlog_tests/binlog.test: test cases for #22027, #22762 mysql-test/r/binlog_row_binlog.result: results changed mysql-test/r/binlog_row_mix_innodb_myisam.result: results changed because of the test's query has "if not exists" mysql-test/r/binlog_stm_binlog.result: results changed sql/sql_show.cc: store_create_info inserts "if not exists" into output when an input query contains the qualifier.
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 236f5737a3d..024e5910cf8 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1042,6 +1042,9 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
packet->append(STRING_WITH_LEN("CREATE TEMPORARY TABLE "));
else
packet->append(STRING_WITH_LEN("CREATE TABLE "));
+ if (create_info_arg &&
+ (create_info_arg->options & HA_LEX_CREATE_IF_NOT_EXISTS))
+ packet->append(STRING_WITH_LEN("IF NOT EXISTS "));
if (table_list->schema_table)
alias= table_list->schema_table->table_name;
else