From: Date: September 29 2008 9:48pm Subject: bzr push into mysql-5.1 tree (frazer:2860 to 2860) Bug#39536 List-Archive: http://lists.mysql.com/commits/54695 X-Bug: 39536 Message-Id: <200809291948.m8TJmmxA030437@forth.ndb.mysql.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0660858808==" --===============0660858808== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------ revno: 2860 revision-id: frazer@stripped parent: frazer@stripped parent: frazer@stripped committer: Frazer Clement branch nick: mysql-5.1-telco-6.4 timestamp: Mon 2008-09-29 19:31:39 +0100 message: Merge 6.3->6.4 modified: mysql-test/suite/ndb/r/ndb_insert.result sp1f-ndb_insert.result-20040430070606-wddzvp2f7jigm33duermsonkpk2un663 sql/ha_ndbcluster.cc sp1f-ha_ndbcluster.cc-20040414175836-rvqnoxrkqexyhfu3d62s4t345ip7rez2 storage/ndb/src/ndbapi/NdbInterpretedCode.cpp sp1f-ndbinterpretedcode.c-20070529114654-w2exwio2w4x73e22p5wcfsa3bgqrtous ------------------------------------------------------------ revno: 2585.15.6 revision-id: frazer@stripped parent: tomas.ulin@stripped parent: frazer@stripped committer: Frazer Clement branch nick: mysql-5.1-telco-6.3 timestamp: Mon 2008-09-29 19:28:00 +0100 message: Merge 6.3->6.4 modified: storage/ndb/src/ndbapi/NdbInterpretedCode.cpp sp1f-ndbinterpretedcode.c-20070529114654-w2exwio2w4x73e22p5wcfsa3bgqrtous ------------------------------------------------------------ revno: 2572.29.8 revision-id: frazer@stripped parent: jonas@stripped committer: Frazer Clement branch nick: mysql-5.1-telco-6.2 timestamp: Mon 2008-09-29 19:26:36 +0100 message: Bug#39536 : NdbInterpretedCode add_val() does not work for values > 65535 Fix branch scope bug modified: storage/ndb/src/ndbapi/NdbInterpretedCode.cpp sp1f-ndbinterpretedcode.c-20070529114654-w2exwio2w4x73e22p5wcfsa3bgqrtous ------------------------------------------------------------ revno: 2585.15.5 revision-id: tomas.ulin@stripped parent: frazer@stripped committer: Tomas Ulin branch nick: mysql-5.1-telco-6.3 timestamp: Mon 2008-09-29 18:21:47 +0200 message: Bug #39538 Constraint violation in multi-row insert does not abort transaction modified: mysql-test/suite/ndb/r/ndb_insert.result sp1f-ndb_insert.result-20040430070606-wddzvp2f7jigm33duermsonkpk2un663 sql/ha_ndbcluster.cc sp1f-ha_ndbcluster.cc-20040414175836-rvqnoxrkqexyhfu3d62s4t345ip7rez2 --===============0660858808== MIME-Version: 1.0 Content-Type: text/text/x-diff; charset="us-ascii"; name="patch-2860.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline === modified file 'mysql-test/suite/ndb/r/ndb_insert.result' --- a/mysql-test/suite/ndb/r/ndb_insert.result 2008-09-19 10:56:53 +0000 +++ b/mysql-test/suite/ndb/r/ndb_insert.result 2008-09-29 16:21:47 +0000 @@ -429,7 +429,7 @@ INSERT INTO t1 VALUES (-1,-1,-1),(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), (6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10),(9999,9999,9999); -ERROR 23000: Can't write; duplicate key in table 't1' +ERROR 23000: Can't write; duplicate key in table '' select count(*) from t1; count(*) 2000 === modified file 'sql/ha_ndbcluster.cc' --- a/sql/ha_ndbcluster.cc 2008-09-24 15:01:01 +0000 +++ b/sql/ha_ndbcluster.cc 2008-09-29 18:31:39 +0000 @@ -536,12 +536,20 @@ int force_send, int ignore_error, uint *ignore_count) { DBUG_ENTER("execute_commit"); + NdbOperation::AbortOption ao= NdbOperation::AO_IgnoreError; + if (thd_ndb->m_unsent_bytes && !ignore_error) + { + /* + We have unsent bytes and cannot ignore error. Calling execute + with NdbOperation::AO_IgnoreError will result in possible commit + of a transaction although there is an error. + */ + ao= NdbOperation::AbortOnError; + } const NdbOperation *first= trans->getFirstDefinedOperation(); thd_ndb->m_execute_count++; DBUG_PRINT("info", ("execute_count: %u", thd_ndb->m_execute_count)); - if (trans->execute(NdbTransaction::Commit, - NdbOperation::AO_IgnoreError, - force_send)) + if (trans->execute(NdbTransaction::Commit, ao, force_send)) { thd_ndb->m_max_violation_count= 0; thd_ndb->m_old_violation_count= 0; === modified file 'storage/ndb/src/ndbapi/NdbInterpretedCode.cpp' --- a/storage/ndb/src/ndbapi/NdbInterpretedCode.cpp 2008-05-22 16:22:34 +0000 +++ b/storage/ndb/src/ndbapi/NdbInterpretedCode.cpp 2008-09-29 18:26:36 +0000 @@ -666,17 +666,21 @@ int res= 0; if ((res= read_attr(6, attrId) != 0)) return res; - + /* Load constant into register 7 */ /* We attempt to use the smallest constant load * instruction */ if (aValue < (1 << 16)) + { if ((res= load_const_u16(7, aValue)) != 0) return res; + } else + { if ((res= load_const_u32(7, aValue)) != 0) return res; + } /* Add registers 6 and 7 -> 7*/ if ((res= add_reg(7, 6, 7)) != 0) @@ -700,6 +704,7 @@ * instruction */ if ((aValue >> 32) == 0) + { if (aValue < (1 << 16)) { if ((res= load_const_u16(7, aValue)) != 0) @@ -710,6 +715,7 @@ if ((res= load_const_u32(7, aValue)) != 0) return res; } + } else if ((res= load_const_u64(7, aValue)) != 0) return res; @@ -717,7 +723,7 @@ /* Add registers 6 and 7 -> 7*/ if ((res= add_reg(7, 6, 7)) != 0) return res; - + /* Write back */ return write_attr(attrId, 7); } @@ -736,11 +742,15 @@ * instruction */ if (aValue < (1 << 16)) + { if ((res= load_const_u16(7, aValue)) != 0) - return res; + return res; + } else + { if ((res= load_const_u32(7, aValue)) != 0) return res; + } /* Subtract register (R7=R6-R7)*/ if ((res= sub_reg(7, 6, 7)) != 0) @@ -764,6 +774,7 @@ * instruction */ if ((aValue >> 32) == 0) + { if (aValue < (1 << 16)) { if ((res= load_const_u16(7, aValue)) != 0) @@ -774,9 +785,12 @@ if ((res= load_const_u32(7, aValue)) != 0) return res; } + } else + { if ((res= load_const_u64(7, aValue)) != 0) return res; + } /* Subtract register (R7=R6-R7)*/ if ((res= sub_reg(7, 6, 7)) != 0) --===============0660858808==--