summaryrefslogtreecommitdiff
path: root/ext/sqlite3
Commit message (Collapse)AuthorAgeFilesLines
* Add missing SKIPIF (sqlite)Fabien Villepinte2019-09-041-0/+2
|
* Report errors from stream read and write operationsNikita Popov2019-07-222-8/+8
| | | | | | | | | | | | | | | | | | The php_stream_read() and php_stream_write() functions now return an ssize_t value, with negative results indicating failure. Functions like fread() and fwrite() will return false in that case. As a special case, EWOULDBLOCK and EAGAIN on non-blocking streams should not be regarded as error conditions, and be reported as successful zero-length reads/writes instead. The handling of EINTR remains unclear and is internally inconsistent (e.g. some code-paths will automatically retry on EINTR, while some won't). I'm landing this now to make sure the stream wrapper ops API changes make it into 7.4 -- however, if the user-facing changes turn out to be problematic we have the option of clamping negative returns to zero in php_stream_read() and php_stream_write() to restore the old behavior in a relatively non-intrusive manner.
* Move HAVE_SQLITE3_CLOSE_V2 to pdo_sqlitePeter Kokot2019-07-211-1/+0
| | | | Closes GH-4444
* Remove unused sqlite symbolsPeter Kokot2019-07-201-8/+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 unsed zts check for sqlite3Peter Kokot2019-07-141-11/+0
| | | | | | | This check was relevant with bundled sqlite library. Removed via 6083a387a81dbbd66d6316a3a12a63f06d5f7109 Closes GH-4403
* Implement SQLite extended result code functionalityRobert Kopack2019-07-023-20/+155
|
* Fix leak on sqlite3 open errorNikita Popov2019-06-251-0/+2
| | | | | sqlite3_open creates the database object even if the operation fails.
* Implement SQLite3 backup APIBohwaZ2019-06-172-0/+126
|
* Cheaper checks for exceptions thrown from __toString()Dmitry Stogov2019-06-061-4/+4
|
* Allow exceptions in __toString()Nikita Popov2019-06-052-8/+58
| | | | | | | | | | 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.
* Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macrosDmitry Stogov2019-05-281-7/+11
|
* Merge branch 'PHP-7.3' into PHP-7.4Stanislav Malyshev2019-05-271-0/+9
|\ | | | | | | | | * PHP-7.3: Fix bug #77967 - Bypassing open_basedir restrictions via file uris
| * 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-113-0/+50
| | | | | | | | | | | | | | | | against potential security flaws
| | | * Sync leading and final newlines in *.phpt sectionsPeter Kokot2018-10-154-4/+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
| | | * Convert CRLF line endings to LFPeter Kokot2018-10-131-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch simplifies line endings tracked in the Git repository and syncs them to all include the LF style instead of the CRLF files. Newline characters: - LF (\n) (*nix and Mac) - CRLF (\r\n) (Windows) - CR (\r) (old Mac, obsolete) To see which line endings are in the index and in the working copy the following command can be used: `git ls-files --eol` Git additionally provides `.gitattributes` file to specify if some files need to have specific line endings on all platforms (either CRLF or LF). Changed files shouldn't cause issues on modern Windows platforms because also Git can do output conversion is core.autocrlf=true is set on Windows and use CRLF newlines in all files in the working tree. Unless CRLF files are tracked specifically, Git by default tracks all files in the index using LF newlines.
* | | | fix typo breaking shared buildRemi Collet2019-05-211-1/+1
| | | |
* | | | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-05-211-1/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.3: use {TMP} placeholder in phpt tests
| * | | Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-05-211-1/+1
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.2: use {TMP} placeholder in phpt tests
| | * | use {TMP} placeholder in phpt testsHolly Li (WIPRO LIMITED)2019-05-211-1/+1
| | | |
* | | | Add RETURN_EMPTY_ARRAY() / RETVAL_EMPTY_ARRAY()Nikita Popov2019-05-141-1/+1
| | | | | | | | | | | | | | | | The usual wrappers around ZVAL_EMPTY_ARRAY()...
* | | | Use pkg-config for sqlite3 and pdo_sqlitePeter Kokot2019-05-141-37/+17
| | | | | | | | | | | | | | | | | | | | 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-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Avoid misc uninitialized variable warningsNikita Popov2019-04-121-7/+7
| | | |
* | | | Replace dirname(__FILE__) by __DIR__ in testsFabien Villepinte2019-03-152-2/+2
| | | |
* | | | Switch to use ZTS cacheDmitry Stogov2019-03-121-6/+4
| | | |
* | | | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-03-113-0/+50
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.3: SQLite3: add DEFENSIVE config for SQLite >= 3.26.0 as a mitigation strategy against potential security flaws
| * | | Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-03-113-0/+50
| |\ \ \ | | |/ / | | | | | | | | | | | | * 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-113-0/+50
| | | | | | | | | | | | | | | | against potential security flaws
* | | | Use EXPECT when possibleGabriel Caruso2019-03-112-2/+2
| | | | | | | | | | | | | | | | EXPECTF logic in run-tests.php is considerable, so let's avoid it.
* | | | More zpp error/variation test removalsNikita Popov2019-03-0820-567/+0
| | | |
* | | | Add AS_HELP_STRING to *nix build configure optionsPeter Kokot2019-03-071-3/+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-034-27/+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-303-3/+3
| | | |
* | | | Remove superfluous variableChristoph M. Becker2019-01-211-2/+1
| | | | | | | | | | | | | | | | This has been missed when libsqlite3 has been unbundled.
* | | | Implement SQLite3Stmt::getSQL method, returning the original statement SQL, ↵BohwaZ2018-12-153-0/+162
| | | | | | | | | | | | | | | | eventually expanded
* | | | SQLite3: Separating parameters binding in a functionBohwaZ2018-12-071-90/+107
| | | |
* | | | Require SQLite ≥ 3.7.4 for ext/sqlite3Christoph M. Becker2018-11-292-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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-292-0/+87
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.3: Fix #77051: Issue with re-binding on SQLite3
| * | | Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2018-11-292-0/+87
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.2: Fix #77051: Issue with re-binding on SQLite3
| | * | Fix #77051: Issue with re-binding on SQLite3BohwaZ2018-11-292-0/+87
| | | | | | | | | | | | | | | | We have to call `sqlite3_reset()` before re-binding the parameters.
| | * | Sync leading and final newlines in *.phpt sectionsPeter Kokot2018-10-154-4/+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
| * | | Sync leading and final newlines in *.phpt sectionsPeter Kokot2018-10-154-4/+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
* | | | 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.
* | | | Fix typo in testsFabien Villepinte2018-11-192-4/+4
| | | |
* | | | 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
| | | |