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

Cannot create table from metadata file #9124

Open
z070204z opened this issue Jun 5, 2024 · 2 comments
Open

Cannot create table from metadata file #9124

z070204z opened this issue Jun 5, 2024 · 2 comments

Comments

@z070204z
Copy link

z070204z commented Jun 5, 2024

[2024/06/05 16:11:18.690 +08:00] [ERROR] [] ["DB::Exception: Cannot create table from metadata file /data/deploy/install/data/tiflash-9000/metadata/db_1077654/t_1487435.sql, error: DB::Exception: Cannot parse string 'CURRENT_DATE' as MyDate: syntax error at position 8 (parsed just 'CURRENT_'), stack trace:\n\n 0x1c54f3e\tDB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, int) [tiflash+29708094]

/data/deploy/install/data/tiflash-9000/metadata/db_1077654/t_1487435.sql:
ATTACH TABLE t_1487435
(
id Int32,
company Nullable(String),
illegal_person Nullable(String),
original_qualifications_levels Nullable(String),
now_qualifications_levels Nullable(String),
registered_capital Nullable(String),
dataid Nullable(String),
declaration_type Nullable(String),
declaration_time Nullable(String),
annex_path Nullable(String),
annex_web_url Nullable(String),
dataid_new Nullable(String), q
data_caiji Nullable(MyDate) DEFAULT CAST('CURRENT_DATE' AS Nullable(MyDate)),
apt_code Nullable(String),
apt_code_date Nullable(MyDate),
project_name Nullable(String),
project_id Nullable(String),
company_id Nullable(String),
company_name Nullable(String),
apt_name Nullable(String)
)
ENGINE = DeltaMerge(id,

@z070204z z070204z added the type/bug The issue is confirmed as a bug. label Jun 5, 2024
@z070204z
Copy link
Author

z070204z commented Jun 5, 2024

version:7.1.2

@JaySon-Huang
Copy link
Contributor

JaySon-Huang commented Jun 7, 2024

Hi @z070204z ,
Can you post the CREATE TABLE statement of the table with table_id=1487435 to this issue?

You can find out the table_schema and table_name by executing following statement on tidb. Then execute show create table xxx to get the CREATE TABLE statement.

select table_schema,table_name,'' as partition_name,tidb_table_id from information_schema.`tables`
where tidb_table_id = 1487435
union
select table_schema,table_name,partition_name,tidb_partition_id from information_schema.`partitions`
where tidb_partition_id = 1487435

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants