List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:October 31 2007 8:43am
Subject:bk commit into 6.0 tree (svoj:1.2650) BUG#31114
View as plain text  
Below is the list of changes that have just been committed into a local
6.0 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-10-31 11:43:10+04:00, svoj@stripped +10 -0
  BUG#31114 - falcon : creating tablespace with same name twice returns
              Unknown error -103
  
  When creating a tablespace that already exists, falcon returns
  non-informative error message.

  include/my_base.h@stripped, 2007-10-31 11:43:08+04:00, svoj@stripped +2 -1
    Added error code for "tablespace already exist" error.

  mysql-test/suite/falcon/r/falcon_bug_29511.result@stripped, 2007-10-31 11:43:08+04:00,
svoj@stripped +1 -1
    Updated test result according to fix for BUG#31296.

  mysql-test/suite/falcon/r/falcon_ts.result@stripped, 2007-10-31 11:43:08+04:00,
svoj@stripped +4 -0
    A test case for BUG#31296.

  mysql-test/suite/falcon/t/falcon_bug_29511.test@stripped, 2007-10-31 11:43:08+04:00,
svoj@stripped +1 -1
    Updated test case according to fix for BUG#31296.

  mysql-test/suite/falcon/t/falcon_ts.test@stripped, 2007-10-31 11:43:08+04:00, svoj@stripped
+10 -0
    A test case for BUG#31296.

  sql/share/errmsg.txt@stripped, 2007-10-31 11:43:08+04:00, svoj@stripped +2 -0
    Added "tablespace already exist" message.

  sql/sql_tablespace.cc@stripped, 2007-10-31 11:43:08+04:00, svoj@stripped +11 -11
    Added handling of HA_ERR_TABLESPACE_EXIST error.

  storage/falcon/StorageHandler.cpp@stripped, 2007-10-31 11:43:08+04:00, svoj@stripped +3 -1
    Check if TableSpaceManager got "tablespace already exists" error and
    return appropriate error code in this case.

  storage/falcon/StorageTableShare.h@stripped, 2007-10-31 11:43:08+04:00, svoj@stripped +2 -1
    Added error code for "tablespace already exist" error.

  storage/falcon/ha_falcon.cpp@stripped, 2007-10-31 11:43:08+04:00, svoj@stripped +2 -0
    Check if StorageHandler got "tablespace already exists" error and
    return appropriate error code in this case.

diff -Nrup a/include/my_base.h b/include/my_base.h
--- a/include/my_base.h	2007-08-27 12:05:23 +05:00
+++ b/include/my_base.h	2007-10-31 11:43:08 +04:00
@@ -418,7 +418,8 @@ enum ha_base_keytype {
 
 #define HA_ERR_LOGGING_IMPOSSIBLE 170 /* It is not possible to log this
                                          statement */
-#define HA_ERR_LAST              170 /*Copy last error nr.*/
+#define HA_ERR_TABLESPACE_EXIST 171
+#define HA_ERR_LAST              171 /*Copy last error nr.*/
 /* Add error numbers before HA_ERR_LAST and change it accordingly. */
 #define HA_ERR_ERRORS            (HA_ERR_LAST - HA_ERR_FIRST + 1)
 
diff -Nrup a/mysql-test/suite/falcon/r/falcon_bug_29511.result
b/mysql-test/suite/falcon/r/falcon_bug_29511.result
--- a/mysql-test/suite/falcon/r/falcon_bug_29511.result	2007-09-20 20:43:16 +05:00
+++ b/mysql-test/suite/falcon/r/falcon_bug_29511.result	2007-10-31 11:43:08 +04:00
@@ -4,5 +4,5 @@ CREATE TABLESPACE tablespace1
 ADD DATAFILE 'falcon_tablespace.fts' Engine Falcon;
 CREATE TABLESPACE tablespace2
 ADD DATAFILE 'falcon_tablespace.fts' Engine Falcon;
-ERROR HY000: Unknown error -103
+ERROR HY000: Tablespace 'tablespace2' already exists
 DROP TABLESPACE tablespace1 Engine Falcon;
diff -Nrup a/mysql-test/suite/falcon/r/falcon_ts.result
b/mysql-test/suite/falcon/r/falcon_ts.result
--- a/mysql-test/suite/falcon/r/falcon_ts.result	2007-10-30 14:11:14 +04:00
+++ b/mysql-test/suite/falcon/r/falcon_ts.result	2007-10-31 11:43:08 +04:00
@@ -2,3 +2,7 @@ CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.
 DROP TABLESPACE ts1 ENGINE=falcon;
 CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.fts' ENGINE=falcon;
 DROP TABLESPACE ts1 ENGINE=falcon;
+CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.fts' ENGINE=falcon;
+CREATE TABLESPACE ts1 ADD DATAFILE 'ts2.fts' ENGINE=falcon;
+ERROR HY000: Tablespace 'ts1' already exists
+DROP TABLESPACE ts1 ENGINE=falcon;
diff -Nrup a/mysql-test/suite/falcon/t/falcon_bug_29511.test
b/mysql-test/suite/falcon/t/falcon_bug_29511.test
--- a/mysql-test/suite/falcon/t/falcon_bug_29511.test	2007-09-29 09:30:38 +05:00
+++ b/mysql-test/suite/falcon/t/falcon_bug_29511.test	2007-10-31 11:43:08 +04:00
@@ -19,7 +19,7 @@ CREATE TABLESPACE tablespace1
 # ----------------------------------------------------- #
 # --- Test                                          --- #
 # ----------------------------------------------------- #
---error 65433
+--error 1655
 CREATE TABLESPACE tablespace2
   ADD DATAFILE 'falcon_tablespace.fts' Engine Falcon;
 
diff -Nrup a/mysql-test/suite/falcon/t/falcon_ts.test
b/mysql-test/suite/falcon/t/falcon_ts.test
--- a/mysql-test/suite/falcon/t/falcon_ts.test	2007-10-30 14:11:14 +04:00
+++ b/mysql-test/suite/falcon/t/falcon_ts.test	2007-10-31 11:43:08 +04:00
@@ -7,3 +7,13 @@ CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.
 DROP TABLESPACE ts1 ENGINE=falcon;
 CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.fts' ENGINE=falcon;
 DROP TABLESPACE ts1 ENGINE=falcon;
+
+#
+# BUG#31114 - falcon : creating tablespace with same name twice returns
+#             Unknown error -103
+#
+
+CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.fts' ENGINE=falcon;
+--error 1655
+CREATE TABLESPACE ts1 ADD DATAFILE 'ts2.fts' ENGINE=falcon;
+DROP TABLESPACE ts1 ENGINE=falcon;
diff -Nrup a/sql/share/errmsg.txt b/sql/share/errmsg.txt
--- a/sql/share/errmsg.txt	2007-10-20 01:20:01 +05:00
+++ b/sql/share/errmsg.txt	2007-10-31 11:43:08 +04:00
@@ -6218,3 +6218,5 @@ ER_TRG_CANT_OPEN_TABLE
 
 ER_CANT_CREATE_SROUTINE
   eng "Cannot create stored routine `%-.64s`. Check warnings"
+ER_TABLESPACE_EXIST
+  eng "Tablespace '%-.192s' already exists"
diff -Nrup a/sql/sql_tablespace.cc b/sql/sql_tablespace.cc
--- a/sql/sql_tablespace.cc	2007-06-19 16:27:52 +05:00
+++ b/sql/sql_tablespace.cc	2007-10-31 11:43:08 +04:00
@@ -43,17 +43,17 @@ int mysql_alter_tablespace(THD *thd, st_
   {
     if ((error= hton->alter_tablespace(hton, thd, ts_info)))
     {
-      if (error == HA_ADMIN_NOT_IMPLEMENTED)
-      {
-        my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "");
-      }
-      else if (error == 1)
-      {
-        DBUG_RETURN(1);
-      }
-      else
-      {
-        my_error(error, MYF(0));
+      switch (error) {
+        case 1:
+          DBUG_RETURN(1);
+        case HA_ADMIN_NOT_IMPLEMENTED:
+          my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "");
+          break;
+        case HA_ERR_TABLESPACE_EXIST:
+          my_error(ER_TABLESPACE_EXIST, MYF(0), ts_info->tablespace_name);
+          break;
+        default:
+          my_error(error, MYF(0));
       }
       DBUG_RETURN(error);
     }
diff -Nrup a/storage/falcon/StorageHandler.cpp b/storage/falcon/StorageHandler.cpp
--- a/storage/falcon/StorageHandler.cpp	2007-09-20 20:42:40 +05:00
+++ b/storage/falcon/StorageHandler.cpp	2007-10-31 11:43:08 +04:00
@@ -438,8 +438,10 @@ int StorageHandler::createTablespace(con
 		statement->executeUpdate(gen.getString());
 		statement->close();
 		}
-	catch (SQLException&)
+	catch (SQLException& exception)
 		{
+                if (strstr(exception.getText(), "already exists"))
+                  return StorageErrorTableSpaceExist;
 		return StorageErrorTablesSpaceOperationFailed;
 		}
 	
diff -Nrup a/storage/falcon/StorageTableShare.h b/storage/falcon/StorageTableShare.h
--- a/storage/falcon/StorageTableShare.h	2007-09-20 20:42:41 +05:00
+++ b/storage/falcon/StorageTableShare.h	2007-10-31 11:43:08 +04:00
@@ -74,7 +74,8 @@ enum StorageError {
 	StorageWarningReadUncommitted	= -102,
 	StorageErrorTablesSpaceOperationFailed = -103,
 	StorageErrorOutOfMemory			= -104,		// memory pool limit reached or system memory
exhausted
-	StorageErrorOutOfRecordMemory	= -105		// memory pool limit reached or system memory
exhausted
+	StorageErrorOutOfRecordMemory	= -105,		// memory pool limit reached or system memory
exhausted
+        StorageErrorTableSpaceExist= -106
 	};
 	
 static const int StoreErrorIndexShift	= 10;
diff -Nrup a/storage/falcon/ha_falcon.cpp b/storage/falcon/ha_falcon.cpp
--- a/storage/falcon/ha_falcon.cpp	2007-10-10 10:43:44 +05:00
+++ b/storage/falcon/ha_falcon.cpp	2007-10-31 11:43:08 +04:00
@@ -1778,6 +1778,8 @@ int StorageInterface::alter_tablespace(h
 		{
 		case CREATE_TABLESPACE:
 			ret = storageHandler->createTablespace(ts_info->tablespace_name,
ts_info->data_file_name, falcon_tablespace_mode);
+                        if (ret == StorageErrorTableSpaceExist)
+                          ret= HA_ERR_TABLESPACE_EXIST;
 			break;
 
 		case DROP_TABLESPACE:
Thread
bk commit into 6.0 tree (svoj:1.2650) BUG#31114Sergey Vojtovich31 Oct