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

executor: load data statement shoule not be prepared #21188

Merged
merged 6 commits into from
Nov 23, 2020
Merged

executor: load data statement shoule not be prepared #21188

merged 6 commits into from
Nov 23, 2020

Conversation

7yyo
Copy link
Contributor

@7yyo 7yyo commented Nov 22, 2020

What problem does this PR solve?

TiDB throw unexpected error while execute loaddata stmt in prepare stmt

Problem Summary:

The current error is:
Load data: previous load data option isn't closed normal
The expected error is:
This command is not supported in the prepared statement protocol yet

What is changed and how it works?

What's Changed:

prepare loaddata stmt will write log error ErrUnsupportedPs
Ps. JDBC will resend the text protocol request

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Release note

  • Raise an error when preparing the loaddata statement.

@7yyo 7yyo requested a review from a team as a code owner November 22, 2020 13:34
@7yyo 7yyo requested review from SunRunAway and removed request for a team November 22, 2020 13:34
@ti-srebot ti-srebot added the first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. label Nov 22, 2020
@CLAassistant
Copy link

CLAassistant commented Nov 22, 2020

CLA assistant check
All committers have signed the CLA.

@sre-bot
Copy link
Contributor

sre-bot commented Nov 22, 2020

@sre-bot
Copy link
Contributor

sre-bot commented Nov 22, 2020

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what's changed

Or if the count of mainly changed packages are more than 3, use

  • *: what's changed

@sre-bot
Copy link
Contributor

sre-bot commented Nov 22, 2020

@sre-bot
Copy link
Contributor

sre-bot commented Nov 22, 2020

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what's changed

Or if the count of mainly changed packages are more than 3, use

  • *: what's changed

1 similar comment
@sre-bot
Copy link
Contributor

sre-bot commented Nov 22, 2020

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what's changed

Or if the count of mainly changed packages are more than 3, use

  • *: what's changed

@7yyo 7yyo changed the title The load data statement does not support preparestatement. executor: The load data statement does not support preparestatement. Nov 22, 2020
@github-actions github-actions bot added the sig/execution SIG execution label Nov 22, 2020
@jackysp jackysp changed the title executor: The load data statement does not support preparestatement. executor: load data statement shoule not be prepared Nov 22, 2020
@jackysp jackysp added the type/bugfix This PR fixes a bug. label Nov 23, 2020
Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

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

Please add a test case.

@@ -5887,6 +5887,12 @@ func (s *testClusterTableSuite) TearDownSuite(c *C) {
s.testSuiteWithCliBase.TearDownSuite(c)
}

func (s *testSuiteP1) TestPrepareLoadData(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec(`prepare stmt from "load data local infile '/tmp/load_data_test.csv' into table test";`)
Copy link
Member

Choose a reason for hiding this comment

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

It should return an error. You could use tk.ExecToErr

Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 23, 2020
@jackysp jackysp requested a review from lysu November 23, 2020 05:10
Copy link
Contributor

@lzmhhh123 lzmhhh123 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Nov 23, 2020
@lzmhhh123
Copy link
Contributor

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 23, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot ti-srebot merged commit 6910eae into pingcap:master Nov 23, 2020
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Nov 23, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #21199

@jackysp
Copy link
Member

jackysp commented Nov 23, 2020

/run-cherry-picker

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Nov 23, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-3.0 in PR #21222

ti-srebot added a commit that referenced this pull request Nov 24, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
ti-srebot added a commit that referenced this pull request Nov 24, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
jackysp pushed a commit to qw4990/tidb that referenced this pull request Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. sig/execution SIG execution status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants