Uh oh!
There was an error while loading. Please reload this page.
GitHub Issue 1431: Cannot generate samples with long counter in the naming pattern - #7970
GitHub Issue 1431: Cannot generate samples with long counter in the naming pattern#7970XingY wants to merge 3 commits into
Conversation
| } | ||
| } | ||
| private static @Nullable Long executeAndMaybeReturnLong(TableInfo tinfo, SQLFragment sql) |
There was a problem hiding this comment.
There's one remaining call to executeAndMaybeReturnInteger that also returns a rowId. Should that also be returning a long?
There was a problem hiding this comment.
No, executeAndMaybeReturnInteger is currently used to query dbsequences.rowId only. There might be plan to migrate rowId to long also, but as of right now, the column type is integer.
| for (String nameSuffix : nameSuffixes) | ||
| { | ||
| // \d+ admits suffixes beyond Long.MAX_VALUE, so skip any that don't fit |
There was a problem hiding this comment.
Why is it we can skip these here? I'm not familiar with how getMaxCounterWithPrefixFunction is used, so a little more detail in this comment would be helpful.
There was a problem hiding this comment.
Comment updated to add: skip any that don't fit so generated sequence won't overflow. getMaxCounterWithPrefixFunction is used to determine the value to bump current dbsequence.value to, before further increment it.
Manual Testing: |
Rationale
core.DBSequence.value column is of bigInt type in DB, but DBSequenceManager.current returns int.
Related Pull Requests
Changes