List:Commits« Previous MessageNext Message »
From:pekka Date:September 10 2006 9:59pm
Subject:bk commit into 5.1 tree (pekka:1.2306) BUG#20612
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of pekka. When pekka 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, 2006-09-10 21:58:51+02:00, pekka@stripped +3 -0
  ndb - bug#20612 ins-del fix in tup

  mysql-test/r/ndb_dd_basic.result@stripped, 2006-09-10 21:55:23+02:00,
pekka@stripped +20 -0
    test INS-DEL via assert in disk data code

  mysql-test/t/ndb_dd_basic.test@stripped, 2006-09-10 21:55:23+02:00, pekka@stripped
+26 -0
    test INS-DEL via assert in disk data code

  storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp@stripped, 2006-09-10 20:41:02+02:00,
pekka@stripped +9 -1
    allocate separate copy tuple for delete after insert or update in same tx, instead of
sharing pointer to same copy tuple.  this is an easy fix independent of commit/abort
order of operations

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	pekka
# Host:	orca.ndb.mysql.com
# Root:	/export/home/space/pekka/ndb/version/my51-bug20612

--- 1.10/mysql-test/r/ndb_dd_basic.result	2006-09-10 21:59:10 +02:00
+++ 1.11/mysql-test/r/ndb_dd_basic.result	2006-09-10 21:59:10 +02:00
@@ -422,6 +422,26 @@
 COUNT(*)
 0
 DROP TABLE t1;
+CREATE TABLE t1 (
+a int NOT NULL,
+b varchar(4000),  -- must use 2 pages undo
+PRIMARY KEY using hash (a)
+)
+TABLESPACE ts1 STORAGE DISK ENGINE=NDBCLUSTER;
+set autocommit = 0;
+insert into t1 values(0,'x');
+insert into t1 values(1,'x');
+insert into t1 values(2,'x');
+insert into t1 values(3,'x');
+insert into t1 values(4,'x');
+insert into t1 values(5,'x');
+insert into t1 values(6,'x');
+insert into t1 values(7,'x');
+insert into t1 values(8,'x');
+delete from t1 where a = 0;
+commit;
+set autocommit = 1;
+drop table t1;
 ALTER TABLESPACE ts1 
 DROP DATAFILE 'datafile.dat' 
 ENGINE = NDB;

--- 1.6/mysql-test/t/ndb_dd_basic.test	2006-09-10 21:59:10 +02:00
+++ 1.7/mysql-test/t/ndb_dd_basic.test	2006-09-10 21:59:10 +02:00
@@ -345,6 +345,32 @@
 SELECT COUNT(*) FROM t1;
 DROP TABLE t1;
 
+# bug#20612 INS-DEL bug (not pgman bug)
+# found via disk data assert but is not pgman or disk data related
+
+CREATE TABLE t1 (
+  a int NOT NULL,
+  b varchar(4000),  -- must use 2 pages undo
+  PRIMARY KEY using hash (a)
+)
+TABLESPACE ts1 STORAGE DISK ENGINE=NDBCLUSTER;
+
+set autocommit = 0;
+insert into t1 values(0,'x');
+insert into t1 values(1,'x');
+insert into t1 values(2,'x');
+insert into t1 values(3,'x');
+insert into t1 values(4,'x');
+insert into t1 values(5,'x');
+insert into t1 values(6,'x');
+insert into t1 values(7,'x');
+insert into t1 values(8,'x');
+delete from t1 where a = 0;
+commit;
+set autocommit = 1;
+
+drop table t1;
+
 ###################
 # Test Cleanup
 ###################

--- 1.44/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2006-09-10 21:59:10 +02:00
+++ 1.45/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2006-09-10 21:59:10 +02:00
@@ -1469,7 +1469,15 @@
   {
     Operationrec* prevOp= req_struct->prevOpPtr.p;
     regOperPtr->tupVersion= prevOp->tupVersion;
-    regOperPtr->m_copy_tuple_location= prevOp->m_copy_tuple_location;
+    // make copy since previous op is committed before this one
+    const Uint32* org = c_undo_buffer.get_ptr(&prevOp->m_copy_tuple_location);
+    Uint32* dst = c_undo_buffer.alloc_copy_tuple(
+        &regOperPtr->m_copy_tuple_location, regTabPtr->total_rec_size);
+    if (dst == 0) {
+      terrorCode = ZMEM_NOMEM_ERROR;
+      goto error;
+    }
+    memcpy(dst, org, regTabPtr->total_rec_size << 2);
   } 
   else 
   {
Thread
bk commit into 5.1 tree (pekka:1.2306) BUG#20612pekka10 Sep