diff options
author | unknown <mskold@mysql.com> | 2005-04-15 15:52:07 +0200 |
---|---|---|
committer | unknown <mskold@mysql.com> | 2005-04-15 15:52:07 +0200 |
commit | b112ccb58364631fa2af34dced30fc578d92ed8c (patch) | |
tree | 10066de4b4e8b456759590e47c973452ab6a0202 /sql/ha_ndbcluster.cc | |
parent | ce22ebd02dcb85f9b88b934162c0ec52e6dd1658 (diff) | |
download | mariadb-git-b112ccb58364631fa2af34dced30fc578d92ed8c.tar.gz |
Bug #9839 Column with AUTOINC contains -1 Value on node stop
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r-- | sql/ha_ndbcluster.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 6dc9c8df64a..242bdec75cb 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -47,6 +47,7 @@ static const char *ha_ndb_ext=".ndb"; #define NDB_HIDDEN_PRIMARY_KEY_LENGTH 8 +#define NDB_FAILED_AUTO_INCREMENT ~(Uint64)0 #define ERR_PRINT(err) \ DBUG_PRINT("error", ("%d message: %s", err.code, err.message)) @@ -1839,6 +1840,8 @@ int ha_ndbcluster::write_row(byte *record) // Table has hidden primary key Ndb *ndb= get_ndb(); Uint64 auto_value= ndb->getAutoIncrementValue((const NDBTAB *) m_table); + if (auto_value == NDB_FAILED_AUTO_INCREMENT) + ERR_RETURN(ndb->getNdbError()); if (set_hidden_key(op, table->fields, (const byte*)&auto_value)) ERR_RETURN(op->getNdbError()); } @@ -3975,6 +3978,8 @@ longlong ha_ndbcluster::get_auto_increment() (m_skip_auto_increment) ? ndb->readAutoIncrementValue((const NDBTAB *) m_table) : ndb->getAutoIncrementValue((const NDBTAB *) m_table, cache_size); + if (auto_value == NDB_FAILED_AUTO_INCREMENT) + ERR_RETURN(ndb->getNdbError()); DBUG_RETURN((longlong)auto_value); } |