背景:使用obdumper导出一个DDL表结构,使用obloader导入到异机上失败了。
2025-09-10 01:48:06 [ERROR] …Loading sql of SQL-format file: “/export2/data/doccollect/TABLE/t_task-schema.sql” exec failure. (1/2). Reason: SQLException: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near ‘json_valid(f_result
)
)
default charset=utf8mb4
default collate=utf8mb4_unicode’ at line 17. SQL: create table if not exists t_task
(
f_id
bigint(20) unsigned not null auto_increment comment ‘主键id’,
f_task_id
char(36) not null comment ‘任务id’,
f_record_id
bigint(20) unsigned not null comment ‘提交记录id’,
f_result
longtext collate utf8mb4_bin comment ‘流转结果’,
primary key (f_id
),
constraint t_doccollect_task_OBCHECK_1735194654798022
check json_valid(f_result
)
)
default charset=utf8mb4
default collate=utf8mb4_unicode_ci
comment=‘提交详情表’
2025-09-10 01:48:06 [ERROR] Error: Loading SQL-format file: “/export2/data/doccollect/TABLE/t_task-schema.sql” failure. Reason: SQLException: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near ‘json_valid(f_result
)
)
default charset=utf8mb4
default collate=utf8mb4_unicode’ at line 17. Please see …/logs/ob-loader-dumper.error
2025-09-10 01:48:07 [ERROR] System exit 1
根据错误提示,手动将ddl语句改成这样,重新导入就不报错了。check 后面的表达式要加括号。
constraint t_doccollect_task_OBCHECK_1735194654798022
check (json_valid(f_result
))
官方后期啥时候,修复下这个bug