Commit 522b702c authored by sunny's avatar sunny

branches/zip: Check for autoinc next value overflow explicitly when offset

is > 1. This is safer and easier to understand.
parent 2e935591
......@@ -1144,7 +1144,7 @@ innobase_next_autoinc(
} else {
next_value = current + increment;
}
} else {
} else if (max_value > current) {
if (current > offset) {
next_value = ((current - offset) / increment) + 1;
} else {
......@@ -1168,6 +1168,8 @@ innobase_next_autoinc(
next_value += offset;
}
}
} else {
next_value = max_value;
}
ut_a(next_value <= max_value);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment