在Informix数据库上运行以下查询时,数据库会因EXCEPTION_ACCESS_VIOLATION而崩溃。
select
trim(systables.owner) owner,
trim(systables.tabname) tabname,
trim(sysconstraints.constrname) constrname,
sysindexes.part1, sysindexes.part2,
sysindexes.part3, sysindexes.part4,
sysindexes.part5, sysindexes.part6,
sysindexes.part7, sysindexes.part8,
sysindexes.part9, sysindexes.part10,
sysindexes.part11, sysindexes.part12,
sysindexes.part13, sysindexes.part14,
sysindexes.part15, sysindexes.part16
from
sysconstraints
join systables
on sysconstraints.tabid = systables.tabid
join sysindexes
on row (sysconstraints.owner, sysconstraints.idxname)
= row (sysindexes.owner, sysindexes.idxname)
order by
sysconstraints.owner asc,
systables.tabname asc,
sysconstraints.constrname asc
我使用的数据库是Windows上的Informix 12.10的开发人员版。
答案 0 :(得分:0)
我可以跟踪问题,与row()
子句中join .. on
谓词的使用严格相关:
-- causes issues
from
sysconstraints
join systables
on sysconstraints.tabid = systables.tabid
join sysindexes
on row (sysconstraints.owner, sysconstraints.idxname)
= row (sysindexes.owner, sysindexes.idxname)
这是一个等效的on
条款,效果很好:
-- causes no issues
from
sysconstraints
join systables
on sysconstraints.tabid = systables.tabid
join sysindexes
on sysconstraints.owner = sysindexes.owner
and sysconstraints.idxname = sysindexes.idxname
这是一个使用row()
子句中的where
谓词的等效查询,它也有效:
-- causes no issues
from
sysconstraints
join systables
on sysconstraints.tabid = systables.tabid
cross join sysindexes
where row (sysconstraints.owner, sysconstraints.idxname)
= row (sysindexes.owner, sysindexes.idxname)
结论:请勿在Informix ROW()
子句中使用JOIN .. ON
谓词。它会使您的数据库崩溃