List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:December 14 2007 1:05pm
Subject:bk commit into 5.1 tree (svoj:1.2618) BUG#22708
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of svoj. When svoj 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@stripped, 2007-12-14 17:05:27+04:00, svoj@stripped +1 -0
  BUG#22708 - Error message doesn't refer to storage engine unsupported
  
  When openning a table with unsupported (disabled or not compiled)
  storage engine, confusing error message is returned.
  
  Return better error message when we're attempting to open a table
  that uses unsupported engine.

  sql/table.cc@stripped, 2007-12-14 17:05:25+04:00, svoj@stripped +24 -17
    Return better error message when we're attempting to open a table
    that uses unsupported engine.

diff -Nrup a/sql/table.cc b/sql/table.cc
--- a/sql/table.cc	2007-11-10 14:58:37 +04:00
+++ b/sql/table.cc	2007-12-14 17:05:25 +04:00
@@ -886,26 +886,31 @@ static int open_binary_frm(THD *thd, TAB
                             ha_legacy_type(share->db_type())));
       }
 #ifdef WITH_PARTITION_STORAGE_ENGINE
-      else
+      else if (str_db_type_length == 9 &&
+               !strncmp((char *) next_chunk + 2, "partition", 9))
       {
-        LEX_STRING pname= { C_STRING_WITH_LEN( "partition" ) };
-        if (str_db_type_length == pname.length &&
-            !strncmp((char *) next_chunk + 2, pname.str, pname.length))
-        {
-          /*
-            Use partition handler
-            tmp_plugin is locked with a local lock.
-            we unlock the old value of share->db_plugin before
-            replacing it with a globally locked version of tmp_plugin
-          */
-          plugin_unlock(NULL, share->db_plugin);
-          share->db_plugin= ha_lock_engine(NULL, partition_hton);
-          DBUG_PRINT("info", ("setting dbtype to '%.*s' (%d)",
-                              str_db_type_length, next_chunk + 2,
-                              ha_legacy_type(share->db_type())));
-        }
+        /*
+          Use partition handler
+          tmp_plugin is locked with a local lock.
+          we unlock the old value of share->db_plugin before
+          replacing it with a globally locked version of tmp_plugin
+        */
+        plugin_unlock(NULL, share->db_plugin);
+        share->db_plugin= ha_lock_engine(NULL, partition_hton);
+        DBUG_PRINT("info", ("setting dbtype to '%.*s' (%d)",
+                            str_db_type_length, next_chunk + 2,
+                            ha_legacy_type(share->db_type())));
       }
 #endif
+      else if (!tmp_plugin)
+      {
+        /* purecov: begin inspected */
+        error= 8;
+        my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), name.str);
+        my_free(buff, MYF(0));
+        goto err;
+        /* purecov: end */
+      }
       next_chunk+= str_db_type_length + 2;
     }
     if (next_chunk + 5 < buff_end)
@@ -2187,6 +2192,8 @@ void open_table_error(TABLE_SHARE *share
                     "Table '%-.64s' was created with a different version "
                     "of MySQL and cannot be read", 
                     MYF(0), buff);
+    break;
+  case 8:
     break;
   default:				/* Better wrong error than none */
   case 4:
Thread
bk commit into 5.1 tree (svoj:1.2618) BUG#22708Sergey Vojtovich14 Dec