|
1 |
| -/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/prepare.c,v 1.26 2008/02/07 11:09:13 meskes Exp $ */ |
| 1 | +/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/prepare.c,v 1.27 2008/05/12 16:29:04 meskes Exp $ */ |
2 | 2 |
|
3 | 3 | #define POSTGRES_ECPG_INTERNAL
|
4 | 4 | #include "postgres_fe.h"
|
@@ -120,10 +120,11 @@ ECPGprepare(int lineno, const char *connection_name, const int questionmarks, co
|
120 | 120 | struct sqlca_t *sqlca = ECPGget_sqlca();
|
121 | 121 | PGresult *query;
|
122 | 122 |
|
123 |
| - ecpg_init_sqlca(sqlca); |
124 |
| - |
125 | 123 | con = ecpg_get_connection(connection_name);
|
126 | 124 |
|
| 125 | + if (!ecpg_init(con, connection_name, lineno)) |
| 126 | + return false; |
| 127 | + |
127 | 128 | /* check if we already have prepared this statement */
|
128 | 129 | this = find_prepared_statement(name, con, &prev);
|
129 | 130 | if (this && !deallocate_one(lineno, ECPG_COMPAT_PGSQL, con, prev, this))
|
@@ -256,6 +257,9 @@ ECPGdeallocate(int lineno, int c, const char *connection_name, const char *name)
|
256 | 257 |
|
257 | 258 | con = ecpg_get_connection(connection_name);
|
258 | 259 |
|
| 260 | + if (!ecpg_init(con, connection_name, lineno)) |
| 261 | + return false; |
| 262 | + |
259 | 263 | this = find_prepared_statement(name, con, &prev);
|
260 | 264 | if (this)
|
261 | 265 | return deallocate_one(lineno, c, con, prev, this);
|
|
0 commit comments