diff options
author | unknown <mskold/marty@quadfish.(none)> | 2007-12-07 10:46:12 +0100 |
---|---|---|
committer | unknown <mskold/marty@quadfish.(none)> | 2007-12-07 10:46:12 +0100 |
commit | f0e3f8f1c2957ca2d17e50a1d7dc72cfa13b6c58 (patch) | |
tree | 18b14ee47a341053047b623b92e487d3b6832995 /sql/ha_ndbcluster.cc | |
parent | c124985e6d2be89719b08833d546ba19e3b21a8a (diff) | |
parent | 8db8ab33f6b925f54143b9dbd5d9df40a6b26f3e (diff) | |
download | mariadb-git-f0e3f8f1c2957ca2d17e50a1d7dc72cfa13b6c58.tar.gz |
Merge mysql.com:/home/marty/MySQL/mysql-5.0-ndb
into mysql.com:/home/marty/MySQL/mysql-5.1-new-ndb
storage/ndb/include/kernel/signaldata/TcKeyRef.hpp:
Auto merged
storage/ndb/include/kernel/signaldata/TcRollbackRep.hpp:
Auto merged
storage/ndb/include/ndbapi/NdbDictionary.hpp:
Auto merged
storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp:
Auto merged
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
Auto merged
storage/ndb/src/ndbapi/NdbDictionary.cpp:
Auto merged
storage/ndb/src/ndbapi/NdbTransaction.cpp:
Auto merged
storage/ndb/src/ndbapi/ndberror.c:
Auto merged
sql/ha_ndbcluster.cc:
Merge
storage/ndb/src/ndbapi/NdbOperationExec.cpp:
Merge
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r-- | sql/ha_ndbcluster.cc | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 93722da574c..55c45f6c687 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -588,6 +588,25 @@ int ha_ndbcluster::ndb_err(NdbTransaction *trans) err.code, res)); if (res == HA_ERR_FOUND_DUPP_KEY) { + uint error_data= (uint) err.details; + uint dupkey= MAX_KEY; + + for (uint i= 0; i < MAX_KEY; i++) + { + if (m_index[i].type == UNIQUE_INDEX || + m_index[i].type == UNIQUE_ORDERED_INDEX) + { + const NDBINDEX *unique_index= + (const NDBINDEX *) m_index[i].unique_index; + if (unique_index && + unique_index->getIndexTable() && + (uint) unique_index->getObjectId() == error_data) + { + dupkey= i; + break; + } + } + } if (m_rows_to_insert == 1) { /* @@ -595,7 +614,7 @@ int ha_ndbcluster::ndb_err(NdbTransaction *trans) violations here, so we need to return MAX_KEY for non-primary to signal that key is unknown */ - m_dupkey= err.code == 630 ? table_share->primary_key : MAX_KEY; + m_dupkey= err.code == 630 ? table_share->primary_key : dupkey; } else { |