Commit abb6bf4b authored by unknown's avatar unknown

Merge rburnett@bk-internal.mysql.com:/home/bk/mysql-5.1-new

into  production.mysql.com:/usersnfs/rburnett/mysql-5.1-bug17173

parents 5a07a098 0c63aee7
...@@ -180,3 +180,14 @@ primary key(a,b)) ...@@ -180,3 +180,14 @@ primary key(a,b))
partition by list (a) partition by list (a)
(partition x1 values in (1,2,9,4) tablespace ts1); (partition x1 values in (1,2,9,4) tablespace ts1);
drop table t1; drop table t1;
CREATE TABLE t1 (s1 int) PARTITION BY LIST (s1)
(PARTITION p1 VALUES IN (1),
PARTITION p2 VALUES IN (2),
PARTITION p3 VALUES IN (3),
PARTITION p4 VALUES IN (4),
PARTITION p5 VALUES IN (5));
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
SELECT COUNT(*) FROM t1 WHERE s1 < 3;
COUNT(*)
2
DROP TABLE t1;
...@@ -337,3 +337,29 @@ a b c ...@@ -337,3 +337,29 @@ a b c
1 1 1 1 1 1
4 1 1 4 1 1
drop table t1; drop table t1;
CREATE TABLE t1 (c1 int default NULL, c2 varchar(30) default NULL,
c3 date default NULL) engine=myisam
PARTITION BY RANGE (year(c3)) (PARTITION p0 VALUES LESS THAN (1995),
PARTITION p1 VALUES LESS THAN (1996) , PARTITION p2 VALUES LESS THAN (1997) ,
PARTITION p3 VALUES LESS THAN (1998) , PARTITION p4 VALUES LESS THAN (1999) ,
PARTITION p5 VALUES LESS THAN (2000) , PARTITION p6 VALUES LESS THAN (2001) ,
PARTITION p7 VALUES LESS THAN (2002) , PARTITION p8 VALUES LESS THAN (2003) ,
PARTITION p9 VALUES LESS THAN (2004) , PARTITION p10 VALUES LESS THAN (2010),
PARTITION p11 VALUES LESS THAN MAXVALUE );
INSERT INTO t1 VALUES (1, 'testing partitions', '1995-07-17'),
(3, 'testing partitions','1995-07-31'),
(5, 'testing partitions','1995-08-13'),
(7, 'testing partitions','1995-08-26'),
(9, 'testing partitions','1995-09-09'),
(0, 'testing partitions','2000-07-10'),
(2, 'testing partitions','2000-07-23'),
(4, 'testing partitions','2000-08-05'),
(6, 'testing partitions','2000-08-19'),
(8, 'testing partitions','2000-09-01');
SELECT COUNT(*) FROM t1 WHERE c3 BETWEEN '1996-12-31' AND '2000-12-31';
COUNT(*)
5
SELECT COUNT(*) FROM t1 WHERE c3 < '2000-12-31';
COUNT(*)
10
DROP TABLE t1;
...@@ -110,3 +110,17 @@ partition by list (a) ...@@ -110,3 +110,17 @@ partition by list (a)
(partition x1 values in (1,2,9,4) tablespace ts1); (partition x1 values in (1,2,9,4) tablespace ts1);
drop table t1; drop table t1;
#
#Bug #17173 Partitions: less-than search fails
#
CREATE TABLE t1 (s1 int) PARTITION BY LIST (s1)
(PARTITION p1 VALUES IN (1),
PARTITION p2 VALUES IN (2),
PARTITION p3 VALUES IN (3),
PARTITION p4 VALUES IN (4),
PARTITION p5 VALUES IN (5));
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
SELECT COUNT(*) FROM t1 WHERE s1 < 3;
DROP TABLE t1;
...@@ -361,3 +361,30 @@ subpartition by hash (a+b) ...@@ -361,3 +361,30 @@ subpartition by hash (a+b)
SELECT * from t1; SELECT * from t1;
drop table t1; drop table t1;
#
# Bug #17894 Comparison with "less than" operator fails with Range partition
#
CREATE TABLE t1 (c1 int default NULL, c2 varchar(30) default NULL,
c3 date default NULL) engine=myisam
PARTITION BY RANGE (year(c3)) (PARTITION p0 VALUES LESS THAN (1995),
PARTITION p1 VALUES LESS THAN (1996) , PARTITION p2 VALUES LESS THAN (1997) ,
PARTITION p3 VALUES LESS THAN (1998) , PARTITION p4 VALUES LESS THAN (1999) ,
PARTITION p5 VALUES LESS THAN (2000) , PARTITION p6 VALUES LESS THAN (2001) ,
PARTITION p7 VALUES LESS THAN (2002) , PARTITION p8 VALUES LESS THAN (2003) ,
PARTITION p9 VALUES LESS THAN (2004) , PARTITION p10 VALUES LESS THAN (2010),
PARTITION p11 VALUES LESS THAN MAXVALUE );
INSERT INTO t1 VALUES (1, 'testing partitions', '1995-07-17'),
(3, 'testing partitions','1995-07-31'),
(5, 'testing partitions','1995-08-13'),
(7, 'testing partitions','1995-08-26'),
(9, 'testing partitions','1995-09-09'),
(0, 'testing partitions','2000-07-10'),
(2, 'testing partitions','2000-07-23'),
(4, 'testing partitions','2000-08-05'),
(6, 'testing partitions','2000-08-19'),
(8, 'testing partitions','2000-09-01');
SELECT COUNT(*) FROM t1 WHERE c3 BETWEEN '1996-12-31' AND '2000-12-31';
SELECT COUNT(*) FROM t1 WHERE c3 < '2000-12-31';
DROP TABLE t1;
...@@ -2430,6 +2430,7 @@ void store_key_image_to_rec(Field *field, char *ptr, uint len) ...@@ -2430,6 +2430,7 @@ void store_key_image_to_rec(Field *field, char *ptr, uint len)
field->set_null(); field->set_null();
return; return;
} }
field->set_notnull();
ptr++; ptr++;
} }
field->set_key_image(ptr, len); field->set_key_image(ptr, len);
......
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