summaryrefslogtreecommitdiff
path: root/mysql-test/extra
diff options
context:
space:
mode:
authorunknown <aelkin/elkin@dsl-hkigw8-feb9fb00-191.dhcp.inet.fi>2006-09-23 15:24:45 +0300
committerunknown <aelkin/elkin@dsl-hkigw8-feb9fb00-191.dhcp.inet.fi>2006-09-23 15:24:45 +0300
commit99f8d0a4a82b6816345fabf5b9570435b80930a0 (patch)
treeec4d7ba3993c54353dc15be04eb441a4abf64a24 /mysql-test/extra
parent73d0afd3d05bc301a0a90f0eca0f7aac350c787a (diff)
downloadmariadb-git-99f8d0a4a82b6816345fabf5b9570435b80930a0.tar.gz
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.
Diffstat (limited to 'mysql-test/extra')
-rw-r--r--mysql-test/extra/binlog_tests/binlog_insert_delayed.test32
1 files changed, 21 insertions, 11 deletions
diff --git a/mysql-test/extra/binlog_tests/binlog_insert_delayed.test b/mysql-test/extra/binlog_tests/binlog_insert_delayed.test
index 6f504fded96..29c2c477960 100644
--- a/mysql-test/extra/binlog_tests/binlog_insert_delayed.test
+++ b/mysql-test/extra/binlog_tests/binlog_insert_delayed.test
@@ -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: #/