Fix catalog finctions which were still slightly broken in declare/fetch mode [Ludek...
authorDave Page <dpage@pgadmin.org>
Fri, 9 Dec 2005 22:35:06 +0000 (22:35 +0000)
committerDave Page <dpage@pgadmin.org>
Fri, 9 Dec 2005 22:35:06 +0000 (22:35 +0000)
statement.c

index e4431e1a5f93bc2d978a082bbd7f795947b3d0c9..2a011e7e10e997da42c75e1ffe1b93f3f692f1d1 100644 (file)
@@ -242,9 +242,11 @@ SC_Constructor(void)
 {
    StatementClass *rv;
 
+   mylog("SC_Constructor: entering ...\n");
    rv = (StatementClass *) malloc(sizeof(StatementClass));
    if (rv)
    {
+       mylog("SC_Constructor: created stmt = %u\n",rv);
        rv->hdbc = NULL;        /* no connection associated yet */
        rv->phstmt = NULL;
        rv->result = NULL;
@@ -974,6 +976,7 @@ SC_fetch(StatementClass *self)
            if ((((self->currTuple + 1) % ci->drivers.fetch_max) >= QR_get_num_total_tuples(res)) &&
                QR_get_num_total_tuples(res) < ci->drivers.fetch_max)
            {
+               SC_no_fetchcursor(self);
                self->currTuple = QR_get_num_total_tuples(res);
                return SQL_NO_DATA_FOUND;
            }