a19920714liou opened a new issue, #11513:
URL: https://github.com/apache/gravitino/issues/11513
### Version
main branch
### Describe what's wrong
When using the MySQL catalog to connect to a MariaDB database, columns with
`CURRENT_TIMESTAMP` as the default value are not correctly parsed.
### Error message and/or stacktrace
In `MysqlColumnDefaultValueConverter`, the `CURRENT_TIMESTAMP` check uses
`String.startsWith()`, which is case-sensitive. MariaDB returns
`current_timestamp` (lowercase) in the column metadata, while MySQL returns
`CURRENT_TIMESTAMP` (uppercase). This causes the default value to be
incorrectly handled when the catalog is connected to a MariaDB instance.
### How to reproduce
1. Set up a MariaDB instance and create a table with a `TIMESTAMP` column
that has `CURRENT_TIMESTAMP` as the default value:
```sql
CREATE TABLE test_table (
id INT PRIMARY KEY,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
```
2. Configure a MySQL catalog in Gravitino pointing to the MariaDB database.
3. Load the table metadata through the Gravitino MySQL catalog.
4. Observe that the default value of created_at is not correctly parsed (it
returns the raw string instead of being recognized as
DEFAULT_VALUE_OF_CURRENT_TIMESTAMP).
### Additional context
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]