Page 1 of 1

assertion failure preparing statement in postgres - bug?

Posted: Fri 02 Dec 2016 15:27
by albourgz
using unidac 6.4.16, c++ builder xe10 pro, vcl win32.
The following occurs when connected to postgres (works fine in oracle). (Current schema is cec).
Table:

Code: Select all

-- Table: cec.messagesservice
-- DROP TABLE cec.messagesservice;

CREATE TABLE cec.messagesservice
(
    dtmess timestamp without time zone NOT NULL DEFAULT now(),
    priority smallint NOT NULL DEFAULT 5,
    message text COLLATE pg_catalog."default" NOT NULL,
    id numeric(20) NOT NULL,
    status character varying(20) COLLATE pg_catalog."default",
    CONSTRAINT messagesservice_pkey PRIMARY KEY (id)
)
WITH (
    OIDS = FALSE
)
TABLESPACE pg_default;
ALTER TABLE cec.messagesservice OWNER to cec;
GRANT ALL ON TABLE cec.messagesservice TO cec;
TUniQuery QGetMessage:

Code: Select all

SELECT ID, MESSAGE 
FROM MessagesService
WHERE STATUS='AAA'
ORDER BY PRIORITY DESC, DTMESS, ID
FOR UPDATE
c++ code:

Code: Select all

if (!QGetMessage->Prepared)
        QGetMessage->Prepare();
On prepare statement, error:
Project GIService_formonly.exe raised exception class EAssertionFailed with message 'Assertion failure (D:\Projects\Delphi\Dac\PostgreSql\Source\PgSQLProtocol.pas, line 2455)'.

There are triggers before insert and after update (could it be the cause)?
In pgAdmin, this statement works fine!!!! (and even returns no row).

Regards.

Re: assertion failure preparing statement in postgres - bug?

Posted: Mon 05 Dec 2016 10:13
by azyk
We could not reproduce the described issue. Please compose a small sample to reproduce it and send to us via our contact form : https://www.devart.com/company/contactform.html . Using the standard pg_dump utility create a test database dump and include it into the sample. Also provide the exact PostgreSQL version where the issue is reproduced.

Re: assertion failure preparing statement in postgres - bug?

Posted: Mon 05 Dec 2016 15:10
by albourgz
postgres version is 9.6. You're right, it doesn't seem related to statement. It seems to be caused by calling Ping() method of TUniSession (prepare works fine before ping, crashes after ping). I will try to make a sample, but it is not easy (it happens only after 2 connections, with different users, it is not straight forward).

Re: assertion failure preparing statement in postgres - bug?

Posted: Fri 09 Dec 2016 08:57
by azyk
We have reproduced the described issue using your sample and we continue its investigation. We will notify you about the results as soon as any are available.