summaryrefslogtreecommitdiff
path: root/statement.c
diff options
context:
space:
mode:
authorHiroshi Inoue2017-09-01 03:08:29 +0000
committerHiroshi Inoue2017-09-01 03:08:29 +0000
commitd4ef75db064333c4591fe48ab3e548e7af4b8ffb (patch)
treeab6cdccc380320e90c9dce4c63c4a6622b9f1bb2 /statement.c
parentfb0dd9acbe6763290090d3e769da04cc06326332 (diff)
Improve QLOG.
Diffstat (limited to 'statement.c')
-rw-r--r--statement.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/statement.c b/statement.c
index 7ccff77..12ade90 100644
--- a/statement.c
+++ b/statement.c
@@ -2757,7 +2757,7 @@ MYLOG(0, "sta_pidx=%d end_pidx=%d num_p=%d\n", sta_pidx, end_pidx, num_params);
conn->unnamed_prepared_stmt = NULL;
/* Prepare */
- QLOG(0, "PQprepare: %p '%s' plan=%s num_params=%d\n", conn->pqconn, query, plan_name, num_params);
+ QLOG(0, "PQprepare: %p '%s' plan=%s nParams=%d\n", conn->pqconn, query, plan_name, num_params);
pgres = PQprepare(conn->pqconn, plan_name, query, num_params, paramTypes);
if (PQresultStatus(pgres) != PGRES_COMMAND_OK)
{
@@ -2864,6 +2864,15 @@ ParseAndDescribeWithLibpq(StatementClass *stmt, const char *plan_name,
/* Extract parameter information from the result set */
num_p = PQnparams(pgres);
MYLOG(1, "num_params=%d info=%d\n", stmt->num_params, num_p);
+ if (get_qlog() > 0)
+ {
+ int i;
+
+ QLOG(0, "\tnParams=%d", num_p);
+ for (i = 0; i < num_p; i++)
+ QPRINTF(0, " %u", PQparamtype(pgres, i));
+ QPRINTF(0, "\n");
+ }
num_discard_params = 0;
if (stmt->discard_output_params)
CountParameters(stmt, NULL, NULL, &num_discard_params);