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

Fix deparse ALTER TABLE table_name ENABLE TRIGGER ALL syntax errors #222

Conversation

CDThomas
Copy link
Contributor

This change fixes syntax errors output by parsing/deparsing ALTER TABLE table_name ENABLE TRIGGER ALL statements. Previously the deparsed statement would be missing the ALL keyword.

Looks like the bug was a typo in the deparse logic that caused the ALL keyword to be left off.

This change adds the ALL keyword to the output string when ENABLE TRIGGER ALL is used. This change also adds coverage for other forms of ALTER TABLE statments that use ENABLE/DISABLE TRIGGER, but the other cases look to already be handled correctly.

This change fixes syntax errors output by parsing/deparsing `ALTER TABLE
table_name ENABLE TRIGGER ALL` statements. Previously the deparsed
statement would be missing the `ALL` keyword.

Looks like the bug was a typo in the deparse logic that caused the `ALL`
keyword to be left off.

This change adds the `ALL` keyword to the output string when `ENABLE
TRIGGER ALL` is used. This change also adds coverage for other forms of
`ALTER TABLE` statments that use `ENABLE`/`DISABLE` `TRIGGER`, but
the other cases look to already be handled correctly.
@CDThomas CDThomas marked this pull request as ready for review November 29, 2023 22:29
@lfittl
Copy link
Member

lfittl commented Nov 29, 2023

Good catch - thanks for the contribution!

@lfittl lfittl merged commit f1f8a02 into pganalyze:15-latest Nov 29, 2023
8 checks passed
@CDThomas CDThomas deleted the fix/deparse-alter-table-enable-trigger-all branch November 29, 2023 23:20
CDThomas added a commit to cipherstash/pg_query.rs that referenced this pull request Nov 30, 2023
Workaround for using pganalyze/libpg_query#222
until the fix is released in both libpq_query and pg_query.rs.
lelit added a commit to lelit/pglast that referenced this pull request Nov 30, 2023
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