Page 1 of 1

Strange Bug with Comments and PGScript

Posted: Tue 08 Oct 2019 11:30
by dschuch
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.

Re: Strange Bug with Comments and PGScript

Posted: Tue 08 Oct 2019 13:45
by dschuch
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 --
--

Re: Strange Bug with Comments and PGScript

Posted: Tue 08 Oct 2019 17:34
by dschuch
PS: Ver 6.0.1

Re: Strange Bug with Comments and PGScript

Posted: Sun 19 Jan 2020 11:31
by dschuch
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.

Re: Strange Bug with Comments and PGScript

Posted: Thu 30 Jan 2020 14:51
by MaximG
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)