pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks
7+ messages / 3 participants
[nested] [flat]

* BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks
@ 2017-08-09 18:56 thom@genx.net
  2017-08-11 01:58 ` Re: BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks Michael Meskes <meskes@postgresql.org>
  0 siblings, 1 reply; 7+ messages in thread

From: thom@genx.net @ 2017-08-09 18:56 UTC (permalink / raw)
  To: pgsql-bugs; +Cc: thom@genx.net

The following bug has been logged on the website:

Bug reference:      14776
Logged by:          Thomas Chin
Email address:      thom@genx.net
PostgreSQL version: 9.6.3
Operating system:   Linux
Description:        

It appears that starting in ecpg 4.12.0, the pre-processor has issues with
macros code blocks ({ }) when a line continuation is used (\). When
encountered, "EXEC SQL TYPE" declarations are not registered, which results
in a "unregistered data type name" error. In another instance, variables
declared in an "EXEC SQL ... DECLARE SECTION" are unavailable given the same
conditions.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks
  2017-08-09 18:56 BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks thom@genx.net
@ 2017-08-11 01:58 ` Michael Meskes <meskes@postgresql.org>
  2017-08-11 09:04   ` Re: BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks Thomas S. Chin <thom@genx.net>
  0 siblings, 1 reply; 7+ messages in thread

From: Michael Meskes @ 2017-08-11 01:58 UTC (permalink / raw)
  To: thom@genx.net; pgsql-bugs

> It appears that starting in ecpg 4.12.0, the pre-processor has issues with
> macros code blocks ({ }) when a line continuation is used (\). When
> encountered, "EXEC SQL TYPE" declarations are not registered, which results
> in a "unregistered data type name" error. In another instance, variables
> declared in an "EXEC SQL ... DECLARE SECTION" are unavailable given the same
> conditions.

Would it be possible for you to post an example?

Thanks

Michael
-- 
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Meskes at (Debian|Postgresql) dot Org
Jabber: michael at xmpp dot meskes dot org
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks
  2017-08-09 18:56 BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks thom@genx.net
  2017-08-11 01:58 ` Re: BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks Michael Meskes <meskes@postgresql.org>
@ 2017-08-11 09:04   ` Thomas S. Chin <thom@genx.net>
  2017-08-11 13:04     ` Re: BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks Michael Meskes <meskes@postgresql.org>
  2017-08-15 15:16     ` Re: BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks Michael Meskes <meskes@postgresql.org>
  0 siblings, 2 replies; 7+ messages in thread

From: Thomas S. Chin @ 2017-08-11 09:04 UTC (permalink / raw)
  To: Michael Meskes <meskes@postgresql.org>; pgsql-bugs

Hello Michael,

Yes, I can. I had hit the "Save" button prematurely, expecting another
page to provide code fragments.

---

typedef char test_t[3];

EXEC SQL TYPE test_t IS VARCHAR[2];

// COMMENT OUT macros with line continued code block to get working
#define TEST_MACROS(x) { \
        }

EXEC SQL BEGIN DECLARE SECTION;
test_t test;
EXEC SQL END DECLARE SECTION;

---

ecpg -o test.c test.pgc
test.pgc:10: ERROR: unrecognized data type name "test_t"

---

This test case works with ecpg (PostgreSQL 9.4.7) 4.10.0.
This test case works with ecpg (PostgreSQL 9.5.7) 4.11.0.
This test case does not work with ecpg (PostgreSQL 9.6.3) 4.12.0.

The code is processed successfully if the macros is omitted, commented
out or changed to be on a single line:

	#define TEST_MACROS(x) { }

Thanks!

Best,
Thomas S. Chin


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks
  2017-08-09 18:56 BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks thom@genx.net
  2017-08-11 01:58 ` Re: BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks Michael Meskes <meskes@postgresql.org>
  2017-08-11 09:04   ` Re: BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks Thomas S. Chin <thom@genx.net>
@ 2017-08-11 13:04     ` Michael Meskes <meskes@postgresql.org>
  2017-08-11 13:28       ` Re: BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks Thomas S. Chin <thom@genx.net>
  1 sibling, 1 reply; 7+ messages in thread

From: Michael Meskes @ 2017-08-11 13:04 UTC (permalink / raw)
  To: Thomas S. Chin <thom@genx.net>; pgsql-bugs

Thanks Thomas.

Yes, I think the bug was introduced by commit
fc1ae7d2eb6a3de47f5f5cd6ebf2d18d226b8036 which was supposed to handle
the case of a cpp line with a linebreak but without a continuation
character. 

Suggestions for a fix are welcome, otherwise I'll look into it when I
find time.

Michael
-- 
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Meskes at (Debian|Postgresql) dot Org
Jabber: michael at xmpp dot meskes dot org
VfL Borussia! Força Barça! SF 49ers! Use Debian GNU/Linux, PostgreSQL


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks
  2017-08-09 18:56 BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks thom@genx.net
  2017-08-11 01:58 ` Re: BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks Michael Meskes <meskes@postgresql.org>
  2017-08-11 09:04   ` Re: BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks Thomas S. Chin <thom@genx.net>
  2017-08-11 13:04     ` Re: BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks Michael Meskes <meskes@postgresql.org>
@ 2017-08-11 13:28       ` Thomas S. Chin <thom@genx.net>
  0 siblings, 0 replies; 7+ messages in thread

From: Thomas S. Chin @ 2017-08-11 13:28 UTC (permalink / raw)
  To: Michael Meskes <meskes@postgresql.org>; pgsql-bugs

Hello Michael,

Fixing it when you find time would be great. Currently, I have a
workaround, and can revert that commit when an updated ecpg build is
available.

Thank you Michael, and I hope to hear from you in the near future.

Kind regards,
Thomas S. Chin

On 08/11/2017 09:04 AM, Michael Meskes wrote:
> Thanks Thomas.
> 
> Yes, I think the bug was introduced by commit
> fc1ae7d2eb6a3de47f5f5cd6ebf2d18d226b8036 which was supposed to handle
> the case of a cpp line with a linebreak but without a continuation
> character. 
> 
> Suggestions for a fix are welcome, otherwise I'll look into it when I
> find time.
> 
> Michael
> 


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks
  2017-08-09 18:56 BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks thom@genx.net
  2017-08-11 01:58 ` Re: BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks Michael Meskes <meskes@postgresql.org>
  2017-08-11 09:04   ` Re: BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks Thomas S. Chin <thom@genx.net>
@ 2017-08-15 15:16     ` Michael Meskes <meskes@postgresql.org>
  2017-08-15 15:38       ` Re: BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks Thomas S. Chin <thom@genx.net>
  1 sibling, 1 reply; 7+ messages in thread

From: Michael Meskes @ 2017-08-15 15:16 UTC (permalink / raw)
  To: Thomas S. Chin <thom@genx.net>; pgsql-bugs

> Yes, I can. I had hit the "Save" button prematurely, expecting
> another
> page to provide code fragments.
> ...

Thanks for that. This example compiles on current master branch with
the fix I committed. Would you be able to try with your full source?

As usual I'm planning to backport if I don't get any negative feedback.

Michael
-- 
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Meskes at (Debian|Postgresql) dot Org
Jabber: michael at xmpp dot meskes dot org
VfL Borussia! Força Barça! SF 49ers! Use Debian GNU/Linux, PostgreSQL


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks
  2017-08-09 18:56 BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks thom@genx.net
  2017-08-11 01:58 ` Re: BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks Michael Meskes <meskes@postgresql.org>
  2017-08-11 09:04   ` Re: BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks Thomas S. Chin <thom@genx.net>
  2017-08-15 15:16     ` Re: BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks Michael Meskes <meskes@postgresql.org>
@ 2017-08-15 15:38       ` Thomas S. Chin <thom@genx.net>
  0 siblings, 0 replies; 7+ messages in thread

From: Thomas S. Chin @ 2017-08-15 15:38 UTC (permalink / raw)
  To: Michael Meskes <meskes@postgresql.org>; pgsql-bugs

Hello again Michael,

Just did a full build of my tree with the postgres-master version of
ecpg, and it is working like a charm once again. Thank you for the
prompt fix, and I look forward to removing the workarounds when the
formal release is available.

Best,
Thomas S. Chin

On 08/15/2017 11:16 AM, Michael Meskes wrote:
>> Yes, I can. I had hit the "Save" button prematurely, expecting
>> another
>> page to provide code fragments.
>> ...
> 
> Thanks for that. This example compiles on current master branch with
> the fix I committed. Would you be able to try with your full source?
> 
> As usual I'm planning to backport if I don't get any negative feedback.
> 
> Michael
> 


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2017-08-15 15:38 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-08-09 18:56 BUG #14776: ecpg 4.12.0 issues with macros containing line continued blocks thom@genx.net
2017-08-11 01:58 ` Michael Meskes <meskes@postgresql.org>
2017-08-11 09:04   ` Thomas S. Chin <thom@genx.net>
2017-08-11 13:04     ` Michael Meskes <meskes@postgresql.org>
2017-08-11 13:28       ` Thomas S. Chin <thom@genx.net>
2017-08-15 15:16     ` Michael Meskes <meskes@postgresql.org>
2017-08-15 15:38       ` Thomas S. Chin <thom@genx.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox