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

feature: add antlr for mysql sqlparser #2933

Merged
merged 42 commits into from
Feb 19, 2021
Merged

feature: add antlr for mysql sqlparser #2933

merged 42 commits into from
Feb 19, 2021

Conversation

springlayer
Copy link
Contributor

Ⅰ. Describe what this PR did

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov-commenter
Copy link

codecov-commenter commented Jul 27, 2020

Codecov Report

Merging #2933 into develop will increase coverage by 0.44%.
The diff coverage is 72.38%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #2933      +/-   ##
=============================================
+ Coverage      50.57%   51.01%   +0.44%     
- Complexity      3105     3184      +79     
=============================================
  Files            599      615      +16     
  Lines          19510    19912     +402     
  Branches        2406     2433      +27     
=============================================
+ Hits            9868    10159     +291     
- Misses          8650     8748      +98     
- Partials         992     1005      +13     
Impacted Files Coverage Δ Complexity Δ
...parser/antlr/mysql/AntlrMySQLDeleteRecognizer.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...parser/antlr/mysql/AntlrMySQLInsertRecognizer.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...parser/antlr/mysql/AntlrMySQLUpdateRecognizer.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...rser/antlr/mysql/MySQLOperateRecognizerHolder.java 40.00% <40.00%> (ø) 2.00 <2.00> (?)
...arser/antlr/SQLOperateRecognizerHolderFactory.java 57.14% <57.14%> (ø) 2.00 <2.00> (?)
...parser/antlr/mysql/AntlrMySQLSelectRecognizer.java 62.50% <62.50%> (ø) 1.00 <1.00> (?)
...arser/antlr/mysql/AntlrMySQLRecognizerFactory.java 66.66% <66.66%> (ø) 3.00 <3.00> (?)
...er/antlr/mysql/stream/ANTLRNoCaseStringStream.java 83.33% <83.33%> (ø) 3.00 <3.00> (?)
...ser/antlr/AntlrDelegatingSQLRecognizerFactory.java 84.61% <84.61%> (ø) 3.00 <3.00> (?)
...a/io/seata/sqlparser/antlr/mysql/MySqlContext.java 87.09% <87.09%> (ø) 30.00 <30.00> (?)
... and 22 more

@springlayer springlayer changed the title add antlr on mysql sqlparser feature: add antlr on mysql sqlparser Jul 28, 2020
@funky-eyes funky-eyes added the first-time contributor first-time contributor label Jul 28, 2020
@jsbxyyx
Copy link
Member

jsbxyyx commented Aug 5, 2020

has code not committed.

@springlayer springlayer closed this Sep 3, 2020
@springlayer springlayer reopened this Sep 3, 2020
funky-eyes and others added 6 commits September 14, 2020 23:20
…arsing spaces, add new SQL alias parsing methods, and optimize some codes.
…arsing spaces, add new SQL alias parsing methods, and optimize some codes.
…arsing spaces, add new SQL alias parsing methods, and optimize some codes.
@codecov-io
Copy link

codecov-io commented Oct 23, 2020

Codecov Report

Merging #2933 (a78670a) into develop (fa3791e) will increase coverage by 0.38%.
The diff coverage is 72.61%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #2933      +/-   ##
=============================================
+ Coverage      51.58%   51.96%   +0.38%     
- Complexity      3401     3479      +78     
=============================================
  Files            621      637      +16     
  Lines          20655    21053     +398     
  Branches        2579     2606      +27     
=============================================
+ Hits           10655    10941     +286     
- Misses          8933     9032      +99     
- Partials        1067     1080      +13     
Impacted Files Coverage Δ Complexity Δ
...parser/antlr/mysql/AntlrMySQLDeleteRecognizer.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...parser/antlr/mysql/AntlrMySQLInsertRecognizer.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...parser/antlr/mysql/AntlrMySQLUpdateRecognizer.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...rser/antlr/mysql/MySQLOperateRecognizerHolder.java 40.00% <40.00%> (ø) 2.00 <2.00> (?)
...parser/antlr/mysql/AntlrMySQLSelectRecognizer.java 62.50% <62.50%> (ø) 1.00 <1.00> (?)
...arser/antlr/SQLOperateRecognizerHolderFactory.java 66.66% <66.66%> (ø) 2.00 <2.00> (?)
...arser/antlr/mysql/AntlrMySQLRecognizerFactory.java 66.66% <66.66%> (ø) 3.00 <3.00> (?)
...er/antlr/mysql/stream/ANTLRNoCaseStringStream.java 83.33% <83.33%> (ø) 3.00 <3.00> (?)
...ser/antlr/AntlrDelegatingSQLRecognizerFactory.java 84.61% <84.61%> (ø) 3.00 <3.00> (?)
...a/io/seata/sqlparser/antlr/mysql/MySqlContext.java 87.09% <87.09%> (ø) 30.00 <30.00> (?)
... and 23 more

bom/pom.xml Outdated Show resolved Hide resolved
pom.xml Outdated
@@ -337,7 +340,8 @@
<phase>validate</phase>
<configuration>
<configLocation>${user.dir}/style/seata_checkstyle.xml</configLocation>
<suppressionsLocation>${user.dir}/style/seata_suppressions.xml</suppressionsLocation>
<suppressionsLocation>${user.dir}/style/seata_suppressions.xml
Copy link
Contributor

Choose a reason for hiding this comment

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

Please revert here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pom space indentation has been processed

pom.xml Outdated
@@ -368,7 +372,8 @@
<artifactId>protobuf-maven-plugin</artifactId>
<version>${protobuf-maven-plugin.version}</version>
<configuration>
<protoSourceRoot>${project.basedir}/src/main/resources/protobuf/io/seata/protocol/transcation/</protoSourceRoot>
<protoSourceRoot>${project.basedir}/src/main/resources/protobuf/io/seata/protocol/transcation/
Copy link
Contributor

Choose a reason for hiding this comment

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

Please reset here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pom space indentation has been processed

* @return the SQLOperateRecognizer
*/
public static SQLOperateRecognizerHolder getSQLRecognizerHolder(String dbType) {
if (RECOGNIZER_HOLDER_MAP.get(dbType) != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

EnhancedServiceLoader already handle singleton, you can check SQLOperateRecognizerHolderFactory in druild.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

already processed

@slievrly slievrly closed this Jan 6, 2021
@slievrly slievrly reopened this Jan 6, 2021
Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@l81893521 l81893521 left a comment

Choose a reason for hiding this comment

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

LGTM

@slievrly slievrly changed the title feature: add antlr on mysql sqlparser feature: add antlr for mysql sqlparser Feb 19, 2021
@slievrly slievrly merged commit 546d342 into apache:develop Feb 19, 2021
@slievrly slievrly added this to the 1.5.0 milestone Feb 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-time contributor first-time contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants