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-28 18:51:27+03:00, aelkin@stripped
+5 -0
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@stripped, 2006-09-28 18:51:24+03:00,
aelkin@stripped +13 -0
test cases for #22027, #22762
mysql-test/r/binlog_row_binlog.result@stripped, 2006-09-28 18:51:24+03:00,
aelkin@stripped +27 -0
results changed
mysql-test/r/binlog_row_mix_innodb_myisam.result@stripped, 2006-09-28 18:51:24+03:00,
aelkin@stripped +1 -1
results changed because of the test's query has "if not exists"
mysql-test/r/binlog_stm_binlog.result@stripped, 2006-09-28 18:51:24+03:00,
aelkin@stripped +21 -0
results changed
sql/sql_show.cc@stripped, 2006-09-28 18:51:24+03:00,
aelkin@stripped +3 -0
store_create_info inserts "if not exists" into output when an input query contains
the qualifier.
# 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-28 18:51:34 +03:00
+++ 1.363/sql/sql_show.cc 2006-09-28 18:51:34 +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-28 18:51:34 +03:00
+++ 1.9/mysql-test/r/binlog_row_binlog.result 2006-09-28 18:51:34 +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,t3,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`,`t3` /* 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.12/mysql-test/r/binlog_row_mix_innodb_myisam.result 2006-09-28 18:51:34 +03:00
+++ 1.13/mysql-test/r/binlog_row_mix_innodb_myisam.result 2006-09-28 18:51:34 +03:00
@@ -376,7 +376,7 @@ 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`; BEGIN
-master-bin.000001 # Query 1 # use `test`; CREATE TABLE `t2` (
+master-bin.000001 # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS `t2` (
`a` int(11) NOT NULL DEFAULT '0',
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
--- 1.15/mysql-test/r/binlog_stm_binlog.result 2006-09-28 18:51:34 +03:00
+++ 1.16/mysql-test/r/binlog_stm_binlog.result 2006-09-28 18:51:34 +03:00
@@ -155,6 +155,22 @@ 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 # Intvar 1 # INSERT_ID=127
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(null)
+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 select * from t1
+master-bin.000001 # Query 1 # use `test`; create temporary table tt1 (a int)
+master-bin.000001 # Query 1 # use `test`; create table if not exists t3 like tt1
+drop table t1,t2,t3,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);
@@ -166,6 +182,11 @@ master-bin.000001 # Query 1 # use `test`
master-bin.000001 # Intvar 1 # INSERT_ID=127
master-bin.000001 # Query 1 # use `test`; insert into t1 values(null)
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 select * from t1
+master-bin.000001 # Query 1 # use `test`; create temporary table tt1 (a int)
+master-bin.000001 # Query 1 # use `test`; create table if not exists t3 like tt1
+master-bin.000001 # Query 1 # use `test`; drop table t1,t2,t3,tt1
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-28 18:51:34 +03:00
+++ 1.14/mysql-test/extra/binlog_tests/binlog.test 2006-09-28 18:51:34 +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,t3,tt1;
+
-- source extra/binlog_tests/binlog_insert_delayed.test
| Thread |
|---|
| • bk commit into 5.1 tree (aelkin:1.2350) BUG#22027 | Andrei Elkin | 28 Sep |