MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Mattias Jonsson Date:February 2 2010 10:49am
Subject:bzr commit into mysql-5.1-bugteam branch (mattias.jonsson:3347)
Bug#49161
View as plain text  
#At file:///Users/mattiasj/clones/bzrroot/topush-51-bugteam/ based on revid:mattias.jonsson@sun.com-20100202100628-s9tgw5hzu8sxs97e

 3347 Mattias Jonsson	2010-02-02
      Bug#49161: Out of memory; restart server and try again (needed 2 bytes)
      Problem was reporting wrong error
      
      Fixed by adding a new error which better explain the problem
     @ mysql-test/r/partition_error.result
        Bug#49161: Out of memory; restart server and try again (needed 2 bytes)
        Problem was reporting wrong error
        
        Added result
     @ mysql-test/t/partition_error.test
        Bug#49161: Out of memory; restart server and try again (needed 2 bytes)
        Problem was reporting wrong error
        
        Added test
     @ sql/ha_partition.cc
        Bug#49161: Out of memory; restart server and try again (needed 2 bytes)
        Problem was reporting wrong error
        
        Reporting a correct error
     @ sql/share/errmsg.txt
        Bug#49161: Out of memory; restart server and try again (needed 2 bytes)
        Problem was reporting wrong error
        
        Added a new error code/text

    modified:
      mysql-test/r/partition_error.result
      mysql-test/t/partition_error.test
      sql/ha_partition.cc
      sql/share/errmsg.txt
=== modified file 'mysql-test/r/partition_error.result'
--- a/mysql-test/r/partition_error.result	2009-12-13 20:29:50 +0000
+++ b/mysql-test/r/partition_error.result	2010-02-02 10:49:35 +0000
@@ -1,4 +1,20 @@
 drop table if exists t1;
+#
+# Bug#49161: Out of memory; restart server and try again (needed 2 bytes)
+#
+CREATE TABLE t1 (a INT) PARTITION BY HASH (a);
+FLUSH TABLES;
+CHECK TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	check	Error	Failed to initialize partitions from .par file
+test.t1	check	Error	Incorrect information in file: './test/t1.frm'
+test.t1	check	error	Corrupt
+SELECT * FROM t1;
+ERROR HY000: Failed to initialize partitions from .par file
+# Note that it is currently impossible to drop a partitioned table
+# without the .par file
+DROP TABLE t1;
+ERROR 42S02: Unknown table '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'

=== modified file 'mysql-test/t/partition_error.test'
--- a/mysql-test/t/partition_error.test	2009-12-13 20:29:50 +0000
+++ b/mysql-test/t/partition_error.test	2010-02-02 10:49:35 +0000
@@ -7,6 +7,24 @@
 --disable_warnings
 drop table if exists t1;
 --enable_warnings
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+
+--echo #
+--echo # Bug#49161: Out of memory; restart server and try again (needed 2 bytes)
+--echo #
+CREATE TABLE t1 (a INT) PARTITION BY HASH (a);
+FLUSH TABLES;
+--remove_file $MYSQLD_DATADIR/test/t1.par
+CHECK TABLE t1;
+--error ER_PAR_FILE_OPEN_ERROR
+SELECT * FROM t1;
+--echo # Note that it is currently impossible to drop a partitioned table
+--echo # without the .par file
+--error ER_BAD_TABLE_ERROR
+DROP TABLE t1;
+--remove_file $MYSQLD_DATADIR/test/t1.frm
+--remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYI
+--remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYD
  
 #
 # Bug#38719: Partitioning returns a different error code for a
@@ -134,7 +152,6 @@ partitions 3
  partition x2 tablespace ts2,
  partition x3 tablespace ts3);
 
-let $MYSQLD_DATADIR= `select @@datadir`;
 select load_file('$MYSQLD_DATADIR/test/t1.par');
 #
 # Partition by hash, invalid field in function

=== modified file 'sql/ha_partition.cc'
--- a/sql/ha_partition.cc	2010-02-02 10:06:28 +0000
+++ b/sql/ha_partition.cc	2010-02-02 10:49:35 +0000
@@ -355,7 +355,7 @@ bool ha_partition::initialize_partition(
   }
   else if (get_from_handler_file(table_share->normalized_path.str, mem_root))
   {
-    mem_alloc_error(2);
+    my_error(ER_PAR_FILE_OPEN_ERROR, MYF(0));
     DBUG_RETURN(1);
   }
   /*

=== modified file 'sql/share/errmsg.txt'
--- a/sql/share/errmsg.txt	2010-01-21 08:10:05 +0000
+++ b/sql/share/errmsg.txt	2010-02-02 10:49:35 +0000
@@ -6213,3 +6213,6 @@ ER_DEBUG_SYNC_TIMEOUT
 ER_DEBUG_SYNC_HIT_LIMIT
   eng "debug sync point hit limit reached"
   ger "Debug Sync Point Hit Limit erreicht"
+ER_PAR_FILE_OPEN_ERROR
+  eng "Failed to initialize partitions from .par file"
+  swe "Fel vid initialisering av partitionerna fr�.par-filen"

Attachment: [text/bzr-bundle]
Thread
bzr commit into mysql-5.1-bugteam branch (mattias.jonsson:3347)Bug#49161Mattias Jonsson2 Feb