Skip to content

[#11513] fix(catalog-mysql): Fix MySQL catalog incompatible with MariaDB due to case-sensitive CURRENT_TIMESTAMP check - #11510

Merged
yuqi1129 merged 1 commit into
apache:mainfrom
a19920714liou:fix/mysql-mariadb-compat
Jun 10, 2026
Merged

[#11513] fix(catalog-mysql): Fix MySQL catalog incompatible with MariaDB due to case-sensitive CURRENT_TIMESTAMP check#11510
yuqi1129 merged 1 commit into
apache:mainfrom
a19920714liou:fix/mysql-mariadb-compat

Conversation

@a19920714liou

@a19920714liou a19920714liou commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Fix #11513

What changes were proposed in this pull request?

Changed the CURRENT_TIMESTAMP comparison in MysqlColumnDefaultValueConverter from case-sensitive startsWith to case-insensitive StringUtils.startsWithIgnoreCase.

Why are the changes needed?

MariaDB returns default values with different casing (e.g., current_timestamp in lowercase) compared to MySQL (e.g., CURRENT_TIMESTAMP in uppercase). The existing String.startsWith() check is case-sensitive, which causes it to fail when connecting to a MariaDB database via the MySQL catalog, resulting in incorrect default value parsing.

Does this PR introduce any user-facing change?

No user-facing API changes. This fix ensures MariaDB users can correctly use the MySQL catalog with proper default value handling.

How was this patch tested?

Manually tested by connecting the MySQL catalog to a MariaDB instance and verifying that columns with CURRENT_TIMESTAMP as default value are correctly parsed.

@roryqi

roryqi commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

If this is a fix, we should have an issue. Could u create an issue first?

@a19920714liou

Copy link
Copy Markdown
Contributor Author

If this is a fix, we should have an issue. Could u create an issue first?

No, I just encountered this issue and made the necessary changes before submitting it directly

@a19920714liou

Copy link
Copy Markdown
Contributor Author

If this is a fix, we should have an issue. Could u create an issue first?

Do I need to add an issue?

@roryqi

roryqi commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

If this is a fix, we should have an issue. Could u create an issue first?

Do I need to add an issue?

yes.

@a19920714liou

Copy link
Copy Markdown
Contributor Author

If this is a fix, we should have an issue. Could u create an issue first?

Do I need to add an issue?

yes.

#11513

@a19920714liou a19920714liou changed the title [MINOR] fix(catalog-mysql): Fix MySQL catalog incompatible with MariaDB due to case-sensitive CURRENT_TIMESTAMP check [https://github.com/apache/gravitino/issues/11513] fix(catalog-mysql): Fix MySQL catalog incompatible with MariaDB due to case-sensitive CURRENT_TIMESTAMP check Jun 9, 2026
@a19920714liou a19920714liou changed the title [https://github.com/apache/gravitino/issues/11513] fix(catalog-mysql): Fix MySQL catalog incompatible with MariaDB due to case-sensitive CURRENT_TIMESTAMP check [#11513] fix(catalog-mysql): Fix MySQL catalog incompatible with MariaDB due to case-sensitive CURRENT_TIMESTAMP check Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Code Coverage Report

Overall Project 67.04% -0.01% 🟢
Files changed 37.14% 🔴

Module Coverage
aliyun 1.72% 🔴
api 46.8% 🟢
authorization-common 85.96% 🟢
aws 3.66% 🔴
azure 2.47% 🔴
catalog-common 10.42% 🔴
catalog-fileset 80.35% 🟢
catalog-glue 67.41% 🟢
catalog-hive 79.35% 🟢
catalog-jdbc-clickhouse 80.02% 🟢
catalog-jdbc-common 45.31% 🟢
catalog-jdbc-doris 80.28% 🟢
catalog-jdbc-hologres 54.03% 🟢
catalog-jdbc-mysql 79.23% -2.76% 🟢
catalog-jdbc-oceanbase 78.38% 🟢
catalog-jdbc-postgresql 82.29% 🟢
catalog-jdbc-starrocks 78.51% 🟢
catalog-kafka 77.01% 🟢
catalog-lakehouse-generic 58.53% 🟢
catalog-lakehouse-hudi 79.1% 🟢
catalog-lakehouse-iceberg 85.94% 🟢
catalog-lakehouse-paimon 79.29% 🟢
catalog-model 77.72% 🟢
cli 44.51% 🟢
client-java 77.91% 🟢
common 50.17% 🟢
core 82.51% 🟢
filesystem-hadoop3 76.97% 🟢
flink 0.0% 🔴
flink-common 46.3% 🟢
flink-runtime 0.0% 🔴
gcp 14.12% 🔴
hadoop-common 10.39% 🔴
hive-metastore-common 53.9% 🟢
iceberg-common 57.41% 🟢
iceberg-rest-server 73.8% 🟢
idp-basic 86.07% 🟢
integration-test-common 0.0% 🔴
jobs 66.17% 🟢
lance-common 20.81% 🔴
lance-rest-server 60.54% 🟢
lineage 53.02% 🟢
optimizer 82.87% 🟢
optimizer-api 21.95% 🔴
server 85.73% 🟢
server-common 73.28% 🟢
spark 28.57% 🔴
spark-common 41.01% 🟢
trino-connector 39.97% 🔴
Files
Module File Coverage
catalog-jdbc-mysql MysqlColumnDefaultValueConverter.java 37.14% 🔴

@roryqi
roryqi requested a review from yuqi1129 June 9, 2026 06:46
@jerryshao jerryshao added the branch-1.3 Automatically cherry-pick commit to branch-1.3 label Jun 9, 2026

@yuqi1129 yuqi1129 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@yuqi1129

Copy link
Copy Markdown
Contributor

@a19920714liou
Thanks for your contribution, and welcome to join the Gravitno community!!!

@yuqi1129
yuqi1129 merged commit 26dfd9b into apache:main Jun 10, 2026
33 checks passed
yuqi1129 pushed a commit that referenced this pull request Jun 10, 2026
…talog incompatible with MariaDB due to case-sensitive CURRENT_TIMESTAMP check (#11510) (#11561)

**Cherry-pick Information:**
- Original commit: 26dfd9b
- Target branch: `branch-1.3`
- Status: ✅ Clean cherry-pick (no conflicts)

Co-authored-by: a19920714liou <562951158@qq.com>
@a19920714liou
a19920714liou deleted the fix/mysql-mariadb-compat branch June 11, 2026 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch-1.3 Automatically cherry-pick commit to branch-1.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug report] MySQL catalog is incompatible with MariaDB due to case-sensitive CURRENT_TIMESTAMP check

4 participants