Bug #55542 'Built-in InnoDB' <> 'InnoDB Plugin' data mismatches for SET and BLOB columns
Submitted: 26 Jul 2010 1:31 Modified: 29 Jul 2010 1:30
Reporter: Roel Van de Paar Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: InnoDB Plugin storage engine Severity:S1 (Critical)
Version:5.1.49, 5.1.50 bzr OS:Any
Assigned to: Marko Mäkelä CPU Architecture:Any
Tags: randgen

[26 Jul 2010 1:31] Roel Van de Paar
Description:
# 2010-07-26T11:25:35 Query: DELETE FROM `table100_innodb_int_autoinc` WHERE `col_blob` = 8 LIMIT 8 failed: affected_rows mismatch between servers (7 vs. 5)

# 2010-07-26T11:25:38 Query: UPDATE `table100_innodb_int_autoinc` SET `col_blob` = 5 WHERE `col_set` > 1 AND `col_blob_key` < "I'll" LIMIT 9 failed: affected_rows mismatch between servers (3 vs. 1)

etc. When running 2x 5.1.49 in randgen, first one with built-in InnoDB, second one with InnoDB plugin.

How to repeat:
========= Randgen 
perl ./runall.pl \
  --basedir=/mysql/mysql-5.1.49-linux-i686-glibc23/ \
  --vardir1=/tmp/51/ \
  --vardir2=/tmp/52/ \
  --mysqld1=--log-output=none \
  --mysqld1=--log_error=/randgen/new_testing/51.log \
  --mysqld2=--log-output=none \
  --mysqld2=--log_error=/randgen/new_testing/52.log \
  --mysqld2=--ignore-builtin-innodb \
  --mysqld2=--plugin-load=innodb=ha_innodb_plugin.so:innodb_trx=ha_innodb_plugin.so:innodb_locks=ha_innodb_plugin.so:innodb_cmp=ha_innodb_plugin.so:innodb_cmp_reset=ha_innodb_plugin.so:innodb_cmpmem=ha_innodb_plugin.so:innodb_cmpmem_reset=ha_innodb_plugin.so \
  --mysqld2=--plugin-dir=/mysql/mysql-5.1.49-linux-i686-glibc23/lib/plugin/ \
  --gendata=/randgen/new_testing/5.zz \
  --grammar=/randgen/new_testing/5.yy \
  --queries=10000 \
  --threads=10 \
  --Validators=ResultsetComparator,MarkErrorLog,AbortOnSyntaxError 

========= 5.zz
$tables = {
        rows => [100],
        engines => ['InnoDB'],
        pk => ['int auto_increment']
};

$fields = {
        types => ['set','blob']
};

$data = {
        blobs => ['english','data']
};

========= 5.yy
query:
 	update | insert | delete ;

update:
 	UPDATE _table SET _field = digit WHERE condition LIMIT _digit ;

delete:
	DELETE FROM _table WHERE condition LIMIT _digit ;

insert:
	INSERT INTO _table ( _field ) VALUES ( _digit ) ;

condition:
 	_field = value |
	_field > value AND _field < value ;

value:
	_digit | _char(255) | _english | _datetime | NULL ;

=========
[26 Jul 2010 1:38] Roel Van de Paar
Issue can be reproduced without the LIMIT clauses also:

update:
 	UPDATE _table SET _field = digit WHERE condition ;

delete:
	DELETE FROM _table WHERE condition ;

# 2010-07-26T11:34:33 Query: DELETE FROM `table100_innodb_int_autoinc` WHERE `col_set_key` > '2007-02-17 13:36:56' AND `pk` < '2005-04-26 04:40:29' failed: affected_rows mismatch between servers (15 vs. 22)

# 2010-07-26T11:34:51 Query: DELETE FROM `table100_innodb_int_autoinc` WHERE `pk` > 4 AND `col_blob` < 'come' failed: affected_rows mismatch between servers (17 vs. 13)
[26 Jul 2010 4:26] Roel Van de Paar
See bug #55543
[26 Jul 2010 6:51] Sveta Smirnova
Thank you for the report.

Verified as described.
[29 Jul 2010 0:00] Roel Van de Paar
OK, small mistake here: --threads=10

"--threads=N - number of threads to run. Using more than one thread makes the test
non-deterministic. If 100% determinism is important (such as when running the same test against two servers) use either only SELECT queries or set --threads to 1. The default is 10 threads;" (http://forge.mysql.com/wiki/RandomQueryGenerator)

However. I am still seeing issues with threads=1, but seems harder to reproduce. Uploading a log of at least one reproduce with threads=1 next.
[29 Jul 2010 1:30] Roel Van de Paar
Not repeatable with --threads=1. I thought I had a log, was a mistake. Marking as not a bug.