# # This test performs zero-sum queries, that is, queries after which the average value of all integers in the table remains the same. # Some queries move values within a single row, others between rows and some insert new values or delete existing ones.# # 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 # insertions and deletions. # # Rows beyond the 10th are just inserted and delted randomly because each row in that part of the table is self-contained # query_init: SET AUTOCOMMIT=OFF ; START TRANSACTION ; query: START TRANSACTION ; body ; commit_rollback ; body: update_between | update_in ; commit_rollback: ROLLBACK ; update_between: SET @var = half_digit ; UPDATE _table SET update_both WHERE `pk` >= @var AND `pk` <= @var + 1 | SET @var = half_digit ; UPDATE _table SET update_both WHERE `pk` BETWEEN @var AND @var + 1 ; update_in: UPDATE _table SET update_one_half + IF(`pk` % 2 = 1 , 30, -30) WHERE `pk` IN ( even_odd ) ; update_both: `int_key` = `int_key` - 20, `int` = `int` + 20 | `int` = `int` + 30, `int_key` = `int_key` - 30 ; update_one_half: `int_key` = `int_key` | `int` = `int` ; value: _digit; half_digit: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 ; even_odd: odd , even | even , odd ; odd: 1 | 3 | 5 | 7 | 9 ; even: 2 | 4 | 6 | 8 ; small: 1 | 2 | 3 | 4 ; big: 5 | 6 | 7 | 8 | 9 ; _digit: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 ;