]> granicus.if.org Git - php/commitdiff
don't free the cols until we know we have another rowset
authorWez Furlong <wez@php.net>
Sat, 9 Jul 2005 05:01:14 +0000 (05:01 +0000)
committerWez Furlong <wez@php.net>
Sat, 9 Jul 2005 05:01:14 +0000 (05:01 +0000)
ext/pdo_odbc/odbc_stmt.c

index 76a82c781a8e1ec420c5523a51f29ee022720a41..0c6f77f4596e7fae87c1eb78bb6fe80e2f8aa16b 100755 (executable)
@@ -489,8 +489,6 @@ static int odbc_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
        SQLSMALLINT colcount;
        pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
 
-       free_cols(stmt, S TSRMLS_CC);
-
        /* NOTE: can't guarantee that output or input/output parameters
         * are set until this fella returns SQL_NO_DATA, according to
         * MSDN ODBC docs */
@@ -500,6 +498,7 @@ static int odbc_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
                return 0;
        }
 
+       free_cols(stmt, S TSRMLS_CC);
        /* how many columns do we have ? */
        SQLNumResultCols(S->stmt, &colcount);
        stmt->column_count = (int)colcount;