Skip to content

GitHub Issue 1431: Cannot generate samples with long counter in the naming pattern - #7970

Open
XingY wants to merge 3 commits into
developfrom
fb_issue1431
Open

GitHub Issue 1431: Cannot generate samples with long counter in the naming pattern#7970
XingY wants to merge 3 commits into
developfrom
fb_issue1431

Conversation

@XingY

@XingYXingY commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Rationale

core.DBSequence.value column is of bigInt type in DB, but DBSequenceManager.current returns int.

Related Pull Requests

Changes

  • sequence.current returns long instead of int
  • add api test

}
}

private static @Nullable Long executeAndMaybeReturnLong(TableInfo tinfo, SQLFragment sql)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's one remaining call to executeAndMaybeReturnInteger that also returns a rowId. Should that also be returning a long?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@labkey-danield

labkey-danield commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Manual Testing:
I repro'd the issue first in develop before verifying the fix.
Tested both name and aliquot name expressions.
I also tested creating aliquots, derived and pooled samples. In all three cases giving the new sample a name and letting the name expression generate the name.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@XingY@labkey-danield@labkey-susanh