Lukas Eder
2014-08-05 15:54:46 UTC
(This is actually a bug report. Not sure if this is the right place to report it)
When running the following query on an Informix database, the database crashes fatally with an 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
The database I'm using is a Developer Edition of Informix 12.10 on Windows.
I could track down the issue to be strictly related to the usage of row() predicates in the join .. on clause:
-- causes issues
from
sysconstraints
join systables
on sysconstraints.tabid = systables.tabid
join sysindexes
on row (sysconstraints.owner, sysconstraints.idxname)
= row (sysindexes.owner, sysindexes.idxname)
Here's an equivalent on clause that works just fine:
-- causes no issues
from
sysconstraints
join systables
on sysconstraints.tabid = systables.tabid
join sysindexes
on sysconstraints.owner = sysindexes.owner
and sysconstraints.idxname = sysindexes.idxname
And here's an equivalent query that uses the row() predicates in the where clause, which also works:
-- 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)
Conclusion: do NOT use ROW() predicates in the Informix JOIN .. ON clause. It will crash your database
Cross-posted here:
http://stackoverflow.com/q/25035770/521799
When running the following query on an Informix database, the database crashes fatally with an 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
The database I'm using is a Developer Edition of Informix 12.10 on Windows.
I could track down the issue to be strictly related to the usage of row() predicates in the join .. on clause:
-- causes issues
from
sysconstraints
join systables
on sysconstraints.tabid = systables.tabid
join sysindexes
on row (sysconstraints.owner, sysconstraints.idxname)
= row (sysindexes.owner, sysindexes.idxname)
Here's an equivalent on clause that works just fine:
-- causes no issues
from
sysconstraints
join systables
on sysconstraints.tabid = systables.tabid
join sysindexes
on sysconstraints.owner = sysindexes.owner
and sysconstraints.idxname = sysindexes.idxname
And here's an equivalent query that uses the row() predicates in the where clause, which also works:
-- 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)
Conclusion: do NOT use ROW() predicates in the Informix JOIN .. ON clause. It will crash your database
Cross-posted here:
http://stackoverflow.com/q/25035770/521799