Strange Bug with Comments and PGScript

Discussion of open issues, suggestions and bugs regarding PgDAC (PostgreSQL Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
dschuch
Posts: 73
Joined: Thu 05 Feb 2009 15:29
Location: Dresden

Strange Bug with Comments and PGScript

Post by dschuch » Tue 08 Oct 2019 11:30

Hi,

if u use a code like this, the PGScript will just do nothing. The reason is that the last comment is before the ";" (which is also the Default Delimiter)

Code: Select all

INSERT INTO a VALUES
 ('A'), -- Comment
 ('B')  -- Comment Last line
 ;
 
-Attached you find a TestApplication.-

* unable to find a button to upload an example. just execute this SQL Statement in a simple PGScript and you will see: nothing happens

Question: is there is any way to prevent the PGScripter from splitting the Statement? We want to execute the Script as one statement (with comments, which are also thrown away)
Actually i made it with typing "NEVER FIND THIS DELIMITER" in the Delimited Property.

dschuch
Posts: 73
Joined: Thu 05 Feb 2009 15:29
Location: Dresden

Re: Strange Bug with Comments and PGScript

Post by dschuch » Tue 08 Oct 2019 13:45

Another Example: try to execute this statement in a PGScript. (With comment Lines at the end)

Code: Select all

-- Info: "WITHOUT TIME ZONE" nicht mehr nötig - TIMESTAMP wurde mit Postgre 7.3 dem SQL-Standard angepasst und ist jetzt standardmäßig ohne TIMEZONE
CREATE OR REPLACE FUNCTION currenttime() 
RETURNS timestamp AS $$
  SELECT date_trunc(
      'second', 
      transaction_timestamp()::timestamp
  )
$$ LANGUAGE sql --
--

dschuch
Posts: 73
Joined: Thu 05 Feb 2009 15:29
Location: Dresden

Re: Strange Bug with Comments and PGScript

Post by dschuch » Tue 08 Oct 2019 17:34

PS: Ver 6.0.1

dschuch
Posts: 73
Joined: Thu 05 Feb 2009 15:29
Location: Dresden

Re: Strange Bug with Comments and PGScript

Post by dschuch » Sun 19 Jan 2020 11:31

Hi, anyone took a look into this? The bug is also in the latest release: 6.1.2.

See first posting. Try to execute this lines in PgScript with ";" es default delemiter.

MaximG
Devart Team
Posts: 1438
Joined: Mon 06 Jul 2015 11:34

Re: Strange Bug with Comments and PGScript

Post by MaximG » Thu 30 Jan 2020 14:51

Thank you for the information. We have reproduced the problem and fixed the bug. The fix will be included in the next PgDAC build. Currently, we can send you a night build of PgDAC with the
fix. For this, please specify your license number and the exact version of Delphi you are using via the e-support form (https://www.devart.com/company/contactform.html)

Post Reply