Bug #30490 Repeatable read strange anomaly
Submitted: 18 Aug 2007 10:34 Modified: 19 Aug 2007 15:54
Reporter: Grigory Rubtsov Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.0.22 OS:Linux
Assigned to: Assigned Account CPU Architecture:Any
Tags: innodb, repeatable read, transactions

[18 Aug 2007 10:34] Grigory Rubtsov
Description:
During repeatable-read transaction there may be a strange anomaly, when user sees double number of rows. Such an anomaly is not documented.

How to repeat:
conn1> select @@tx_isolation;
+-----------------+
| @@tx_isolation  |
+-----------------+
| REPEATABLE-READ | 
+-----------------+
1 row in set (0.00 sec)
conn1> BEGIN;
conn2> BEGIN;
conn1>  select * from cities;
+----+----------+
| id | name     |
+----+----------+
|  2 | New York | 
|  3 | Tokyo    | 
+----+----------+
2 rows in set (0.00 sec)
conn2>  select * from cities;
+----+----------+
| id | name     |
+----+----------+
|  2 | New York | 
|  3 | Tokyo    | 
+----+----------+
2 rows in set (0.00 sec)
conn1> UPDATE cities SET id=id+10;
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2  Changed: 2  Warnings: 0
conn2> UPDATE cities SET id=id+20;
................****WAITS FOR LOCK****
conn1> COMMIT;
conn2>
Query OK, 2 rows affected (33.09 sec)
Rows matched: 2  Changed: 2  Warnings: 0
conn2> SELECT * FROM cities;
+----+----------+
| id | name     |
+----+----------+
|  2 | New York | 
|  3 | Tokyo    | 
| 32 | New York | 
| 33 | Tokyo    | 
+----+----------+
4 rows in set (0.00 sec)
[19 Aug 2007 15:54] Heikki Tuuri
A duplicate of this anomaly report:

http://bugs.mysql.com/bug.php?id=30184