dbTalk Databases Forums  

[BUGS] BUG #1165: ECPG can't parse dynamic SQL with indicator

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


Discuss [BUGS] BUG #1165: ECPG can't parse dynamic SQL with indicator in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
PostgreSQL Bugs List
 
Posts: n/a

Default [BUGS] BUG #1165: ECPG can't parse dynamic SQL with indicator - 06-14-2004 , 07:55 PM







The following bug has been logged online:

Bug reference: 1165
Logged by: ISHIDA Akio

Email address: iakio (AT) mono-space (DOT) net

PostgreSQL version: 7.4

Operating system: Linux miracle 2.4.9-31.22ml

Description: ECPG can't parse dynamic SQL with indicator

Details:

$ cat indtest.pgc
int main()
{
exec sql begin declare section;
int i, i_ind;
exec sql end declare section;
exec sql execute stmt using :i; /* good */
exec sql execute stmt using :i :i_ind; /* error */
}

==== version 7.3.6 ====
$ pgsql736/bin/ecpg --version
ecpg (PostgreSQL 7.3.6) 2.10.0
$ pgsql736/bin/ecpg indtest.pgc
(No error)

==== version 7.4.2 ====
$ pgsql742/bin/ecpg --version
ecpg (PostgreSQL 7.4.2) 3.1.1
$ pgsql742/bin/ecpg indtest.pgc
indtest.pgc:7: ERROR: syntax error at or near ":i_ind"

This problem was reported in Japanese mailing list.
http://ml.postgresql.jp/pipermail/pg...ne/008332.html

It is a patch.(but I'm not good at using bison)

--- src/interfaces/ecpg/preproc/preproc.y.org Mon Jun 14 11:24:25 2004
+++ src/interfaces/ecpg/preproc/preproc.y Fri Jun 11 12:54:10 2004
@@ -5304,6 +5304,7 @@
add_variable_to_head(&argsinsert,
new_variable($1, ECPGmake_simple_type(ECPGt_const, length), 0),
&no_indicator);
}
}
+ | civarind { $$ = EMPTY; }
;



---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)

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

Default Re: [BUGS] BUG #1165: ECPG can't parse dynamic SQL with indicator - 06-17-2004 , 07:14 AM






On Mon, Jun 14, 2004 at 09:52:20PM -0300, PostgreSQL Bugs List wrote:
Quote:
It is a patch.(but I'm not good at using bison)

--- src/interfaces/ecpg/preproc/preproc.y.org Mon Jun 14 11:24:25 2004
+++ src/interfaces/ecpg/preproc/preproc.y Fri Jun 11 12:54:10 2004
@@ -5304,6 +5304,7 @@
add_variable_to_head(&argsinsert,
new_variable($1, ECPGmake_simple_type(ECPGt_const, length), 0),
&no_indicator);
}
}
+ | civarind { $$ = EMPTY; }
;

This patch indeed fixes the problem and it allows indicators and thus
NULL values to be entered in every using clause there is. I don't see a
problem with this so I just committed the patch to CVS, HEAD and 7.4.

Sorry, that it did not make it into 7.4.3. This is my fault as I was
too busy to seriously review the patch.

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 7: don't forget to increase your free space map settings


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.