Skip to content

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

Open
labkey-adam wants to merge 2 commits intodevelopfrom
fb_reorderer
Open

Fix a few minor issues with the SQL script reorderer#7393
labkey-adam wants to merge 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
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.

1 participant