2
# This test performs zero-sum queries, that is, queries after which the average value of all integers in the table remains the same.
3
# Some queries move values within a single row, others between rows and some insert new values or delete existing ones.
5
# The values in the first 10 rows are updated so that values from one row may move into another row. This makes those rows unsuitable for random
6
# insertions and deletions.
8
# Rows beyond the 10th are just inserted and delted randomly because each row in that part of the table is self-contained
12
SET AUTOCOMMIT=OFF ; START TRANSACTION ;
15
START TRANSACTION ; body ; commit_rollback ;
22
# update_two | # Not fully consistent
23
update_limit | # Broken in Falcon
25
insert_one | # Broken with Falcon
26
insert_multi | # Broken with Falcon
27
insert_select | # Broken with Falcon
28
insert_delete | # Broken with Falcon
29
# insert_update | # Not fully consistent
30
replace | # Broken in Falcon
38
ROLLBACK TO SAVEPOINT A |
43
UPDATE _table SET update_both ;
46
UPDATE _table SET update_both WHERE key_nokey_pk > _digit ;
49
UPDATE _table SET update_both WHERE `pk` = value ;
52
SET @var = half_digit ; UPDATE _table SET update_both WHERE `pk` >= @var AND `pk` <= @var + 1 |
53
SET @var = half_digit ; UPDATE _table SET update_both WHERE `pk` BETWEEN @var AND @var + 1 ;
56
UPDATE _table SET `int_key` = `int_key` - 10 WHERE `pk` = small ; UPDATE _table SET `int_key` = `int_key` + 10 WHERE `pk` = big ;
59
UPDATE _table SET update_one_half + IF(`pk` % 2 = 1 , 20, -20) WHERE `pk` >= half_digit ORDER BY `pk` ASC LIMIT 2 ;
62
UPDATE _table SET update_one_half + IF(`pk` % 2 = 1 , 30, -30) WHERE `pk` IN ( even_odd ) ;
65
INSERT INTO _table ( `pk` , `int_key` , `int`) VALUES ( NULL , 100 , 100 ) |
66
INSERT INTO _table ( `pk` ) VALUES ( NULL ) ; ROLLBACK ;
69
INSERT INTO _table ( `pk` , `int_key` , `int`) VALUES ( NULL , 100 , 100 ) , ( NULL , 100 , 100 ) |
70
INSERT INTO _table ( `pk` ) VALUES ( NULL ) , ( NULL ) , ( NULL ) ; ROLLBACK ;
73
INSERT INTO _table ( `int_key` , `int` ) SELECT `int` , `int_key` FROM _table WHERE `pk` > 10 LIMIT _digit ;
76
INSERT INTO _table ( `pk` , `int_key` , `int` ) VALUES ( NULL , 50 , 60 ) ; DELETE FROM _table WHERE `pk` = @@LAST_INSERT_ID ;
79
INSERT INTO _table ( `pk` , `int_key` , `int` ) VALUES ( NULL, 170 , 180 ) ; UPDATE _table SET `int_key` = `int_key` - 80 , `int` = `int` - 70 WHERE `pk` = _digit ;
82
REPLACE INTO _table ( `pk` , `int_key` , `int` ) VALUES ( NULL, 100 , 100 ) |
83
REPLACE INTO _table ( `pk` ) VALUES ( _digit ) ; ROLLBACK ;
86
DELETE FROM _table WHERE `pk` = _tinyint_unsigned AND `pk` > 10;
89
DELETE FROM _table WHERE `pk` > _tinyint_unsigned AND `pk` > 10 LIMIT _digit ;
92
`int_key` = `int_key` - 20, `int` = `int` + 20 |
93
`int` = `int` + 30, `int_key` = `int_key` - 30 ;
96
`int_key` = `int_key` |
100
`int_key` | `int` | `pk` ;
106
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 ;
109
odd , even | even , odd ;
124
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 ;