-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Conversation
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
Please follow PR Title Format:
Or if the count of mainly changed packages are more than 3, use
|
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
Please follow PR Title Format:
Or if the count of mainly changed packages are more than 3, use
|
1 similar comment
Please follow PR Title Format:
Or if the count of mainly changed packages are more than 3, use
|
There was a problem hiding this 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.
-- add test case
executor/executor_test.go
Outdated
@@ -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";`) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/merge |
/run-all-tests |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #21199 |
/run-cherry-picker |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-3.0 in PR #21222 |
…ingcap#21199) Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
What problem does this PR solve?
TiDB
throw unexpectederror
while executeloaddata stmt
inprepare 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 logerror
ErrUnsupportedPs
Ps.
JDBC
will resend thetext protocol request
Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Release note
error
when preparing theloaddata
statement.