Skip to content

Fix a few minor issues with the SQL script reorderer#7393

Merged
labkey-adam merged 2 commits intodevelopfrom
fb_reorderer
Feb 7, 2026
Merged

Fix a few minor issues with the SQL script reorderer#7393
labkey-adam merged 2 commits intodevelopfrom
fb_reorderer

Conversation

@labkey-adam
Copy link
Contributor

@labkey-adam labkey-adam commented Feb 5, 2026

Rationale

The SQL script reorderer uses regular expressions to parse SQL statements. This fixes a couple issues I noticed when attempting to reorder the TNPRC upgrade scripts:

  • DROP INDEX regex on SQL Server did not model the correct syntax, which meant it mis-parsed the associated table name.
  • Parameters to stored procedures (e.g., sp_rename and fn_dropifexists) are comma-separated. On both databases, the stored procedure regexes assumed 0 or more spaces between a comma and the subsequent parameter value (good), but assumed 0 spaces between a parameter value and the subsequent comma (bad). Whitespace is permitted before a comma as well as after, so the regexes should allow it. This issue also led to table-name-parsing confusion.

@labkey-adam labkey-adam self-assigned this Feb 5, 2026
Copy link
Contributor

@labkey-martyp labkey-martyp left a comment

Choose a reason for hiding this comment

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

I tested on TNPRC. Looks good.

Still some issues around rename but I know that's not part of this PR.

@labkey-adam labkey-adam merged commit 3417286 into develop Feb 7, 2026
9 checks passed
@labkey-adam labkey-adam deleted the fb_reorderer branch February 7, 2026 01:20
Sign up for free to 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.

2 participants