MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:November 28 2007 2:07pm
Subject:bk commit into 6.0 tree (svoj:1.2695) BUG#22972
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-11-28 18:07:24+04:00, svoj@stripped +5 -0
  BUG#22972 - Falcon: Partitioned table with pending transaction leads to
              strange error
  
  Falcon cannot drop a table with pending transaction and error
  message is misleading.
  
  With this fix Falcon returns descriptive warning.

  include/my_base.h@stripped, 2007-11-28 18:07:22+04:00, svoj@stripped +2 -1
    Added error code for "Can't execute the given command because you have
    active locked tables or an active transaction" message.

  mysql-test/suite/falcon/r/falcon_bug_22972.result@stripped, 2007-11-28 18:07:22+04:00, svoj@stripped +10 -0
    New BitKeeper file ``mysql-test/suite/falcon/r/falcon_bug_22972.result''

  mysql-test/suite/falcon/r/falcon_bug_22972.result@stripped, 2007-11-28 18:07:22+04:00, svoj@stripped +0 -0

  mysql-test/suite/falcon/t/falcon_bug_22972.test@stripped, 2007-11-28 18:07:22+04:00, svoj@stripped +15 -0
    New BitKeeper file ``mysql-test/suite/falcon/t/falcon_bug_22972.test''

  mysql-test/suite/falcon/t/falcon_bug_22972.test@stripped, 2007-11-28 18:07:22+04:00, svoj@stripped +0 -0

  sql/handler.cc@stripped, 2007-11-28 18:07:22+04:00, svoj@stripped +5 -0
    Added handling of HA_ERR_LOCK_OR_ACTIVE_TRANSACTION error.

  storage/falcon/ha_falcon.cpp@stripped, 2007-11-28 18:07:22+04:00, svoj@stripped +1 -1
    Return descriptive error when storage has uncommitted updates.

diff -Nrup a/include/my_base.h b/include/my_base.h
--- a/include/my_base.h	2007-11-15 03:00:50 +04:00
+++ b/include/my_base.h	2007-11-28 18:07:22 +04:00
@@ -419,7 +419,8 @@ enum ha_base_keytype {
 #define HA_ERR_LOGGING_IMPOSSIBLE 170 /* It is not possible to log this
                                          statement */
 #define HA_ERR_TABLESPACE_EXIST 171
-#define HA_ERR_LAST              171 /*Copy last error nr.*/
+#define HA_ERR_LOCK_OR_ACTIVE_TRANSACTION 172
+#define HA_ERR_LAST              172 /*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_22972.result b/mysql-test/suite/falcon/r/falcon_bug_22972.result
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/suite/falcon/r/falcon_bug_22972.result	2007-11-28 18:07:22 +04:00
@@ -0,0 +1,10 @@
+CREATE TABLE t1(a INT) ENGINE=Falcon;
+START TRANSACTION;
+INSERT INTO t1 VALUES(1);
+DROP TABLE t1;
+ERROR 42S02: Unknown table 't1'
+SHOW WARNINGS;
+Level	Code	Message
+Error	172	Can't execute the given command because you have active locked tables or an active transaction
+COMMIT;
+DROP TABLE t1;
diff -Nrup a/mysql-test/suite/falcon/t/falcon_bug_22972.test b/mysql-test/suite/falcon/t/falcon_bug_22972.test
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/suite/falcon/t/falcon_bug_22972.test	2007-11-28 18:07:22 +04:00
@@ -0,0 +1,15 @@
+--source include/have_falcon.inc
+CREATE TABLE t1(a INT) ENGINE=Falcon;
+connect (con1,localhost,root,,);
+connection con1;
+START TRANSACTION;
+INSERT INTO t1 VALUES(1);
+connection default;
+--error 1051
+DROP TABLE t1;
+SHOW WARNINGS;
+connection con1;
+COMMIT;
+connection default;
+disconnect con1;
+DROP TABLE t1;
diff -Nrup a/sql/handler.cc b/sql/handler.cc
--- a/sql/handler.cc	2007-11-14 17:35:34 +04:00
+++ b/sql/handler.cc	2007-11-28 18:07:22 +04:00
@@ -2288,6 +2288,11 @@ void handler::print_error(int error, myf
   case HA_ERR_AUTOINC_ERANGE:
     textno= ER_WARN_DATA_OUT_OF_RANGE;
     break;
+  case HA_ERR_LOCK_OR_ACTIVE_TRANSACTION:
+    my_message(ER_LOCK_OR_ACTIVE_TRANSACTION,
+               ER(ER_LOCK_OR_ACTIVE_TRANSACTION), MYF(0));
+    DBUG_VOID_RETURN;
+    break;
   default:
     {
       /* The error was "unknown" to this function.
diff -Nrup a/storage/falcon/ha_falcon.cpp b/storage/falcon/ha_falcon.cpp
--- a/storage/falcon/ha_falcon.cpp	2007-11-28 00:07:21 +04:00
+++ b/storage/falcon/ha_falcon.cpp	2007-11-28 18:07:22 +04:00
@@ -1645,7 +1645,7 @@ int StorageInterface::getMySqlError(int 
 
 		case StorageErrorUncommittedUpdates:
 			DBUG_PRINT("info", ("StorageErrorUncommittedUpdates"));
-			return (HA_ERR_TABLE_EXIST);
+			return (HA_ERR_LOCK_OR_ACTIVE_TRANSACTION);
 
 		case StorageErrorUncommittedRecords:
 			DBUG_PRINT("info", ("StorageErrorUncommittedRecords"));
Thread
bk commit into 6.0 tree (svoj:1.2695) BUG#22972Sergey Vojtovich28 Nov
  • Re: bk commit into 6.0 tree (svoj:1.2695) BUG#22972Sergei Golubchik29 Nov
  • Re: bk commit into 6.0 tree (svoj:1.2695) BUG#22972Sergei Golubchik30 Nov