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

refactor(DBTableEditor): DBTableEditor adapt for native mysql and ob mysql #406

Conversation

PeachThinking
Copy link
Collaborator

What type of PR is this?

module-Schema object

What this PR does / why we need it:

The table creation statement generated by DBTableEditor by OB MYSQL mode cannot be executed in native MySQL.
In DBTableEditor#appendTableOptions:

if (Objects.nonNull(options.getReplicaNum())) {
            sqlBuilder.append("REPLICA_NUM = ").append(String.valueOf(options.getReplicaNum())).space();
        }

        if (Objects.nonNull(options.getUseBloomFilter())) {
            sqlBuilder.append("USE_BLOOM_FILTER = ").append(options.getUseBloomFilter() ? "TRUE" : "FALSE").space();
        }
        if (Objects.nonNull(options.getTabletSize())) {
            sqlBuilder.append("TABLET_SIZE = ").append(String.valueOf(options.getTabletSize())).space();
        }

These three parameters are unique to OB server. Neither native mysql nor oracle support these three parameters.
So OBMySQLTableEditor was created to distinguish these differences.

Which issue(s) this PR fixes:

Fixes #404

Special notes for your reviewer:

Additional documentation e.g., usage docs, etc.:


@PeachThinking PeachThinking added priority-high module-Database object Table/View/Type/Function/Procedure/Package/Synonym/Constraint/Index type-refactor refactor code or rename variables labels Sep 26, 2023
@PeachThinking PeachThinking added this to the ODC 4.2.2 milestone Sep 26, 2023
@PeachThinking PeachThinking self-assigned this Sep 26, 2023
@PeachThinking PeachThinking changed the base branch from main to dev/4.2.2 September 26, 2023 04:00
Copy link
Collaborator

@guowl3 guowl3 left a comment

Choose a reason for hiding this comment

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

MySqlTableEditor delete some optional parameters that unsupported in MySql.

@PeachThinking PeachThinking merged commit a5abf3c into dev/4.2.2 Sep 27, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module-Database object Table/View/Type/Function/Procedure/Package/Synonym/Constraint/Index priority-high type-refactor refactor code or rename variables
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Bug]: The table creation statement generated by TableEditor in MYSQL mode cannot be executed.
2 participants