summaryrefslogtreecommitdiff
path: root/ext/sqlite3/sqlite3.c
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | 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
* | | | Remove local variablesPeter Kokot2019-02-031-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the so called local variables defined per file basis for certain editors to properly show tab width, and similar settings. These are mainly used by Vim and Emacs editors yet with recent changes the once working definitions don't work anymore in Vim without custom plugins or additional configuration. Neither are these settings synced across the PHP code base. A simpler and better approach is EditorConfig and fixing code using some code style fixing tools in the future instead. This patch also removes the so called modelines for Vim. Modelines allow Vim editor specifically to set some editor configuration such as syntax highlighting, indentation style and tab width to be set in the first line or the last 5 lines per file basis. Since the php test files have syntax highlighting already set in most editors properly and EditorConfig takes care of the indentation settings, this patch removes these as well for the Vim 6.0 and newer versions. With the removal of local variables for certain editors such as Emacs and Vim, the footer is also probably not needed anymore when creating extensions using ext_skel.php script. Additionally, Vim modelines for setting php syntax and some editor settings has been removed from some *.phpt files. All these are mostly not relevant for phpt files neither work properly in the middle of the file.
* | | | Remove yearly range from copyright noticeZeev Suraski2019-01-301-1/+1
| | | |
* | | | Implement SQLite3Stmt::getSQL method, returning the original statement SQL, ↵BohwaZ2018-12-151-0/+46
| | | | | | | | | | | | | | | | eventually expanded
* | | | SQLite3: Separating parameters binding in a functionBohwaZ2018-12-071-90/+107
| | | |
* | | | Require SQLite ≥ 3.7.4 for ext/sqlite3Christoph M. Becker2018-11-291-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `SQLite3::readOnly()` uses `sqlite3_stmt_readonly()` which is only available as of libsqlite 3.7.4. For older SQLite3 versions we return always `false`, which can be confusing. Instead of sticking with this behavior, or even undefining the method for old SQLite3 versions, we lift the requirements to SQLite 3.7.4 (released on 2010-12-08), according to a respective discussion[1]. Since pdo_sqlite doesn't use `sqlite3_stmt_readonly()`, we stick with the minimum requirement of SQLite 3.5.0. [1] <https://github.com/php/php-src/pull/3614>
* | | | Handle potential sqlite3_bind_*() call failuresChristoph M. Becker2018-11-291-8/+29
| | | | | | | | | | | | | | | | | | | | | | | | Since bug 77051 has been fixed, it is unlikely that any of the `sqlite3_bind_*` calls will ever fail, but we add respective checks nonetheless, and call `php_sqlite3_error()` in case of bind failures.
* | | | Merge branch 'PHP-7.3'Christoph M. Becker2018-11-291-0/+3
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.3: Fix #77051: Issue with re-binding on SQLite3
| * | | 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.
* | | | Deny (un)serialization of SQLite3, SQLite3Stmt and SQLite3ResultChristoph M. Becker2018-11-291-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Serializing `SQLite3`, `SQLite3Stmt` and `SQLite3Result` instances is possible but pointless, since unserializing results in uninitialized instances, which will bail out of any method call. Therefore, we deny serialization and unserialization in the first place.
* | | | Use ZEND_THIS macro to hide implementation details in extensions code.Dmitry Stogov2018-11-151-33/+33
| | | |
* | | | Replace getThis() by EX(This), when additional check is not necessary.Dmitry Stogov2018-11-141-33/+33
| | | |
* | | | Support SQLite3 @name notationChristoph M. Becker2018-11-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Besides the common `:param` notation to designate named parameters in prepared statements, SQLite3 also supports `@param` and `$param`. While the latter is mostly to support the Tcl programming language, and would be confusing for PHP's sqlite3 binding due to the similarity with string interpolation, the former is common under .NET and raises no such issue. Therefore we add support for it. This patch has been developed in cooperation with @BohwaZ.
* | | | Avoid needless string duplicationChristoph M. Becker2018-11-071-1/+1
| | | | | | | | | | | | | | | | Cf. <https://github.com/php/php-src/pull/3636#issuecomment-436638833>.
* | | | Require SQLite ≥ 3.5.0 for ext/sqlite3 and ext/pdo_sqliteChristoph M. Becker2018-10-131-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is possible to pass flags when opening an SQLite database. For Sqlite < 3.5.0 these are ignored, since `sqlite3_open` doesn't support flags. Neither a warning or notice is raised in this case, nor is this behavior documented in the PHP manual. Instead of fixing it either way, we lift the requirement to SQLite 3.5.0 (released on 2007-09-04) instead of the former SQLite 3.3.9 (released on 2007-01-04).
* | | | Get rid of ZEND_ACC_CTOR, ZEND_ACC_DTOR and ZEND_ACC_IMPLEMENTED_ABSTRACTDmitry Stogov2018-09-051-3/+3
|/ / /
* | | 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