5.7.25-OceanBase_CE-v4.2.5.3 不能创建视图

【 使用环境 】5.7.25-OceanBase_CE-v4.2.5.3
【 OB or 其他组件 】ob_compatibility_mode MYSQL
【 使用版本 】5.7.25-OceanBase_CE-v4.2.5.3
【问题描述】创建视图失败

【复现路径】执行:CREATE VIEW test_view AS
SELECT id, floor_plan_id, otn_link_name
FROM nps_general.otn_link;

nps_general> CREATE VIEW test_view AS
SELECT id, floor_plan_id, otn_link_name
FROM nps_general.otn_link
【报错】:
[2025-05-30 17:09:57] [0A000][1235] Not supported feature or function

– auto-generated definition
create table otn_link
(
id BIGINT UNSIGNED not null comment ‘主键,由应用生成(如Snowflake)’
primary key,
floor_plan_id BIGINT(19) not null comment ‘平面,字典id’,
otn_link_name VARCHAR(255) not null comment ‘OTN链路名称’,
a_ne_id BIGINT(19) not null comment ‘源网元名称(A)(关联节点表)’,
z_ne_id BIGINT(19) not null comment ‘宿网元名称(Z)(关联节点表)’,
a_port VARCHAR(255) not null comment ‘A端口’,
z_port VARCHAR(255) not null comment ‘Z端口’,
total_distance_km DECIMAL(10, 2) not null comment ‘总距离(km)’,
project_time VARCHAR(255) not null comment ‘工程’,
remark VARCHAR(500) null comment ‘备注’,
year BIGINT(19) not null comment ‘年份’,
create_time BIGINT(19) null comment ‘创建时间’,
create_by BIGINT(19) null comment ‘创建人ID’,
create_user_name VARCHAR(255) null comment ‘创建人名字’,
update_time BIGINT(19) null comment ‘更新时间’,
update_by BIGINT(19) null comment ‘更新人ID’,
update_user_name VARCHAR(255) null comment ‘更新人名字’,
is_del TINYINT(3) default 0 not null comment ‘是否已删除(0-未删除,1-已删除)’,
constraint otn_link_unique
unique (otn_link_name)
);

create index idx_del
on otn_link (is_del);

create index idx_station_id
on otn_link (a_ne_id, z_ne_id);

我也遇见这个问题,求解答

语法不支持,麻烦提供一下otn_link表结构

– auto-generated definition
create table otn_link
(
id BIGINT UNSIGNED not null comment ‘主键,由应用生成(如Snowflake)’
primary key,
floor_plan_id BIGINT(19) not null comment ‘平面,字典id’,
otn_link_name VARCHAR(255) not null comment ‘OTN链路名称’,
a_ne_id BIGINT(19) not null comment ‘源网元名称(A)(关联节点表)’,
z_ne_id BIGINT(19) not null comment ‘宿网元名称(Z)(关联节点表)’,
a_port VARCHAR(255) not null comment ‘A端口’,
z_port VARCHAR(255) not null comment ‘Z端口’,
total_distance_km DECIMAL(10, 2) not null comment ‘总距离(km)’,
project_time VARCHAR(255) not null comment ‘工程’,
remark VARCHAR(500) null comment ‘备注’,
year BIGINT(19) not null comment ‘年份’,
create_time BIGINT(19) null comment ‘创建时间’,
create_by BIGINT(19) null comment ‘创建人ID’,
create_user_name VARCHAR(255) null comment ‘创建人名字’,
update_time BIGINT(19) null comment ‘更新时间’,
update_by BIGINT(19) null comment ‘更新人ID’,
update_user_name VARCHAR(255) null comment ‘更新人名字’,
is_del TINYINT(3) default 0 not null comment ‘是否已删除(0-未删除,1-已删除)’,
constraint otn_link_unique
unique (otn_link_name)
);

create index idx_del
on otn_link (is_del);

create index idx_station_id
on otn_link (a_ne_id, z_ne_id);

nps_general.otn_link
先use nps_general
然后执行
CREATE VIEW test_view AS
SELECT id, floor_plan_id, otn_link_name
FROM otn_link试试

都是一个用户下吗?权限都有吧?create view的权限

是这样吗,还是不可以

当前登录的就是这个用户,权限都有

方便的话,你可以用管理员的用户创建测试一下 :joy:

image
这边425.3测试没复现出来

好的,谢谢

我用管理员账户试试