MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Mattias Jonsson Date:September 20 2008 9:24am
Subject:bzr commit into mysql-6.0 branch (mattias.jonsson:2820)
View as plain text  
#At file:///Users/mattiasj/clones/bzrroot/topush-60-bugteam/

 2820 Mattias Jonsson	2008-09-20 [merge]
      merge
modified:
  mysql-test/r/partition_error.result
  mysql-test/t/partition_error.test
  sql/handler.cc

=== modified file 'mysql-test/r/partition_error.result'
--- a/mysql-test/r/partition_error.result	2008-02-25 20:18:50 +0000
+++ b/mysql-test/r/partition_error.result	2008-09-04 12:00:14 +0000
@@ -1,4 +1,13 @@
 drop table if exists t1;
+CREATE TABLE t1 (a INTEGER NOT NULL, PRIMARY KEY (a));
+INSERT INTO t1 VALUES (1),(1);
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+DROP TABLE t1;
+CREATE TABLE t1 (a INTEGER NOT NULL, PRIMARY KEY (a))
+PARTITION BY KEY (a) PARTITIONS 2;
+INSERT INTO t1 VALUES (1),(1);
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+DROP TABLE t1;
 CREATE TABLE t1 (a INT)
 PARTITION BY HASH (a)
 ( PARTITION p0 ENGINE=MyISAM,

=== modified file 'mysql-test/t/partition_error.test'
--- a/mysql-test/t/partition_error.test	2008-02-25 20:18:50 +0000
+++ b/mysql-test/t/partition_error.test	2008-09-04 12:00:14 +0000
@@ -1,5 +1,5 @@
 #
-# Simple test for the erroneos create statements using the 
+# Simple test for the erroneos statements using the 
 # partition storage engine
 #
 -- source include/have_partition.inc
@@ -7,6 +7,19 @@
 --disable_warnings
 drop table if exists t1;
 --enable_warnings
+ 
+#
+# Bug#38719: Partitioning returns a different error code for a
+# duplicate key error
+CREATE TABLE t1 (a INTEGER NOT NULL, PRIMARY KEY (a));
+-- error ER_DUP_ENTRY
+INSERT INTO t1 VALUES (1),(1);
+DROP TABLE t1;
+CREATE TABLE t1 (a INTEGER NOT NULL, PRIMARY KEY (a))
+PARTITION BY KEY (a) PARTITIONS 2;
+-- error ER_DUP_ENTRY
+INSERT INTO t1 VALUES (1),(1);
+DROP TABLE t1;
 
 #
 # Bug#31931: Mix of handlers error message

=== modified file 'sql/handler.cc'
--- a/sql/handler.cc	2008-09-08 13:52:04 +0000
+++ b/sql/handler.cc	2008-09-20 09:23:59 +0000
@@ -2862,7 +2862,7 @@ uint handler::get_dup_key(int error)
   if (error == HA_ERR_FOUND_DUPP_KEY || error == HA_ERR_FOREIGN_DUPLICATE_KEY ||
       error == HA_ERR_FOUND_DUPP_UNIQUE || error == HA_ERR_NULL_IN_SPATIAL ||
       error == HA_ERR_DROP_INDEX_FK)
-    info(HA_STATUS_ERRKEY | HA_STATUS_NO_LOCK);
+    table->file->info(HA_STATUS_ERRKEY | HA_STATUS_NO_LOCK);
   DBUG_RETURN(table->file->errkey);
 }
 

Thread
bzr commit into mysql-6.0 branch (mattias.jonsson:2820)Mattias Jonsson20 Sep