Skip to content

WITH keyword panics #270

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

Closed
edwardloveall opened this issue Mar 29, 2025 · 2 comments
Closed

WITH keyword panics #270

edwardloveall opened this issue Mar 29, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@edwardloveall
Copy link

I saw that a fix for WITH was made in #263, but I have an example that is not a CTE but still crashes:

# echo "CREATE ROLE foo WITH SUPERUSER" > scratch.sql
# ./postgrestools check scratch.sql
Encountered an unexpected error

This is a bug in Postgres Tools, not an error in your code, and we would appreciate it if you could report it along with the following information to help us fixing the issue:

Source Location: crates/pgt_statement_splitter/src/parser.rs:88:9
Thread Name: pgt::worker_5
Message: cannot start statement within statement at Some(Token { kind: With, text: "WITH", span: 16..20, token_type: ReservedKeyword })

scratch.sql internalError/panic  INTERNAL  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ processing panicked: cannot start statement within statement at Some(Token { kind: With, text: "WITH", span: 16..20, token_type: ReservedKeyword })
  
  ⚠ This diagnostic was derived from an internal error. Potential bug, please report it if necessary.
  

Checked 0 files in 504µs. No fixes applied.
internalError/io ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ No files were processed in the specified paths.
@edwardloveall edwardloveall added the bug Something isn't working label Mar 29, 2025
@psteinroe
Copy link
Collaborator

we need to publish a new release for the fix to be available. We will do so latest Monday.

Unfortunately, we did not set up nightly releases yet. If you don't want to wait, you can build from source.

Thanks for trying it out!

@psteinroe
Copy link
Collaborator

after some upstream issues have been resolved, we finally released a new version that includes this fix. Sorry for the delay!

@edwardloveall edwardloveall changed the title WITH keyword panic's WITH keyword panics Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants