List:Commits« Previous MessageNext Message »
From:Martin Skold Date:February 11 2009 8:45pm
Subject:bzr commit into mysql-5.1-telco-6.4 branch (Martin.Skold:3257) Bug#39268
Bug#40464 Bug#42232
View as plain text  
#At file:///home/marty/MySQL/mysql-5.1-telco-6.4_latest/

 3257 Martin Skold	2009-02-11 [merge]
      Merge
modified:
  mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result
  mysql-test/suite/rpl_ndb/t/rpl_ndb_auto_inc.test
  sql/ha_ndbcluster.cc
  storage/ndb/src/ndbapi/Ndb.cpp

per-file messages:
  storage/ndb/src/ndbapi/Ndb.cpp
    Bug #39268 No transaction hints used to update SYSTAB_0 for autoincrement and PK-less table: disabled bugfix in mysql-5.1-telco-6.4 since it caused crash.
=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result	2008-09-29 21:55:56 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result	2009-02-10 16:30:54 +0000
@@ -168,3 +168,31 @@ a
 32
 42
 drop table t1;
+set @old_ndb_autoincrement_prefetch_sz = @@session.ndb_autoincrement_prefetch_sz;
+set ndb_autoincrement_prefetch_sz = 32;
+CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT KEY) ENGINE=ndb;
+INSERT INTO t1 () VALUES (),(),();
+set @old_ndb_autoincrement_prefetch_sz = @@session.ndb_autoincrement_prefetch_sz;
+set ndb_autoincrement_prefetch_sz = 32;
+select * from t1 order by id;
+id
+1
+2
+3
+INSERT INTO t1 () VALUES (),(),();
+select * from t1 order by id;
+id
+1
+2
+3
+4
+5
+6
+set ndb_autoincrement_prefetch_sz = @old_ndb_autoincrement_prefetch_sz;
+select * from t1 order by id;
+id
+1
+2
+3
+drop table t1;
+set ndb_autoincrement_prefetch_sz = @old_ndb_autoincrement_prefetch_sz;

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_auto_inc.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_auto_inc.test	2007-06-27 12:29:10 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_auto_inc.test	2009-02-05 13:27:46 +0000
@@ -111,8 +111,26 @@ sync_slave_with_master;
 --echo
 select * from t1 ORDER BY a;
 connection master;
-
 drop table t1;
 
+#
+# Bug #42232 Cluster to cluster replication is not setting auto_increment
+# on slave cluster
+#
+set @old_ndb_autoincrement_prefetch_sz = @@session.ndb_autoincrement_prefetch_sz;
+set ndb_autoincrement_prefetch_sz = 32;
+CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT KEY) ENGINE=ndb;
+INSERT INTO t1 () VALUES (),(),();
+sync_slave_with_master;
+set @old_ndb_autoincrement_prefetch_sz = @@session.ndb_autoincrement_prefetch_sz;
+set ndb_autoincrement_prefetch_sz = 32;
+select * from t1 order by id;
+INSERT INTO t1 () VALUES (),(),();
+select * from t1 order by id;
+set ndb_autoincrement_prefetch_sz = @old_ndb_autoincrement_prefetch_sz;
+connection master;
+select * from t1 order by id;
+drop table t1;
+set ndb_autoincrement_prefetch_sz = @old_ndb_autoincrement_prefetch_sz;
 # End cleanup
 sync_slave_with_master;

=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2009-02-11 12:33:09 +0000
+++ b/sql/ha_ndbcluster.cc	2009-02-11 20:45:23 +0000
@@ -9621,7 +9621,9 @@ ndbcluster_cache_retrieval_allowed(THD *
   {
     /* Don't allow qc to be used if table has been previously
        modified in transaction */
-    Thd_ndb *thd_ndb= get_thd_ndb(thd);
+    if (!check_ndb_in_thd(thd))
+      DBUG_RETURN(FALSE);
+   Thd_ndb *thd_ndb= get_thd_ndb(thd);
     if (!thd_ndb->changed_tables.is_empty())
     {
       NDB_SHARE* share;

=== modified file 'storage/ndb/src/ndbapi/Ndb.cpp'
--- a/storage/ndb/src/ndbapi/Ndb.cpp	2008-12-12 14:30:54 +0000
+++ b/storage/ndb/src/ndbapi/Ndb.cpp	2009-02-11 20:45:23 +0000
@@ -1537,7 +1537,20 @@ Ndb::opTupleIdOnNdb(const NdbTableImpl* 
   if (initAutoIncrement() == -1)
     goto error_handler;
 
+/*
+  Fix for
+  Bug #39268 No transaction hints used to update SYSTAB_0 for autoincrement and PK-less table
+  causes crash in 6.4
+ */
+#if 0
+  // Start transaction with table id as hint
+  tConnection = this->startTransaction(table,
+                                       (const char *) &aTableId,
+                                       sizeof(Uint32));
+#else
   tConnection = this->startTransaction();
+#endif
+
   if (tConnection == NULL)
     goto error_handler;
 

Thread
bzr commit into mysql-5.1-telco-6.4 branch (Martin.Skold:3257) Bug#39268Bug#40464 Bug#42232Martin Skold11 Feb