以下SQL 功能和同构数据源一致,暂不支持:
GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
612
不支持对dblink 表进行DDL 操作,如drop table,alter table 等操作;
不支持使用dblink 查询创建视图;
不支持使用dblink 表或查询作为update 的源关联更新本地表;
不支持merge 语句using 源部分使用dblink 查询;
不支持function 中使用dblink 查询。
示例
示例1
不支持对dblink 表进行DDL 操作,如drop table,alter table 等操作:
drop table x1@gc_dblink;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your GBase server version for the right syntax to use near '@gc_dblink'
at line 1
示例2
不支持对dblink 表进行update/delete/insert/merge 操作:
update x1@gc_dblink set id2 =1;
ERROR 1105 (HY000): DBLink-Table does not support update operation.
delete from x1@gc_dblink;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to
your GBase server version for the right syntax to use near '@gc_dblink' at line 1
示例3
不支持使用dblink 查询创建视图:
create view v1 as select * from t1@testlink;
ERROR 1235 (42000): This version of GBase doesn't yet support 'use dblink table in a
FUNCTION/TRIGGER/VIEW.'
示例4
不支持使用dblink 表或查询作为update 的源关联更新本地表
update t1,t1@o_link tt1 set t1.b=tt1.b where t1.a=tt1.a;
update t1 join t1@_link tt1 on t1.a=tt1.a set t1.b=tt1.b;
update t1 join (select a,b from t1@_link) tt1 on t1.a=tt1.a set t1.b=tt1.b;
GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
613
ERROR 1105 (HY000): DBLink-Table does not support update operation.
示例5
不支持merge 语句using 源部分使用dblink 查询:
merge into x1 tt1 using (select * from x1@olink) tt on (tt1.id2=tt.id2)
when matched then update set tt1.id3=tt.id3
ERROR 1105 (HY000): DBLink-Table does not support update operation.
示例6
不支持function 中使用dblink 查询:
delimiter //
create function dfunc(id int) returns int
begin
declare fid int default 1;
set fid = (select id2 from x1@olink where id2=id limit 1);
return fid;
end //
This version of GBase doesn't yet support 'use dblink table in a FUNCTION/TRIGGER/VIEW.