Unix Technical Forum

Fix ecpg SQL CONNECT with variable user name

This is a discussion on Fix ecpg SQL CONNECT with variable user name within the Pgsql Patches forums, part of the PostgreSQL category; --> Here is a fix for ecpg in 8.3 when the user name is specified by variables on SQL CONNECT. ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 07:24 AM
ITAGAKI Takahiro
 
Posts: n/a
Default Fix ecpg SQL CONNECT with variable user name

Here is a fix for ecpg in 8.3 when the user name is specified by
variables on SQL CONNECT.

When we compile the following statement in ecpg:
EXEC SQL CONNECT TO :dbname USER :usrname IDENTIFIED BY :usrpass;

ecpg in 8.2 compiles it correctly.
{ ECPGconnect(__LINE__, 0, dbname , usrname , usrpass , NULL, 0); }

but ecpg in 8.3beta4 returns wrong results.
{ ECPGconnect(__LINE__, 0, dbname , " $1 " , " $2 " , NULL, 0); }


It seems to come from the change of create_questionmarks() in
http://archives.postgresql.org/pgsql...8/msg00185.php
http://developer.postgresql.org/cvsw...1.348&r2=1.349

Variables are represented as "$%d" instead of "?" now.
The grammer of "user_name" should have followed the change.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center


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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 07:24 AM
Michael Meskes
 
Posts: n/a
Default Re: Fix ecpg SQL CONNECT with variable user name

On Fri, Dec 28, 2007 at 11:43:49AM +0900, ITAGAKI Takahiro wrote:
> Here is a fix for ecpg in 8.3 when the user name is specified by
> variables on SQL CONNECT.
> ...


Just committed fix to CVS. Thanks for pointing this out and fixing it
Takahiro-san.

Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL!

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:46 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com