List:Commits« Previous MessageNext Message »
From:Andrei Elkin Date:September 27 2006 10:30pm
Subject:bk commit into 5.1 tree (aelkin:1.2348) BUG#22027
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of elkin. When elkin does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-09-27 23:30:20+03:00, aelkin@stripped +3 -0
  bug#22027: CREATE TABLE IF NOT EXISTS SELECT logged improperly with row-based 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@stripped, 2006-09-27 23:30:15+03:00, aelkin@stripped +13 -0
    adding two blocks for bugs 22027,22762

  mysql-test/r/binlog_row_binlog.result@stripped, 2006-09-27 23:30:15+03:00, aelkin@stripped +27 -0
    results changed to include "if not exists" in create table

  sql/sql_show.cc@stripped, 2006-09-27 23:30:15+03:00, aelkin@stripped +3 -0
    inserting "if not exists" into binlogging buffer.
    This modification affects only handling of CREATE TABLE ... SELECT and
    CREATE TABLE LIKE "a-temp-table"
    only "if not exists" supplied. 

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	aelkin
# Host:	dsl-hkigw8-feb9fb00-191.dhcp.inet.fi
# Root:	/home/elkin/MySQL/TEAM/FIXES/5.1/bug22027_create_select_exists

--- 1.362/sql/sql_show.cc	2006-09-27 23:30:29 +03:00
+++ 1.363/sql/sql_show.cc	2006-09-27 23:30:29 +03:00
@@ -1042,6 +1042,9 @@ int store_create_info(THD *thd, TABLE_LI
     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

--- 1.8/mysql-test/r/binlog_row_binlog.result	2006-09-27 23:30:29 +03:00
+++ 1.9/mysql-test/r/binlog_row_binlog.result	2006-09-27 23:30:29 +03:00
@@ -245,6 +245,25 @@ select * from t1;
 id
 127
 drop table t1;
+create table t1 (a int);
+create table if not exists t2 select * from t1;
+create temporary table tt1 (a int);
+create table if not exists t3 like tt1;
+show binlog events;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Format_desc	1	#	Server ver: 5.1.12-beta-debug-log, Binlog ver: 4
+master-bin.000001	#	Query	1	#	use `test`; create table t1 (id tinyint auto_increment primary key)
+master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	1	#	use `test`; drop table t1
+master-bin.000001	#	Query	1	#	use `test`; create table t1 (a int)
+master-bin.000001	#	Query	1	#	use `test`; CREATE TABLE IF NOT EXISTS `t2` (
+  `a` int(11) DEFAULT NULL
+)
+master-bin.000001	#	Query	1	#	use `test`; CREATE TABLE IF NOT EXISTS `t3` (
+  `a` int(11) DEFAULT NULL
+)
+drop table t1,t2,tt1;
 create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
 set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
 insert delayed into t1 values (207);
@@ -256,6 +275,14 @@ master-bin.000001	#	Query	1	#	use `test`
 master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
 master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Query	1	#	use `test`; drop table t1
+master-bin.000001	#	Query	1	#	use `test`; create table t1 (a int)
+master-bin.000001	#	Query	1	#	use `test`; CREATE TABLE IF NOT EXISTS `t2` (
+  `a` int(11) DEFAULT NULL
+)
+master-bin.000001	#	Query	1	#	use `test`; CREATE TABLE IF NOT EXISTS `t3` (
+  `a` int(11) DEFAULT NULL
+)
+master-bin.000001	#	Query	1	#	use `test`; DROP TABLE `t1`,`t2` /* generated by server */
 master-bin.000001	#	Query	1	#	use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam
 master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
 master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F

--- 1.13/mysql-test/extra/binlog_tests/binlog.test	2006-09-27 23:30:29 +03:00
+++ 1.14/mysql-test/extra/binlog_tests/binlog.test	2006-09-27 23:30:29 +03:00
@@ -59,4 +59,17 @@ insert into t1 values(null);
 select * from t1;
 drop table t1;
 
+# bug#22027 
+create table t1 (a int);
+create table if not exists t2 select * from t1;
+
+# bug#22762
+create temporary table tt1 (a int);
+create table if not exists t3 like tt1;
+
+--replace_column 2 # 5 #
+--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
+show binlog events;
+drop table t1,t2,tt1;
+
 -- source extra/binlog_tests/binlog_insert_delayed.test
Thread
bk commit into 5.1 tree (aelkin:1.2348) BUG#22027Andrei Elkin27 Sep