Commit graph

1403 commits

Author SHA1 Message Date
Stanislav Malyshev
a6a80eefe0 Improve fix for bug #81740 2022-12-18 23:20:29 -07:00
Michael Voříšek
2db2cab6ad
Fix pdo_oci tests for PHP 8.1
Closes GH-9051
2022-08-24 14:39:45 +02:00
Máté Kocsis
3e0f144b2c
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix pdo_oci tests for PHP 8.0
2022-08-22 09:28:29 +02:00
Michael Voříšek
305892580e
Fix pdo_oci tests for PHP 8.0 2022-08-22 09:25:43 +02:00
Christoph M. Becker
f768f3d60b
Fix recently broken test case
This test was written to always use the sqlite PDO driver; however,
that driver may no longer be available[1], and actually the test is
supposed to work for all drivers – otherwise it should be placed in
ext/pdo_sqlite/tests.

[1] <938049b927>

Closes GH-8732.
2022-06-08 18:33:55 +02:00
George Peter Banyard
938049b927 PDO Common tests should not require a driver 2022-06-08 11:37:07 +01:00
David Carlier
4a1c50b9be Merge branch 'PHP-8.0' into PHP-8.1 2022-06-03 15:15:30 +01:00
Yurun
bfe63f565f Fix dblib ghtest8626 test.
Follow-up of GH-8628.
Closes GH-9694.
2022-06-03 15:12:09 +01:00
David Carlier
0f428ae240 Merge branch 'PHP-8.0' into PHP-8.1 2022-06-02 17:35:45 +01:00
Yurun
df52903ee0 Closes GH-8626: Fix PDOStatement->execute() failed.
Then execute successfully, errorInfo() information is incorrect
2022-06-02 17:32:43 +01:00
Máté Kocsis
96a5026bfd
Redefine PDOException::$code with correct type
Closes GH-7839
2022-01-01 17:54:59 +01:00
Christoph M. Becker
7d4fdf1510
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Skip bug_36798.phpt for PDO_DBLIB
2021-12-07 20:25:35 +01:00
Christoph M. Becker
efb901ebed
Skip bug_36798.phpt for PDO_DBLIB
For some reason, this test fails now with "Incorrect syntax near ''.
[SELECT '�' as test FROM test WHERE id = '1']", so we skip it.
2021-12-07 20:24:15 +01:00
Nikita Popov
c02aa46126 Fix leak when persistent PDO connection fails
As we don't register the resource, the resource dtor is not called
and will not decrement the refcount.
2021-11-16 16:14:29 +01:00
Máté Kocsis
6a47831e6e
Add more specific array return type hints for various extensions - part 3 (#7467) 2021-09-06 12:27:28 +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
Nikita Popov
6385006102 Merge branch 'PHP-8.0'
* PHP-8.0:
  Mark PDO::setAttribute() $value as mixed
2021-08-20 16:53:25 +02:00
Nikita Popov
2e343fcb42 Mark PDO::setAttribute() $value as mixed
For consistency with PDOStatement::setAttribute(). Attribute values
can for example also be bool.

This is backwards-compatible, as mixed is the same as no type for
parameter variance.
2021-08-20 16:51:52 +02:00
Jeremy Mikola
858d0c0916 Include class name in Serializable deprecation message
The deprecation message was originally introduced in 3e6b447 (#6494).

I first encountered this notice when testing the MongoDB extension
with PHP 8.1, which produced many duplicate messages that provided
no detail about the particular class that needed to be fixed.

Closes GH-7346.
2021-08-11 10:35:47 +02:00
Nikita Popov
8a26cbe0dd Remove unnecessary PDORow get_method / get_class_name handlers
These implement the default behavior, but badly.
2021-07-22 10:40:10 +02:00
Máté Kocsis
2378f35787
Use single line phpdoc in stubs where possible 2021-07-20 13:16:56 +02:00
Joe Watkins
570d9b63e9
Not serializable flag permeation 2021-07-20 12:28:35 +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
7485978339
Migrate SKIPIF -> EXTENSIONS (#7138)
This is an automated migration of most SKIPIF extension_loaded checks.
2021-06-11 11:57:42 +02:00
Nikita Popov
9d2a466c4b Remove explicit assignments of zend_objects_destroy_object
This is the default handler, no need to set it explicitly. This
makes it easier to see which objects really have a custom dtor_obj.
2021-06-09 11:29:50 +02:00
Nikita Popov
91eb201fd8 Allow initializing assignment to PDOStatement::$queryString
If the object is not created through PDO::prepare(), e.g. in a
mock scenario, it should still be possible to initialize the
$queryString property.

See bug #81084.
2021-05-31 14:54:29 +02:00
Máté Kocsis
62f7c0a2d6
Remove unnecessary return doc comment from PDOStatement::errorInfo() 2021-05-26 17:33:14 +02:00
Máté Kocsis
4ed66ff2a9
Declare tentative return types for ext/pdo
Closes GH-6996
2021-05-25 19:17:40 +02:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Máté Kocsis
7df7867624
Merge branch 'PHP-8.0'
* Fix the signature of PDOStatement::fetchObject()
2021-05-05 16:51:23 +02:00
Máté Kocsis
068c8db276
Fix the signature of PDOStatement::fetchObject()
The ?array $ctorArgs = null parameter is changed to array $constructorArgs = [], and an additional memory leak revealed by the new test case is fixed.

Closes GH-6937

Co-Authored-By: Nikita Popov <nikita.ppv@gmail.com>
2021-05-05 16:48:22 +02:00
Máté Kocsis
e2ad44357e
Merge branch 'PHP-8.0'
* Fix the default value of $mode in PDOStatement::fetch*()
2021-05-03 13:08:36 +02:00
Máté Kocsis
30d3062c9b
Fix the default value of $mode in PDOStatement::fetch*()
Closes GH-6933
2021-05-03 13:06:38 +02:00
Nikita Popov
3e6b447979 Partially deprecate Serializable
If Serializable is implemented, require that __serialize() and
__unserialize() are implemented as well, else issue a deprecation
warning.

Also deprecate use of PDO::FETCH_SERIALIZE.

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

Closes GH-6494.
2021-04-28 16:55:14 +02:00
Kamil Tekiela
0a779040a0 Add test case for errorCode() 2021-04-25 15:57:43 +01:00
Kamil Tekiela
3292b9761a Add ZEND_ASSERT to stmt->errorCode 2021-04-25 15:57:43 +01:00
Máté Kocsis
f11411ea0d Use typed property in PDOException 2021-04-20 14:45:42 +02:00
George Peter Banyard
e3403d80af Use ZEND_FALLTHROUGH instead of a comment in PDO 2021-04-19 13:59:18 +01:00
Nikita Popov
65a5c184d7 Add functions to convert i64/u64 to string
PDO implement half of this, but this functionality is generally
useful. Provide these as zend_u64_to_str and zend_i64_to_str to
complement zend_long_to_str.
2021-04-13 15:43:23 +02:00
Nikita Popov
19775afab3 Merge branch 'PHP-8.0'
* PHP-8.0:
  PDO: Respect connection transaction state for dtor rollback
2021-04-12 12:39:50 +02:00
Nikita Popov
8effbd1cb0 PDO: Respect connection transaction state for dtor rollback
As mentioned in bug #80949, if a transaction is implicitly
committed, then PDO may still issue a ROLLBACK when the PDO
object is destroyed, as the transaction is still marked as active
in PDO's (inaccurate) transaction emulation.

Make sure we use the connection transaction state also for that
final ROLLBACK. A caveat here is that the connection might have
been dropped already, which may be the case for some drivers if
construction fails. Make sure we don't crash in that case.
2021-04-12 12:39:44 +02:00
George Peter Banyard
5caaf40b43
Introduce pseudo-keyword ZEND_FALLTHROUGH
And use it instead of comments
2021-04-07 00:46:29 +01:00
Máté Kocsis
aa45eedef0
Merge branch 'PHP-8.0' 2021-03-25 19:32:21 +01:00
Máté Kocsis
d7ae64627f
Fix PDOStatement::bindColumn() parameter default value 2021-03-25 19:31:04 +01:00
Máté Kocsis
f15d52796e
Declare PDORow::queryString property
Relates GH-6742
2021-03-17 09:42:35 +01:00
George Peter Banyard
ebaeb93c3f Add API to fetch bool value for PDO attribute values
Closes GH-6766
2021-03-17 00:58:01 +00:00
George Peter Banyard
32fb9b6fd1 Validate string is numeric for integer PDO attribute value 2021-03-17 00:58:00 +00:00
George Peter Banyard
f89f600d4f Add comment explaining empty default case 2021-03-15 16:39:40 +00:00
George Peter Banyard
6cc0d7c0ec Boolify pdo_dbh_attribute_set() 2021-03-15 14:48:33 +00:00
George Peter Banyard
3e6940fe29 Boolify pdo_hash_methods() 2021-03-15 14:48:33 +00:00