By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,834 Members | 2,234 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,834 IT Pros & Developers. It's quick & easy.

ecpg question

P: n/a
I wanted to ask this on here before going any further.

I've got functions that return rowsets, which from the psql shell require
me to write selects with AS TBL( ... ) to define the return types.

When I try to put a query together in ECPG to get values from these
functions, I discovered some nasty ecpg behavior.

EXEC SQL SELECT * FROM foo() AS TBL( c int );

compiles properly (?) to

{ ECPGdo(__LINE__, 0, 1, NULL, "select * from foo () as TBL ( c int )
", ECPGt_EOIT, ECPGt_EORT);}

however
EXEC SQL SELECT * FROM foo() AS TBL( c int, i int );

or any other query with multiple columns to a TBL description causes a
segfault in ecpg. It also concerns me that all other symbols are
dropped to lowercase, while TBL is still uppercase. Leads me to
believe that TBL isn't getting parsed. This was tested against cvs pgsql,
and the backtrace from the segfaults are consistent and appear below.

Program received signal SIGSEGV, Segmentation fault.
in strlen () from /usr/lib/libc.so.1
(gdb) bt
#0 in strlen () from /usr/lib/libc.so.1
#1 in cat2_str (str1=0xa5750 "c int ",
str2=0x2c <Address 0x2c out of bounds>) at preproc.y:80
#2 in cat_str (count=3) at preproc.y:103
#3 in _end ()
#4 in main (argc=2, argv=0xxxxxxxxx) at ecpg.c:395

I tried picking the rules apart that call cat_str in this case, but I
can't really figure out where in preproc.y it gets called and screws that
second var argument to cat_str up. Hopefully someone has dealt with this
before and can tell me why what I'm doing is wrong, or that I should send
this on to -hackers.

Thanks,
-George
we***@csh.rit.edu

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

Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Tue, Dec 23, 2003 at 02:06:14AM -0500, George Gensure wrote:
dropped to lowercase, while TBL is still uppercase. Leads me to
believe that TBL isn't getting parsed. This was tested against cvs pgsql,
and the backtrace from the segfaults are consistent and appear below.
Yes, it surely looks that way.
second var argument to cat_str up. Hopefully someone has dealt with this
before and can tell me why what I'm doing is wrong, or that I should send
this on to -hackers.


Not yet, but I will when I find the time.

Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: me****@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #2

P: n/a
Cool. I only thought that tbl would need special treatment. Is that fix
in cvs?

Thanks,
-George

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.