mirror of
https://github.com/MariaDB/server.git
synced 2025-08-29 00:08:14 +03:00
BUG#19903: Add partition crashes
Added new test cases
This commit is contained in:
58
mysql-test/t/partition_innodb.test
Normal file
58
mysql-test/t/partition_innodb.test
Normal file
@@ -0,0 +1,58 @@
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
SET @max_row = 20;
|
||||
let $engine= 'InnoDB';
|
||||
let $MAX_VALUE= (2147483646);
|
||||
|
||||
let $max_row= `SELECT @max_row`;
|
||||
|
||||
# Column list with definition for all tables to be checked
|
||||
let $column_list= f_int1 INTEGER,
|
||||
f_int2 INTEGER,
|
||||
f_char1 CHAR(20),
|
||||
f_char2 CHAR(20),
|
||||
f_charbig VARCHAR(1000);
|
||||
|
||||
let $sub_part_no= 3;
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t0_template;
|
||||
--enable_warnings
|
||||
eval CREATE TABLE t0_template (
|
||||
$column_list ,
|
||||
PRIMARY KEY(f_int1))
|
||||
ENGINE = MEMORY;
|
||||
let $num= `SELECT @max_row`;
|
||||
while ($num)
|
||||
{
|
||||
eval INSERT INTO t0_template
|
||||
SET f_int1 = $num, f_int2 = $num, f_char1 = '$num', f_char2 = '$num',
|
||||
f_charbig = '===$num===';
|
||||
dec $num;
|
||||
}
|
||||
# 1. Create the table
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
eval CREATE TABLE t1 (f_date DATE, f_varchar VARCHAR(30)) engine=$engine;
|
||||
# 2. Fill the table t1 with records
|
||||
INSERT INTO t1 (f_date, f_varchar)
|
||||
SELECT CONCAT(CAST((f_int1 + 999) AS CHAR),'-02-10'), CAST(f_char1 AS CHAR)
|
||||
FROM t0_template
|
||||
WHERE f_int1 + 999 BETWEEN 1000 AND 9999;
|
||||
# 3. Calculate the number of inserted records.
|
||||
SELECT IF(9999 - 1000 + 1 > @max_row, @max_row , 9999 - 1000 + 1)
|
||||
INTO @exp_row_count;
|
||||
# DEBUG SELECT @exp_row_count;
|
||||
# 4. Print the layout, check Readability
|
||||
ALTER TABLE t1 PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER));
|
||||
--echo # 1.1.5 Add two named partitions + test
|
||||
ALTER TABLE t1 ADD PARTITION (PARTITION part1, PARTITION part7);
|
||||
|
||||
--disable_warnings
|
||||
DROP VIEW IF EXISTS v1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t0_aux;
|
||||
DROP TABLE IF EXISTS t0_definition;
|
||||
DROP TABLE IF EXISTS t0_template;
|
||||
--enable_warnings
|
||||
|
Reference in New Issue
Block a user