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: postgresql add default expr and nextval #2301

Merged
merged 19 commits into from
Apr 17, 2020
Merged

feature: postgresql add default expr and nextval #2301

merged 19 commits into from
Apr 17, 2020

Conversation

jsbxyyx
Copy link
Member

@jsbxyyx jsbxyyx commented Feb 26, 2020

Ⅰ. Describe what this PR did

feature: postgresql add default expr and convert nextval to sequence expr.

Ⅱ. 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-io
Copy link

codecov-io commented Feb 26, 2020

Codecov Report

Merging #2301 into develop will decrease coverage by 0.08%.
The diff coverage is 6.45%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #2301      +/-   ##
=============================================
- Coverage      51.41%   51.32%   -0.09%     
+ Complexity      2807     2803       -4     
=============================================
  Files            553      553              
  Lines          17698    17716      +18     
  Branches        2093     2097       +4     
=============================================
- Hits            9099     9093       -6     
- Misses          7742     7763      +21     
- Partials         857      860       +3     
Impacted Files Coverage Δ Complexity Δ
...r/druid/postgresql/PostgresqlInsertRecognizer.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...va/io/seata/rm/datasource/exec/InsertExecutor.java 63.27% <9.09%> (-6.61%) 45.00 <1.00> (-2.00)
...o/seata/server/coordinator/DefaultCoordinator.java 54.63% <0.00%> (-0.52%) 28.00% <0.00%> (-1.00%)
...in/java/io/seata/server/session/GlobalSession.java 83.71% <0.00%> (-0.46%) 71.00% <0.00%> (-1.00%)

@zjinlei zjinlei added this to the 1.2.0 milestone Mar 12, 2020
@jsbxyyx jsbxyyx closed this Apr 10, 2020
@jsbxyyx jsbxyyx reopened this Apr 10, 2020
@@ -0,0 +1,42 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

why not use com.alibaba.druid.sql.ast.expr.SQLSequenceExpr

Copy link
Member Author

Choose a reason for hiding this comment

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

sqlparser module can be multi implemention. druid just one of them.

@slievrly slievrly assigned slievrly and unassigned slievrly Apr 16, 2020
@slievrly slievrly self-requested a review April 16, 2020 06:22
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.

how to support mysql default?

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. Test case:
PG

insert into account_tbl(id, user_id, money) values (nextval('seq_account_tbl_id'), trim(both ?), ?)
insert into account_tbl(user_id, money, id) values (trim(both ?), ?, nextval('seq_account_tbl_id'))
insert into account_tbl(id, user_id, money) values (default, ?, ?)

Oracle

insert into account_tbl(id, user_id, money, information, description) values (account_tbl_seq.nextval, ?, ?, ?, ?)

@slievrly
Copy link
Member

default as value check valid.
image

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

@slievrly slievrly merged commit 74f0f09 into apache:develop Apr 17, 2020
@jsbxyyx jsbxyyx deleted the sql_method branch April 17, 2020 07:41
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.

None yet

6 participants