Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FORMATTING] plsql - keyword "rows" #818

Closed
sosoba opened this issue Dec 31, 2024 · 1 comment
Closed

[FORMATTING] plsql - keyword "rows" #818

sosoba opened this issue Dec 31, 2024 · 1 comment
Labels

Comments

@sosoba
Copy link

sosoba commented Dec 31, 2024

Input data

Which SQL and options did you provide as input?

select * from dual offset 5 rows fetch next 10 rows only

Expected Output

SELECT
  *
FROM
  dual
OFFSET
  5 ROWS
FETCH NEXT
  10 ROWS ONLY

Actual Output

SELECT
  *
FROM
  dual
OFFSET
  5 rows
FETCH NEXT
  10 rows ONLY

Usage

  • How are you calling / using the library?
    JS API and playground
  • What SQL language(s) does this apply to?
    plsql
  • Which SQL Formatter version are you using?
    15.4.8

It seems that rows are treated as identifier not keyword here.

@sosoba sosoba added the bug label Dec 31, 2024
@nene
Copy link
Collaborator

nene commented Jan 2, 2025

Thanks for reporting.

Unfortunately SQL Formatter is unable to properly distinguish between keywords and identifiers. There are basically two bad choices for it:

  • list lots as words as keywords and risk detecting normal identifiers as keywords
  • list only a few words as keywords and risk not detecting them

SQL Formatter takes the latter approach.

Or put in another way: I could "fix" this bug by introducing another bug.

@nene nene closed this as not planned Won't fix, can't repro, duplicate, stale Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants