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

ddl: Remove field "comment" from TiDB::TableInfo #9339

Merged
merged 4 commits into from
Aug 22, 2024

Conversation

JaySon-Huang
Copy link
Contributor

@JaySon-Huang JaySon-Huang commented Aug 21, 2024

What problem does this PR solve?

Issue Number: close #9497

Problem Summary:

The "comment" field in TableInfo is useless for TiFlash. And also it could contain some user info of the table def. Removing them from TiFlash is more reasonable.

What is changed and how it works?

ddl: Remove field "comment" from TiDB::TableInfo

  * Remove `comment` field from `TableInfo`, `ColumnInfo`, etc
  * Remove `table_name` from `IndexInfo` because it is useless
  * Remove storage_engine_type from `TableInfo`. We used to use it to create "StorageDeltaMerge" or "StorageTransactionMergeTree" before v4.0 is released. But the later one has been totally removed from TiFlash.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility
    • Older version tiflash binary require the "comment" field when parsing. This PR will make in-place downgrade failed

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 21, 2024
@JaySon-Huang JaySon-Huang changed the title [WIP] ddl: Remove comments from TiDB::TableInfo [WIP] ddl: Remove field "comment" from TiDB::TableInfo Aug 21, 2024
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 21, 2024
@JaySon-Huang JaySon-Huang changed the title [WIP] ddl: Remove field "comment" from TiDB::TableInfo ddl: Remove field "comment" from TiDB::TableInfo Aug 21, 2024
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 21, 2024
Comment on lines -766 to -775
: id(0)
, state(TiDB::SchemaState::StateNone)
, index_type(0)
, is_unique(true)
, is_primary(true)
, is_invisible(true)
, is_global(true)
Copy link
Contributor Author

@JaySon-Huang JaySon-Huang Aug 21, 2024

Choose a reason for hiding this comment

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

Remove because it is conflict with those default value defined in TiDB.h

struct IndexInfo
{
IndexInfo() = default;
explicit IndexInfo(Poco::JSON::Object::Ptr json);
Poco::JSON::Object::Ptr getJSONObject() const;
void deserialize(Poco::JSON::Object::Ptr json);
Int64 id = -1;
String idx_name;
std::vector<IndexColumnInfo> idx_cols;
SchemaState state = StatePublic;
Int32 index_type = -1;
bool is_unique = false;
bool is_primary = false;
bool is_invisible = false;
bool is_global = false;
};

@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 21, 2024
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Aug 21, 2024
Copy link
Member

@CalvinNeo CalvinNeo left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

ti-chi-bot bot commented Aug 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CalvinNeo, JinheLin

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 22, 2024
Copy link
Contributor

ti-chi-bot bot commented Aug 22, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-08-21 14:55:24.859159497 +0000 UTC m=+363719.993609627: ☑️ agreed by JinheLin.
  • 2024-08-22 02:49:30.105083072 +0000 UTC m=+406565.239533193: ☑️ agreed by CalvinNeo.

@ti-chi-bot ti-chi-bot bot merged commit e139b95 into pingcap:master Aug 22, 2024
5 checks passed
@JaySon-Huang JaySon-Huang deleted the refine_table_info branch August 22, 2024 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove useless fields in TiDB::TableInfo
3 participants