Commit graph

507 commits

Author SHA1 Message Date
Saki Takamachi
3e3875c379
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-13998: Manage refcount of agg_context->val correctly (#14004)
2024-04-20 22:34:53 +09:00
Saki Takamachi
43064160c4
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-13998: Manage refcount of agg_context->val correctly (#14004)
2024-04-20 22:34:31 +09:00
Saki Takamachi
2a1aa8cac5
Fix GH-13998: Manage refcount of agg_context->val correctly (#14004)
When step_callback fails, agg_context->val is passed dtor, but agg_context->val
is also used in final_callback regardless of the success/failure of step_callback,
so should not call dtor.

closes #14004
fixes #13998
2024-04-20 22:33:25 +09:00
Saki Takamachi
d14b208552
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-13984: Buffer size is now checked before memcmp (#13991)
2024-04-18 08:38:18 +09:00
Saki Takamachi
dd5cdfd645
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-13984: Buffer size is now checked before memcmp (#13991)
2024-04-18 08:37:55 +09:00
Saki Takamachi
fda91a0543
Fix GH-13984: Buffer size is now checked before memcmp (#13991)
Fixed an issue where a buffer overflow occurred when a string shorter than
`:memory:` was passed as the db name of pdo_sqlite.

fixed #13984
closes #13991
2024-04-18 08:35:50 +09:00
Nikita Popov
67184f5445
Fix PdoSqlite::loadExtension() test (#13736)
The test contained a syntax error and an incorrect use of loadExtension(), which returns void not bool.

Also install the necessary package in CI, so it gets tested there.
2024-03-17 22:27:09 +01:00
Gina Peter Banyard
5c7a0abe55
Merge branch 'PHP-8.3'
* PHP-8.3:
  ext/pdo: Fix various PDORow bugs
2024-02-27 15:32:20 +00:00
Gina Peter Banyard
ddebe469e1
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  ext/pdo: Fix various PDORow bugs
2024-02-27 15:31:48 +00:00
Gina Peter Banyard
b4e272c56a
ext/pdo: Fix various PDORow bugs
- Add tests
- NULL derefencing in read_dimension handler
- Fix isset()
- Fix empty() with column numbers as offsets
- Refactoring to use common functions
2024-02-27 15:30:23 +00:00
Máté Kocsis
10957e498c
Do not generate frameless info items when func info generation is disabled
While here, I fixed newlines around arginfo and function entry generation. Previously, newlines were repeated.
2024-02-18 11:39:00 +01:00
Máté Kocsis
d6a0b3af68
Implement PDO driver-specific subclasses
RFC: https://wiki.php.net/rfc/pdo_driver_specific_subclasses
Closes GH-12804

Co-Authored-By: Danack <Danack@basereality.com>
2024-01-11 23:22:41 +01:00
George Peter Banyard
c1fec9bbc3
PDO: Clean-up tests so it's easier to see if they use default test table (#12552) 2023-10-29 23:13:30 +00:00
Máté Kocsis
f4a5db3e08
Parallelize pdo tests (dblib, firebird, oci, odbc, pgsql) (#12395)
Co-authored-by: George Peter Banyard <girgias@php.net>
Co-authored-by: Jorg Adam Sowa <jorg.sowa@gmail.com>
2023-10-28 12:35:57 +01:00
Ilija Tovilo
3fb09940fc
Revert "Skip profiling of sqlite3_step"
This reverts commit bb31a75321.

It doesn't seem like this actually fixed the problem.
2023-09-07 10:35:06 +02:00
Ilija Tovilo
bb31a75321
Skip profiling of sqlite3_step
It looks like sqlite3_step can vary quite drastically from one request to the
next. This seems to be caused by more or fewer calls to sqlite3VdbeSorterWrite.
It would be great if we could find a way to make execution of this function more
consistent, but at this point I don't know how.

Closes GH-12130
2023-09-05 17:38:00 +02:00
Alexandre Daubois
417f3fdb91
Improve ext/pdo_sqlite tests cleanup (#11900) 2023-08-08 09:49:02 +01:00
nielsdos
724af01eaa Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-11492: Make test failure: ext/pdo_sqlite/tests/bug_42589.phpt
2023-06-22 20:51:29 +02:00
nielsdos
c44f79b7d5 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11492: Make test failure: ext/pdo_sqlite/tests/bug_42589.phpt
2023-06-22 20:51:11 +02:00
Vinicius Dias
039dd0b4bd Fix GH-11492: Make test failure: ext/pdo_sqlite/tests/bug_42589.phpt
Closes GH-11494.
2023-06-22 20:49:00 +02:00
George Peter Banyard
d5ad75108e
More usage of known zend_str instead of C string (#11381) 2023-06-08 13:03:29 +01:00
David CARLIER
54f92fc333
ext/pdo_sqlite: simplifying sqlite3_exec usage. (#10910)
pdo_sqlite_error copy the error message via the php's allocator,
 while the one from sqlite3_exec is unused.
2023-03-23 13:43:58 +00:00
Ilija Tovilo
da4167b918
Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix unescaped {TMP} variables in tests
2023-03-01 13:25:34 +01:00
Ilija Tovilo
2b5aac9303
Fix unescaped {TMP} variables in tests
On Windows {TMP} can return ~, which will result in a parse error
2023-03-01 13:24:39 +01:00
Christoph M. Becker
a23e837f16
Merge branch 'PHP-8.2'
* PHP-8.2:
  Force extension loading for new test
2022-12-19 16:17:02 +01:00
Christoph M. Becker
1abc1645dd
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Force extension loading for new test
2022-12-19 16:15:24 +01:00
Christoph M. Becker
da5cbca23e
Force extension loading for new test 2022-12-19 16:14:00 +01:00
Christoph M. Becker
0cbc49b3c2
Merge branch 'PHP-8.2'
* PHP-8.2:
  Skip newly added test on 32bit platforms
2022-12-19 16:08:57 +01:00
Christoph M. Becker
6bd65cd8d2
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Skip newly added test on 32bit platforms
2022-12-19 16:07:08 +01:00
Christoph M. Becker
c702c9f0a3
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Skip newly added test on 32bit platforms
2022-12-19 16:06:18 +01:00
Christoph M. Becker
cf5dac07d2
Skip newly added test on 32bit platforms
That bug didn't affect 32bit platforms, and besides, it is rather
unlikely that allocating a 2GB string works on such platforms.
2022-12-19 16:04:29 +01:00
Stanislav Malyshev
ec5b872dcd Merge branch 'PHP-8.2' 2022-12-18 23:21:30 -07:00
Stanislav Malyshev
32b6eacbc6 Merge branch 'PHP-8.1' into PHP-8.2 2022-12-18 23:21:25 -07:00
Stanislav Malyshev
a6a80eefe0 Improve fix for bug #81740 2022-12-18 23:20:29 -07:00
Stanislav Malyshev
5975f33c37 Merge branch 'PHP-8.0' into PHP-8.1 2022-12-18 23:02:09 -07:00
Christoph M. Becker
921b6813da Fix #81740: PDO::quote() may return unquoted string
`sqlite3_snprintf()` expects its first parameter to be `int`; we need
to avoid overflow.
2022-12-18 22:41:43 -07:00
Tim Düsterhus
03fd405423
Use php_info_print_table_header for actual column headers only (#9485)
Using php_info_print_table_header() for "Foo: bar" looks odd and out of place,
because the whole line is colored. It is also questionable from a HTML
semantics point of view, because it does not described the columns that follow.

The use of this across extensions is inconsistent. It was part of the skeleton,
but ext/date or ext/json already use a regular row.
2022-09-06 08:48:22 +02:00
Máté Kocsis
c547fc183c
Add support for validation of missing class synopses (#9472) 2022-09-05 14:21:15 +02:00
Christoph M. Becker
a398a2fd3d
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-9032: SQLite3 authorizer crashes on NULL values
2022-07-27 13:11:58 +02:00
Christoph M. Becker
ca84d06bbc
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-9032: SQLite3 authorizer crashes on NULL values
2022-07-27 13:06:15 +02:00
Christoph M. Becker
8ed21a89f3
Fix GH-9032: SQLite3 authorizer crashes on NULL values
The arguments 3 to 6 of the authorizer callback may be `NULL`[1], and
we have to properly deal with that.  Instead of causing a segfault, we
deny authorization, which is still better than a crash, and apparently,
we cannot do better anyway.

[1] <https://www.sqlite.org/c3ref/set_authorizer.html>

Closes GH-9040.
2022-07-27 12:49:16 +02:00
Christoph M. Becker
8fec415557
Drop support for SQLITE_COPY in authorizer callback
According to the sources, `SQLITE_COPY` is unused as of SQLite
3.6.10[1] (at least), so there is no need to support it any longer; we
require at least SQLite 3.7.7 at minimum.

[1] <https://github.com/sqlite/sqlite/blob/version-3.6.10/src/sqlite.h.in#L2411>

Closes GH-9041.
2022-07-19 10:55:50 +02:00
Nikita Popov
902d64390e Deprecate implicit dynamic properties
Writing to a proprety that hasn't been declared is deprecated,
unless the class uses the #[AllowDynamicProperties] attribute or
defines __get()/__set().

RFC: https://wiki.php.net/rfc/deprecate_dynamic_properties
2021-11-26 14:10:11 +01:00
othercorey
108bd4417a
Add pdo_sqlite tests for empty filename and in-memory uri (#7662)
pdo_sqlite already supports empty filenames and shared in-memory DBs. Add tests for them.
2021-11-24 14:49:10 +01:00
Nikita Popov
ee510eed68 Deprecate partially supported callables
This deprecates all callables that are accepted by
call_user_func($callable) but not by $callable(). In particular:

    "self::method"
    "parent::method"
    "static::method"
    ["self", "method"]
    ["parent", "method"]
    ["static", "method"]
    ["Foo", "Bar::method"]
    [new Foo, "Bar::method"]

RFC: https://wiki.php.net/rfc/deprecate_partially_supported_callables

Closes GH-7446.
2021-10-22 10:15:24 +02:00
Nikita Popov
1e012ecb3f Fix bug #81405: Restore old PDO::PARAM_* values
Doctrine hardcodes the values of these constants, avoid changing
them.

Closes GH-7445.
2021-09-01 13:54:41 +02:00
Radosław Kowalewski
3a4d0d360d
Require sqlite >= 3.7.7 for URI in DSN (#7347)
SQLITE_OPEN_URI introduced in #6610 is available from sqlite version 3.7.7.
2021-08-11 10:31:28 +02:00
Patrick Allaert
ac18dd0dc7 Prefer EXPECT over EXPECTF 2021-06-29 17:13:02 +02:00
Nikita Popov
584dc19df1 Move tests requiring pdo_sqlite into ext directory
If the test is written against a specific PDO driver, it should
not be part of the generic ext/pdo tests.
2021-06-14 15:01:16 +02:00
Nikita Popov
39131219e8
Migrate more SKIPIF -> EXTENSIONS (#7139)
This is a mix of more automated and manual migration. It should remove all applicable extension_loaded() checks outside of skipif.inc files.
2021-06-11 12:58:44 +02:00