FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

INSERT with SetOperations by manticore-projects · Pull Request #1531 · JSQLParser/JSqlParser · GitHub

INSERT with SetOperations - #1531

Merged
wumpz merged 7 commits into
JSQLParser:masterfrom
manticore-projects:#1491_InsertUnionSelect
May 15, 2022
Merged

INSERT with SetOperations#1531
wumpz merged 7 commits into
JSQLParser:masterfrom
manticore-projects:#1491_InsertUnionSelect

Conversation

manticore-projects commented May 8, 2022
edited
Loading

Copy link
Copy Markdown
Contributor

Simplify the INSERT production
Use SetOperations for Select and Values
Better Bracket handling for WITH ... SELECT ...
Fixes #1491

Following statements will work now:

(
    with a as (select * from dual) 
    select * from a
);

insert into table1 (tf1,tf2,tf2) (   
    (select sf1,sf2,sf3 from s1)
    union (select rf1,rf2,rf2 from r1)
);

Simplify the INSERT production
Use SetOperations for Select and Values
Better Bracket handling for WITH ... SELECT ...
Fixes JSQLParser#1491
List the changes
Minor rephrases
Correct the Maven Artifact Example

wumpz commented May 11, 2022

Copy link
Copy Markdown
Member

please resolve conflicts

manticore-projects force-pushed the #1491_InsertUnionSelect branch from aabebbf to ca82997 Compare May 12, 2022 13:46
manticore-projects requested a review from wumpz May 12, 2022 14:00
wumpz merged commit b5672c5 into JSQLParser:master May 15, 2022

wumpz commented May 15, 2022

Copy link
Copy Markdown
Member

After merging I am not able to compile anymore.

Copy link
Copy Markdown
Contributor Author

After merging I am not able to compile anymore.

What is the challenge please?
Have you tried gradle build? The CI passed before.

Copy link
Copy Markdown
Contributor Author

Confirmed, I get the same problem -- very strange. How did the CI succeed?
I will fix that tomorrow morning, whatever it is.

wumpz commented May 15, 2022

Copy link
Copy Markdown
Member

I am not able to correct this since

Select SelectWithWithItems( ):
{
    Select select;
    List<WithItem> with = null;
}
{
    LOOKAHEAD(2) ( 
        "(" with=WithList()  select = Select( with ) ")" { select.withUsingWithBrackets(true); }
    )
    |
    (
         [ with=WithList() ] select = Select( with )
    )

    {
        return select;
    }
}

yields

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project jsqlparser: Compilation failure: Compilation failure: 
/C:/work/java/JSqlParser/target/generated-sources/javacc/net/sf/jsqlparser/parser/CCJSqlParser.java:[5631,9] unreachable statement
/C:/work/java/JSqlParser/target/generated-sources/javacc/net/sf/jsqlparser/parser/CCJSqlParser.java:[5639,1] missing return statement
-> [Help 1]

This one I know from switching to modern JavaCC templating. Very strange.

wumpz commented May 15, 2022

Copy link
Copy Markdown
Member

I pushed a running version. To get this state I had to remove the changes from

SelectWithWithItems production
and disabled tests in InsrtTest (testInsertOutputClause, one assert in testInsertWithSelect)

wumpz commented May 15, 2022

Copy link
Copy Markdown
Member

Here only the Codacy and Merge checks were presented. Your change was perfectly mergeable, but this means not automatically compilable.

wumpz commented May 15, 2022

Copy link
Copy Markdown
Member

Corrected grammar. It was semantically incomplete.

wumpz commented May 15, 2022

Copy link
Copy Markdown
Member
  1. Tests reactivated again.
  2. deparser and toString for OutputClause implemented

so this seems to be complete now

Copy link
Copy Markdown
Contributor Author

Good Morning,

thank you for sorting this out. I am really sorry for this mess, no idea what happened.
I build and test every single time, before I push -- however, checking out this PR, I found those missing part myself and was able to reproduce the problem. Very odd. I can only imagine, that I merged wrongly when resolving conflicts after the previous PR has been accepted.

Sorry again and cheers!

wumpz commented May 16, 2022

Copy link
Copy Markdown
Member

No problem. However, strange that this happended. BTW I found out, that travis-ci does not work since a couple of month, even that there are a lot of free build credits left. I opened a new issue here. Maybe its time to switch to Github Actions.

Copy link
Copy Markdown
Contributor Author

Maybe its time to switch to Github Actions.

Yes please, I'd like to support that, because I really do not like it when things suddenly stop to work -- without notice.
This commit should have been rejected and sent me a message at least.

wumpz commented May 16, 2022

Copy link
Copy Markdown
Member

Github Action Maven build activated. I have no idea how to configure this Gradle build to use multiple JDKs.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

can not parser union select clause in insert query

2 participants


Back | FazBrowse Home | New Git URL