summaryrefslogtreecommitdiff
path: root/mysql-test/r/partition.result
diff options
context:
space:
mode:
authorunknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru>2007-11-26 10:28:25 +0400
committerunknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru>2007-11-26 10:28:25 +0400
commitbc3e1ff5e0df561e554c44fa64d0d71fa0bab645 (patch)
tree5ed65ba6297b7467391d45aa8de93623c84df83a /mysql-test/r/partition.result
parentcaa031e0f76c769f044d39c4f244c8fbee71c3f0 (diff)
downloadmariadb-git-bc3e1ff5e0df561e554c44fa64d0d71fa0bab645.tar.gz
Fix for bug #29258: Partitions: search fails for maximum unsigned bigint
Problems: 1. looking for a matching partition we miss the fact that the maximum allowed value is in the PARTITION p LESS THAN MAXVALUE. 2. one can insert maximum value if numeric maximum value is the last range. (should only work if LESS THAN MAXVALUE). 3. one cannot have both numeric maximum value and MAXVALUE string as ranges (the same value, but different meanings). Fix: consider the maximum value as a supremum. mysql-test/r/partition.result: Fix for bug #29258: Partitions: search fails for maximum unsigned bigint - test result. mysql-test/t/partition.test: Fix for bug #29258: Partitions: search fails for maximum unsigned bigint - test case. sql/partition_info.cc: Fix for bug #29258: Partitions: search fails for maximum unsigned bigint - In case of PARTITION p VALUES LESS THAN MAXVALUE consider the maximium value as a supremum. sql/sql_partition.cc: Fix for bug #29258: Partitions: search fails for maximum unsigned bigint - In case of PARTITION p VALUES LESS THAN MAXVALUE consider the maximium value as a supremum.
Diffstat (limited to 'mysql-test/r/partition.result')
-rw-r--r--mysql-test/r/partition.result47
1 files changed, 47 insertions, 0 deletions
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index 2b8c79b4563..22dca8888ef 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -1297,4 +1297,51 @@ create table t1
partition by key(s1) partitions 3;
insert into t1 values (null,null);
drop table t1;
+CREATE TABLE t1 (s1 BIGINT UNSIGNED)
+PARTITION BY RANGE (s1) (
+PARTITION p0 VALUES LESS THAN (0),
+PARTITION p1 VALUES LESS THAN (1),
+PARTITION p2 VALUES LESS THAN (18446744073709551615)
+);
+INSERT INTO t1 VALUES (0), (18446744073709551614);
+INSERT INTO t1 VALUES (18446744073709551615);
+ERROR HY000: Table has no partition for value 18446744073709551615
+DROP TABLE t1;
+CREATE TABLE t1 (s1 BIGINT UNSIGNED)
+PARTITION BY RANGE (s1) (
+PARTITION p0 VALUES LESS THAN (0),
+PARTITION p1 VALUES LESS THAN (1),
+PARTITION p2 VALUES LESS THAN (18446744073709551614),
+PARTITION p3 VALUES LESS THAN MAXVALUE
+);
+INSERT INTO t1 VALUES (-1), (0), (18446744073709551613),
+(18446744073709551614), (18446744073709551615);
+Warnings:
+Warning 1264 Out of range value for column 's1' at row 1
+SELECT * FROM t1;
+s1
+0
+0
+18446744073709551613
+18446744073709551614
+18446744073709551615
+SELECT * FROM t1 WHERE s1 = 0;
+s1
+0
+0
+SELECT * FROM t1 WHERE s1 = 18446744073709551614;
+s1
+18446744073709551614
+SELECT * FROM t1 WHERE s1 = 18446744073709551615;
+s1
+18446744073709551615
+DROP TABLE t1;
+CREATE TABLE t1 (s1 BIGINT UNSIGNED)
+PARTITION BY RANGE (s1) (
+PARTITION p0 VALUES LESS THAN (0),
+PARTITION p1 VALUES LESS THAN (1),
+PARTITION p2 VALUES LESS THAN (18446744073709551615),
+PARTITION p3 VALUES LESS THAN MAXVALUE
+);
+DROP TABLE t1;
End of 5.1 tests