Informix 中的横向取消嵌套集合派生 table 时出现内部错误
Internal error when lateral unnesting collection derived table in Informix
我正在研究 Informix 中与集合派生表和嵌套集合相关的可能性。鉴于此模式:
create table t (i int);
create table u (i int, j int);
insert into t values (1);
insert into t values (2);
insert into u values (1, 10);
insert into u values (2, 20);
我尝试了以下查询:
with x as (
select
t.i,
multiset(
select * from u where u.i = t.i
) m
from t
order by t.i
)
select *
from x, lateral(table(x.m));
运行 它第一次从 Dbeaver SQL 编辑器中产生这个错误:
SQL Error [IX000]: The current transaction has been rolled back due to an internal error.
运行 它第二次产生这个错误:
SQL Error [IX000]: System or internal error
似乎连接已经失效,我必须重新连接以 运行 进一步查询。
这似乎是 Informix 中的一个错误,但我该如何解决这个问题?我正在使用 IBM Informix 动态服务器版本 14.10.FC5DE
看来问题与 ORDER BY
子句有关。此查询按预期工作:
with x as (
select
t.i,
multiset(
select * from u where u.i = t.i
) m
from t
)
select *
from x, lateral(table(x.m));
生成以下输出:
|i |m |i |j |
|---|-----------------------------------------|---|---|
|1 |[IfxStruct. Type: row ( i int , j int ) ]|1 |10 |
|2 |[IfxStruct. Type: row ( i int , j int ) ]|2 |20 |
(不要介意 IfxStruct
文本。那只是 Dbeaver,which can't print these types, yet)
我正在研究 Informix 中与集合派生表和嵌套集合相关的可能性。鉴于此模式:
create table t (i int);
create table u (i int, j int);
insert into t values (1);
insert into t values (2);
insert into u values (1, 10);
insert into u values (2, 20);
我尝试了以下查询:
with x as (
select
t.i,
multiset(
select * from u where u.i = t.i
) m
from t
order by t.i
)
select *
from x, lateral(table(x.m));
运行 它第一次从 Dbeaver SQL 编辑器中产生这个错误:
SQL Error [IX000]: The current transaction has been rolled back due to an internal error.
运行 它第二次产生这个错误:
SQL Error [IX000]: System or internal error
似乎连接已经失效,我必须重新连接以 运行 进一步查询。
这似乎是 Informix 中的一个错误,但我该如何解决这个问题?我正在使用 IBM Informix 动态服务器版本 14.10.FC5DE
看来问题与 ORDER BY
子句有关。此查询按预期工作:
with x as (
select
t.i,
multiset(
select * from u where u.i = t.i
) m
from t
)
select *
from x, lateral(table(x.m));
生成以下输出:
|i |m |i |j |
|---|-----------------------------------------|---|---|
|1 |[IfxStruct. Type: row ( i int , j int ) ]|1 |10 |
|2 |[IfxStruct. Type: row ( i int , j int ) ]|2 |20 |
(不要介意 IfxStruct
文本。那只是 Dbeaver,which can't print these types, yet)