Re: [HACKERS] ECPG DESCRIBE [OUTPUT] support

2010-01-15 Thread Michael Meskes
On Fri, Jan 15, 2010 at 01:16:18PM +0100, Boszormenyi Zoltan wrote:
> Please, also add this small change that adds ecpg_raise()
> calls to ECPGdescribe() to return the proper sqlca error
> in error paths for:
> ...

Done.

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

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


Re: [HACKERS] ECPG DESCRIBE [OUTPUT] support

2010-01-15 Thread Boszormenyi Zoltan
Hi,

I just saw that you committed the DESCRIBE patch.

Please, also add this small change that adds ecpg_raise()
calls to ECPGdescribe() to return the proper sqlca error
in error paths for:
- unsupported call for DESCRIBE INPUT
- no such connection name
- no such prepared statement

Thanks and best regards,
Zoltán Böszörményi

-- 
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics

--
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/

*** /home/zozo/cvs/pgsql/pgsql/src/interfaces/ecpg/ecpglib/descriptor.c	2010-01-15 12:55:24.0 +0100
--- pgsql.3/src/interfaces/ecpg/ecpglib/descriptor.c	2010-01-15 13:14:35.0 +0100
***
*** 739,752 
  
  	/* DESCRIBE INPUT is not yet supported */
  	if (input)
  		return ret;
  
  	con = ecpg_get_connection(connection_name);
  	if (!con)
! 		return false;
  	prep = ecpg_find_prepared_statement(stmt_name, con, NULL);
  	if (!prep)
  		return ret;
  
  	va_start(args, stmt_name);
  
--- 739,762 
  
  	/* DESCRIBE INPUT is not yet supported */
  	if (input)
+ 	{
+ 		ecpg_raise(line, ECPG_UNSUPPORTED, ECPG_SQLSTATE_ECPG_INTERNAL_ERROR, "DESCRIBE INPUT");
  		return ret;
+ 	}
  
  	con = ecpg_get_connection(connection_name);
  	if (!con)
! 	{
! 		ecpg_raise(line, ECPG_NO_CONN, ECPG_SQLSTATE_CONNECTION_DOES_NOT_EXIST,
! connection_name ? connection_name : ecpg_gettext("NULL"));
! 		return ret;
! 	}
  	prep = ecpg_find_prepared_statement(stmt_name, con, NULL);
  	if (!prep)
+ 	{
+ 		ecpg_raise(line, ECPG_INVALID_STMT, ECPG_SQLSTATE_INVALID_SQL_STATEMENT_NAME, stmt_name);
  		return ret;
+ 	}
  
  	va_start(args, stmt_name);
  

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


Re: [HACKERS] ECPG DESCRIBE [OUTPUT] support

2010-01-04 Thread Robert Haas
On Mon, Jan 4, 2010 at 1:51 PM, Boszormenyi Zoltan  wrote:
> new patch is attached. Modified according to
> the new DB2 / Sybase compatible SQLDA structure.
> ECPGdescribe() has an "int compat" parameter, because:
> - the (struct prepared_statement *)->stmt ->compat is not set, and
> - it's more sensible to use the compat mode of the
>  ECPGdescribe() caller, because different source files can be
>  compiled with different (native or compat) modes.
> The Informix-specific syntax "DESCRIBE ... INTO sqlda" is also
> accepted in native mode now.

For tracking purposes, can you add a "Patch"-type comment for each of
these to the relevant entry on commitfest.postgresql.org?

Thanks,

...Robert

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