为了更快的定位您的问题,请提供以下信息,谢谢
【详述】建表及修改字段时,表字段为bigint,赋予默认值0时报错
【背景】
【业务影响】
【StarRocks版本】2.5.8
【集群规模】例如:1fe(1 follower+2observer)+3be(fe与be混部)
【机器信息】CPU虚拟核/内存/网卡,例如:48C/64G/万兆
【联系方式】
【附件】
①建表时报错
create table test_alter_column_value(
id bigint comment ‘id’,
age bigint null comment ‘age’,
name varchar(20) default ‘无’ comment ‘姓名’,
number bigint(20) default 1 comment ‘编号’
)engine = olap
primary key(id)
distributed by hash(id) buckets 1
PROPERTIES (
“replication_num” = “3”,
“in_memory” = “false”,
“storage_format” = “DEFAULT”,
“enable_persistent_index” = “false”,
“compression” = “LZ4”
);
报错:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘1’ at line 5
②
create table test_alter_column_value(
id bigint comment ‘id’,
age bigint null comment ‘age’,
name varchar(20) default ‘无’ comment ‘姓名’,
number bigint(20) comment ‘编号’
)engine = olap
primary key(id)
distributed by hash(id) buckets 1
PROPERTIES (
“replication_num” = “3”,
“in_memory” = “false”,
“storage_format” = “DEFAULT”,
“enable_persistent_index” = “false”,
“compression” = “LZ4”
);
alter table test_alter_column_value modify column number bigint(20) default 0 comment ‘编号’
报错:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘0’ at line 1
官方文档中没有限制数值类型的设置默认值