1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

binlog_row_binlog test gained some indeterministic checks with changes due to

ChangeSet@1.2309.1.12, 2006-09-12 15:42:13+02:00, guilhem@gbichot3.local +14 -0
  Fixing problems I identified in my auto_increment work pushed in July
  (as part of the auto_increment cleanup of WL #3146; ...
The problem is in that show binlog events in indeterministic, row events can be compressed,
so that 2 seconds original delay does not guard from inconsistency.

We syncronize test's current inserted rows counter with system insert delayed thread
per each query.

From another side there is no requirement for binlog to be event per row and then 
to verify if binlog has recorded what was recently inserted is better
via reading from it instead of 'show binlog events'. 


mysql-test/extra/binlog_tests/binlog_insert_delayed.test:
  removing sleeps, syncronizing with system delayed thread per each statement,
  note that an insert statement is performed atomically including writing to binlog,
  so that concurrent selects are waiting. That's why the wait macro is safe.
mysql-test/r/binlog_row_binlog.result:
  new result
mysql-test/include/wait_until_rows_count.inc:
  macro implements waiting until a targeted table has a prescribed rows number.
This commit is contained in:
unknown
2006-09-23 15:24:45 +03:00
parent 73d0afd3d0
commit 99f8d0a4a8
3 changed files with 74 additions and 11 deletions

View File

@@ -4,23 +4,33 @@ 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;
# Verify that only one INSERT_ID event is binlogged.
# Note, that because of WL#3368 mixed mode binlog records RBR events for the delayed
let $table=t1;
let $rows_inserted=11; # total number of inserted rows in this test
insert delayed into t1 values (207);
let $count=1;
# We use sleeps between statements, that's the only way to get a
# repeatable binlog in a normal test run and under Valgrind. The
# reason is that without sleeps, rows of different INSERT DELAYEDs
# sometimes group together and sometimes not, so the table may be
# unlocked/relocked causing a different number of table map log
# events.
sleep 2;
# use this macro instead of sleeps.
--source include/wait_until_rows_count.inc
insert delayed into t1 values (null);
sleep 2;
inc $count;
--source include/wait_until_rows_count.inc
insert delayed into t1 values (300);
sleep 2; # time for the delayed queries to reach disk
inc $count;
--source include/wait_until_rows_count.inc
insert delayed into t1 values (null),(null),(null),(null);
sleep 2;
inc $count; inc $count; inc $count; inc $count;
--source include/wait_until_rows_count.inc
insert delayed into t1 values (null),(null),(400),(null);
sleep 2;
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
select * from t1;
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/