summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
authorunknown <mskold/marty@mysql.com/linux.site>2007-06-14 16:01:51 +0200
committerunknown <mskold/marty@mysql.com/linux.site>2007-06-14 16:01:51 +0200
commit160489138d83098236700e7db8e18c38764e871f (patch)
tree5f4258ac0aba88f7837ee18654f416308009d585 /ndb
parent8046747c62197d6eea236bc5d6ec5e9c23b8416a (diff)
downloadmariadb-git-160489138d83098236700e7db8e18c38764e871f.tar.gz
Bug#26342 auto_increment_increment AND auto_increment_offset REALLY REALLY anger NDB cluster, implemented support for auto_increment_offset and auto_increment_increment for Ndb, post review fix
Diffstat (limited to 'ndb')
-rw-r--r--ndb/src/ndbapi/Ndb.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp
index 941bfc88b24..dcdee3d4ea1 100644
--- a/ndb/src/ndbapi/Ndb.cpp
+++ b/ndb/src/ndbapi/Ndb.cpp
@@ -882,8 +882,8 @@ Ndb::getTupleIdFromNdb(Ndb_local_table_info* info,
DBUG_PRINT("info", ("Next value fetched from database %lu", (ulong) opValue));
DBUG_PRINT("info", ("Increasing %lu by offset %lu, increment is %lu", (ulong) (ulong) opValue, (ulong) offset, (ulong) step));
Uint64 current, next;
- next = ((Uint64) (opValue + step - offset)) / step;
- next = next * step + offset;
+ Uint64 div = ((Uint64) (opValue + step - offset)) / step;
+ next = div * step + offset;
current = (next < step) ? next : next - step;
tupleId = (opValue <= current) ? current : next;
DBUG_PRINT("info", ("Returning %lu", (ulong) tupleId));