Fixed a bug in UseDeclareFetch mode.
authorHiroshi Inoue <inoue@tpf.co.jp>
Fri, 20 Oct 2006 22:46:35 +0000 (22:46 +0000)
committerHiroshi Inoue <inoue@tpf.co.jp>
Fri, 20 Oct 2006 22:46:35 +0000 (22:46 +0000)
statement.c

index 4805cd70c8a7800ae12e2f411d0d0f752d48006d..f5e0bd853208997e585ec19e493b2e011a10c032 100644 (file)
@@ -2372,12 +2372,15 @@ SendExecuteRequest(StatementClass *stmt, const char *plan_name, UInt4 count)
    if (sock = conn->sock, !sock)   return FALSE;
 
    mylog("%s: plan_name=%s count=%d\n", func, plan_name, count);
-   switch (stmt->prepared)
+   if (!SC_is_fetchcursor(stmt))
    {
-       case NOT_YET_PREPARED:
-       case ONCE_DESCRIBED:
-           SC_set_error(stmt, STMT_EXEC_ERROR, "about to execute a non-prepared statement", func);
-           return FALSE;
+       switch (stmt->prepared)
+       {
+           case NOT_YET_PREPARED:
+           case ONCE_DESCRIBED:
+               SC_set_error(stmt, STMT_EXEC_ERROR, "about to execute a non-prepared statement", func);
+               return FALSE;
+       }
    }
    if (!RequestStart(stmt, conn, func))
        return FALSE;