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

parser: support the 'alter table xx cache' and 'alter table xx nocache' #28922

Merged
merged 12 commits into from
Oct 21, 2021
Merged

parser: support the 'alter table xx cache' and 'alter table xx nocache' #28922

merged 12 commits into from
Oct 21, 2021

Conversation

JayLZhou
Copy link
Contributor

@JayLZhou JayLZhou commented Oct 18, 2021

What problem does this PR solve?

Support alter table ${table_name} cache or nocache, close #28926
See Optimizing hotspot small tables #25293

Problem Summary:

What is changed and how it works?

There is no similar syntax in mysql, so we used an operation similar to oracle syntax. see : oracle documentation It will not affect the existing sql syntax.

How it Works:

ALTER TABLE xxx cache(CACHE) it turns a non-cache table into a cache table
ALTER TABLE xxx nocache(NOCACHE) it turns a cache table into a non-cache table

Check List

Tests

  • Unit test

Release note

Add syntax support for 'alter table xx cache' and 'alter table xx nocache' in the parser

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Oct 18, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • sylzd
  • tiancaiamao

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Oct 18, 2021
@CLAassistant
Copy link

CLAassistant commented Oct 18, 2021

CLA assistant check
All committers have signed the CLA.

@ti-chi-bot ti-chi-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 18, 2021
@ti-chi-bot
Copy link
Member

Welcome @jayl-zxl!

It looks like this is your first PR to pingcap/tidb 🎉.

I'm the bot to help you request reviewers, add labels and more, See available commands.

We want to make sure your contribution gets all the attention it needs!



Thank you, and welcome to pingcap/tidb. 😃

@tiancaiamao tiancaiamao changed the title [parser] parser: support the 'alter table xx cache' and 'alter table xx nocache' parser: support the 'alter table xx cache' and 'alter table xx nocache' Oct 18, 2021
parser/parser.y Outdated Show resolved Hide resolved
Copy link
Contributor

@tiancaiamao tiancaiamao left a comment

Choose a reason for hiding this comment

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

Please fix CI

planner/core/preprocess.go Outdated Show resolved Hide resolved
parser/parser_test.go Outdated Show resolved Hide resolved
parser/parser.y Outdated Show resolved Hide resolved
Copy link
Contributor

@tiancaiamao tiancaiamao 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 test to cover the change

parser/parser_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@tiancaiamao tiancaiamao left a comment

Choose a reason for hiding this comment

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

Rest LGTM

@sylzd
Copy link
Contributor

sylzd commented Oct 19, 2021

lgtm

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Oct 19, 2021
@JayLZhou
Copy link
Contributor Author

already remove it

@tisonkun
Copy link
Contributor

tisonkun commented Oct 19, 2021

@tiancaiamao @jayl-zxl I think the issue deserve a release note?

@sylzd
Copy link
Contributor

sylzd commented Oct 19, 2021

Does alter table .. cache cover all grammar? Is create table cache/nocache needed? if it is, maybe it's not suitable to close #28926

@JayLZhou
Copy link
Contributor Author

Does alter table .. cache covers all grammar? Is create table cache/nocache needed? if it is, maybe it's not suitable to close #28926

@tiancaiamao This operation is not supported for the time being

@tiancaiamao
Copy link
Contributor

@tiancaiamao @jayl-zxl I think the issue deserve a release note?

I've change the release note description for this PR.
This feature is still a WIP change, so before the finish of this feature, the user should not use it.
We will write the document when the whole things are done.

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Oct 20, 2021
@JayLZhou
Copy link
Contributor Author

@djshow832 PTAL

@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Oct 20, 2021
@tisonkun
Copy link
Contributor

tisonkun commented Oct 20, 2021

@tiancaiamao we should follow a format of release-note to pass the tide checker...updated.

@JayLZhou
Copy link
Contributor Author

@tiancaiamao we should follow a format of release-note to pass the tide checker...updated.

okay already modify it

@tiancaiamao
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 1311d01

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Oct 21, 2021
@ti-chi-bot
Copy link
Member

@jayl-zxl: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot merged commit 549fac6 into pingcap:master Oct 21, 2021
@JayLZhou JayLZhou deleted the samllhottable-parser branch October 21, 2021 03:09
@tiancaiamao tiancaiamao mentioned this pull request Oct 25, 2021
32 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. 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.

add grammar support in parser
7 participants