Skip to content

server: check LOAD DATA is into a base table#20924

Merged
ti-srebot merged 12 commits into
masterfrom
unknown repository
Dec 10, 2020
Merged

server: check LOAD DATA is into a base table#20924
ti-srebot merged 12 commits into
masterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Nov 9, 2020

What problem does this PR solve?

Issue Number: Fixes #20880

Problem Summary:

What is changed and how it works?

What's Changed:

Before loading data using LOAD DATA, a check if performed to make sure that the table is of type base table.

How it Works:

I have a PR on pingcap/parser#1080 to add an explicity IsBaseTable() function, which I think will be useful in other cases such as infoschema.

Note: The error code is a generic one. TiDB does not allow insertable views (differing from MySQL), and MySQL does not support sequences.

Related changes

Check List

Tests

  • Unit test

Side effects

  • None

Release note

  • TiDB now checks to make sure that the LOAD DATA statement can only load data into base tables.

@ghost ghost added the needs-cherry-pick-4.0 label Nov 9, 2020
@lonng
Copy link
Copy Markdown
Contributor

lonng commented Nov 9, 2020

@nullnotnil The PR #20917 has fixed the break of pingcap/parser#1079

@ghost
Copy link
Copy Markdown
Author

ghost commented Nov 9, 2020

@nullnotnil The PR #20917 has fixed the break of pingcap/parser#1079

Thanks! I'll watch for this to merge, and then update this PR.

@lonng
Copy link
Copy Markdown
Contributor

lonng commented Nov 10, 2020

@nullnotnil The PR #20917 has merged.

@ghost ghost added the component/server label Nov 10, 2020
@ghost ghost added the status/PTAL label Nov 10, 2020
Copy link
Copy Markdown
Contributor

@tangenta tangenta 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 Dec 3, 2020
Copy link
Copy Markdown
Member

@wjhuang2016 wjhuang2016 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 removed the status/LGT1 Indicates that a PR has LGTM 1. label Dec 3, 2020
ti-srebot
ti-srebot previously approved these changes Dec 3, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Dec 3, 2020
@ti-srebot
Copy link
Copy Markdown
Contributor

@tangenta, @wjhuang2016, @ti-srebot, PTAL.

1 similar comment
@ti-srebot
Copy link
Copy Markdown
Contributor

@tangenta, @wjhuang2016, @ti-srebot, PTAL.

Copy link
Copy Markdown
Member

@wjhuang2016 wjhuang2016 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
Copy link
Copy Markdown
Contributor

@tangenta, @wjhuang2016, @ti-srebot, PTAL.

@wjhuang2016
Copy link
Copy Markdown
Member

/merge

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

/run-all-tests

@ti-srebot
Copy link
Copy Markdown
Contributor

@nullnotnil merge failed.

@wjhuang2016
Copy link
Copy Markdown
Member

/merge

@ti-srebot
Copy link
Copy Markdown
Contributor

Your auto merge job has been accepted, waiting for:

  • 21179
  • 21633

@ti-srebot
Copy link
Copy Markdown
Contributor

/run-all-tests

@ti-srebot ti-srebot merged commit 836bf75 into pingcap:master Dec 10, 2020
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Dec 10, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Copy Markdown
Contributor

cherry pick to release-4.0 in PR #21638

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/server status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TiDB doesn't check LOAD DATA for view/sequence.

4 participants