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解析会报错,建立虚拟字段无法解析
1条答案
按热度按时间oxosxuxt1#
你用的是哪个版本的