From 79fa21bd5c52157cf9a2296b06aa7ad6cb9c8b9c Mon Sep 17 00:00:00 2001
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: Tue, 19 Mar 2013 00:04:19 +0200
Subject: [PATCH 1/1] Fix column_size=5 varchar field in BoolsAsChar=1 mode.

If a query was sent to the server using the Parse command, we returned the
dummy QResult for the Parse, with 0 rows, to the caller of SQLExecute.
Fix by clearing out the result set just before executing.
---
 execute.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/execute.c b/execute.c
index 1339b58..a680dc8 100644
--- a/execute.c
+++ b/execute.c
@@ -1149,6 +1149,12 @@ next_param_row:
 		}
 	}
 
+	/*
+	 * Clear any old result sets before executing. The prepare stage might've
+	 * created one.
+	 */
+	SC_set_Result(stmt, NULL);
+
 	if (0 != (flag & PODBC_WITH_HOLD))
 		SC_set_with_hold(stmt);
 	retval = Exec_with_parameters_resolved(stmt, &exec_end);
-- 
1.7.10.4

