summaryrefslogtreecommitdiff
path: root/sql/ha_ndbcluster.cc
diff options
context:
space:
mode:
authorunknown <mskold@mysql.com>2005-04-21 13:09:19 +0200
committerunknown <mskold@mysql.com>2005-04-21 13:09:19 +0200
commit122a2fdaf1dd61f09a5051d5a037bf6f0659459b (patch)
tree5d8f007a84fa9c3acae14b6965e1756ed0659e88 /sql/ha_ndbcluster.cc
parent7f0f4c5875a1b62ecf5467253c1a038c88625ecd (diff)
downloadmariadb-git-122a2fdaf1dd61f09a5051d5a037bf6f0659459b.tar.gz
Fix for failing ps_7ndb.test, force write_row when batching inserts so that update of primary key is done before next value to insert
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r--sql/ha_ndbcluster.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index a6b4f928e72..bf8db96c76f 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -1894,6 +1894,7 @@ int ha_ndbcluster::write_row(byte *record)
m_bulk_insert_not_flushed= TRUE;
if ((m_rows_to_insert == (ha_rows) 1) ||
((m_rows_inserted % m_bulk_insert_rows) == 0) ||
+ m_primary_key_update ||
set_blob_value)
{
THD *thd= current_thd;
@@ -2018,17 +2019,19 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data)
if (delete_res)
{
DBUG_PRINT("info", ("delete failed"));
- // Undo write_row(new_data)
DBUG_RETURN(delete_res);
}
// Insert new row
DBUG_PRINT("info", ("delete succeded"));
+ m_primary_key_update= TRUE;
insert_res= write_row(new_data);
+ m_primary_key_update= FALSE;
if (insert_res)
{
DBUG_PRINT("info", ("insert failed"));
if (trans->commitStatus() == NdbConnection::Started)
{
+ // Undo write_row(new_data)
m_primary_key_update= TRUE;
insert_res= write_row((byte *)old_data);
m_primary_key_update= FALSE;