summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <mikael@c-0409e253.1238-1-64736c10.cust.bredbandsbolaget.se>2006-06-14 09:12:07 -0400
committerunknown <mikael@c-0409e253.1238-1-64736c10.cust.bredbandsbolaget.se>2006-06-14 09:12:07 -0400
commite6170de4c01edaf6a39bd94d84be935f228332dc (patch)
tree827438a688b1352593deb848a80ecd9f5c6f17b5 /mysql-test
parent2ecd916de6f0daebb22f79cd6f0ad09f581c2aec (diff)
parent6e9bdcc9e91db27ca37535f7d4989d08727d1902 (diff)
downloadmariadb-git-e6170de4c01edaf6a39bd94d84be935f228332dc.tar.gz
Merge c-0409e253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/clean-mysql-5.1
into c-0409e253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/bug16002 sql/ha_ndbcluster.cc: Auto merged sql/sql_partition.h: Auto merged sql/sql_show.cc: Auto merged sql/sql_yacc.yy: Auto merged mysql-test/r/partition.result: manual merge mysql-test/r/partition_error.result: manual merge mysql-test/r/partition_range.result: manual merge mysql-test/t/partition.test: manual merge mysql-test/t/partition_error.test: manual merge mysql-test/t/partition_range.test: manual merge sql/ha_partition.cc: manual merge sql/partition_element.h: manual merge sql/partition_info.cc: manual merge sql/partition_info.h: manual merge sql/share/errmsg.txt: manual merge sql/sql_partition.cc: manual merge sql/sql_table.cc: manual merge sql/table.cc: manual merge
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/partition.result38
-rw-r--r--mysql-test/r/partition_error.result4
-rw-r--r--mysql-test/r/partition_range.result26
-rw-r--r--mysql-test/t/partition.test46
-rw-r--r--mysql-test/t/partition_error.test4
-rw-r--r--mysql-test/t/partition_range.test24
6 files changed, 142 insertions, 0 deletions
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index 025d9f46412..a81c7043041 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -1,4 +1,32 @@
drop table if exists t1;
+create table t1 (a bigint)
+partition by range (a)
+(partition p0 values less than (0xFFFFFFFFFFFFFFFF),
+partition p1 values less than (10));
+ERROR 42000: VALUES value must be of same type as partition function near '),
+partition p1 values less than (10))' at line 3
+create table t1 (a bigint)
+partition by list (a)
+(partition p0 values in (0xFFFFFFFFFFFFFFFF),
+partition p1 values in (10));
+ERROR 42000: VALUES value must be of same type as partition function near '),
+partition p1 values in (10))' at line 3
+create table t1 (a bigint unsigned)
+partition by range (a)
+(partition p0 values less than (100),
+partition p1 values less than MAXVALUE);
+insert into t1 values (1);
+drop table t1;
+create table t1 (a bigint unsigned)
+partition by hash (a);
+insert into t1 values (0xFFFFFFFFFFFFFFFD);
+insert into t1 values (0xFFFFFFFFFFFFFFFE);
+select * from t1 where (a + 1) < 10;
+a
+select * from t1 where (a + 1) > 10;
+a
+18446744073709551613
+18446744073709551614
create table t1 (a int)
engine = csv
partition by list (a)
@@ -865,6 +893,16 @@ SHOW TABLE STATUS;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MyISAM 10 Dynamic 0 0 0 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
DROP TABLE t1;
+create table t1 (a bigint unsigned)
+partition by list (a)
+(partition p0 values in (0-1));
+ERROR HY000: Partition constant is out of partition function domain
+create table t1 (a bigint unsigned)
+partition by range (a)
+(partition p0 values less than (10));
+insert into t1 values (0xFFFFFFFFFFFFFFFF);
+ERROR HY000: Table has no partition for value 18446744073709551615
+drop table t1;
create table t1 (a int)
partition by list (a)
(partition `s1 s2` values in (0));
diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result
index a7ca3d9b2fa..0ab65f669ac 100644
--- a/mysql-test/r/partition_error.result
+++ b/mysql-test/r/partition_error.result
@@ -554,6 +554,10 @@ PARTITION BY RANGE (a) (PARTITION p1 VALUES LESS THAN(5));
insert into t1 values (10);
ERROR HY000: Table has no partition for value 10
drop table t1;
+create table t1 (a bigint unsigned)
+partition by range (a)
+(partition p0 values less than (-1));
+ERROR HY000: Partition constant is out of partition function domain
create table t1 (v varchar(12))
partition by range (ascii(v))
(partition p0 values less than (10));
diff --git a/mysql-test/r/partition_range.result b/mysql-test/r/partition_range.result
index 518d3a8e1d4..ff17abe0ffb 100644
--- a/mysql-test/r/partition_range.result
+++ b/mysql-test/r/partition_range.result
@@ -363,6 +363,32 @@ SELECT COUNT(*) FROM t1 WHERE c3 < '2000-12-31';
COUNT(*)
10
DROP TABLE t1;
+create table t1 (a bigint unsigned)
+partition by range (a)
+(partition p0 values less than (10),
+partition p1 values less than (0));
+ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition
+create table t1 (a bigint unsigned)
+partition by range (a)
+(partition p0 values less than (0),
+partition p1 values less than (10));
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` bigint(20) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM)
+drop table t1;
+create table t1 (a bigint unsigned)
+partition by range (a)
+(partition p0 values less than (2),
+partition p1 values less than (10));
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` bigint(20) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (2) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM)
+insert into t1 values (0xFFFFFFFFFFFFFFFF);
+ERROR HY000: Table has no partition for value 18446744073709551615
create table t1 (a int)
partition by range (MOD(a,3))
subpartition by hash(a)
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index a7f2e1c0b3e..f893d6e704c 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -10,6 +10,34 @@ drop table if exists t1;
--enable_warnings
#
+# BUG 16002: Handle unsigned integer functions properly
+#
+--error 1064
+create table t1 (a bigint)
+partition by range (a)
+(partition p0 values less than (0xFFFFFFFFFFFFFFFF),
+ partition p1 values less than (10));
+--error 1064
+create table t1 (a bigint)
+partition by list (a)
+(partition p0 values in (0xFFFFFFFFFFFFFFFF),
+ partition p1 values in (10));
+
+create table t1 (a bigint unsigned)
+partition by range (a)
+(partition p0 values less than (100),
+ partition p1 values less than MAXVALUE);
+insert into t1 values (1);
+drop table t1;
+
+create table t1 (a bigint unsigned)
+partition by hash (a);
+insert into t1 values (0xFFFFFFFFFFFFFFFD);
+insert into t1 values (0xFFFFFFFFFFFFFFFE);
+select * from t1 where (a + 1) < 10;
+select * from t1 where (a + 1) > 10;
+
+#
# Bug 19307: CSV engine crashes
#
--error ER_PARTITION_MERGE_ERROR
@@ -19,6 +47,7 @@ partition by list (a)
(partition p0 values in (null));
#
+# Added test case
#
create table t1 (a int)
partition by key(a)
@@ -986,6 +1015,23 @@ SHOW TABLE STATUS;
DROP TABLE t1;
#
+#BUG 16002 Erroneus handling of unsigned partition functions
+#
+--error ER_PARTITION_CONST_DOMAIN_ERROR
+create table t1 (a bigint unsigned)
+partition by list (a)
+(partition p0 values in (0-1));
+
+create table t1 (a bigint unsigned)
+partition by range (a)
+(partition p0 values less than (10));
+
+--error ER_NO_PARTITION_FOR_GIVEN_VALUE
+insert into t1 values (0xFFFFFFFFFFFFFFFF);
+
+drop table t1;
+
+#
#BUG 18750 Problems with partition names
#
create table t1 (a int)
diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test
index 659f0b8cef4..19e43372670 100644
--- a/mysql-test/t/partition_error.test
+++ b/mysql-test/t/partition_error.test
@@ -748,6 +748,10 @@ CREATE TABLE t1(a int)
insert into t1 values (10);
drop table t1;
+--error ER_PARTITION_CONST_DOMAIN_ERROR
+create table t1 (a bigint unsigned)
+partition by range (a)
+(partition p0 values less than (-1));
#
# Bug 18198 Partitions: Verify that erroneus partition functions doesn't work
#
diff --git a/mysql-test/t/partition_range.test b/mysql-test/t/partition_range.test
index 42ce4e0d879..5c1c17dc511 100644
--- a/mysql-test/t/partition_range.test
+++ b/mysql-test/t/partition_range.test
@@ -389,6 +389,30 @@ SELECT COUNT(*) FROM t1 WHERE c3 < '2000-12-31';
DROP TABLE t1;
#
+# BUG 16002: Unsigned partition functions not handled correctly
+#
+--error ER_RANGE_NOT_INCREASING_ERROR
+create table t1 (a bigint unsigned)
+partition by range (a)
+(partition p0 values less than (10),
+ partition p1 values less than (0));
+
+create table t1 (a bigint unsigned)
+partition by range (a)
+(partition p0 values less than (0),
+ partition p1 values less than (10));
+show create table t1;
+drop table t1;
+
+create table t1 (a bigint unsigned)
+partition by range (a)
+(partition p0 values less than (2),
+ partition p1 values less than (10));
+show create table t1;
+--error ER_NO_PARTITION_FOR_GIVEN_VALUE
+insert into t1 values (0xFFFFFFFFFFFFFFFF);
+
+#
# BUG 18962 Errors in DROP PARTITION
#
create table t1 (a int)