List:Commits« Previous MessageNext Message »
From:reggie Date:February 21 2006 11:40pm
Subject:bk commit into 5.1 tree (reggie:1.2155) BUG#15408
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of reggie. When reggie 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.2155 06/02/21 17:40:07 reggie@stripped +10 -0
  BUG #15408 - Partitions: subpartition names are not unique

  win/cmakefiles/sql
    1.6 06/02/21 17:39:57 reggie@stripped +1 -1
    changed name to partition_info.cc

  sql/sql_partition.h
    1.4 06/02/21 17:39:57 reggie@stripped +1 -1
    updated copyright date

  sql/sql_partition.cc
    1.40 06/02/21 17:39:57 reggie@stripped +4 -4
    updated file comment and fixed some spacing

  sql/partition_info.h
    1.2 06/02/21 17:39:57 reggie@stripped +1 -1
    updated copyright date

  sql/partition_info.cc
    1.4 06/02/21 17:39:57 reggie@stripped +23 -31
    minor corrections as a result of review

  sql/partition_element.h
    1.2 06/02/21 17:39:56 reggie@stripped +1 -1
    updated copyright date

  sql/Makefile.am
    1.132 06/02/21 17:39:56 reggie@stripped +3 -3
    reformatted a bit
    changed name of partition_info.cpp to partition_info.cc

  mysql-test/t/partition_mgm_err.test
    1.10 06/02/21 17:39:56 reggie@stripped +1 -0
    added drop table for previous test

  mysql-test/r/partition_mgm_err.result
    1.10 06/02/21 17:39:56 reggie@stripped +1 -0
    added drop table for previous test

  libmysqld/Makefile.am
    1.80 06/02/21 17:39:56 reggie@stripped +1 -1
    changed name to partition_info.cc

  sql/partition_info.cc
    1.3 06/02/21 14:09:48 reggie@stripped +0 -0
    Rename: sql/partition_info.cpp -> sql/partition_info.cc

# 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:	reggie
# Host:	linux.site
# Root:	/home/reggie/work/mysql-5.1-bug15408

--- 1.131/sql/Makefile.am	2006-02-16 12:01:07 -06:00
+++ 1.132/sql/Makefile.am	2006-02-21 17:39:56 -06:00
@@ -65,8 +65,8 @@
 			sp_head.h sp_pcontext.h sp_rcontext.h sp.h sp_cache.h \
 			parse_file.h sql_view.h	sql_trigger.h \
 			sql_array.h sql_cursor.h event.h event_priv.h \
-			sql_plugin.h authors.h sql_partition.h partition_info.h \
-			partition_element.h
+			sql_plugin.h authors.h sql_partition.h \
+                        partition_info.h partition_element.h
 mysqld_SOURCES =	sql_lex.cc sql_handler.cc sql_partition.cc \
 			item.cc item_sum.cc item_buff.cc item_func.cc \
 			item_cmpfunc.cc item_strfunc.cc item_timefunc.cc \
@@ -102,7 +102,7 @@
 			sp_cache.cc parse_file.cc sql_trigger.cc \
                         event_executor.cc event.cc event_timed.cc \
 			sql_plugin.cc sql_binlog.cc \
-			handlerton.cc sql_tablespace.cc partition_info.cpp
+			handlerton.cc sql_tablespace.cc partition_info.cc
 EXTRA_mysqld_SOURCES =	ha_innodb.cc ha_berkeley.cc ha_archive.cc \
 			ha_innodb.h  ha_berkeley.h  ha_archive.h \
 			ha_blackhole.cc ha_federated.cc ha_ndbcluster.cc \

--- 1.79/libmysqld/Makefile.am	2006-02-16 15:02:35 -06:00
+++ 1.80/libmysqld/Makefile.am	2006-02-21 17:39:56 -06:00
@@ -67,7 +67,7 @@
         event_executor.cc event.cc event_timed.cc \
         rpl_filter.cc sql_partition.cc handlerton.cc sql_plugin.cc \
         sql_tablespace.cc \
-        rpl_injector.cc my_user.c partition_info.cpp
+        rpl_injector.cc my_user.c partition_info.cc
 
 libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources)
 EXTRA_libmysqld_a_SOURCES =	ha_innodb.cc ha_berkeley.cc ha_archive.cc \

--- 1.39/sql/sql_partition.cc	2006-02-16 15:02:36 -06:00
+++ 1.40/sql/sql_partition.cc	2006-02-21 17:39:57 -06:00
@@ -15,10 +15,10 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 /*
-  This file was introduced as a container for general functionality related
+  This file is a container for general functionality related
   to partitioning introduced in MySQL version 5.1. It contains functionality
-  used by all handlers that support partitioning, which in the first version
-  is the partitioning handler itself and the NDB handler.
+  used by all handlers that support partitioning, such as
+  the partitioning handler itself and the NDB handler.
 
   The first version was written by Mikael Ronstrom.
 
@@ -26,7 +26,7 @@
   partitioning and composite partitioning (hereafter called subpartitioning)
   where each RANGE/LIST partitioning is HASH partitioned. The hash function
   can either be supplied by the user or by only a list of fields (also
-  called KEY partitioning, where the MySQL server will use an internal
+  called KEY partitioning), where the MySQL server will use an internal
   hash function.
   There are quite a few defaults that can be used as well.
 */

--- 1.9/mysql-test/r/partition_mgm_err.result	2006-02-16 10:38:19 -06:00
+++ 1.10/mysql-test/r/partition_mgm_err.result	2006-02-21 17:39:56 -06:00
@@ -142,6 +142,7 @@
 DROP TABLE t1;
 CREATE TABLE t1 (a INT) PARTITION BY HASH(a);
 ALTER TABLE t1 ADD PARTITION PARTITIONS 4;
+DROP TABLE t1;
 CREATE TABLE t1 (s1 int, s2 int) PARTITION BY LIST (s1)  (
 PARTITION p1 VALUES IN (0) (SUBPARTITION p1b), 
 PARTITION p2 VALUES IN (2) (SUBPARTITION p1b)

--- 1.9/mysql-test/t/partition_mgm_err.test	2006-02-16 10:38:19 -06:00
+++ 1.10/mysql-test/t/partition_mgm_err.test	2006-02-21 17:39:56 -06:00
@@ -216,6 +216,7 @@
 #
 CREATE TABLE t1 (a INT) PARTITION BY HASH(a);
 ALTER TABLE t1 ADD PARTITION PARTITIONS 4;
+DROP TABLE t1;
 
 #
 #BUG 15408: Partitions: subpartition names are not unique

--- 1.1/sql/partition_element.h	2006-02-16 10:38:24 -06:00
+++ 1.2/sql/partition_element.h	2006-02-21 17:39:56 -06:00
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+/* Copyright (C) 2000,200666666 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by

--- 1.2/sql/partition_info.cpp	2006-02-16 12:01:07 -06:00
+++ 1.4/sql/partition_info.cc	2006-02-21 17:39:57 -06:00
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB
+/* Copyright (C) 2006 MySQL AB
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -14,23 +14,6 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
-/*
-  This file was introduced as a container for general functionality related
-  to partitioning introduced in MySQL version 5.1. It contains functionality
-  used by all handlers that support partitioning, which in the first version
-  is the partitioning handler itself and the NDB handler.
-
-  The first version was written by Mikael Ronstrom.
-
-  This version supports RANGE partitioning, LIST partitioning, HASH
-  partitioning and composite partitioning (hereafter called subpartitioning)
-  where each RANGE/LIST partitioning is HASH partitioned. The hash function
-  can either be supplied by the user or by only a list of fields (also
-  called KEY partitioning, where the MySQL server will use an internal
-  hash function.
-  There are quite a few defaults that can be used as well.
-*/
-
 /* Some general useful functions */
 
 #include "mysql_priv.h"
@@ -164,6 +147,7 @@
   DBUG_RETURN(result);
 }
 
+
 /*
   Set up all the default subpartitions not set-up by the user in the SQL
   statement. Also perform a number of checks that the default partitioning
@@ -235,6 +219,7 @@
   DBUG_RETURN(result);
 }
 
+
 /*
   Support routine for check_partition_info
 
@@ -272,6 +257,7 @@
   DBUG_RETURN(FALSE);
 }
 
+
 /*
   A support function to check if a partition element's name is unique
   
@@ -283,6 +269,7 @@
     TRUE               Has unique name
     FALSE              Doesn't
 */
+
 bool partition_info::has_unique_name(partition_element *element)
 {
   DBUG_ENTER("partition_info::has_unique_name");
@@ -297,14 +284,16 @@
                         name_to_check)) && el != element)
         DBUG_RETURN(FALSE);
 
-    if (el->subpartitions.is_empty()) continue;
-    List_iterator<partition_element> subparts_it(el->subpartitions);
-    partition_element *sub_el;
-    while (sub_el= (subparts_it++))
+    if (!el->subpartitions.is_empty()) 
     {
-      if (!(my_strcasecmp(system_charset_info, sub_el->partition_name, 
-                          name_to_check)) && sub_el != element)
-          DBUG_RETURN(FALSE);
+      partition_element *sub_el;    
+      List_iterator<partition_element> subparts_it(el->subpartitions);
+      while (sub_el= (subparts_it++))
+      {
+        if (!(my_strcasecmp(system_charset_info, sub_el->partition_name, 
+                            name_to_check)) && sub_el != element)
+            DBUG_RETURN(FALSE);
+      }
     }
   } 
   DBUG_RETURN(TRUE);
@@ -326,6 +315,7 @@
     Checks that the list of names in the partitions doesn't contain any
     duplicated names.
 */
+
 char *partition_info::has_unique_names()
 {
   DBUG_ENTER("partition_info::has_unique_names");
@@ -338,13 +328,15 @@
     if (! has_unique_name(el))
       DBUG_RETURN(el->partition_name);
       
-    if (el->subpartitions.is_empty()) continue;
-    List_iterator<partition_element> subparts_it(el->subpartitions);
-    partition_element *subel;
-    while (subel= (subparts_it++))
+    if (!el->subpartitions.is_empty())
     {
-      if (! has_unique_name(subel))
-        DBUG_RETURN(subel->partition_name);
+      List_iterator<partition_element> subparts_it(el->subpartitions);
+      partition_element *subel;
+      while (subel= (subparts_it++))
+      {
+        if (! has_unique_name(subel))
+          DBUG_RETURN(subel->partition_name);
+      }
     }
   } 
   DBUG_RETURN(NULL);

--- 1.1/sql/partition_info.h	2006-02-16 10:38:24 -06:00
+++ 1.2/sql/partition_info.h	2006-02-21 17:39:57 -06:00
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+/* Copyright (C) 2000,2006 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by

--- 1.3/sql/sql_partition.h	2006-02-16 12:03:31 -06:00
+++ 1.4/sql/sql_partition.h	2006-02-21 17:39:57 -06:00
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB
+/* Copyright (C) 2006 MySQL AB
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by

--- 1.5/win/cmakefiles/sql	2006-02-16 10:38:23 -06:00
+++ 1.6/win/cmakefiles/sql	2006-02-21 17:39:57 -06:00
@@ -40,7 +40,7 @@
 					  sql_state.c sql_string.cc sql_table.cc sql_test.cc sql_trigger.cc sql_udf.cc sql_union.cc
 					  sql_update.cc sql_view.cc sql_yacc.h sql_yacc.cc strfunc.cc table.cc thr_malloc.cc time.cc tztime.cc
 					  uniques.cc unireg.cc item_xmlfunc.cc rpl_tblmap.cc sql_binlog.cc event_executor.cc
-					  event_timed.cc sql_tablespace.cc event.cc ../sql-common/my_user.c partition_info.cpp
+					  event_timed.cc sql_tablespace.cc event.cc ../sql-common/my_user.c partition_info.cc
 					  ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
   					  ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
 					  ${PROJECT_SOURCE_DIR}/include/mysqld_error.h
Thread
bk commit into 5.1 tree (reggie:1.2155) BUG#15408reggie22 Feb