| 1 |
# This is the test case for bug #61209 - duplicate key errors |
| 2 |
# when using auto_increment_increment > 1 and auto_increment_offset > 1 |
| 3 |
# |
| 4 |
--source include/have_innodb.inc |
| 5 |
|
| 6 |
# |
| 7 |
# Precautionary clean up. |
| 8 |
# |
| 9 |
--disable_warnings |
| 10 |
DROP TABLE IF EXISTS bug_61209; |
| 11 |
--enable_warnings |
| 12 |
|
| 13 |
# |
| 14 |
# Create test data. |
| 15 |
# |
| 16 |
CREATE TABLE bug_61209 (a INT auto_increment, PRIMARY KEY(a)) ENGINE=InnoDB; |
| 17 |
|
| 18 |
INSERT INTO bug_61209 VALUES (), (), (), (); |
| 19 |
|
| 20 |
--connect (con1,localhost,root,,) |
| 21 |
--connect (con2,localhost,root,,) |
| 22 |
|
| 23 |
--connection con1 |
| 24 |
SET SESSION auto_increment_increment=3; |
| 25 |
SET SESSION auto_increment_offset=2; |
| 26 |
SELECT GET_LOCK('a', 9); |
| 27 |
|
| 28 |
--connection con2 |
| 29 |
SET SESSION auto_increment_increment=3; |
| 30 |
SET SESSION auto_increment_offset=2; |
| 31 |
send INSERT INTO bug_61209 (a) VALUES (NULL), (NULL), (NULL + GET_LOCK('a', 10)); |
| 32 |
|
| 33 |
--connection con1 |
| 34 |
INSERT INTO bug_61209 (a) VALUES (NULL), (NULL), (NULL); |
| 35 |
SELECT RELEASE_LOCK('a'); |
| 36 |
|
| 37 |
--connection con2 |
| 38 |
reap; |
| 39 |
|
| 40 |
# |
| 41 |
# Clean up |
| 42 |
# |
| 43 |
DROP TABLE bug_61209; |