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 TiDB DEFAULT_GENERATED #290

Merged
merged 2 commits into from Jun 29, 2020
Merged

fix TiDB DEFAULT_GENERATED #290

merged 2 commits into from Jun 29, 2020

Conversation

Ryan-Git
Copy link
Collaborator

@Ryan-Git Ryan-Git commented Jun 17, 2020

this closes #289

for datetime column with DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP property, TiDB show it as DEFAULT_GENERATED on update CURRENT_TIMESTAMP in meta data. There might be other cases I'm not sure but anyway it must be distinguished from MySQL STORED GENERATED and VIRTUAL GENERATED columns.

@Ryan-Git Ryan-Git requested a review from ming535 June 17, 2020 12:59
@Ryan-Git Ryan-Git changed the title add debug fix TiDB DEFAULT_GENERATED Jun 26, 2020
if extra.Valid && strings.Contains(strings.ToUpper(extra.String), "GENERATED") {

// TiDB describes certain column as `DEFAULT_GENERATED`
if extra.Valid && (strings.Contains(strings.ToUpper(extra.String), "VIRTUAL GENERATED") ||
Copy link
Contributor

Choose a reason for hiding this comment

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

better to cache the result of "IsTidb" , and use that to identiry tidb.

Copy link
Collaborator Author

@Ryan-Git Ryan-Git Jun 29, 2020

Choose a reason for hiding this comment

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

IsTiDB does not help here.
It distinguishes whether a column is generated or not, rather than TiDB or not.

@Ryan-Git Ryan-Git merged commit 2176f75 into master Jun 29, 2020
@Ryan-Git Ryan-Git deleted the debug branch September 6, 2021 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gravity全量同步时updated_at会发生改变
2 participants