GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix: DESC and EXPLAIN by jxnu-liguobin · Pull Request #1933 · JSQLParser/JSqlParser

Conversation

@jxnu-liguobin

@jxnu-liguobin jxnu-liguobin commented Dec 23, 2023

Copy link
Copy Markdown
Contributor

close #1931, to support MySQL {EXPLAIN | DESCRIBE | DESC} tbl_name
it is necessary to use LOOKAHEAD(3), It made explain01.sql change. It seems to be expected?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
jxnu-liguobin added 3 commits December 23, 2023 14:06
@jxnu-liguobin
Fix: DESC and EXPLAIN
47ddb91
@jxnu-liguobin
Fix: DESC and EXPLAIN
767f4ce
@jxnu-liguobin
add test
2eca1ec
manticore-projects
manticore-projects reviewed Dec 23, 2023
View reviewed changes
Comment thread src/test/java/net/sf/jsqlparser/util/validation/validator/StatementValidatorTest.java
@@ -53,7 +61,8 @@ public void testValidateBlock() throws JSQLParserException {
@Test

@manticore-projects manticore-projects Dec 23, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next time please use a Parametrised Test for this. Loops in Tests are an Anti-Pattern because you won't know which one failed. You can lookup the KeywordTests for getting a template.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
manticore-projects
manticore-projects reviewed Dec 23, 2023
View reviewed changes
Comment thread src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt

DescribeStatement Describe(): {
Table table;
DescribeStatement stmt = new DescribeStatement();

@manticore-projects manticore-projects Dec 23, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next time, create the statement at the end only after all tokens have parsed and passed, like:

return new Statement().withX(token.image).withY(token.image);

Its not a hard requirement, but in general Objects should be initialized only when needed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jxnu-liguobin and SheldonKubor reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@manticore-projects
manticore-projects merged commit 45f98f8 into JSQLParser:master Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@manticore-projects manticore-projects manticore-projects left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[FEATURE] cannot parse DESC table_name

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@jxnu-liguobin @manticore-projects
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.