summaryrefslogtreecommitdiff
path: root/ext/pdo_sqlite
Commit message (Collapse)AuthorAgeFilesLines
* Declare PDORow::queryString propertyMáté Kocsis2021-03-171-2/+2
| | | | Relates GH-6742
* Use standard PDO way for fetching integer attribute valuesGeorge Peter Banyard2021-03-172-6/+21
|
* Allow specifying sqlite3 DSN (file:/) in PDO SQLitetzmfreedom2021-01-253-0/+77
| | | | Closes GH-6610.
* Refactor PDO's last inserted ID handler to use and return zend_stringGeorge Peter Banyard2021-01-191-5/+2
| | | | Closes GH-6617
* Refactor PDO doer handler to use zend_stringGeorge Peter Banyard2021-01-191-2/+2
|
* Make convert_to_*_ex simple aliases of convert_to_*Nikita Popov2021-01-141-1/+1
| | | | | | | | | | | | | Historically, the _ex variants separated the zval first, if a conversion was necessary. This distinction no longer makes sense since PHP 7. The only difference that was still left is that _ex checked whether the type is the same first, but the usage of these macros did not actually distinguish on whether such an inlined check is valuable or not in a given context. Also drop the unused convert_to_explicit_type macros.
* Refactor PDO's quoter handler to return a zend_stringGeorge Peter Banyard2021-01-071-5/+7
| | | | Closes GH-6547
* Voidify PDO's fetch_error handlerGeorge Peter Banyard2021-01-061-3/+1
|
* Boolify PDO's preparer handlerGeorge Peter Banyard2021-01-061-4/+4
|
* Voidify PDO's closer handlerGeorge Peter Banyard2021-01-061-2/+1
|
* Boolify PDO's quoter handlerGeorge Peter Banyard2021-01-061-2/+2
|
* Boolify PDO's set_attribute driver functionGeorge Peter Banyard2021-01-061-4/+4
|
* Boolify PDO's transaction handlersGeorge Peter Banyard2021-01-061-10/+10
| | | | This includes begin(), commit(), rollBack(), and inTransaction()
* Support native types in PDO SQLiteNikita Popov2020-12-238-13/+80
| | | | | | | Return integers and floats as native types if possible. As usual, the old behavior can be restored by enabling ATTR_STRINGIFY_FETCHES. Fixes bug #38334.
* Rewrite PDO result bindingNikita Popov2020-12-223-23/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead of requiring the type to be determined in advance by the describer function and then requiring get_col to return a buffer of appropriate type, allow get_col to return an arbitrary zval. See UPGRADING.INTERNALS for a more detailed description of the change. This makes the result fetching simpler, more efficient and more flexible. The general possibility already existed via the special PDO_PARAM_ZVAL type, but the usage was very inconvenient and/or inefficient. Now it's possible to easily implement behavior like "return int if it fits, otherwise string" and to avoid any kind of complex management of temporary buffers. This also fixes bug #40913 (our second highest voted bug of all time, for some reason). PARAM_LOB result bindings will now consistently return a stream resource, independently of the used database driver. I've tried my best to update all PDO drivers for this change, but some of the changes may be broken, as I cannot test or even build some of these drivers (in particular PDO dblib and PDO oci). Fixes are appreciated -- a working CI setup would be even more appreciated ;)
* PDO: Store/pass query_string as zend_stringNikita Popov2020-12-141-2/+2
| | | | | Rather than storing char* + size_t, use a zend_string*. Also avoid various copies of the query string.
* Merge branch 'PHP-8.0'Nikita Popov2020-12-081-42/+2
|\ | | | | | | | | * PHP-8.0: Handle column count change in PDO MySQL
| * Handle column count change in PDO MySQLNikita Popov2020-12-081-42/+2
| | | | | | | | | | | | | | | | This has been fixed for PDO SQlite by GH-4313, however the same issue also applied to PDO MySQL. Move the column count setting function into the main PDO layer (and export it) and then use it in both PDO SQLite and PDO MySQL.
* | Merge branch 'PHP-8.0'Máté Kocsis2020-10-123-11/+11
|\ \ | |/
| * Improve parameter names in ext/pdo_sqliteMáté Kocsis2020-10-123-11/+11
| | | | | | | | Closes GH-6310
* | Add GC support for PDO driver dataNikita Popov2020-10-122-1/+45
|/ | | | | | | | | Add a get_gc method that can be implemented by drivers, which can be used to add additional zvals to the GC buffer. Implement GC support for PDO SQLite callbacks in particular. Closes GH-6262.
* Make various failure conditions in PDO unconditional errorsGeorge Peter Banyard2020-09-282-56/+78
| | | | | | | This includes TypeErrors, ValueErrors, Error for uninitialized objects and invalid user classes/callable instanciation Closes GH-6212
* Run tidyNikita Popov2020-09-181-1/+1
| | | | | This should fix most of the remaining issues with tabs and spaces being mixed in tests.
* Fix #80027 Terrible performance using $query->fetch on queries with many ↵Matteo Beccati2020-08-311-0/+3
| | | | | | | | | | bind parameters Added new flags that allow skipping param_evt(s) that are not used by drivers, in a backwards and forward compatible manner. Updated the pgsql, mysql, sqlite and oci drivers to properly use the new flags. I've left out pdo_dblib, which doesn't have a param_hook, and pdo_firebird, which seems to be using PARAM_EVT_NORMALIZE in a wrong context (param type vs event type).
* Fix test after is_callable changeNikita Popov2020-08-141-1/+1
|
* Merge branch 'PHP-7.4'Nikita Popov2020-08-112-2/+18
|\ | | | | | | | | * PHP-7.4: Fix #64705 errorInfo property of PDOException is null when PDO::__construct() fails
| * Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-08-112-2/+18
| |\ | | | | | | | | | | | | * PHP-7.3: Fix #64705 errorInfo property of PDOException is null when PDO::__construct() fails
| | * Fix #64705 errorInfo property of PDOException is null when ↵Ahmed Abdou2020-08-112-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | PDO::__construct() fails PDO driver constructors are throwing PdoException without setting errorInfo, so create a new reusable function that throws exceptions for PDO and will also set the errorInfo. Use this function in pdo_mysql, pdo_sqlite, and pdo_pgsql.
| | * Report len as -1 instead of INT_MAXNikita Popov2020-07-082-2/+2
| | | | | | | | | | | | | | | | | | | | | Per docs it should be -1. And would be on 32-bit systems, but not on 64-bit systems. (cherry picked from commit 39111585a2f8e40e72bdc662eb8b2e3c19e93615)
* | | Add many missing closing PHP tags to testsMáté Kocsis2020-08-092-0/+2
| | | | | | | | | | | | Closes GH-5958
* | | Get rid of empty function entriesMáté Kocsis2020-08-011-7/+1
| | | | | | | | | | | | Closes GH-5917
* | | Add stubs for PDO PGSql extension methodsNikita Popov2020-07-211-1/+1
| | |
* | | Add stubs for PDO SQLite extension methodsNikita Popov2020-07-215-14/+57
| | | | | | | | | | | | Putting these under a dummy PDO_SQLite_Ext class.
* | | Use ZPP callable for PDO SqliteGeorge Peter Banyard2020-07-213-51/+37
| | |
* | | Review the usage of apostrophes in error messagesMáté Kocsis2020-07-101-4/+4
| | | | | | | | | | | | Closes GH-5590
* | | Remove proto comments from C filesMax Semenik2020-07-061-6/+3
| | | | | | | | | | | | Closes GH-5758
* | | Merge branch 'PHP-7.4'Nikita Popov2020-06-032-2/+2
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Report len as -1 instead of INT_MAX
| * | Report len as -1 instead of INT_MAXNikita Popov2020-06-032-2/+2
| | | | | | | | | | | | | | | Per docs it should be -1. And would be on 32-bit systems, but not on 64-bit systems.
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-06-022-1/+33
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #79664: PDOStatement::getColumnMeta fails on empty result set
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-06-022-1/+33
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #79664: PDOStatement::getColumnMeta fails on empty result set
| | * Fix #79664: PDOStatement::getColumnMeta fails on empty result setChristoph M. Becker2020-06-022-1/+33
| | | | | | | | | | | | | | | | | | | | | As its name suggests, `sqlite3_data_count` returns the number of columns in the current row of the result set; we are interested in the number of columns regardless of the current row, so we have to use `sqlite3_column_count` instead.
* | | Change the default PDO error mode to exceptionsAllenJB2020-05-043-1/+24
| | | | | | | | | | | | According to <https://www.php.net/manual/en/pdo.error-handling.php>.
* | | Improve undefined variable error messagesMáté Kocsis2020-03-311-1/+1
| | | | | | | | | | | | Closes GH-5312
* | | Reindent phpt filesNikita Popov2020-02-0312-64/+64
| | |
* | | Merge branch 'PHP-7.4'Nikita Popov2020-02-031-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Apply tidy formatting
| * | Apply tidy formattingNikita Popov2020-02-031-1/+1
| | | | | | | | | | | | Mostly reindent PHP scripts to spaces.
* | | Make error messages more consistent by fixing capitalizationMáté Kocsis2020-01-173-7/+7
| | | | | | | | | | | | Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
* | | Merge branch 'PHP-7.4'Nikita Popov2020-01-031-10/+5
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fixed bug #79056
| * | Fixed bug #79056Nikita Popov2020-01-031-10/+5
| | |
* | | Remove most uses of ZEND_PARSE_PARAMETERS_END_EX()Nikita Popov2019-10-071-3/+3
| | | | | | | | | | | | | | | As ZPP now throws, it makes no sense to specify an explicit return value.