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

.*: complete insert/replace statement #708 #709

Merged

Conversation

hustjieke
Copy link
Contributor

[summary]
compute insert/replace statement.

  1. add [HIGH_PRIORITY | LOW_PRIORITY | DELAYED] options for Insert, add
    [LOW_PRIORITY | DELAYED] options for Replace Statement.
  2. remove "on duplicate key update" for Replace Statement, this is a bug.
  3. add support for "PARTITION" to parse, but the function hasn't
    implement yet.
  4. add support for writing data without columns, like: "insert into t values ...."
  5. refactor some code on insert plan.

[test case]
src/planner/insert_plan_test.go
src/proxy/insert_test.go
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/parse_test.go

[patch codecov]
src/planner/insert_plan.go 93.7%
src/proxy/insert.go 87.0%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast.go 96.6%

@hustjieke hustjieke force-pushed the feature_complete_replace_insert_stmt branch 3 times, most recently from 55604fc to ddaeebe Compare December 21, 2020 07:15
@codecov
Copy link

codecov bot commented Dec 21, 2020

Codecov Report

Merging #709 (f1529a0) into master (7637ccb) will decrease coverage by 0%.
The diff coverage is 90%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #709   +/-   ##
=====================================
- Coverage      89%    89%   -1%     
=====================================
  Files         131    131           
  Lines        9284   9308   +24     
=====================================
+ Hits         8271   8286   +15     
- Misses        672    676    +4     
- Partials      341    346    +5     
Impacted Files Coverage Δ
src/proxy/insert.go 81% <77%> (-19%) ⬇️
src/planner/insert_plan.go 90% <91%> (-4%) ⬇️
src/router/compute.go 100% <100%> (ø)
src/router/global.go 83% <100%> (ø)
src/router/hash.go 98% <100%> (ø)
src/router/list.go 91% <100%> (ø)
src/router/router.go 86% <100%> (ø)
src/router/single.go 83% <100%> (ø)
src/backend/txn.go 86% <0%> (-2%) ⬇️
src/backend/connection.go 89% <0%> (+1%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7637ccb...f1529a0. Read the comment docs.

@hustjieke hustjieke marked this pull request as ready for review December 21, 2020 07:34
@hustjieke hustjieke force-pushed the feature_complete_replace_insert_stmt branch from ddaeebe to f8a54e2 Compare December 21, 2020 15:35
[summary]
compute insert/replace statement.
1. add [HIGH_PRIORITY | LOW_PRIORITY | DELAYED] options for Insert, add
[LOW_PRIORITY | DELAYED] options for Replace Statement.
2. remove "on duplicate key update" for Replace Statement, this is a bug.
3. add support for "PARTITION" to parse, but the function hasn't
implement yet.
4. add support for writing data without columns, like: "insert into t values ...."
5. refactor some code on insert plan.

[test case]
src/planner/insert_plan_test.go
src/proxy/insert_test.go
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/parse_test.go

[patch codecov]
src/planner/insert_plan.go  93.7%
src/proxy/insert.go 92.0%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast.go 96.6%
@hustjieke hustjieke force-pushed the feature_complete_replace_insert_stmt branch from f8a54e2 to 5b8db72 Compare December 21, 2020 15:42
@BohuTANG
Copy link
Contributor

This feature is really cool, I need @andyli029 to review it first.

src/proxy/insert.go Outdated Show resolved Hide resolved
src/proxy/insert.go Outdated Show resolved Hide resolved
[summary]
fix wrong word  'globle' --> 'global'

[test case]
N/A

[patch codecov]
N/A
@andyli029
Copy link
Contributor

LGTM

…sn't match value count' radondb#708

[summary]
add fail test cases about insert stmt 'Column count doesn't match value count',e.g.:
create table t(a int key);
insert /*success test*/ into t values(1);
insert /*fail test*/ into t values(2, 3);

[test case]
N/A

[patch codecov]
N/A
@BohuTANG
Copy link
Contributor

LGTM

@BohuTANG BohuTANG merged commit 3885e5a into radondb:master Dec 30, 2020
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

3 participants