Commit 134d1f3e authored by unknown's avatar unknown
Browse files

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

into  c-1309e253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/mysql-5.1

parents ba02b086 11c50356
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -8,6 +8,14 @@ partition by key (a);
select count(*) from t1;
count(*)
0
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` int(11) NOT NULL,
  `b` int(11) NOT NULL,
  `c` int(11) NOT NULL,
  PRIMARY KEY  (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY (a) 
drop table t1;
CREATE TABLE t1 (
a int not null,
+34 −0
Original line number Diff line number Diff line
@@ -19,6 +19,14 @@ a b c
6	1	1
10	1	1
15	1	1
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` int(11) NOT NULL,
  `b` int(11) NOT NULL,
  `c` int(11) NOT NULL,
  PRIMARY KEY  (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) (PARTITION x1 VALUES LESS THAN (5) TABLESPACE = ts1 ENGINE = MyISAM, PARTITION x2 VALUES LESS THAN (10) TABLESPACE = ts2 ENGINE = MyISAM, PARTITION x3 VALUES LESS THAN MAXVALUE TABLESPACE = ts3 ENGINE = MyISAM)
ALTER TABLE t1
partition by range (a)
partitions 3
@@ -31,6 +39,14 @@ a b c
6	1	1
10	1	1
15	1	1
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` int(11) NOT NULL,
  `b` int(11) NOT NULL,
  `c` int(11) NOT NULL,
  PRIMARY KEY  (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) (PARTITION x1 VALUES LESS THAN (5) TABLESPACE = ts1 ENGINE = MyISAM, PARTITION x2 VALUES LESS THAN (10) TABLESPACE = ts2 ENGINE = MyISAM, PARTITION x3 VALUES LESS THAN MAXVALUE TABLESPACE = ts3 ENGINE = MyISAM)
drop table if exists t1;
CREATE TABLE t1 (
a int not null,
@@ -120,6 +136,24 @@ subpartition x22)
);
SELECT * from t1;
a	b	c
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` int(11) NOT NULL,
  `b` int(11) NOT NULL,
  `c` int(11) NOT NULL,
  PRIMARY KEY  (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) SUBPARTITION BY HASH (a+b) (PARTITION x1 VALUES LESS THAN (1)  (SUBPARTITION x11 ENGINE = MyISAM, SUBPARTITION x12 ENGINE = MyISAM), PARTITION x2 VALUES LESS THAN (5)  (SUBPARTITION x21 ENGINE = MyISAM, SUBPARTITION x22 ENGINE = MyISAM))
ALTER TABLE t1 ADD COLUMN d int;
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` int(11) NOT NULL,
  `b` int(11) NOT NULL,
  `c` int(11) NOT NULL,
  `d` int(11) default NULL,
  PRIMARY KEY  (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) SUBPARTITION BY HASH (a+b) (PARTITION x1 VALUES LESS THAN (1)  (SUBPARTITION x11 ENGINE = MyISAM, SUBPARTITION x12 ENGINE = MyISAM), PARTITION x2 VALUES LESS THAN (5)  (SUBPARTITION x21 ENGINE = MyISAM, SUBPARTITION x22 ENGINE = MyISAM))
drop table t1;
CREATE TABLE t1 (
a int not null,
+5 −0
Original line number Diff line number Diff line
@@ -23,6 +23,11 @@ partition by key (a);
#
select count(*) from t1;

#
# Test SHOW CREATE TABLE
#
show create table t1;

drop table t1;
#
# Partition by key no partition, list of fields
+6 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ INSERT into t1 values (10, 1, 1);
INSERT into t1 values (15, 1, 1);

select * from t1;
show create table t1;

ALTER TABLE t1
partition by range (a)
@@ -39,6 +40,7 @@ partitions 3
 partition x3 values less than maxvalue tablespace ts3);

select * from t1;
show create table t1;

drop table if exists t1;

@@ -143,6 +145,10 @@ subpartition by hash (a+b)
);

SELECT * from t1;
show create table t1;

ALTER TABLE t1 ADD COLUMN d int;
show create table t1;

drop table t1;

+1 −1
Original line number Diff line number Diff line
@@ -686,7 +686,7 @@ void get_full_part_id_from_key(const TABLE *table, byte *buf,
                               const key_range *key_spec,
                               part_id_range *part_spec);
bool mysql_unpack_partition(File file, THD *thd, uint part_info_len,
                            TABLE *table);
                            TABLE *table, enum db_type default_db_type);
#endif


Loading