Skip to content

fix truncate parsing to capture multiple tables #2048

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

Merged

Conversation

nick-redfearn
Copy link
Contributor

@nick-redfearn nick-redfearn commented Jul 24, 2024

Looking to address this issue -> #2047

Problem

Truncate statements with multiple tables do not parse

Solution

  • Add test scenarios
  • Add getTables, setTables and withTables methods to the Truncate class
  • Update JSqlParserCC.jjt + StatementDeParser

@manticore-projects
Copy link
Contributor

Very clean, I tip my hat.
Although you will need to check the look aheads because of:

Error: /home/runner/work/JSqlParser/JSqlParser/target/generated-sources/javacc/net/sf/jsqlparser/parser/CCJSqlParser.java:[24727,5] unreachable statement

After fixing this I would merge promptly, thank you for effort and contribution.

@nick-redfearn
Copy link
Contributor Author

Very clean, I tip my hat. Although you will need to check the look aheads because of:

Error: /home/runner/work/JSqlParser/JSqlParser/target/generated-sources/javacc/net/sf/jsqlparser/parser/CCJSqlParser.java:[24727,5] unreachable statement

After fixing this I would merge promptly, thank you for effort and contribution.

Thanks @manticore-projects 👍

I think Ive made the correct amendments now

@nick-redfearn
Copy link
Contributor Author

I have things running properly from my local instance now when I run

 mvn -B package --file pom.xml -DdisableXmlReport=true -Djacoco.skip=true -Dpmd.skip=true

image

@manticore-projects
Copy link
Contributor

Thank you much for your contribution and welcome to the JSQLParser team!

@manticore-projects manticore-projects merged commit aca82f5 into JSQLParser:master Jul 26, 2024
2 of 3 checks passed
@nick-redfearn nick-redfearn deleted the multiple-truncate-tables branch July 26, 2024 12:05
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