summaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/preproc/output.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/ecpg/preproc/output.c')
-rw-r--r--src/interfaces/ecpg/preproc/output.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/interfaces/ecpg/preproc/output.c b/src/interfaces/ecpg/preproc/output.c
index 09486c66d00..94cefdb2d2c 100644
--- a/src/interfaces/ecpg/preproc/output.c
+++ b/src/interfaces/ecpg/preproc/output.c
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/output.c,v 1.25 2009/06/11 14:49:13 momjian Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/output.c,v 1.26 2009/12/16 10:15:06 meskes Exp $ */
#include "postgres_fe.h"
@@ -105,14 +105,24 @@ hashline_number(void)
return EMPTY;
}
+static char *ecpg_statement_type_name[] = {
+ "ECPGst_normal",
+ "ECPGst_execute",
+ "ECPGst_exec_immediate",
+ "ECPGst_prepnormal"
+};
+
void
output_statement(char *stmt, int whenever_mode, enum ECPG_statement_type st)
{
-
fprintf(yyout, "{ ECPGdo(__LINE__, %d, %d, %s, %d, ", compat, force_indicator, connection ? connection : "NULL", questionmarks);
- if (st == ECPGst_normal)
+ if (st == ECPGst_execute || st == ECPGst_exec_immediate)
+ {
+ fprintf(yyout, "%s, %s, ", ecpg_statement_type_name[st], stmt);
+ }
+ else
{
- if (auto_prepare)
+ if (st == ECPGst_prepnormal && auto_prepare)
fputs("ECPGst_prepnormal, \"", yyout);
else
fputs("ECPGst_normal, \"", yyout);
@@ -120,8 +130,6 @@ output_statement(char *stmt, int whenever_mode, enum ECPG_statement_type st)
output_escaped_str(stmt, false);
fputs("\", ", yyout);
}
- else
- fprintf(yyout, "%d, %s, ", st, stmt);
/* dump variables to C file */
dump_variables(argsinsert, 1);