From 69a06dba095e473221eb2e758499f7b286bacb7f Mon Sep 17 00:00:00 2001 From: "jianghang.loujh" Date: Thu, 12 Feb 2026 17:42:44 +0800 Subject: [PATCH] fixed issue #5517: H2 database field type error causing 'Value too long for column' exception - Changed meta_snapshot.data from longtext to CLOB in H2 schema - Changed meta_history.sql_text from longtext to CLOB in H2 schema - H2 database doesn't recognize MySQL's longtext type and converts it to VARCHAR with length limit - CLOB type supports up to 2GB text data, solving the issue when storing large table structures (>1MB DDL) --- parse/src/main/resources/ddl/h2/meta_history.sql | 2 +- parse/src/main/resources/ddl/h2/meta_snapshot.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/parse/src/main/resources/ddl/h2/meta_history.sql b/parse/src/main/resources/ddl/h2/meta_history.sql index 4c7bbff4..1e19b776 100644 --- a/parse/src/main/resources/ddl/h2/meta_history.sql +++ b/parse/src/main/resources/ddl/h2/meta_history.sql @@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS `meta_history` ( `use_schema` varchar(1024) DEFAULT NULL COMMENT '执行sql时对应的schema', `sql_schema` varchar(1024) DEFAULT NULL COMMENT '对应的schema', `sql_table` varchar(1024) DEFAULT NULL COMMENT '对应的table', - `sql_text` longtext DEFAULT NULL COMMENT '执行的sql', + `sql_text` CLOB DEFAULT NULL COMMENT '执行的sql', `sql_type` varchar(256) DEFAULT NULL COMMENT 'sql类型', `extra` text DEFAULT NULL COMMENT '额外的扩展信息', PRIMARY KEY (`id`), diff --git a/parse/src/main/resources/ddl/h2/meta_snapshot.sql b/parse/src/main/resources/ddl/h2/meta_snapshot.sql index c14d7358..2433bb6a 100644 --- a/parse/src/main/resources/ddl/h2/meta_snapshot.sql +++ b/parse/src/main/resources/ddl/h2/meta_snapshot.sql @@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS `meta_snapshot` ( `binlog_offest` bigint(20) DEFAULT NULL COMMENT 'binlog偏移量', `binlog_master_id` varchar(64) DEFAULT NULL COMMENT 'binlog节点id', `binlog_timestamp` bigint(20) DEFAULT NULL COMMENT 'binlog应用的时间戳', - `data` longtext DEFAULT NULL COMMENT '表结构数据', + `data` CLOB DEFAULT NULL COMMENT '表结构数据', `extra` text DEFAULT NULL COMMENT '额外的扩展信息', PRIMARY KEY (`id`), UNIQUE KEY meta_snapshot_binlog_file_offest(`destination`,`binlog_master_id`,`binlog_file`,`binlog_offest`),