dbTalk Databases Forums  

[BUGS] ecpg -D SYMBOL

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] ecpg -D SYMBOL in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Luke McFarlane
 
Posts: n/a

Default [BUGS] ecpg -D SYMBOL - 07-09-2004 , 04:13 PM






Hi

I'm running postgresql 7.4.1 and ecpg 3.1.0.

When defining a symbol on the command line with ecpg -D SYMBOL the ecpg
preprocessor will replace that symbol with empty space in 'C' program
space rather than limiting it to 'SQL' program space.

For example:

EXEC SQL IFDEF SYMBOL;
EXEC SQL ...
EXEC SQL ENDIF;

#ifdef SYMBOL
....
#endif

compiling with ecpg -D SYMBOL results in

EXEC SQL IFDEF SYMBOL;
EXEC SQL ...
EXEC SQL ENDIF;

#ifdef
....
#endif

It shouldn't touch anything outside EXEC SQL.

Also, if you try to fool ecpg by compiling with ecpg -D SYMBOL=SYMBOL it
will sit in an infinite loop gobbling as much virtual memory as it sees fit.

Luke


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply With Quote
  #2  
Old   
Michael Meskes
 
Posts: n/a

Default Re: [BUGS] ecpg -D SYMBOL - 07-20-2004 , 01:35 PM






On Tue, Jul 06, 2004 at 03:49:14PM +1000, Luke McFarlane wrote:
Quote:
When defining a symbol on the command line with ecpg -D SYMBOL the ecpg
preprocessor will replace that symbol with empty space in 'C' program
space rather than limiting it to 'SQL' program space.
This indeed is a bug, but ecpg has never been designed to limit symbols
to SQL space. You're absolutely right that it should not use empty
space. I just fixed that in CVS. Now it correctly uses "1".

Quote:
It shouldn't touch anything outside EXEC SQL.
Why? That means you have to define most things twice.

Quote:
Also, if you try to fool ecpg by compiling with ecpg -D SYMBOL=SYMBOL it
will sit in an infinite loop gobbling as much virtual memory as it sees fit.
Ah yes, another bug.

I just committed a fix for this as well.

All fixes went into HEAD and 7.4.

Michael

--
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes (AT) jabber (DOT) org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


Reply With Quote
  #3  
Old   
Luke McFarlane
 
Posts: n/a

Default Re: [BUGS] ecpg -D SYMBOL - 07-23-2004 , 01:02 AM



Defining things twice - once in 'SQL' space and once in 'C' space is
something I struggled with when using Informix ESQL/C. I like the idea
of having it apply to both.

Although if you are to support INFORMIX or INFORMIX_SE mode in ecpg you
will need limit it to 'SQL' space (for these modes anyway).

Michael Meskes wrote:

Quote:
On Tue, Jul 06, 2004 at 03:49:14PM +1000, Luke McFarlane wrote:


When defining a symbol on the command line with ecpg -D SYMBOL the ecpg
preprocessor will replace that symbol with empty space in 'C' program
space rather than limiting it to 'SQL' program space.



This indeed is a bug, but ecpg has never been designed to limit symbols
to SQL space. You're absolutely right that it should not use empty
space. I just fixed that in CVS. Now it correctly uses "1".



It shouldn't touch anything outside EXEC SQL.



Why? That means you have to define most things twice.



Also, if you try to fool ecpg by compiling with ecpg -D SYMBOL=SYMBOL it
will sit in an infinite loop gobbling as much virtual memory as it sees fit.



Ah yes, another bug.

I just committed a fix for this as well.

All fixes went into HEAD and 7.4.

Michael




---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match


Reply With Quote
  #4  
Old   
Michael Meskes
 
Posts: n/a

Default Re: [BUGS] ecpg -D SYMBOL - 07-26-2004 , 06:25 AM



On Fri, Jul 23, 2004 at 03:49:30PM +1000, Luke McFarlane wrote:
Quote:
Although if you are to support INFORMIX or INFORMIX_SE mode in ecpg you
will need limit it to 'SQL' space (for these modes anyway).
Didn't know that. Thanks for the info. Patch committed to CVS.

Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes (AT) jabber (DOT) org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.