? ext/pdo_sqlite/sqlite/Makefile ? ext/pdo_sqlite/sqlite/config.log ? ext/pdo_sqlite/sqlite/config.status ? ext/pdo_sqlite/sqlite/libtool ? ext/pdo_sqlite/sqlite/sqlite3.pc Index: ext/pdo/pdo_stmt.c =================================================================== RCS file: /repository/php-src/ext/pdo/pdo_stmt.c,v retrieving revision 1.118.2.38.2.9 diff -u -p -d -r1.118.2.38.2.9 pdo_stmt.c --- ext/pdo/pdo_stmt.c 7 Nov 2006 17:57:17 -0000 1.118.2.38.2.9 +++ ext/pdo/pdo_stmt.c 28 Nov 2006 10:51:51 -0000 @@ -466,7 +466,7 @@ static PHP_METHOD(PDOStatement, execute) if (!stmt->executed) { /* this is the first execute */ - if (stmt->dbh->alloc_own_columns) { + if (stmt->dbh->alloc_own_columns && !stmt->columns) { /* for "big boy" drivers, we need to allocate memory to fetch * the results into, so lets do that now */ ret = pdo_stmt_describe_columns(stmt TSRMLS_CC); @@ -617,6 +617,10 @@ static inline void fetch_value(pdo_stmt_ static int do_fetch_common(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, long offset, int do_bind TSRMLS_DC) /* {{{ */ { + if (!stmt->executed) { + return 0; + } + if (!dispatch_param_event(stmt, PDO_PARAM_EVT_FETCH_PRE TSRMLS_CC)) { return 0; } Index: ext/pdo_sqlite/sqlite_statement.c =================================================================== RCS file: /repository/php-src/ext/pdo_sqlite/sqlite_statement.c,v retrieving revision 1.18.2.4.2.1 diff -u -p -d -r1.18.2.4.2.1 sqlite_statement.c --- ext/pdo_sqlite/sqlite_statement.c 27 Nov 2006 12:14:09 -0000 1.18.2.4.2.1 +++ ext/pdo_sqlite/sqlite_statement.c 28 Nov 2006 10:51:51 -0000 @@ -215,6 +215,9 @@ static int pdo_sqlite_stmt_get_col(pdo_s if (!S->stmt) { return 0; } + if (!stmt->executed) { + return 0; + } if(colno >= sqlite3_data_count(S->stmt)) { /* error invalid column */ pdo_sqlite_error_stmt(stmt); @@ -301,6 +304,7 @@ static int pdo_sqlite_stmt_cursor_closer { pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data; sqlite3_reset(S->stmt); + stmt->executed = 0; return 1; }