Commit 12e5d5b6 authored by mleich@five.local.lan's avatar mleich@five.local.lan

Fixes for the bugs

       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
parent be638f60
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
###############################################
# #
# Partition tests NDB tables #
# #
###############################################
#
# NOTE: PLEASE DO NOT ADD NOT NDB SPECIFIC TESTCASES HERE !
# NON STORAGE SPECIFIC TESTCASES SHOULD BE ADDED IN
# THE SOURCED FIELS ONLY.
#
# Storage engine to be tested
let $engine= 'NDB' ;
-- source include/have_ndb.inc
eval SET SESSION storage_engine=$engine;
# Other storage engine <> storage engine to be tested
let $engine_other= 'MEMORY';
# number of rows for the INSERT/UPDATE/DELETE/SELECT experiments
# on partioned tables
# Attention: In the moment the result files fit to @max_row = 200 only
SET @max_row = 200;
-- source include/partition_1.inc
################################################################################
# include/partition_methods1.inc #
# inc/partition_methods1.inc #
# #
# Purpose: #
# Create and check partitioned tables #
......@@ -11,7 +11,7 @@
# do #
# 1. Create the partitioned table #
# 2 Insert the content of the table t0_template into t1 #
# 3. Execute include/partition_check.inc #
# 3. Execute inc/partition_check.inc #
# 4. Drop the table t1 #
# done #
# #
......@@ -21,14 +21,14 @@
# has to be set before sourcing this routine. #
# Example: #
# let $unique= , UNIQUE INDEX uidx1 (f_int1); #
# include/partition_method1s.inc #
# inc/partition_method1s.inc #
# #
# Attention: The routine include/partition_methods2.inc is very similar #
# Attention: The routine inc/partition_methods2.inc is very similar #
# to this one. So if something has to be changed here it #
# might be necessary to do it also there #
# #
#------------------------------------------------------------------------------#
# Original Author: ML #
# Original Author: mleich #
# Original Date: 2006-03-05 #
# Change Author: #
# Change Date: #
......@@ -52,7 +52,6 @@ $unique
$partitioning;
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
DROP TABLE t1;
#----------- PARTITION BY KEY
......@@ -67,7 +66,6 @@ $unique
$partitioning;
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
DROP TABLE t1;
#----------- PARTITION BY LIST
......@@ -90,7 +88,6 @@ $unique
$partitioning;
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
DROP TABLE t1;
#----------- PARTITION BY RANGE
......@@ -114,7 +111,6 @@ $unique
$partitioning;
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
DROP TABLE t1;
#----------- PARTITION BY RANGE -- SUBPARTITION BY HASH
......@@ -137,7 +133,6 @@ $unique
$partitioning;
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
DROP TABLE t1;
#----------- PARTITION BY RANGE -- SUBPARTITION BY KEY
......@@ -163,7 +158,6 @@ $unique
$partitioning;
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
DROP TABLE t1;
#----------- PARTITION BY LIST -- SUBPARTITION BY HASH
......@@ -186,7 +180,6 @@ $unique
$partitioning;
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
DROP TABLE t1;
#----------- PARTITION BY LIST -- SUBPARTITION BY KEY
......@@ -209,5 +202,4 @@ $unique
$partitioning;
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
DROP TABLE t1;
......@@ -21,253 +21,207 @@ let $sqlfunc = ascii(col1);
let $valsqlfunc = ascii('a');
let $coltype = char(30);
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = ord(col1);
let $valsqlfunc = ord('a');
let $coltype = char(30);
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = greatest(col1,15);
let $valsqlfunc = greatest(1,15);
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = isnull(col1);
let $valsqlfunc = isnull(15);
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = least(col1,15);
let $valsqlfunc = least(15,30);
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = case when col1>15 then 20 else 10 end;
let $valsqlfunc = case when 1>30 then 20 else 15 end;
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = ifnull(col1,30);
let $valsqlfunc = ifnull(1,30);
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = nullif(col1,30);
let $valsqlfunc = nullif(1,30);
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = bit_length(col1);
let $valsqlfunc = bit_length(255);
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $coltype = char(30);
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = char_length(col1);
let $valsqlfunc = char_length('a');
#let $coltype = int;
#--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $coltype = char(30);
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = character_length(col1);
let $valsqlfunc = character_length('a');
let $coltype = char(30)
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = find_in_set(col1,'1,2,3,4,5,6,7,8,9');
let $valsqlfunc = find_in_set('i','a,b,c,d,e,f,g,h,i');
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $coltype = char(30);
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = instr(col1,'acb');
let $valsqlfunc = instr('i','a,b,c,d,e,f,g,h,i');
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $coltype = char(30);
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = length(col1);
let $valsqlfunc = length('a,b,c,d,e,f,g,h,i');
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = locate('a',col1);
let $valsqlfunc = locate('i','a,b,c,d,e,f,g,h,i');
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $coltype = char(30);
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = octet_length(col1);
let $valsqlfunc = octet_length('a,b,c,d,e,f,g,h,i');
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = position('a' in col1);
let $valsqlfunc = position('i' in 'a,b,c,d,e,f,g,h,i');
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $coltype = char(30);
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = strcmp(col1,'acb');
let $valsqlfunc = strcmp('i','a,b,c,d,e,f,g,h,i');
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $coltype = char(30);
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = crc32(col1);
let $valsqlfunc = crc32('a,b,c,d,e,f,g,h,i');
let $coltype = char(30);
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = round(col1);
let $valsqlfunc = round(15);
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = sign(col1);
let $valsqlfunc = sign(123);
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = period_add(col1,5);
let $valsqlfunc = period_add(9804,5);
let $coltype = datetime;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = period_diff(col1,col2);
let $valsqlfunc = period_diff(9809,199907);
let $coltype = datetime,col2 datetime;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $coltype = int,col2 int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = timestampdiff(day,5,col1);
let $valsqlfunc = timestampdiff(YEAR,'2002-05-01','2001-01-01');
let $coltype = datetime;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = unix_timestamp(col1);
let $valsqlfunc = unix_timestamp ('2002-05-01');
let $coltype = date;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = week(col1);
let $valsqlfunc = week('2002-05-01');
let $coltype = datetime;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = weekofyear(col1);
let $valsqlfunc = weekofyear('2002-05-01');
let $coltype = datetime;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = cast(col1 as signed);
let $valsqlfunc = cast(123 as signed);
let $coltype = varchar(30);
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = convert(col1,unsigned);
let $valsqlfunc = convert(123,unsigned);
let $coltype = varchar(30);
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = col1 | 20;
let $valsqlfunc = 10 | 20;
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = col1 & 20;
let $valsqlfunc = 10 & 20;
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = col1 ^ 20;
let $valsqlfunc = 10 ^ 20;
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = col1 << 20;
let $valsqlfunc = 10 << 20;
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = col1 >> 20;
let $valsqlfunc = 10 >> 20;
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = ~col1;
let $valsqlfunc = ~20;
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = bit_count(col1);
let $valsqlfunc = bit_count(20);
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = inet_aton(col1);
let $valsqlfunc = inet_aton('192.168.1.1');
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
set @var =20;
let $sqlfunc = bit_length(col1)+@var-@var;
let $valsqlfunc = bit_length(20)+@var-@var;
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
delimiter //;
......@@ -298,5 +252,4 @@ let $sqlfunc = getmaxsigned_t1(col1);
let $valsqlfunc = getmaxsigned(10);
let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
drop function if exists getmaxsigned_t1;
################################################################################
# t/part_supported_sql_funcs_delete.inc # # #
# t/part_supported_sql_funcs_delete.inc #
# #
# Purpose: #
# Delete access of the tests frame for allowed sql functions #
# #
......
......@@ -38,7 +38,6 @@ let $val2 = 13 ;
let $val3 = 17 ;
let $val4 = 15 ;
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = ceiling(col1);
......@@ -51,7 +50,6 @@ let $val3 = 17.987;
let $val4 = 15.654 ;
# DISABLED due to bug 30577
#--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = floor(col1);
let $valsqlfunc = floor(15.123);
......@@ -63,7 +61,6 @@ let $val3 = 17.987;
let $val4 = 15.654 ;
# DISABLED due to bug 30577
#--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = mod(col1,10);
let $valsqlfunc = mod(15,10);
......@@ -74,7 +71,6 @@ let $val2 = 19;
let $val3 = 17;
let $val4 = 15 ;
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = day(col1);
let $valsqlfunc = day('2006-12-21');
......@@ -85,7 +81,6 @@ let $val2 = '2006-01-17';
let $val3 = '2006-01-25';
let $val4 = '2006-02-05';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = dayofmonth(col1);
let $valsqlfunc = dayofmonth('2006-12-24');
......@@ -96,7 +91,6 @@ let $val2 = '2006-01-17';
let $val3 = '2006-01-25';
let $val4 = '2006-02-05';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = dayofweek(col1);
let $valsqlfunc = dayofweek('2006-12-24');
......@@ -107,7 +101,6 @@ let $val2 = '2006-02-17';
let $val3 = '2006-01-25';
let $val4 = '2006-02-05';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = dayofyear(col1);
let $valsqlfunc = dayofyear('2006-12-25');
......@@ -118,10 +111,8 @@ let $val2 = '2006-01-17';
let $val3 = '2006-02-25';
let $val4 = '2006-02-05';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $coltype = char(30);
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = extract(month from col1);
let $valsqlfunc = extract(year from '1998-11-23');
......@@ -132,7 +123,6 @@ let $val2 = '2006-02-17';
let $val3 = '2006-01-25';
let $val4 = '2006-02-05';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = hour(col1);
let $valsqlfunc = hour('18:30');
......@@ -143,7 +133,6 @@ let $val2 = '14:30';
let $val3 = '21:59';
let $val4 = '10:30';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = microsecond(col1);
let $valsqlfunc = microsecond('10:30:10.000010');
......@@ -154,7 +143,6 @@ let $val2 = '04:30:01.000018';
let $val3 = '00:59:22.000024';
let $val4 = '05:30:34.000037';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = minute(col1);
let $valsqlfunc = minute('18:30');
......@@ -164,7 +152,6 @@ let $val2 = '14:30:45';
let $val3 = '21:59:22';
let $val4 = '10:24:23';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = second(col1);
let $valsqlfunc = second('18:30:14');
......@@ -175,10 +162,8 @@ let $val2 = '14:30:20';
let $val3 = '21:59:22';
let $val4 = '10:22:33';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $coltype = char(30);
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = month(col1);
let $valsqlfunc = month('2006-10-14');
......@@ -189,7 +174,6 @@ let $val2 = '2006-12-17';
let $val3 = '2006-05-25';
let $val4 = '2006-11-06';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = quarter(col1);
let $valsqlfunc = quarter('2006-10-14');
......@@ -200,7 +184,6 @@ let $val2 = '2006-12-17';
let $val3 = '2006-09-25';
let $val4 = '2006-07-30';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = time_to_sec(col1)-(time_to_sec(col1)-20);
let $valsqlfunc = time_to_sec('18:30:14')-(time_to_sec('17:59:59'));
......@@ -211,7 +194,6 @@ let $val2 = '14:30:45';
let $val3 = '21:59:22';
let $val4 = '10:33:11';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = to_days(col1)-to_days('2006-01-01');
let $valsqlfunc = to_days('2006-02-02')-to_days('2006-01-01');
......@@ -222,7 +204,6 @@ let $val2 = '2006-01-17';
let $val3 = '2006-01-25';
let $val4 = '2006-02-06';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
# DATEDIFF() is implemented as (TO_DAYS(d1) - TO_DAYS(d2))
let $sqlfunc = datediff(col1, '2006-01-01');
......@@ -234,7 +215,6 @@ let $val2 = '2006-01-17';
let $val3 = '2006-01-25';
let $val4 = '2006-02-06';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = weekday(col1);
let $valsqlfunc = weekday('2006-10-14');
......@@ -245,7 +225,6 @@ let $val2 = '2006-11-17';
let $val3 = '2006-05-25';
let $val4 = '2006-02-06';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = year(col1)-1990;
let $valsqlfunc = year('2005-10-14')-1990;
......@@ -256,7 +235,6 @@ let $val2 = '2000-02-17';
let $val3 = '2004-05-25';
let $val4 = '2002-02-15';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = yearweek(col1)-200600;
let $valsqlfunc = yearweek('2006-10-14')-200600;
......@@ -267,4 +245,3 @@ let $val2 = '2006-08-17';
let $val3 = '2006-03-25';
let $val4 = '2006-11-15';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
This diff is collapsed.
# include/partition_10.inc
# inc/partition_10.inc
#
# Do some basic checks on a table.
#
......@@ -10,7 +10,7 @@
# is like expected.
#
--source include/partition_layout.inc
--source suite/parts/inc/partition_layout.inc
####### Variations with multiple records
# Select on empty table
......@@ -50,20 +50,14 @@ 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';
if ($fixed_bug15968)
{
# 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';
if ($fixed_bug15968)
{
DELETE FROM t1 WHERE f1 = 0 - 1 AND f2 = 'ZZZZZZZ';
}
# Select
SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ';
......
# include/partition_11.inc
# inc/partition_11.inc
#
# Try to create a table with the given partition number
#
......@@ -13,7 +13,7 @@ let $run= `SELECT @my_errno = 0`;
# If this operation was successfull, check + drop this table
if ($run)
{
--source include/partition_10.inc
--source suite/parts/inc/partition_10.inc
eval DROP TABLE t1;
}
#### Try to create a table with the given subpartition number
......@@ -29,6 +29,6 @@ let $run= `SELECT @my_errno = 0`;
# If this operation was successfull, check + drop this table
if ($run)
{
--source include/partition_10.inc
--source suite/parts/inc/partition_10.inc
eval DROP TABLE t1;
}
# include/partition_12.inc
# inc/partition_12.inc
#
# Do some basic things on a table, if the SQL command executed just before
# sourcing this file was successful.
#
--source include/partition_layout.inc
--source suite/parts/inc/partition_layout.inc
####### Variations with multiple records
# (mass) Insert max_row_div2 + 1 records
......@@ -42,20 +42,14 @@ 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';
if ($fixed_bug15968)
{
# 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';
if ($fixed_bug15968)
{
DELETE FROM t1 WHERE f1 = 0 - 1 AND f2 = 'ZZZZZZZ';
}
# Select
SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ';
......
################################################################################
# include/partition_20.inc #
# inc/partition_20.inc #
# #
# Purpose: #
# Auxiliary script, only useful when sourced by include/partition_check.inc. #
# Auxiliary script, only useful when sourced by #
# suite/parts/inc/partition_check.inc. #
# #
# 1. Check if the preceeding statement caused that the expected number of #
# 1. Check if the preceding statement caused that the expected number of #
# records was #
# - inserted #
# - updated or deleted+inserted #
......@@ -17,19 +18,13 @@
# must be set before sourcing this routine. #
# #
#------------------------------------------------------------------------------#
# Original Author: ML #
# Original Author: mleich #
# Original Date: 2006-03-05 #
# Change Author: #
# Change Date: #
# Change: #
################################################################################
# include/partition_20.inc
#
# Auxiliary script, only useful when sourced by include/partition_check.inc.
#
# Check of preceeding statement via Select
if ($no_debug)
{
--disable_query_log
......
################################################################################
# include/partition_alter_1.inc #
# inc/partition_alter_1.inc #
# #
# Purpose: #
# Alter a partioned table and check the usability afterwards #
# This script is only usefule when sourced by #
# include/partition_alter_1[1|3].inc #
# inc/partition_alter_1[1|3].inc #
# #
# 0. Expect there is a table t1 #
# 1. Insert the first half of the table t0_template into t1 #
# 2. Execute the ALTER TABLE statement within the variable $alter #
# Case SQL code in #
# 0: 1. Insert the second half of the table t0_template into t1 #
# 2. Execute the usability test include/partition_check.inc #
# 2. Execute the usability test inc/partition_check.inc #
# >0, but expected: nothing #
# >0 and unexpected: abort #
# 3. DROP the table t1 #
......@@ -20,10 +20,10 @@
# Example: #
# CREATE TABLE t1 (f_int1 INT,f_int2 INT, .... ); #
# let $alter= ALTER TABLE t1 ADD PRIMARY KEY(f_int2); #
# include/partition_alter_1.inc #
# inc/partition_alter_1.inc #
# #
# The parameters $insert_first_half and $insert_second_half #
# are also to be set outside (source ./include/partition.pre). #
# are also to be set outside (source ./inc/partition.pre). #
# #
#------------------------------------------------------------------------------#
# Original Author: mleich #
......@@ -50,13 +50,15 @@ if ($no_debug)
}
eval SET @my_errno = $mysql_errno;
let $run_test= `SELECT @my_errno = 0`;
let $unexpected_error= `SELECT @my_errno NOT IN (0,1030,1502,1506)`;
if ($unexpected_error)
if (`SELECT @my_errno NOT IN (0,$ER_GET_ERRNO,
$ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF,
$ER_DROP_PARTITION_NON_EXISTENT)`);
{
--echo # The last command got an unexepected error response.
--echo # Expected/handled SQL codes are 0,1030,1502,1506
--echo # Expected/handled SQL codes are 0,$ER_GET_ERRNO,$ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF,$ER_DROP_PARTITION_NON_EXISTENT
SELECT '# SQL code we got was: ' AS "", @my_errno AS "";
--echo # Sorry, have to abort.
--echo # Please check the error name to number mapping in inc/partition.pre.
exit;
--echo
}
......@@ -66,6 +68,5 @@ if ($run_test)
{
eval $insert_second_half;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
}
DROP TABLE t1;
--echo ---- Partitioning and binary data type
--disable_query_log
# DATA DIRECTORY
eval SET @data_dir = 'DATA DIRECTORY =
......@@ -43,6 +45,9 @@ select count(*) from t2;
select hex(a) from t2;
drop table t2;
# mleich: Several partitioning functions are no more allowed.
if (0)
{
eval create table t3 (a binary(255) not null, primary key(a)) engine=$engine
partition by range (ascii(a)) subpartition by key (a) subpartitions 4 (
partition pa16 values less than (16),
......@@ -66,6 +71,7 @@ select count(*) from t3;
select hex(a) from t3;
drop table t3;
eval create table t4 (a binary(255) not null, primary key(a)) engine=$engine
partition by list (ascii(a)) subpartition by key (a) subpartitions 4 (
partition pa16 values in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
......@@ -86,6 +92,9 @@ eval insert into t4 values (repeat(char(ascii('a')+$letter),$count+54));
dec $count;
inc $letter;
}
select count(*) from t4;
select hex(a) from t4;
drop table t4;
}
# End of tests with disallowed partitioning functions.
--echo ---- Partitioning and blob data type
--disable_query_log
# DATA DIRECTORY
eval SET @data_dir = 'DATA DIRECTORY =
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment