2006-08-30 09:22:43 +02:00
|
|
|
# Test of binlogging of INSERT_ID with INSERT DELAYED
|
|
|
|
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
|
|
|
|
# First, avoid BUG#20627:
|
|
|
|
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
|
|
|
|
# Verify that only one INSERT_ID event is binlogged.
|
|
|
|
# Note, that because of WL#3368 mixed mode binlog records RBR events for the delayed
|
2006-09-23 14:24:45 +02:00
|
|
|
let $table=t1;
|
|
|
|
let $rows_inserted=11; # total number of inserted rows in this test
|
2006-08-30 09:22:43 +02:00
|
|
|
insert delayed into t1 values (207);
|
2006-09-23 14:24:45 +02:00
|
|
|
let $count=1;
|
2006-08-30 09:22:43 +02:00
|
|
|
|
2006-09-23 14:24:45 +02:00
|
|
|
# use this macro instead of sleeps.
|
|
|
|
|
|
|
|
--source include/wait_until_rows_count.inc
|
2006-08-30 09:22:43 +02:00
|
|
|
insert delayed into t1 values (null);
|
2006-09-23 14:24:45 +02:00
|
|
|
inc $count;
|
|
|
|
--source include/wait_until_rows_count.inc
|
|
|
|
|
2006-08-30 09:22:43 +02:00
|
|
|
insert delayed into t1 values (300);
|
2006-09-23 14:24:45 +02:00
|
|
|
inc $count;
|
|
|
|
--source include/wait_until_rows_count.inc
|
|
|
|
|
2006-09-27 12:05:29 +02:00
|
|
|
# moving binlog check affront of multi-rows queries which work is indeterministic (extra table_maps)
|
|
|
|
# todo: better check is to substitute SHOW BINLOG with reading from binlog, probably bug#19459 is in
|
|
|
|
# the way
|
2007-03-29 21:38:03 +02:00
|
|
|
source include/show_binlog_events.inc;
|
2006-09-27 12:05:29 +02:00
|
|
|
|
2006-09-12 15:42:13 +02:00
|
|
|
insert delayed into t1 values (null),(null),(null),(null);
|
2006-09-23 14:24:45 +02:00
|
|
|
inc $count; inc $count; inc $count; inc $count;
|
|
|
|
--source include/wait_until_rows_count.inc
|
|
|
|
|
2006-09-12 15:42:13 +02:00
|
|
|
insert delayed into t1 values (null),(null),(400),(null);
|
2006-09-23 14:24:45 +02:00
|
|
|
inc $count; inc $count; inc $count; inc $count;
|
|
|
|
--source include/wait_until_rows_count.inc
|
|
|
|
|
|
|
|
#check this assertion about $count calculation
|
|
|
|
--echo $count == $rows_inserted
|
|
|
|
|
2006-08-30 09:22:43 +02:00
|
|
|
select * from t1;
|
|
|
|
drop table t1;
|