summaryrefslogtreecommitdiff
path: root/ext/pdo_sqlite/sqlite_statement.c
Commit message (Collapse)AuthorAgeFilesLines
* Support native types in PDO SQLiteNikita Popov2020-12-231-1/+22
| | | | | | | 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-221-18/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 ;)
* 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-7.4'Nikita Popov2020-06-031-1/+1
|\ | | | | | | | | * PHP-7.4: Report len as -1 instead of INT_MAX
| * Report len as -1 instead of INT_MAXNikita Popov2020-06-031-1/+1
| | | | | | | | | | 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-021-1/+1
|\ \ | |/ | | | | | | * PHP-7.4: Fix #79664: PDOStatement::getColumnMeta fails on empty result set
| * Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-06-021-1/+1
| |\ | | | | | | | | | | | | * PHP-7.3: Fix #79664: PDOStatement::getColumnMeta fails on empty result set
| | * Fix #79664: PDOStatement::getColumnMeta fails on empty result setChristoph M. Becker2020-06-021-1/+1
| | | | | | | | | | | | | | | | | | | | | 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.
* | | 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.
* | | Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-251-2/+0
|/ / | | | | | | Closes GH-4732.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-06-281-2/+42
|\ \ | |/ | | | | | | * PHP-7.3: Fix bug #78192 PDO SQLite SegFault when reuse statement after schema has changed
| * Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-06-281-2/+42
| |\ | | | | | | | | | | | | * PHP-7.2: Fix bug #78192 PDO SQLite SegFault when reuse statement after schema has changed
| | * Fix bug #78192 PDO SQLite SegFault when reuse statement after schema has changedVincent2019-06-281-2/+42
| | | | | | | | | | | | Reset stmt->columns when column count changed on new execution of prepared statement
| | * year++Xinchen Hui2018-01-021-1/+1
| | |
* | | Fix type mismatch in two get_col callbacksNikita Popov2019-06-121-1/+1
| | |
* | | Allow exceptions in __toString()Nikita Popov2019-06-051-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC: https://wiki.php.net/rfc/tostring_exceptions And convert some object to string conversion related recoverable fatal errors into Error exceptions. Improve exception safety of internal code performing string conversions.
* | | 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
| | |
* | | Unbundle libsqlite3Christoph M. Becker2018-10-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since there is no need to patch libsqlite3 for our purposes, and since libsqlite3 ≥ 3.3.9 (which is our current requirement) is widely available on distros, there is no reason anymore to bundle the library. Besides removing the bundled libsqlite, and adapting the configuration respectively, we also fix the use of the SQLITE_ENABLE_COLUMN_METADATA compile time constant to detect whether sqlite3_column_table_name() is available by a working feature detection (otherwise bug_42589.phpt would fail). We also skip bug73068.phpt for libsqlite 3.11.0 to 3.14.1 which have a bug (<https://sqlite.org/src/info/ef360601>). We also completely drop support for the obscure pdo_sqlite_external extension (which could have been enabled on Windows only by passing `--pdo-sqlite-external` to configure), since it is not needed anymore. Furthermore, we remove references to the bundled libsqlite from Makefile.gcov, CONTRIBUTING.md and README.REDIST.BINS.
* | | Add \PDO::SQLITE_ATTR_READONLY_STATEMENTBohwaZ2018-08-011-1/+23
|/ / | | | | | | | | | | This attribute is a boolean value. It is taken from the return value of sqlite3_stmt_readonly(), indicating if and only if the prepared statement makes no direct changes to the content of the database.
* | 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.
* | year++Xinchen Hui2018-01-021-1/+1
| |
* | Turn "pdo_stmt_methods" into constants.Dmitry Stogov2017-12-141-1/+1
|/
* Update copyright headers to 2017Sammy Kaye Powers2017-01-021-1/+1
|
* Merge branch 'PHP-5.6' into PHP-7.0Lior Kaplan2016-01-011-1/+1
|\ | | | | | | | | * PHP-5.6: Happy new year (Update copyright to 2016)
| * Happy new year (Update copyright to 2016)Lior Kaplan2016-01-011-1/+1
| |
| * bump yearXinchen Hui2015-01-151-1/+1
| |
* | use Z* macro nameAnatol Belski2015-11-051-1/+1
| |
* | fix pdo_sqlite crash with empty bound streamAnatol Belski2015-11-051-2/+3
| |
* | Various warning fixesNikita Popov2015-07-171-1/+1
| |
* | Use ZSTR_ API to access zend_string elements (this is just renaming without ↵Dmitry Stogov2015-06-301-1/+1
| | | | | | | | semantick changes).
* | Use zend_string to represent pdo_column_data.name and avoid duplication.Dmitry Stogov2015-05-051-2/+3
| |
* | bump yearXinchen Hui2015-01-151-1/+1
| |
* | trailing whitespace removalStanislav Malyshev2015-01-101-11/+11
| |
* | first shot remove TSRMLS_* thingsAnatol Belski2014-12-131-9/+9
| |
* | s/PHP 5/PHP 7/Johannes Schlüter2014-09-191-1/+1
| |
* | master renames phase 7PRE_AST_MERGEAnatol Belski2014-08-251-1/+1
| |
* | master renames phase 3Anatol Belski2014-08-251-1/+1
| |
* | master renames phase 1Anatol Belski2014-08-251-7/+7
| |
* | ported pdo and pdo_sqliteAnatol Belski2014-08-191-4/+4
| |
* | basic macro replacements, all at onceAnatol Belski2014-08-191-5/+5
| |
* | Various bugs fixedXinchen Hui2014-04-241-18/+33
| |
* | Refactor pdo_sqlite (only compilable)Xinchen Hui2014-04-231-23/+20
| |
* | Cleanup (1-st round)Dmitry Stogov2014-04-151-7/+7
|/
* Bump yearXinchen Hui2014-01-031-1/+1
|
* Fix bug #63916: PDO::PARAM_INT casts to 32bit int internally even on 64bit ↵Lars Strojny2013-01-141-0/+6
| | | | builds in pdo_sqlite
* Happy New YearXinchen Hui2013-01-011-1/+1
|
* - Year++Felipe Pena2012-01-011-1/+1
|
* - Year++Felipe Pena2011-01-011-1/+1
|