【修复中】2.1版本,UNIQUE表开启了merge-on-write后,添加update_time 报错

Viewed 83

建表:

CREATE TABLE `test_insert2` (
  `id` INT NOT NULL COMMENT 'ID',
  `status` INT NULL COMMENT '状态',
  `delete_flag` CHAR(1) NOT NULL DEFAULT "N" COMMENT '是否删除',
  -- `date_created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `created_by` INT NOT NULL DEFAULT "0" COMMENT '创建人',
  -- `date_updated` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `updated_by` INT NOT NULL DEFAULT "0" COMMENT '修改人'
) ENGINE=OLAP
UNIQUE KEY(`id`)
COMMENT 'test_insert'
DISTRIBUTED BY HASH(`id`) BUCKETS 2
PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"enable_unique_key_merge_on_write" = "true"
);
alter table test_insert2 add COLUMN(
	`date_created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
	`date_updated` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间'
)

image.png

1 Answers

新优化器对于alter table的on update支持有问题,正在修复,预计最近两周可以fix