# # 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: insert_one1 | update_in1 ; update_in1: START TRANSACTION ; update_in ; commit_rollback ; insert_one1: START TRANSACTION ; insert_one ; commit_rollback ; commit_rollback: COMMIT | ROLLBACK ; update_in: UPDATE _table SET update_one_half + IF(`pk` % 2 = 1 , 30, -30) WHERE `pk` IN ( even_odd ) ; insert_one: INSERT INTO _table ( `pk` , `int_key` , `int`) VALUES ( NULL , 100 , 100 ) | INSERT INTO _table ( `pk` ) VALUES ( NULL ) ; ROLLBACK ; 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` ; key_nokey_pk: `int_key` | `int` | `pk` ; 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 ;