assertion failure preparing statement in postgres - bug?

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
albourgz
Posts: 160
Joined: Wed 06 May 2009 12:17
Location: belgium

assertion failure preparing statement in postgres - bug?

Post by albourgz » Fri 02 Dec 2016 15:27

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.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: assertion failure preparing statement in postgres - bug?

Post by azyk » Mon 05 Dec 2016 10:13

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.

albourgz
Posts: 160
Joined: Wed 06 May 2009 12:17
Location: belgium

Re: assertion failure preparing statement in postgres - bug?

Post by albourgz » Mon 05 Dec 2016 15:10

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).

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: assertion failure preparing statement in postgres - bug?

Post by azyk » Fri 09 Dec 2016 08:57

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.

Post Reply