List:Internals« Previous MessageNext Message »
From:tomas Date:September 14 2005 5:30pm
Subject:bk commit into 5.1 tree (tulin:1.1890) BUG#13179
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of ndbdev. When ndbdev does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.1890 05/09/14 17:30:23 tulin@stripped +8 -0
  Bug #13179 partition info in mysqldump makes it hard to use dump in different sized
cluster

  sql/sql_table.cc
    1.270 05/09/14 17:29:29 tulin@stripped +3 -3
    Bug #13179 partition info in mysqldump makes it hard to use dump in different sized
cluster

  sql/sql_show.cc
    1.267 05/09/14 17:29:29 tulin@stripped +2 -2
    Bug #13179 partition info in mysqldump makes it hard to use dump in different sized
cluster

  sql/sql_partition.cc
    1.6 05/09/14 17:29:29 tulin@stripped +8 -1
    Bug #13179 partition info in mysqldump makes it hard to use dump in different sized
cluster

  sql/handler.h
    1.158 05/09/14 17:29:29 tulin@stripped +2 -1
    Bug #13179 partition info in mysqldump makes it hard to use dump in different sized
cluster

  mysql-test/t/ndb_partition_range.test
    1.2 05/09/14 17:29:29 tulin@stripped +6 -0
    Bug #13179 partition info in mysqldump makes it hard to use dump in different sized
cluster

  mysql-test/t/ndb_partition_key.test
    1.5 05/09/14 17:29:29 tulin@stripped +7 -0
    Bug #13179 partition info in mysqldump makes it hard to use dump in different sized
cluster

  mysql-test/r/ndb_partition_range.result
    1.2 05/09/14 17:29:29 tulin@stripped +9 -0
    Bug #13179 partition info in mysqldump makes it hard to use dump in different sized
cluster

  mysql-test/r/ndb_partition_key.result
    1.3 05/09/14 17:29:29 tulin@stripped +9 -0
    Bug #13179 partition info in mysqldump makes it hard to use dump in different sized
cluster

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	tulin
# Host:	dl145c.mysql.com
# Root:	/home/ndbdev/tomas/mysql-5.1

--- 1.157/sql/handler.h	Wed Sep 14 09:39:44 2005
+++ 1.158/sql/handler.h	Wed Sep 14 17:29:29 2005
@@ -675,7 +675,8 @@
                           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,

--- 1.266/sql/sql_show.cc	Wed Sep 14 13:34:08 2005
+++ 1.267/sql/sql_show.cc	Wed Sep 14 17:29:29 2005
@@ -961,7 +961,7 @@
   packet->append("\n)", 2);
   if (!(thd->variables.sql_mode & MODE_NO_TABLE_OPTIONS) &&
!foreign_db_mode)
   {
-#ifdef HAVE_PARTITION_DB
+#if 0 //def HAVE_PARTITION_DB
     if (!table->s->part_info)
 #endif
     {
@@ -1047,7 +1047,7 @@
     if (table->s->part_info &&
         ((part_syntax= generate_partition_syntax(table->s->part_info,
                                                   &part_syntax_len,
-                                                  FALSE))))
+                                                  FALSE,FALSE))))
     {
        packet->append(part_syntax, part_syntax_len);
        my_free(part_syntax, MYF(0));

--- 1.269/sql/sql_table.cc	Wed Sep 14 09:39:45 2005
+++ 1.270/sql/sql_table.cc	Wed Sep 14 17:29:29 2005
@@ -1629,7 +1629,7 @@
     */
     if (!(part_syntax_buf= generate_partition_syntax(part_info,
                                                      &syntax_len,
-                                                     TRUE)))
+                                                     TRUE,TRUE)))
       DBUG_RETURN(TRUE);
     part_info->part_info_string= part_syntax_buf;
     part_info->part_info_len= syntax_len;
@@ -4274,7 +4274,7 @@
                           /*select_field_count*/ 0);
       if (!(part_syntax_buf= generate_partition_syntax(part_info,
                                                        &syntax_len,
-                                                       TRUE)))
+                                                       TRUE,TRUE)))
       {
         DBUG_RETURN(TRUE);
       }
@@ -4310,7 +4310,7 @@
       }
       if (!(part_syntax_buf= generate_partition_syntax(part_info,
                                                        &syntax_len,
-                                                       TRUE)))
+                                                       TRUE,TRUE)))
       {
         DBUG_RETURN(TRUE);
       }

--- 1.2/mysql-test/r/ndb_partition_key.result	Tue Jul 26 16:15:22 2005
+++ 1.3/mysql-test/r/ndb_partition_key.result	Wed Sep 14 17:29:29 2005
@@ -68,4 +68,13 @@
 
 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;

--- 1.1/mysql-test/r/ndb_partition_range.result	Mon Jul 18 13:30:28 2005
+++ 1.2/mysql-test/r/ndb_partition_range.result	Wed Sep 14 17:29:29 2005
@@ -102,4 +102,13 @@
 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;

--- 1.4/mysql-test/t/ndb_partition_key.test	Mon Aug  8 22:21:37 2005
+++ 1.5/mysql-test/t/ndb_partition_key.test	Wed Sep 14 17:29:29 2005
@@ -55,4 +55,11 @@
 # 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;

--- 1.1/mysql-test/t/ndb_partition_range.test	Mon Jul 18 13:30:33 2005
+++ 1.2/mysql-test/t/ndb_partition_range.test	Wed Sep 14 17:29:29 2005
@@ -82,5 +82,11 @@
 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;
 

--- 1.5/sql/sql_partition.cc	Sat Aug 27 03:11:52 2005
+++ 1.6/sql/sql_partition.cc	Wed Sep 14 17:29:29 2005
@@ -1961,6 +1961,7 @@
     buf_length                 A pointer to the returned buffer length
     use_sql_alloc              Allocate buffer from sql_alloc if true
                                otherwise use my_malloc
+    add_default_info           Add info generated by default
   RETURN VALUES
     NULL error
     buf, buf_length            Buffer and its length
@@ -1986,7 +1987,8 @@
 
 char *generate_partition_syntax(partition_info *part_info,
                                 uint *buf_length,
-                                bool use_sql_alloc)
+                                bool use_sql_alloc,
+				bool add_default_info)
 {
   uint i,j, no_parts, no_subparts;
   partition_element *part_elem;
@@ -2013,9 +2015,11 @@
   switch (part_info->part_type)
   {
     case RANGE_PARTITION:
+      add_default_info= TRUE;
       err+= add_part_key_word(fptr, range_str);
       break;
     case LIST_PARTITION:
+      add_default_info= TRUE;
       err+= add_part_key_word(fptr, list_str);
       break;
     case HASH_PARTITION:
@@ -2051,6 +2055,8 @@
     err+= add_end_parenthesis(fptr);
     err+= add_space(fptr);
   }
+  if (add_default_info)
+  {
   err+= add_begin_parenthesis(fptr);
   List_iterator<partition_element> part_it(part_info->partitions);
   no_parts= part_info->no_parts;
@@ -2095,6 +2101,7 @@
     else
       err+= add_end_parenthesis(fptr);
   } while (++i < no_parts);
+  }
   if (err)
     goto close_file;
   buffer_length= my_seek(fptr, 0L,MY_SEEK_END,MYF(0));
Thread
bk commit into 5.1 tree (tulin:1.1890) BUG#13179tomas14 Sep