summaryrefslogtreecommitdiff
path: root/ext/pdo_sqlite
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'PHP-7.3' into PHP-7.4Matteo Beccati2020-08-311-0/+3
|\ | | | | | | | | * PHP-7.3: Fix #80027 Terrible performance using $query->fetch on queries with many bind parameters
| * 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).
* | 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)
* | 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.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.
* | Apply tidy formattingNikita Popov2020-02-031-1/+1
| | | | | | | | Mostly reindent PHP scripts to spaces.
* | Fixed bug #79056Nikita Popov2020-01-031-10/+5
| |
* | Fix #78348: Remove -lrt from pdo_sqlite.soPeter Kokot2019-07-301-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | The fdatasync check has been removed since PHP 5.3. The Solaris fix was introduced via 8d63360fc40dec579af5b5f455ef02b85caff5c5 and is today no longer relevant since the sqlite library is neither bundled in php-src anymore neither the check needs to be done via the PHP build system. Closes GH-4485
* | Move HAVE_SQLITE3_CLOSE_V2 to pdo_sqlitePeter Kokot2019-07-211-0/+1
| | | | | | | | Closes GH-4444
* | Remove unused sqlite symbolsPeter Kokot2019-07-201-4/+0
| | | | | | | | | | | | | | - HAVE_SQLITE3_KEY is no longer used in php-src - SQLITE_ENABLE_COLUMN_METADATA is no longer used in php-src Closes GH-4443
* | Remove conditional calls of always available macrosPeter Kokot2019-07-141-4/+1
| | | | | | | | | | | | | | These checks were once relevant for these extensions in PECL and PHP versions without availability of the checked macros. Closes GH-4405
* | Simplify PHP_CHECK_PDO_INCLUDES callsPeter Kokot2019-07-081-16/+1
| | | | | | | | | | | | | | Conditional checks were once used for backwards compatibility with phpize from PHP versions that didn't have this macro call yet. Closes GH-4376
* | Implement SQLite extended result code functionalityRobert Kopack2019-07-024-1/+56
| |
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-06-282-2/+88
|\ \ | |/ | | | | | | * 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-282-2/+88
| |\ | | | | | | | | | | | | * 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-282-2/+88
| | | | | | | | | | | | Reset stmt->columns when column count changed on new execution of prepared statement
| | * Sync leading and final newlines in *.phpt sectionsPeter Kokot2018-10-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines in all *.phpt sections. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
| | * Trim trailing whitespace in *.phptPeter Kokot2018-10-143-6/+6
| | |
| | * Sync leading and final newlines in source code filesPeter Kokot2018-10-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
| | * Trim trailing whitespace in source code filesPeter Kokot2018-10-131-1/+1
| | |
| * | Sync leading and final newlines in *.phpt sectionsPeter Kokot2018-10-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines in all *.phpt sections. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
| * | Trim trailing whitespace in *.phptPeter Kokot2018-10-143-6/+6
| | |
| * | Sync leading and final newlines in source code filesPeter Kokot2018-10-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
| * | Trim trailing whitespace in source code filesPeter Kokot2018-10-131-1/+1
| | |
* | | Don't use sqlite3_aggregate_count()Nikita Popov2019-06-121-17/+20
| | | | | | | | | | | | | | | | | | This function has been deprecated, with the recommendation that the count should be explicitly tracked in the aggregate context, if it is needed.
* | | Fix type mismatch in two get_col callbacksNikita Popov2019-06-121-1/+1
| | |
* | | Allow exceptions in __toString()Nikita Popov2019-06-053-3/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Use pkg-config for sqlite3 and pdo_sqlitePeter Kokot2019-05-141-43/+18
| | | | | | | | | | | | | | | Following other migrations to pkg-config usage for the *nix build system this migrates also sqlite3 and pdo_sqlite extensions.
* | | Normalize comments in *nix build system m4 filesPeter Kokot2019-05-121-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Normalization include: - Use dnl for everything that can be ommitted when configure is built in favor of the shell comment character # which is visible in the output. - Line length normalized to 80 columns - Dots for most of the one line sentences - Macro definitions include similar pattern header comments now
* | | Using PDO instead because of consistencypeter279k2019-05-1110-10/+10
| | |
* | | Replace dirname(__FILE__) by __DIR__ in testsFabien Villepinte2019-03-154-8/+8
| | |
* | | Cleanup unused module globalsDmitry Stogov2019-03-121-16/+0
| | |
* | | Add AS_HELP_STRING to *nix build configure optionsPeter Kokot2019-03-071-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | The Autoconf's default AS_HELP_STRING macro can properly format help strings [1] so watching out if columns are aligned manually is not anymore. [1] https://www.gnu.org/software/autoconf/manual/autoconf.html#Pretty-Help-Strings
* | | Remove local variablesPeter Kokot2019-02-039-33/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-305-5/+5
| | |
* | | Fix illogical strncpy sizeChristoph M. Becker2018-12-011-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | While both source and destination buffers have the same size (6 bytes), and this is unlikely to change in the future, we nonetheless fix the illogical `strncpy` size. Based on a pull request provided by Cristian Rodríguez.
* | | Use ZEND_THIS macro to hide implementation details in extensions code.Dmitry Stogov2018-11-151-3/+3
| | |
* | | Replace getThis() by EX(This), when additional check is not necessary.Dmitry Stogov2018-11-141-3/+3
| | |
* | | Sync leading and final newlines in *.phpt sectionsPeter Kokot2018-10-152-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines in all *.phpt sections. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
* | | Trim trailing whitespace in testsGabriel Caruso2018-10-143-6/+6
| | |
* | | Sync leading and final newlines in source code filesPeter Kokot2018-10-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
* | | Require SQLite ≥ 3.5.0 for ext/sqlite3 and ext/pdo_sqliteChristoph M. Becker2018-10-132-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* | | Unbundle libsqlite3Christoph M. Becker2018-10-063-84/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Remove HAVE_TIME_HPeter Kokot2018-09-211-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `<time.h>` header file is part of the standard C89 headers [1] and on current systems can be included unconditionally. Since PHP requires at least C89 or greater, the `HAVE_TIME_H` symbol defined by Autoconf in ext/pdo_sqlite/config.m4 [2] can be ommitted and simplifed. Additionally, since PHP didn't define `HAVE_TIME_H` prior in the configure.ac the occurrence of this symbol in cli can be removed. Refs: [1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2 [2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
* | | Use EXPECT instead of EXPECTF when possibleGabriel Caruso2018-09-164-4/+4
| | |
* | | Merge branch 'PHP-7.3'Anatol Belski2018-08-031-1/+5
|\ \ \ | |/ / | | | | | | | | | * PHP-7.3: Improve cleanup
| * | Merge branch 'PHP-7.2' into PHP-7.3Anatol Belski2018-08-031-1/+5
| |\ \ | | |/ | | | | | | | | | * PHP-7.2: Improve cleanup