MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Mattias Jonsson Date:February 10 2010 11:07am
Subject:bzr commit into mysql-6.0-codebase branch (mattias.jonsson:3875)
Bug#50201
View as plain text  
#At file:///Users/mattiasj/clones/bzrroot/topush-60-cb-bf/ based on revid:alik@stripped

 3875 Mattias Jonsson	2010-02-10 [merge]
      manual merge of bug#50201 from mysql-next-mr-bugfixing
      into mysql-6.0-codebase-bugfixing, due to read only
      innodb_lock_wait_timeout variable

    added:
      mysql-test/suite/parts/r/partition_innodb_status_file.result
      mysql-test/suite/parts/t/partition_innodb_status_file-master.opt
      mysql-test/suite/parts/t/partition_innodb_status_file.test
    modified:
      sql/sql_table.cc
      sql/unireg.h
=== added file 'mysql-test/suite/parts/r/partition_innodb_status_file.result'
--- a/mysql-test/suite/parts/r/partition_innodb_status_file.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/r/partition_innodb_status_file.result	2010-02-10 11:06:55 +0000
@@ -0,0 +1,13 @@
+CREATE TABLE t1 (a INT) ENGINE = InnoDB PARTITION BY HASH(a);
+INSERT INTO t1 VALUES (0), (1), (2);
+START TRANSACTION;
+UPDATE t1 SET a = 5 WHERE a = 1;
+# Connection con1
+# InnoDB lock timeout and monitor thread runs every 15 seconds
+START TRANSACTION;
+UPDATE t1 SET a = 3 WHERE a = 1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+COMMIT;
+# Connection default
+COMMIT;
+DROP TABLE t1;

=== added file 'mysql-test/suite/parts/t/partition_innodb_status_file-master.opt'
--- a/mysql-test/suite/parts/t/partition_innodb_status_file-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/t/partition_innodb_status_file-master.opt	2010-02-10 11:06:55 +0000
@@ -0,0 +1 @@
+--innodb-status-file=1 --innodb_lock_wait_timeout=20

=== added file 'mysql-test/suite/parts/t/partition_innodb_status_file.test'
--- a/mysql-test/suite/parts/t/partition_innodb_status_file.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/t/partition_innodb_status_file.test	2010-02-10 11:06:55 +0000
@@ -0,0 +1,19 @@
+--source include/have_innodb.inc
+--source include/have_partition.inc
+
+CREATE TABLE t1 (a INT) ENGINE = InnoDB PARTITION BY HASH(a);
+INSERT INTO t1 VALUES (0), (1), (2);
+START TRANSACTION;
+UPDATE t1 SET a = 5 WHERE a = 1;
+connect (con1, localhost, root,,);
+--echo # Connection con1
+--echo # InnoDB lock timeout and monitor thread runs every 15 seconds
+START TRANSACTION;
+--error ER_LOCK_WAIT_TIMEOUT
+UPDATE t1 SET a = 3 WHERE a = 1;
+COMMIT;
+disconnect con1;
+connection default;
+--echo # Connection default
+COMMIT;
+DROP TABLE t1;

=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc	2010-02-05 15:19:43 +0000
+++ b/sql/sql_table.cc	2010-02-10 11:06:55 +0000
@@ -294,7 +294,8 @@ uint explain_filename(THD* thd,
   {
     if (explain_mode == EXPLAIN_ALL_VERBOSE)
     {
-      to_p= strnmov(to_p, ER(ER_DATABASE_NAME), end_p - to_p);
+      to_p= strnmov(to_p, ER_THD_OR_DEFAULT(thd, ER_DATABASE_NAME),
+                                            end_p - to_p);
       *(to_p++)= ' ';
       to_p= add_identifier(thd, to_p, end_p, db_name, db_name_len);
       to_p= strnmov(to_p, ", ", end_p - to_p);
@@ -307,7 +308,7 @@ uint explain_filename(THD* thd,
   }
   if (explain_mode == EXPLAIN_ALL_VERBOSE)
   {
-    to_p= strnmov(to_p, ER(ER_TABLE_NAME), end_p - to_p);
+    to_p= strnmov(to_p, ER_THD_OR_DEFAULT(thd, ER_TABLE_NAME), end_p - to_p);
     *(to_p++)= ' ';
     to_p= add_identifier(thd, to_p, end_p, table_name, table_name_len);
   }
@@ -324,18 +325,22 @@ uint explain_filename(THD* thd,
     if (name_type != NORMAL)
     {
       if (name_type == TEMP)
-        to_p= strnmov(to_p, ER(ER_TEMPORARY_NAME), end_p - to_p);
+        to_p= strnmov(to_p, ER_THD_OR_DEFAULT(thd, ER_TEMPORARY_NAME),
+                      end_p - to_p);
       else
-        to_p= strnmov(to_p, ER(ER_RENAMED_NAME), end_p - to_p);
+        to_p= strnmov(to_p, ER_THD_OR_DEFAULT(thd, ER_RENAMED_NAME),
+                      end_p - to_p);
       to_p= strnmov(to_p, " ", end_p - to_p);
     }
-    to_p= strnmov(to_p, ER(ER_PARTITION_NAME), end_p - to_p);
+    to_p= strnmov(to_p, ER_THD_OR_DEFAULT(thd, ER_PARTITION_NAME),
+                  end_p - to_p);
     *(to_p++)= ' ';
     to_p= add_identifier(thd, to_p, end_p, part_name, part_name_len);
     if (subpart_name)
     {
       to_p= strnmov(to_p, ", ", end_p - to_p);
-      to_p= strnmov(to_p, ER(ER_SUBPARTITION_NAME), end_p - to_p);
+      to_p= strnmov(to_p, ER_THD_OR_DEFAULT(thd, ER_SUBPARTITION_NAME),
+                    end_p - to_p);
       *(to_p++)= ' ';
       to_p= add_identifier(thd, to_p, end_p, subpart_name, subpart_name_len);
     }

=== modified file 'sql/unireg.h'
--- a/sql/unireg.h	2010-01-22 08:06:07 +0000
+++ b/sql/unireg.h	2010-02-10 11:06:55 +0000
@@ -46,6 +46,9 @@
 #define ER(X)         CURRENT_THD_ERRMSGS[(X) - ER_ERROR_FIRST]
 #define ER_DEFAULT(X) DEFAULT_ERRMSGS[(X) - ER_ERROR_FIRST]
 #define ER_SAFE(X) (((X) >= ER_ERROR_FIRST && (X) <= ER_ERROR_LAST) ? ER(X) : "Invalid error code")
+#define ER_THD(thd,X) ((thd)->variables.lc_messages->errmsgs->errmsgs[(X) - \
+                       ER_ERROR_FIRST])
+#define ER_THD_OR_DEFAULT(thd,X) ((thd) ? ER_THD(thd, X) : ER_DEFAULT(X))
 
 
 #define ERRMAPP 1				/* Errormap f|r my_error */


Attachment: [text/bzr-bundle]
Thread
bzr commit into mysql-6.0-codebase branch (mattias.jonsson:3875)Bug#50201Mattias Jonsson10 Feb