Commit 6f3f33b5 authored by unknown's avatar unknown
Browse files

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

into mysql.com:/home/hf/work/mysql-5.1.clean

parents a848d91e 49a22151
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -343,8 +343,9 @@ enum ha_base_keytype {
#define HA_ERR_NO_CONNECTION     157  /* Could not connect to storage engine */
#define HA_ERR_NULL_IN_SPATIAL   158  /* NULLs are not supported in spatial index */
#define HA_ERR_TABLE_DEF_CHANGED 159  /* The table changed in storage engine */
#define HA_ERR_NO_PARTITION_FOUND 160  /* There's no partition in table for given value */

#define HA_ERR_LAST              159  /*Copy last error nr.*/
#define HA_ERR_LAST              160  /*Copy last error nr.*/
/* Add error numbers before HA_ERR_LAST and change it accordingly. */
#define HA_ERR_ERRORS            (HA_ERR_LAST - HA_ERR_FIRST + 1)

+34 −0
Original line number Diff line number Diff line
@@ -114,3 +114,37 @@ CREATE TABLE `t1` (
SELECT * FROM t1;
id
drop table t1;
create table t1
(a int)
partition by range (a)
( partition p0 values less than(10),
partition p1 values less than (20),
partition p2 values less than maxvalue);
alter table t1 reorganise partition p2 into (partition p2 values less than (30));
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (30) ENGINE = MyISAM)
drop table t1;
CREATE TABLE t1 (a int, b int)
PARTITION BY RANGE (a)
(PARTITION x0 VALUES LESS THAN (2),
PARTITION x1 VALUES LESS THAN (4),
PARTITION x2 VALUES LESS THAN (6),
PARTITION x3 VALUES LESS THAN (8),
PARTITION x4 VALUES LESS THAN (10),
PARTITION x5 VALUES LESS THAN (12),
PARTITION x6 VALUES LESS THAN (14),
PARTITION x7 VALUES LESS THAN (16),
PARTITION x8 VALUES LESS THAN (18),
PARTITION x9 VALUES LESS THAN (20));
ALTER TABLE t1 REORGANISE PARTITION x0,x1,x2 INTO
(PARTITION x1 VALUES LESS THAN (6));
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` int(11) default NULL,
  `b` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) (PARTITION x1 VALUES LESS THAN (6) ENGINE = MyISAM, PARTITION x3 VALUES LESS THAN (8) ENGINE = MyISAM, PARTITION x4 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION x5 VALUES LESS THAN (12) ENGINE = MyISAM, PARTITION x6 VALUES LESS THAN (14) ENGINE = MyISAM, PARTITION x7 VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION x8 VALUES LESS THAN (18) ENGINE = MyISAM, PARTITION x9 VALUES LESS THAN (20) ENGINE = MyISAM)
drop table t1;
+5 −0
Original line number Diff line number Diff line
@@ -544,3 +544,8 @@ partitions 2
partition x2 values in (5));
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '4,
partition x2 values in (5))' at line 8
CREATE TABLE t1(a int)
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;
+5 −5
Original line number Diff line number Diff line
@@ -9,16 +9,16 @@ partitions 2
partition x234 values in (4,7,8));
INSERT into t1 VALUES (1,1,1);
INSERT into t1 VALUES (2,1,1);
ERROR HY000: Got error 1 from storage engine
ERROR HY000: Table has no partition for value 2
INSERT into t1 VALUES (3,1,1);
ERROR HY000: Got error 1 from storage engine
ERROR HY000: Table has no partition for value 3
INSERT into t1 VALUES (4,1,1);
INSERT into t1 VALUES (5,1,1);
INSERT into t1 VALUES (6,1,1);
INSERT into t1 VALUES (7,1,1);
INSERT into t1 VALUES (8,1,1);
INSERT into t1 VALUES (9,1,1);
ERROR HY000: Got error 1 from storage engine
ERROR HY000: Table has no partition for value 9
INSERT into t1 VALUES (1,2,1);
INSERT into t1 VALUES (1,3,1);
INSERT into t1 VALUES (1,4,1);
@@ -137,7 +137,7 @@ a b c
7	4	1
INSERT into t1 VALUES (6,2,1);
INSERT into t1 VALUES (2,2,1);
ERROR HY000: Got error 1 from storage engine
ERROR HY000: Table has no partition for value 2
drop table t1;
CREATE TABLE t1 (
a int not null,
@@ -156,7 +156,7 @@ subpartition x22 nodegroup 1)
INSERT into t1 VALUES (1,1,1);
INSERT into t1 VALUES (4,1,1);
INSERT into t1 VALUES (7,1,1);
ERROR HY000: Got error 1 from storage engine
ERROR HY000: Table has no partition for value 7
UPDATE t1 SET a=5 WHERE a=1;
SELECT * from t1;
a	b	c
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ ALTER TABLE t1 REORGANISE PARTITION x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10 INTO
(PARTITION x11 VALUES LESS THAN (22));
ERROR HY000: More partitions to reorganise than there are partitions
ALTER TABLE t1 REORGANISE PARTITION x0,x1,x2 INTO
(PARTITION x1 VALUES LESS THAN (6));
(PARTITION x3 VALUES LESS THAN (6));
ERROR HY000: All partitions must have unique names in the table
ALTER TABLE t1 REORGANISE PARTITION x0, x2 INTO
(PARTITION x11 VALUES LESS THAN (2));
Loading