druid 解析虚拟字段失败

mf98qq94  于 2022-10-22  发布在  Druid
关注(0)|答案(1)|浏览(243)

CREATE TABLE test_json3 (
id bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
ext_info json DEFAULT NULL COMMENT '拓展信息',
zip varchar(128) GENERATED ALWAYS AS (json_extract( ext_info ,'$.zip')) VIRTUAL COMMENT '虚拟字段',
tag varchar(128) GENERATED ALWAYS AS (json_extract( ext_info ,'$.tag')) VIRTUAL COMMENT '虚拟字段',
ins_tm datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
upd_tm datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY ( id ) USING BTREE,
KEY idx_zip ((cast( zip as unsigned array))),
KEY idx_tag ((cast( tag as unsigned array)))
) ENGINE=InnoDB COMMENT='json表';

用上面的SQL语句进行建表,在mysql上可以执行成功,使用druid解析会报错,建立虚拟字段无法解析

相关问题