List:Commits« Previous MessageNext Message »
From:Mikael Date:March 14 2006 10:32am
Subject:bk commit into 5.1 tree (mikael:1.2178)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of mikael. When mikael 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.2178 06/03/14 02:32:46 mikael@zim.(none) +4 -0
  Merge mronstrom@stripped:/home/bk/mysql-5.1-new
  into  zim.(none):/home/mikael/bug17127

  mysql-test/t/partition.test
    1.23 06/03/14 02:32:41 mikael@zim.(none) +0 -0
    manual merge

  mysql-test/r/partition.result
    1.20 06/03/14 02:32:41 mikael@zim.(none) +4 -1
    manual merge

  sql/sql_yacc.yy
    1.478 06/03/14 01:44:53 mikael@zim.(none) +0 -0
    Auto merged

  sql/sql_partition.cc
    1.47 06/03/14 01:44:52 mikael@zim.(none) +0 -0
    Auto merged

# 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:	mikael
# Host:	zim.(none)
# Root:	/home/mikael/bug17127/RESYNC

--- 1.477/sql/sql_yacc.yy	2006-03-10 01:40:57 -08:00
+++ 1.478/sql/sql_yacc.yy	2006-03-14 01:44:53 -08:00
@@ -6348,9 +6348,19 @@
 	| SUBSTRING_INDEX '(' expr ',' expr ',' expr ')'
 	  { $$= new Item_func_substr_index($3,$5,$7); }
 	| SYSDATE optional_braces
-	  { $$= new Item_func_sysdate_local(); Lex->safe_to_cache_query=0;}
+          {
+            if (global_system_variables.sysdate_is_now == 0)
+              $$= new Item_func_sysdate_local();
+            else $$= new Item_func_now_local();
+            Lex->safe_to_cache_query=0;
+          }
 	| SYSDATE '(' expr ')'
-	  { $$= new Item_func_sysdate_local($3); Lex->safe_to_cache_query=0;}
+          {
+            if (global_system_variables.sysdate_is_now == 0)
+              $$= new Item_func_sysdate_local($3);
+            else $$= new Item_func_now_local($3);
+            Lex->safe_to_cache_query=0;
+          }
 	| TIME_SYM '(' expr ')'
 	  { $$= new Item_time_typecast($3); }
 	| TIMESTAMP '(' expr ')'

--- 1.19/mysql-test/r/partition.result	2006-03-13 06:19:43 -08:00
+++ 1.20/mysql-test/r/partition.result	2006-03-14 02:32:41 -08:00
@@ -423,6 +423,33 @@
 x234	NULL,1	1
 drop table t1;
 create table t1 (a int)
+(partition p0 values less than (1));
+alter table t1 add partition (partition p1 values in (2));
+ERROR HY000: Only LIST PARTITIONING can use VALUES IN in partition definition
+alter table t1 add partition (partition p1);
+ERROR HY000: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition
+drop table t1;
+create table t1 (a int)
+partition by list (a)
+(partition p0 values in (1));
+alter table t1 add partition (partition p1 values less than (2));
+ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition definition
+alter table t1 add partition (partition p1);
+ERROR HY000: LIST PARTITIONING requires definition of VALUES IN for each partition
+drop table t1;
+create table t1 (a int)
+partition by hash (a)
+(partition p0);
+alter table t1 add partition (partition p1 values less than (2));
+ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition definition
+alter table t1 add partition (partition p1 values in (2));
+ERROR HY000: Only LIST PARTITIONING can use VALUES IN in partition definition
+drop table t1;
+create table t1 (a int)
+partition by list (a)
+(partition p0 values in (1));
+alter table t1 rebuild partition;
+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 '' at line 1
 partition by list (a)
 (partition p0 values in (1));
 alter table t1 rebuild partition;

--- 1.22/mysql-test/t/partition.test	2006-03-13 06:20:12 -08:00
+++ 1.23/mysql-test/t/partition.test	2006-03-14 02:32:41 -08:00
@@ -541,6 +541,42 @@
 drop table t1;
 
 #
+# Bug 17127 
+#
+create table t1 (a int)
+partition by range (a)
+(partition p0 values less than (1));
+
+--error ER_PARTITION_WRONG_VALUES_ERROR
+alter table t1 add partition (partition p1 values in (2));
+--error ER_PARTITION_REQUIRES_VALUES_ERROR
+alter table t1 add partition (partition p1);
+
+drop table t1;
+
+create table t1 (a int)
+partition by list (a)
+(partition p0 values in (1));
+
+--error ER_PARTITION_WRONG_VALUES_ERROR
+alter table t1 add partition (partition p1 values less than (2));
+--error ER_PARTITION_REQUIRES_VALUES_ERROR
+alter table t1 add partition (partition p1);
+
+drop table t1;
+
+create table t1 (a int)
+partition by hash (a)
+(partition p0);
+
+--error ER_PARTITION_WRONG_VALUES_ERROR
+alter table t1 add partition (partition p1 values less than (2));
+--error ER_PARTITION_WRONG_VALUES_ERROR
+alter table t1 add partition (partition p1 values in (2));
+
+drop table t1;
+
+#
 # BUG 17947 Crash with REBUILD PARTITION
 #
 create table t1 (a int)

--- 1.46/sql/sql_partition.cc	2006-03-14 01:39:21 -08:00
+++ 1.47/sql/sql_partition.cc	2006-03-14 01:44:52 -08:00
@@ -4061,6 +4061,15 @@
 {
   DBUG_ENTER("prep_alter_part_table");
 
+  /*
+    We are going to manipulate the partition info on the table object
+    so we need to ensure that the data structure of the table object
+    is freed by setting version to 0. table->s->version= 0 forces a
+    flush of the table object in close_thread_tables().
+  */
+  if (table->part_info)
+    table->s->version= 0L;
+
   if (alter_info->flags &
       (ALTER_ADD_PARTITION | ALTER_DROP_PARTITION |
        ALTER_COALESCE_PARTITION | ALTER_REORGANIZE_PARTITION |
@@ -4069,19 +4078,12 @@
        ALTER_REPAIR_PARTITION | ALTER_REBUILD_PARTITION))
   {
     partition_info *tab_part_info= table->part_info;
+    uint flags= 0;
     if (!tab_part_info)
     {
       my_error(ER_PARTITION_MGMT_ON_NONPARTITIONED, MYF(0));
       DBUG_RETURN(TRUE);
     }
-    /*
-      We are going to manipulate the partition info on the table object
-      so we need to ensure that the data structure of the table object
-      is freed by setting version to 0. table->s->version= 0 forces a
-      flush of the table object in close_thread_tables().
-    */
-    uint flags= 0;
-    table->s->version= 0L;
     if (alter_info->flags == ALTER_TABLE_REORG)
     {
       uint new_part_no, curr_part_no;
Thread
bk commit into 5.1 tree (mikael:1.2178)Mikael14 Mar