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

fix generated column check in information_schema extra field #29

Merged
merged 2 commits into from
Jun 18, 2019

Conversation

amyangfei
Copy link

@amyangfei amyangfei commented Jun 12, 2019

in mysql5.7, Extra Fields include:

auto_increment for columns that have the AUTO_INCREMENT attribute.
on update CURRENT_TIMESTAMP for TIMESTAMP or DATETIME columns that have the ON UPDATE CURRENT_TIMESTAMP attribute.
VIRTUAL GENERATED or VIRTUAL STORED for generated columns.

in mysql8.0, Extra Fields include:

auto_increment for columns that have the AUTO_INCREMENT attribute.
on update CURRENT_TIMESTAMP for TIMESTAMP or DATETIME columns that have the ON UPDATE CURRENT_TIMESTAMP attribute.
VIRTUAL GENERATED or VIRTUAL STORED for generated columns.
DEFAULT_GENERATED for columns that have an expression default value.

I also checked mariadb 10.2, 10.3 have VIRTUAL GENERATED and DEFAULT_GENERATED too in extra too.

Before this pr, mydumper uses like '%GENERATED%' to filter generated column, which will have false positive (treat non-generated column as generated column). We can use more accurate match rule for the generated column.

@amyangfei amyangfei added the status/PTAL This PR is ready for review. Add this label back after committing new changes label Jun 12, 2019
mydumper.c Outdated Show resolved Hide resolved
mydumper.c Outdated Show resolved Hide resolved
Copy link

@kennytm kennytm left a comment

Choose a reason for hiding this comment

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

LGTM

@kennytm kennytm added status/LGTM1 One reviewer already commented LGTM and removed status/PTAL This PR is ready for review. Add this label back after committing new changes labels Jun 14, 2019
Copy link
Member

@csuzhangxc csuzhangxc left a comment

Choose a reason for hiding this comment

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

LGTM

@csuzhangxc csuzhangxc added status/LGTM2 Two reviewers already commented LGTM, ready for merge and removed status/LGTM1 One reviewer already commented LGTM labels Jun 18, 2019
@amyangfei amyangfei merged commit 068026d into pingcap:master Jun 18, 2019
@amyangfei amyangfei deleted the fix-generated-col-check branch June 18, 2019 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/LGTM2 Two reviewers already commented LGTM, ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants