3 # Do some basic things on a table, if the SQL command executed just before
4 # sourcing this file was successful.
7 --source suite/parts/inc/partition_layout.inc
9 ####### Variations with multiple records
10 # (mass) Insert max_row_div2 + 1 records
11 eval INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN $max_row_div2 AND $max_row;
13 eval SELECT (COUNT(*) = $max_row) AND (MIN(f1) = 1) AND (MAX(f1) = $max_row)
15 # DEBUG SELECT COUNT(*),MIN(f1),MAX(f1) FROM t1;
16 # (mass) Update $max_row_div4 * 2 + 1 records
17 eval UPDATE t1 SET f1 = f1 + $max_row
18 WHERE f1 BETWEEN $max_row_div2 - $max_row_div4 AND $max_row_div2 + $max_row_div4;
20 eval SELECT (COUNT(*) = $max_row) AND (MIN(f1) = 1) AND (MAX(f1) = $max_row_div2 + $max_row_div4 + $max_row )
22 # DEBUG SELECT COUNT(*),MIN(f1),MAX(f1) FROM t1;
23 # (mass) Delete $max_row_div4 * 2 + 1 records
25 WHERE f1 BETWEEN $max_row_div2 - $max_row_div4 + $max_row AND $max_row_div2 + $max_row_div4 + $max_row;
27 eval SELECT (COUNT(*) = $max_row - $max_row_div4 - $max_row_div4 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = $max_row)
29 # DEBUG SELECT COUNT(*),MIN(f1),MAX(f1) FROM t1;
31 ####### Variations with single records
32 # Insert one record at beginning
33 INSERT INTO t1 SET f1 = 0 , f2 =
'#######';
35 SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 =
'#######';
36 # Insert one record at end
37 eval INSERT INTO t1 SET f1 = $max_row + 1, f2 =
'#######';
39 eval SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = $max_row + 1 AND f2 =
'#######';
41 eval UPDATE t1 SET f1 = $max_row + 2, f2 =
'ZZZZZZZ'
42 WHERE f1 = 0 AND f2 =
'#######';
44 eval SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = $max_row + 2 AND f2 =
'ZZZZZZZ';
45 # Bug #15968: Partitions: crash when INSERT with f1 = -1 into PARTITION BY HASH(f1)
46 eval UPDATE t1 SET f1 = 0 - 1, f2 =
'ZZZZZZZ'
47 WHERE f1 = $max_row + 1 AND f2 =
'#######';
49 SELECT COUNT(*) AS my_value FROM t1 WHERE f1 = 0 - 1 AND f2 = 'ZZZZZZZ';
51 eval DELETE FROM t1 WHERE f1 = $max_row + 2 AND f2 =
'ZZZZZZZ';
52 DELETE FROM t1 WHERE f1 = 0 - 1 AND f2 =
'ZZZZZZZ';
54 SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 =
'ZZZZZZZ';
58 # Select on empty table
59 SELECT COUNT(*) = 0 AS my_value FROM t1;