summaryrefslogtreecommitdiff
path: root/ext/sqlite3/sqlite3.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix #79294: ::columnType() may fail after SQLite3Stmt::reset()Christoph M. Becker2020-02-211-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | The fix for feature request #53466 did not properly handle resetting of the corresponding statement; the problem with this is that the statement does not know about its result sets. But even if we could fix this, the `complete` handling still appears to be brittle, since the `sqlite3_column_type()`docs[1] state: | If the SQL statement does not currently point to a valid row, or if | the column index is out of range, the result is undefined. Fortunately, we can use `sqlite3_data_count()` instead, since[2]: | If prepared statement P does not have results ready to return (via | calls to the sqlite3_column() family of interfaces) then | sqlite3_data_count(P) returns 0. Thus, we guard `SQLite3::columnType()` with `sqlite3_data_count()`, and completely drop updating the `php_sqlite3_result_object.complete` field, but keep it for ABI BC purposes. [1] <https://www.sqlite.org/c3ref/column_blob.html> [2] <https://www.sqlite.org/c3ref/data_count.html>
* Merge branch 'PHP-7.2' into PHP-7.3Stanislav Malyshev2019-05-271-0/+9
|\ | | | | | | | | * PHP-7.2: Fix bug #77967 - Bypassing open_basedir restrictions via file uris
| * Merge branch 'PHP-7.1' into PHP-7.2Stanislav Malyshev2019-05-271-0/+9
| |\ | | | | | | | | | | | | * PHP-7.1: Fix bug #77967 - Bypassing open_basedir restrictions via file uris
| | * Fix bug #77967 - Bypassing open_basedir restrictions via file urisStanislav Malyshev2019-05-271-0/+9
| | |
| | * SQLite3: add DEFENSIVE config for SQLite >= 3.26.0 as a mitigation strategy ↵bohwaz2019-03-111-0/+9
| | | | | | | | | | | | against potential security flaws
* | | Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-03-111-0/+9
|\ \ \ | |/ / | | | | | | | | | * PHP-7.2: SQLite3: add DEFENSIVE config for SQLite >= 3.26.0 as a mitigation strategy against potential security flaws
| * | SQLite3: add DEFENSIVE config for SQLite >= 3.26.0 as a mitigation strategy ↵bohwaz2019-03-111-0/+9
| | | | | | | | | | | | against potential security flaws
* | | Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2018-11-291-0/+3
|\ \ \ | |/ / | | | | | | | | | * PHP-7.2: Fix #77051: Issue with re-binding on SQLite3
| * | Fix #77051: Issue with re-binding on SQLite3BohwaZ2018-11-291-0/+3
| | | | | | | | | | | | We have to call `sqlite3_reset()` before re-binding the parameters.
* | | Merge branch 'PHP-7.2'Christoph M. Becker2018-07-261-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.2: Fix #76665: SQLite3Stmt::bindValue() with SQLITE3_FLOAT doesn't juggle
| * | Merge branch 'PHP-7.1' into PHP-7.2Christoph M. Becker2018-07-261-1/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.1: Fix #76665: SQLite3Stmt::bindValue() with SQLITE3_FLOAT doesn't juggle
| | * Fix #76665: SQLite3Stmt::bindValue() with SQLITE3_FLOAT doesn't juggleChristoph M. Becker2018-07-261-1/+1
| | | | | | | | | | | | | | | We need to ensure that a zval IS_DOUBLE before we access it as such. In this case we apply common type juggling to do so.
| | * year++Xinchen Hui2018-01-021-1/+1
| | |
| * | year++Xinchen Hui2018-01-021-1/+1
| | |
* | | Remove unused Git attributes identPeter Kokot2018-07-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The $Id$ keywords were used in Subversion where they can be substituted with filename, last revision number change, last changed date, and last user who changed it. In Git this functionality is different and can be done with Git attribute ident. These need to be defined manually for each file in the .gitattributes file and are afterwards replaced with 40-character hexadecimal blob object name which is based only on the particular file contents. This patch simplifies handling of $Id$ keywords by removing them since they are not used anymore.
* | | Use zval_ptr_dtor() instead of zval_dtor() in internal functions that ↵Dmitry Stogov2018-07-051-4/+4
| | | | | | | | | | | | destroy new created object (This is safer and produces less code)
* | | Remove sqlite and xmlrpc extension versions from phpinfo outputPeter Kokot2018-07-031-1/+0
| | | | | | | | | | | | | | | The rest of the core extensions don't display the extension versions in the phpinfo output since they in most cases match the PHP release version.
* | | Remove unnecessary uses of z/ parametersNikita Popov2018-06-251-2/+2
| | |
* | | Export standard object handlers, to avoid indirect accessDmitry Stogov2018-05-311-3/+3
| | |
* | | Use zend_string_release_ex() instread of zend_string_release() in places, ↵Dmitry Stogov2018-05-281-7/+7
| | | | | | | | | | | | where we sure about string persistence.
* | | Remove return types from some magic method in protosGabriel Caruso2018-03-091-2/+2
| | | | | | | | | | | | __construct, __destruct, __wakeup does not have return types defined.
* | | Usee reference-counting instead of duplicationDmitry Stogov2018-01-191-1/+1
| | |
* | | Use stack allocated zvalsXinchen Hui2018-01-071-3/+1
| | |
* | | year++Xinchen Hui2018-01-021-1/+1
| | |
* | | Move constants into read-only data segmentDmitry Stogov2017-12-141-1/+1
| | |
* | | Move constants into read-only data segmentDmitry Stogov2017-12-141-3/+3
| | |
* | | Add zend_object_alloc() APINikita Popov2017-11-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using ecalloc() to create objects is expensive, because the dynamic-size memset() is unreasonably slow. Make sure we only zero the main object structure with known size, as the properties are intialized separately anyway. Technically we do not need to zero the embedded zend_object structure either, but as long as the memset argument is constant, a couple more bytes don't really matter.
* | | Avoid HashTable allocations for empty arrays (using zend_empty_array).Dmitry Stogov2017-10-241-1/+1
|/ /
* | Merge branch 'PHP-7.1' into PHP-7.2Remi Collet2017-08-021-0/+4
|\ \ | |/ | | | | | | * PHP-7.1: fix build with old system libsqlite (sqlite3_errstr may be missing)
| * Merge branch 'PHP-7.0' into PHP-7.1Remi Collet2017-08-021-0/+4
| |\ | | | | | | | | | | | | * PHP-7.0: fix build with old system libsqlite (sqlite3_errstr may be missing)
| | * fix build with old system libsqlite (sqlite3_errstr may be missing)Remi Collet2017-08-021-0/+4
| | |
* | | Merge branch 'PHP-7.1'Anatol Belski2017-07-091-3/+6
|\ \ \ | |/ / | | | | | | | | | * PHP-7.1: Fixed bug #74883 SQLite3::__construct() produces "out of memory" exception with invalid flags
| * | Merge branch 'PHP-7.0' into PHP-7.1Anatol Belski2017-07-091-3/+6
| |\ \ | | |/ | | | | | | | | | * PHP-7.0: Fixed bug #74883 SQLite3::__construct() produces "out of memory" exception with invalid flags
| | * Fixed bug #74883 SQLite3::__construct() produces "out of memory" exception ↵Anatol Belski2017-07-081-3/+6
| | | | | | | | | | | | with invalid flags
* | | Only compute callback name in error casesNikita Popov2017-06-251-11/+8
| | | | | | | | | | | | | | | Mostly the callback name is only used to report an error. Try to avoid calculating it if no error occurred.
* | | Change flags to use SQLITE3_OPEN_READ* constants instead of a fake-boolean, ↵BohwaZ2017-06-081-4/+6
| | | | | | | | | | | | add tests on errors
* | | Implement writing to BLOBs in SQLite3BohwaZ2017-05-181-6/+35
| | |
* | | Merge branch 'PHP-7.1'Anatol Belski2017-04-111-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.1: Fix misleading typo in identifiers
| * | Merge branch 'PHP-7.0' into PHP-7.1Anatol Belski2017-04-111-4/+4
| |\ \ | | |/ | | | | | | | | | * PHP-7.0: Fix misleading typo in identifiers
| | * Fix misleading typo in identifiersAnatol Belski2017-04-111-4/+4
| | |
* | | Merge branch 'PHP-7.1'Joe Watkins2017-04-111-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.1: fixed bug #74413 wrong reflection on SQLite3::enableExceptions
| * | Merge branch 'PHP-7.0' into PHP-7.1Joe Watkins2017-04-111-1/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.0: fixed bug #74413 wrong reflection on SQLite3::enableExceptions
| | * fixed bug #74413 wrong reflection on SQLite3::enableExceptionsJoe Watkins2017-04-111-1/+1
| | |
| | * Update copyright headers to 2017Sammy Kaye Powers2017-01-041-1/+1
| | |
* | | Merge branch 'PHP-7.1'Remi Collet2017-03-291-0/+2
|\ \ \ | |/ / | | | | | | | | | * PHP-7.1: Fix buid with system libsqlite, see bug #74217
| * | Fix buid with system libsqlite, see bug #74217Remi Collet2017-03-291-0/+2
| | | | | | | | | | | | | | | | | | SQLITE_DETERMINISTIC only exists in recent version e.g. missing on 3.7 which is the default on RHEL/CentOS-7 and probably others (wheezy have 3.7, jessie 3.8...)
* | | Merge branch 'PHP-7.1'Nikita Popov2017-03-121-3/+7
|\ \ \ | |/ /
| * | Implement FR #74217: deterministic sqlite functionsandrewnester2017-03-121-3/+7
| | |
| * | Update copyright headers to 2017Sammy Kaye Powers2017-01-041-1/+1
| | |
* | | Update copyright headers to 2017Sammy Kaye Powers2017-01-021-1/+1
| | |