1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

BUG#48165, needed to introduce length restrictions on partitioning fields to ensure that no stack overruns occur

This commit is contained in:
Mikael Ronstrom
2009-10-28 01:11:17 +01:00
parent cc43a2089c
commit 10fed1aca0
11 changed files with 98 additions and 18 deletions

View File

@ -8,6 +8,23 @@
drop table if exists t1;
--enable_warnings
#
# BUG#48164, too long partition fields causes crash
#
--error ER_PARTITION_FIELDS_TOO_LONG
create table t1 (a varchar(1500), b varchar(1570))
partition by list column_list(a,b)
( partition p0 values in (('a','b')));
create table t1 (a varchar(1023) character set utf8 collate utf8_spanish2_ci)
partition by range column_list(a)
( partition p0 values less than ('CZ'),
partition p1 values less than ('CH'),
partition p2 values less than ('D'));
insert into t1 values ('czz'),('chi'),('ci'),('cg');
select * from t1 where a between 'cg' AND 'ci';
drop table t1;
#
# BUG#48165, sql_mode gives error
#

View File

@ -4,6 +4,7 @@
# as partition by key
# Created to verify the fix for Bug#31705
# Partitions: crash if varchar length > 65530
# BUG#48164 limited size to 3072 bytes
#
-- source include/have_partition.inc
@ -192,27 +193,29 @@ create table t1 (a set('y','n')) partition by key (a);
insert into t1 values ('y');
select * from t1 where a = 'y';
drop table t1;
create table t1 (a varchar(65531)) partition by key (a);
create table t1 (a varchar(3068)) partition by key (a);
insert into t1 values ('bbbb');
insert into t1 values ('aaaa');
select * from t1 where a = 'aaaa';
select * from t1 where a like 'aaa%';
select * from t1 where a = 'bbbb';
drop table t1;
create table t1 (a varchar(65532)) partition by key (a);
create table t1 (a varchar(3069)) partition by key (a);
insert into t1 values ('bbbb');
insert into t1 values ('aaaa');
select * from t1 where a = 'aaaa';
select * from t1 where a like 'aaa%';
select * from t1 where a = 'bbbb';
drop table t1;
create table t1 (a varchar(65533) not null) partition by key (a);
create table t1 (a varchar(3070) not null) partition by key (a);
insert into t1 values ('bbbb');
insert into t1 values ('aaaa');
select * from t1 where a = 'aaaa';
select * from t1 where a like 'aaa%';
select * from t1 where a = 'bbbb';
drop table t1;
-- error ER_PARTITION_FIELDS_TOO_LONG
create table t1 (a varchar(3070)) partition by key (a);
-- error ER_TOO_BIG_ROWSIZE
create table t1 (a varchar(65533)) partition by key (a);
-- error ER_TOO_BIG_ROWSIZE