[Enhancement]: Add dynamic configuration for lower_case_table_names i…#156
Open
SimonChou12138 wants to merge 1 commit intooceanbase:developfrom
Open
[Enhancement]: Add dynamic configuration for lower_case_table_names i…#156SimonChou12138 wants to merge 1 commit intooceanbase:developfrom
SimonChou12138 wants to merge 1 commit intooceanbase:developfrom
Conversation
…nstead of hard coding
Author
|
@LINxiansheng Hello, could you please help me with a review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task Description
Fix hardcoded table names in SQL queries to support
lower_case_table_namessystem variable. This resolves issues where system tables cannot be found whenlower_case_table_names=0(case-sensitive mode) is configured.Related to case-sensitivity handling for MySQL compatibility.
Solution Description
Replace hardcoded table names with constants: Changed direct string literals like
__all_serverand__all_zoneto use constants fromob_inner_table_schema_constants.h(e.g.,OB_ALL_SERVER_TNAME,OB_ALL_ZONE_TNAME)Read
lower_case_table_namesfrom system variables: Modified bootstrap and schema initialization code to dynamically read thelower_case_table_namessetting instead of hardcodingOB_LOWERCASE_AND_INSENSITIVESupport environment variable configuration: Added support for setting
lower_case_table_namesvia theLOWER_CASE_TABLE_NAMESenvironment variable inmain.cppSet proper
name_case_modefor system tables: Ensured system tables always use case-sensitive mode (OB_ORIGIN_AND_SENSITIVE) regardless of tenant settings, while user tables respect the tenant'slower_case_table_namesconfigurationModified files:
src/observer/main.cppsrc/rootserver/ob_bootstrap.cppsrc/share/ob_locality_table_operator.cppsrc/share/schema/ob_schema_mgr.cppsrc/share/schema/ob_schema_utils.cppsrc/share/schema/ob_server_schema_service.cppsrc/storage/tx/wrs/ob_tenant_weak_read_cluster_service.cppPassed Regressions
lower_case_table_names=0configurationUpgrade Compatibility
This change is backward compatible:
lower_case_table_names=1)Other Information
This fix improves MySQL compatibility by properly supporting the
lower_case_table_namessystem variable, which is important for:Release Note
Enhancement: Added proper support for
lower_case_table_namessystem variable. System table names are now referenced using constants instead of hardcoded strings, enabling case-sensitive table name mode (lower_case_table_names=0) to work correctly. This improves MySQL compatibility and supports cross-platform deployments.