Commit Graph

433 Commits

Author SHA1 Message Date
Nikita Popov
bfa69d27bc Handle column count change in PDO MySQL
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.
2020-12-08 16:41:35 +01:00
Máté Kocsis
eef994d621
Improve parameter names in ext/pdo_sqlite
Closes GH-6310
2020-10-12 18:05:35 +02:00
George Peter Banyard
a5cf82802d Make various failure conditions in PDO unconditional errors
This includes TypeErrors, ValueErrors, Error for uninitialized objects
and invalid user classes/callable instanciation

Closes GH-6212
2020-09-28 18:51:36 +01:00
Nikita Popov
c5401854fc Run tidy
This should fix most of the remaining issues with tabs and spaces
being mixed in tests.
2020-09-18 14:28:32 +02:00
Matteo Beccati
ee2506cc02 Fix #80027 Terrible performance using $query->fetch on queries with many 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).
2020-08-31 11:02:34 +02:00
Nikita Popov
964f66942c Fix test after is_callable change 2020-08-14 10:40:20 +02:00
Nikita Popov
33028bf014 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #64705 errorInfo property of PDOException is null when PDO::__construct() fails
2020-08-11 17:16:38 +02:00
Nikita Popov
981af26d7b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #64705 errorInfo property of PDOException is null when PDO::__construct() fails
2020-08-11 17:13:28 +02:00
Ahmed Abdou
2fe2e5b48f Fix #64705 errorInfo property of PDOException is null when 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.
2020-08-11 17:12:48 +02:00
Máté Kocsis
7aacc705d0
Add many missing closing PHP tags to tests
Closes GH-5958
2020-08-09 22:03:36 +02:00
Máté Kocsis
ec22e5aa38
Get rid of empty function entries
Closes GH-5917
2020-08-01 10:07:05 +02:00
Nikita Popov
4dd8fec073 Add stubs for PDO PGSql extension methods 2020-07-21 12:49:37 +02:00
Nikita Popov
1afcced1f0 Add stubs for PDO SQLite extension methods
Putting these under a dummy PDO_SQLite_Ext class.
2020-07-21 12:49:36 +02:00
George Peter Banyard
a1097677a5 Use ZPP callable for PDO Sqlite 2020-07-21 00:20:02 +01:00
Máté Kocsis
d30cd7d7e7
Review the usage of apostrophes in error messages
Closes GH-5590
2020-07-10 21:05:28 +02:00
Nikita Popov
e6160e99d8 Report len as -1 instead of INT_MAX
Per docs it should be -1. And would be on 32-bit systems, but
not on 64-bit systems.

(cherry picked from commit 39111585a2)
2020-07-08 10:38:11 +02:00
Max Semenik
2b5de6f839
Remove proto comments from C files
Closes GH-5758
2020-07-06 21:13:34 +02:00
Nikita Popov
3f6a212be7 Merge branch 'PHP-7.4'
* PHP-7.4:
  Report len as -1 instead of INT_MAX
2020-06-03 10:17:27 +02:00
Nikita Popov
39111585a2 Report len as -1 instead of INT_MAX
Per docs it should be -1. And would be on 32-bit systems, but
not on 64-bit systems.
2020-06-03 10:15:54 +02:00
Christoph M. Becker
97b7dbb8f4 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79664: PDOStatement::getColumnMeta fails on empty result set
2020-06-02 10:48:15 +02:00
Christoph M. Becker
461135009c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79664: PDOStatement::getColumnMeta fails on empty result set
2020-06-02 10:47:10 +02:00
Christoph M. Becker
63bd8f38f4 Fix #79664: PDOStatement::getColumnMeta fails on empty result set
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.
2020-06-02 10:45:47 +02:00
AllenJB
50752401a7 Change the default PDO error mode to exceptions
According to <https://www.php.net/manual/en/pdo.error-handling.php>.
2020-05-04 22:51:47 +02:00
Máté Kocsis
36935e42ea
Improve undefined variable error messages
Closes GH-5312
2020-03-31 13:02:32 +02:00
Nikita Popov
f8d795820e Reindent phpt files 2020-02-03 22:52:20 +01:00
Nikita Popov
169805777c Merge branch 'PHP-7.4'
* PHP-7.4:
  Apply tidy formatting
2020-02-03 13:42:08 +01:00
Nikita Popov
58b17906f5 Apply tidy formatting
Mostly reindent PHP scripts to spaces.
2020-02-03 13:41:31 +01:00
Máté Kocsis
d1764ca330
Make error messages more consistent by fixing capitalization
Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
2020-01-17 14:52:46 +01:00
Nikita Popov
36c8e57495 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79056
2020-01-03 11:09:06 +01:00
Nikita Popov
1dcdcd79ba Fixed bug #79056 2020-01-03 11:08:48 +01:00
Nikita Popov
647b1c7fcf Remove most uses of ZEND_PARSE_PARAMETERS_END_EX()
As ZPP now throws, it makes no sense to specify an explicit return
value.
2019-10-07 10:02:18 +02:00
Nikita Popov
2f92957fd3 Convert some notices to warnings
Part of https://wiki.php.net/rfc/engine_warnings.
2019-10-02 10:34:08 +02:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Peter Kokot
3e124fc1c7 Merge branch 'PHP-7.4'
* PHP-7.4:
  Update NEWS
  Fix #78348: Remove -lrt from pdo_sqlite.so
2019-07-30 22:09:18 +02:00
Peter Kokot
09b108246a Fix #78348: Remove -lrt from pdo_sqlite.so
The fdatasync check has been removed since PHP 5.3.

The Solaris fix was introduced via
8d63360fc4
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
2019-07-30 22:06:23 +02:00
Peter Kokot
b2bd9aeb41 Merge branch 'PHP-7.4'
* PHP-7.4:
  Move HAVE_SQLITE3_CLOSE_V2 to pdo_sqlite
2019-07-21 00:41:20 +02:00
Peter Kokot
f5227c5863 Move HAVE_SQLITE3_CLOSE_V2 to pdo_sqlite
Closes GH-4444
2019-07-21 00:40:59 +02:00
Peter Kokot
ba2864d4d8 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove unused sqlite symbols
2019-07-20 00:27:39 +02:00
Peter Kokot
6de97402b5 Remove unused sqlite symbols
- HAVE_SQLITE3_KEY is no longer used in php-src
- SQLITE_ENABLE_COLUMN_METADATA is no longer used in php-src

Closes GH-4443
2019-07-20 00:27:10 +02:00
Peter Kokot
f91ffe5915 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove conditional calls of always available macros
2019-07-14 22:24:59 +02:00
Peter Kokot
94421e5724 Remove conditional calls of always available macros
These checks were once relevant for these extensions in PECL and PHP
versions without availability of the checked macros.

Closes GH-4405
2019-07-14 22:24:21 +02:00
Peter Kokot
4f5c6bc15e Merge branch 'PHP-7.4'
* PHP-7.4:
  Simplify PHP_CHECK_PDO_INCLUDES calls
2019-07-08 10:26:08 +02:00
Peter Kokot
a39ea91753 Simplify PHP_CHECK_PDO_INCLUDES calls
Conditional checks were once used for backwards compatibility with
phpize from PHP versions that didn't have this macro call yet.

Closes GH-4376
2019-07-08 10:24:41 +02:00
Nikita Popov
80fc31c887 Merge branch 'PHP-7.4' 2019-07-02 13:03:45 +02:00
Robert Kopack
b546ae986a Implement SQLite extended result code functionality 2019-07-02 13:03:35 +02:00
Christoph M. Becker
44b97fd1ee Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix bug #78192 PDO SQLite SegFault when reuse statement after schema has changed
2019-06-28 12:38:17 +02:00
Christoph M. Becker
645ca710d7 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #78192 PDO SQLite SegFault when reuse statement after schema has changed
2019-06-28 12:37:49 +02:00
Christoph M. Becker
646debaf38 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #78192 PDO SQLite SegFault when reuse statement after schema has changed
2019-06-28 12:36:55 +02:00
Vincent
05c00a832c Fix bug #78192 PDO SQLite SegFault when reuse statement after schema has changed
Reset stmt->columns when column count changed on new execution of prepared statement
2019-06-28 12:36:02 +02:00
Nikita Popov
477d1e02ae Merge branch 'PHP-7.4' 2019-06-12 11:54:21 +02:00