Fix bug in determining the datatypes when binding.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 21 Jan 2015 16:43:09 +0000 (18:43 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 21 Jan 2015 16:44:30 +0000 (18:44 +0200)
In the big libpq patch, I accidentally removed the line where
current_exec_param was reset to 0. It's still required (which is a very
fiddly way to pass that value to ParseAndDescribeWithLibpq, but let's live
with it for now..)

convert.c
statement.c

index 148ee3d9b1210b4345c985d1c1f706901e16a656..75f2a297f97907139b6b28fcc95a30577dbbc002 100644 (file)
--- a/convert.c
+++ b/convert.c
@@ -2682,6 +2682,7 @@ inolog("prep_params_and_sync\n");
 
    pstmt = stmt->processed_statements;
 
+   stmt->current_exec_param = 0;
    res = ParseAndDescribeWithLibpq(stmt, plan_name, pstmt->query, pstmt->num_params, "prepare_and_describe", NULL);
    if (res == NULL)
        goto cleanup;
index a7f98f6a47be55113796f39c2997798fda53dace..0b7fce0ff6bf7fd3d6a036482a6e456eceb437d4 100644 (file)
@@ -2757,6 +2757,9 @@ cleanup:
  * Returns an empty result set that has the column information, or error code
  * and message, filled in. If 'res' is not NULL, it is the result set
  * returned, otherwise a new one is allocated.
+ *
+ * NB: The caller must set stmt->current_exec_param before calling this
+ * function!
  */
 QResultClass *
 ParseAndDescribeWithLibpq(StatementClass *stmt, const char *plan_name,