Loading mysql-test/r/blackhole.result +17 −0 Original line number Diff line number Diff line Loading @@ -138,3 +138,20 @@ ALTER TABLE t1 DROP INDEX a; ALTER TABLE t1 ADD PRIMARY KEY(a); DELETE FROM t1 WHERE a=10; DROP TABLE t1; reset master; create table t1 (a int auto_increment, primary key (a)) engine=blackhole; insert into t1 values (11), (NULL), (NULL), (NULL); set insert_id= 3; insert into t1 values (NULL), (33), (NULL); set insert_id= 5; insert into t1 values (55), (NULL); show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1 (a int auto_increment, primary key (a)) engine=blackhole master-bin.000001 # Intvar 1 # INSERT_ID=1 master-bin.000001 # Query 1 # use `test`; insert into t1 values (11), (NULL), (NULL), (NULL) master-bin.000001 # Intvar 1 # INSERT_ID=3 master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL), (33), (NULL) master-bin.000001 # Intvar 1 # INSERT_ID=5 master-bin.000001 # Query 1 # use `test`; insert into t1 values (55), (NULL) drop table t1; mysql-test/t/blackhole.test +24 −2 Original line number Diff line number Diff line Loading @@ -142,7 +142,6 @@ CREATE TABLE t1(a INT) ENGINE=BLACKHOLE; INSERT DELAYED INTO t1 VALUES(1); DROP TABLE t1; # End of 4.1 tests # #Bug#19717: DELETE Query Error on BLACKHOLE when using WHERE on column with UNIQUE INDEX Loading @@ -159,4 +158,27 @@ ALTER TABLE t1 ADD PRIMARY KEY(a); DELETE FROM t1 WHERE a=10; DROP TABLE t1; # End of 5.0 tests # # Bug#35178 INSERT_ID not written to binary log for inserts against BLACKHOLE backed tables # # # the test checks that explicitly prescribed with set insert_id= value # preceeds the following autoincrement insert in a blachhole # reset master; create table t1 (a int auto_increment, primary key (a)) engine=blackhole; # not insert_id prescribed insert binlogs with the default set insert_id 1 insert into t1 values (11), (NULL), (NULL), (NULL); set insert_id= 3; insert into t1 values (NULL), (33), (NULL); set insert_id= 5; insert into t1 values (55), (NULL); source include/show_binlog_events2.inc; # cleanup drop table t1; # End of tests sql/ha_blackhole.cc +1 −1 Original line number Diff line number Diff line Loading @@ -115,7 +115,7 @@ const char *ha_blackhole::index_type(uint key_number) int ha_blackhole::write_row(byte * buf) { DBUG_ENTER("ha_blackhole::write_row"); DBUG_RETURN(0); DBUG_RETURN(table->next_number_field ? update_auto_increment() : 0); } int ha_blackhole::rnd_init(bool scan) Loading Loading
mysql-test/r/blackhole.result +17 −0 Original line number Diff line number Diff line Loading @@ -138,3 +138,20 @@ ALTER TABLE t1 DROP INDEX a; ALTER TABLE t1 ADD PRIMARY KEY(a); DELETE FROM t1 WHERE a=10; DROP TABLE t1; reset master; create table t1 (a int auto_increment, primary key (a)) engine=blackhole; insert into t1 values (11), (NULL), (NULL), (NULL); set insert_id= 3; insert into t1 values (NULL), (33), (NULL); set insert_id= 5; insert into t1 values (55), (NULL); show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1 (a int auto_increment, primary key (a)) engine=blackhole master-bin.000001 # Intvar 1 # INSERT_ID=1 master-bin.000001 # Query 1 # use `test`; insert into t1 values (11), (NULL), (NULL), (NULL) master-bin.000001 # Intvar 1 # INSERT_ID=3 master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL), (33), (NULL) master-bin.000001 # Intvar 1 # INSERT_ID=5 master-bin.000001 # Query 1 # use `test`; insert into t1 values (55), (NULL) drop table t1;
mysql-test/t/blackhole.test +24 −2 Original line number Diff line number Diff line Loading @@ -142,7 +142,6 @@ CREATE TABLE t1(a INT) ENGINE=BLACKHOLE; INSERT DELAYED INTO t1 VALUES(1); DROP TABLE t1; # End of 4.1 tests # #Bug#19717: DELETE Query Error on BLACKHOLE when using WHERE on column with UNIQUE INDEX Loading @@ -159,4 +158,27 @@ ALTER TABLE t1 ADD PRIMARY KEY(a); DELETE FROM t1 WHERE a=10; DROP TABLE t1; # End of 5.0 tests # # Bug#35178 INSERT_ID not written to binary log for inserts against BLACKHOLE backed tables # # # the test checks that explicitly prescribed with set insert_id= value # preceeds the following autoincrement insert in a blachhole # reset master; create table t1 (a int auto_increment, primary key (a)) engine=blackhole; # not insert_id prescribed insert binlogs with the default set insert_id 1 insert into t1 values (11), (NULL), (NULL), (NULL); set insert_id= 3; insert into t1 values (NULL), (33), (NULL); set insert_id= 5; insert into t1 values (55), (NULL); source include/show_binlog_events2.inc; # cleanup drop table t1; # End of tests
sql/ha_blackhole.cc +1 −1 Original line number Diff line number Diff line Loading @@ -115,7 +115,7 @@ const char *ha_blackhole::index_type(uint key_number) int ha_blackhole::write_row(byte * buf) { DBUG_ENTER("ha_blackhole::write_row"); DBUG_RETURN(0); DBUG_RETURN(table->next_number_field ? update_auto_increment() : 0); } int ha_blackhole::rnd_init(bool scan) Loading