Commit 4ab6caf6 authored by unknown's avatar unknown
Browse files

Bug #13179 partition info in mysqldump makes it hard to use dump in different sized cluster

parent b165734a
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -68,4 +68,13 @@ PRIMARY KEY(a, b, c) - UniqueHashIndex

NDBT_ProgramExit: 0 - OK

show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` int(11) NOT NULL default '0',
  `b` char(10) character set latin1 collate latin1_bin NOT NULL default '',
  `c` int(11) NOT NULL default '0',
  `d` int(11) default NULL,
  PRIMARY KEY  USING HASH (`a`,`b`,`c`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY (b) 
DROP TABLE t1;
+9 −0
Original line number Diff line number Diff line
@@ -102,4 +102,13 @@ a b c
1	1	1
DELETE from t1 WHERE b = 6;
DELETE from t1 WHERE a = 6;
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  (`b`),
  UNIQUE KEY `a` (`a`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (b) (PARTITION x1 VALUES LESS THAN (5) ENGINE = NDBCLUSTER, PARTITION x2 VALUES LESS THAN (10) ENGINE = NDBCLUSTER, PARTITION x3 VALUES LESS THAN (20) ENGINE = NDBCLUSTER)
drop table t1;
+7 −0
Original line number Diff line number Diff line
@@ -55,4 +55,11 @@ insert into t1 values (1,"a",1,1),(2,"a",1,1),(3,"a",1,1);
# should show only one attribute with DISTRIBUTION KEY
--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | sed 's/Version: [0-9]*//' | sed 's/\(Length of frm data: \)[0-9]*/\1#/'

#
# Test that explicit partition info is not shown in show create table
# result should not contain (PARTITION P0 ... etc) since this is what shows up in
# mysqldump, and we don't want that info there
#
show create table t1;

DROP TABLE t1;
+6 −0
Original line number Diff line number Diff line
@@ -82,5 +82,11 @@ select * from t1 where a=1 and b in (1,6,10,21) order by b;
DELETE from t1 WHERE b = 6;
DELETE from t1 WHERE a = 6;

#
# Test that explicit partition info _is_ shown in show create table
# result _should_ contain (PARTITION x1 ... etc)
#
show create table t1;

drop table t1;
+2 −1
Original line number Diff line number Diff line
@@ -675,7 +675,8 @@ bool check_partition_info(partition_info *part_info,enum db_type eng_type,
                          handler *file, ulonglong max_rows);
bool fix_partition_func(THD *thd, const char *name, TABLE *table);
char *generate_partition_syntax(partition_info *part_info,
                                uint *buf_length, bool use_sql_alloc);
                                uint *buf_length, bool use_sql_alloc,
                                bool add_default_info);
bool partition_key_modified(TABLE *table, List<Item> &fields);
void get_partition_set(const TABLE *table, byte *buf, const uint index,
                       const key_range *key_spec,
Loading