Commit c41a4472 authored by mskold/marty@mysql.com/linux.site's avatar mskold/marty@mysql.com/linux.site
Browse files

Bug#26342 auto_increment_increment AND auto_increment_offset REALLY REALLY...

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
parent 43f80e98
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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));