aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2010-01-15 13:19:12 +0000
committerMichael Meskes <meskes@postgresql.org>2010-01-15 13:19:12 +0000
commiteb730cf5565c1699cf670437188b11ba2639745e (patch)
treedf42384e350875a38c0f30eac11ea6453eedc34d
parentd3be71a208f2bd4bc529c55a23d9da44f62b0ebb (diff)
downloadpostgresql-eb730cf5565c1699cf670437188b11ba2639745e.tar.gz
postgresql-eb730cf5565c1699cf670437188b11ba2639745e.zip
Added correct error handling in DESCRIBE statement processing by Boszormenyi Zoltan <zb@cybertec.at>.
-rw-r--r--src/interfaces/ecpg/ecpglib/descriptor.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/interfaces/ecpg/ecpglib/descriptor.c b/src/interfaces/ecpg/ecpglib/descriptor.c
index 367081a684d..acc26574b75 100644
--- a/src/interfaces/ecpg/ecpglib/descriptor.c
+++ b/src/interfaces/ecpg/ecpglib/descriptor.c
@@ -1,6 +1,6 @@
/* dynamic SQL support routines
*
- * $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/descriptor.c,v 1.34 2010/01/15 10:44:34 meskes Exp $
+ * $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/descriptor.c,v 1.35 2010/01/15 13:19:12 meskes Exp $
*/
#define POSTGRES_ECPG_INTERNAL
@@ -739,14 +739,24 @@ ECPGdescribe(int line, int compat, bool input, const char *connection_name, cons
/* 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)
- return false;
+ {
+ 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);