mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 22:12:30 +01:00
12e5d5b6be
Bug#31610 Remove outdated and redundant tests: partition_02myisam partition_03ndb Bug#32405 testsuite parts: partition_char_myisam wrong content and cleanup of testsuite - remove/correct wrong comments - remove workarounds for fixed bugs - replace error numbers with error names - exclude subtests from execution which fail now because of new limitations for partitioning functions - remove code for the no more intended dual use fast test in regression tests/slow test in testsuite - analyze and fix problems with partition_char_innodb - fix problems caused by last change of error numbers - Introduce error name to error number mapping which makes maintenance after next error renumbering easier
59 lines
2.5 KiB
SQL
59 lines
2.5 KiB
SQL
# inc/partition_12.inc
|
|
#
|
|
# Do some basic things on a table, if the SQL command executed just before
|
|
# sourcing this file was successful.
|
|
#
|
|
|
|
--source suite/parts/inc/partition_layout.inc
|
|
|
|
####### Variations with multiple records
|
|
# (mass) Insert max_row_div2 + 1 records
|
|
eval INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN $max_row_div2 AND $max_row;
|
|
# Select
|
|
eval SELECT (COUNT(*) = $max_row) AND (MIN(f1) = 1) AND (MAX(f1) = $max_row)
|
|
AS my_value FROM t1;
|
|
# DEBUG SELECT COUNT(*),MIN(f1),MAX(f1) FROM t1;
|
|
# (mass) Update $max_row_div4 * 2 + 1 records
|
|
eval UPDATE t1 SET f1 = f1 + $max_row
|
|
WHERE f1 BETWEEN $max_row_div2 - $max_row_div4 AND $max_row_div2 + $max_row_div4;
|
|
# Select
|
|
eval SELECT (COUNT(*) = $max_row) AND (MIN(f1) = 1) AND (MAX(f1) = $max_row_div2 + $max_row_div4 + $max_row )
|
|
AS my_value FROM t1;
|
|
# DEBUG SELECT COUNT(*),MIN(f1),MAX(f1) FROM t1;
|
|
# (mass) Delete $max_row_div4 * 2 + 1 records
|
|
eval DELETE FROM t1
|
|
WHERE f1 BETWEEN $max_row_div2 - $max_row_div4 + $max_row AND $max_row_div2 + $max_row_div4 + $max_row;
|
|
# Select
|
|
eval SELECT (COUNT(*) = $max_row - $max_row_div4 - $max_row_div4 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = $max_row)
|
|
AS my_value FROM t1;
|
|
# DEBUG SELECT COUNT(*),MIN(f1),MAX(f1) FROM t1;
|
|
|
|
####### Variations with single records
|
|
# Insert one record at beginning
|
|
INSERT INTO t1 SET f1 = 0 , f2 = '#######';
|
|
# Select this record
|
|
SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######';
|
|
# Insert one record at end
|
|
eval INSERT INTO t1 SET f1 = $max_row + 1, f2 = '#######';
|
|
# Select this record
|
|
eval SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = $max_row + 1 AND f2 = '#######';
|
|
# Update one record
|
|
eval UPDATE t1 SET f1 = $max_row + 2, f2 = 'ZZZZZZZ'
|
|
WHERE f1 = 0 AND f2 = '#######';
|
|
# Select
|
|
eval SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = $max_row + 2 AND f2 = 'ZZZZZZZ';
|
|
# Bug #15968: Partitions: crash when INSERT with f1 = -1 into PARTITION BY HASH(f1)
|
|
eval UPDATE t1 SET f1 = 0 - 1, f2 = 'ZZZZZZZ'
|
|
WHERE f1 = $max_row + 1 AND f2 = '#######';
|
|
# Select
|
|
SELECT COUNT(*) AS my_value FROM t1 WHERE f1 = 0 - 1 AND f2 = 'ZZZZZZZ';
|
|
# Delete
|
|
eval DELETE FROM t1 WHERE f1 = $max_row + 2 AND f2 = 'ZZZZZZZ';
|
|
DELETE FROM t1 WHERE f1 = 0 - 1 AND f2 = 'ZZZZZZZ';
|
|
# Select
|
|
SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ';
|
|
|
|
# Truncate
|
|
TRUNCATE t1;
|
|
# Select on empty table
|
|
SELECT COUNT(*) = 0 AS my_value FROM t1;
|