From: Scott MacVicar Date: Thu, 6 Jan 2011 00:08:59 +0000 (+0000) Subject: Implemented FR #53466 (SQLite3Result::columnType() should return false after all... X-Git-Tag: php-5.3.6RC1~152 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e1c1cc0ed5d19babcdc5641e2cc20be122ae4238;p=php Implemented FR #53466 (SQLite3Result::columnType() should return false after all of the rows have been fetched). --- diff --git a/NEWS b/NEWS index acb6e25cbf..e022f5ce3b 100644 --- a/NEWS +++ b/NEWS @@ -85,6 +85,7 @@ - SQLite3 extension: . Fixed memory leaked introduced by the NULL poisoning patch (Mateusz Kocielski, Pierre) . Add SQlite3_Stmt::readonly() for checking if a statement is read only. (Scott) + . Implemented FR #53466 (SQLite3Result::columnType() should return false after all of the rows have been fetched). (Scott) - Streams: . Implemented FR #26158 (open arbitrary file descriptor with fopen). (Gustavo) diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index 2e13918a11..541c13f6c5 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -1585,6 +1585,10 @@ PHP_METHOD(sqlite3result, columnType) return; } + if (result_obj->complete) { + RETURN_FALSE; + } + RETURN_LONG(sqlite3_column_type(result_obj->stmt_obj->stmt, column)); } /* }}} */ @@ -1634,6 +1638,7 @@ PHP_METHOD(sqlite3result, fetchArray) break; case SQLITE_DONE: + result_obj->complete = 1; RETURN_FALSE; break;