Page 1 of 1

Assertion Error

Posted: Fri 26 Dec 2008 18:45
by snorkel
I am getting this error on a certain query:

First chance exception at $7C812AEB. Exception class EAssertionFailed with message 'Assertion failure (D:\Projects\Delphi\Dac\Source\MemData.pas, line 8547)'.

This is the query:

select trg.oid,trg.tgname as trigger_name ,trg.tgtype,trg.tgnargs,trg.tgargs,trg.tgisconstraint,trg.tgdeferrable,trg.tginitdeferred,
(select description from pg_description where objoid = trg.oid) as comment,
(select nspname from pg_namespace where oid = p.pronamespace)||'.'||p.proname as function_name ,
case trg.tgtype & cast(1 as int2)
when 0 then false
else true
end as row_trigger,
cast(case trg.tgtype & cast(2 as int2)
when 0 then 'AFTER'
else 'BEFORE'
end as varchar(50)) as trigger_type,
cast(case trg.tgtype & cast(28 as int2)
when 16 then 'UPDATE'
when 8 then 'DELETE'
when 4 then 'INSERT'
when 20 then 'INSERT, UPDATE'
when 28 then 'INSERT, UPDATE, DELETE'
when 24 then 'UPDATE, DELETE'
when 12 then 'INSERT, DELETE'
end as varchar(50)) as trigger_event
from pg_trigger trg, pg_proc p
where trg.tgfoid = p.oid AND trg.tgname NOT LIKE 'RI_%' AND trg.tgrelid = :tableoid;

Posted: Fri 26 Dec 2008 18:53
by snorkel
oh, forgot to add the error is only raised if the table identified by the tableoid param actually has a trigger and trigger function. The query runs without the assertion error if the table has no triggers.

Posted: Sat 27 Dec 2008 10:03
by Plash
We have fixed this problem. The fix will be included in the next build of PgDAC.