Commit graph

1016 commits

Author SHA1 Message Date
Amo Chohan
61e15a37a1 Add tests for PDO::getAvailableDrivers 2016-10-20 20:53:53 -07:00
Adam Baratz
6c867cb8e5 Remove DBDO-specific field
DBDO is a PECL package which hasn't been updated since 2010 and has been marked
as unmaintained. Additionally, I can't find a reference to this field in the
latest source.
2016-10-20 17:39:00 -04:00
Adam Baratz
82fe200a3f Remove dead code 2016-10-17 17:07:10 -04:00
Adam Baratz
0eeb06bf17 Addendum to #73234: Assume param types are nullable 2016-10-12 11:59:01 -04:00
Adam Baratz
32b6154a61 Fix #73234: Emulated statements let value dictate parameter type
The prepared statement emulator (pdo_sql_parser.*) figures out how to quote
each query parameter. The intended type is specified by the PDO::PARAM_*
consts, but this direction wasn't always followed. In practice, queries could
work as expected, but subtle errors could result. For example, a numeric string
bound as PDO::PARAM_INT would be sent to a driver's quote function. While these
functions are told which type is expected, they generally assume values are
being quoted as strings. This can result in implicit casts, which are bad for
performance.

This commit includes the following changes:
 - Cast values marked as bool/int/null to the appropriate type and bypass the
   driver's quote function.
 - Save some memory by dropping the temporary zval used for casting.
 - Avoid a memory leak if the driver's quote function produces an error.
 - Appropriate test suite updates.
2016-10-10 18:16:17 -04:00
Adam Baratz
6dd4efb70a Merge branch 'PHP-7.1'
* PHP-7.1:
  Add special case for earlier versions of TDS
  Adjust error formatting so ext/pdo/tests/bug_43130.phpt passes with pdo_dblib
  Free error and message strings when cleaning up PDO instances that use pdo_dblib
  Add common suite
2016-09-13 17:16:46 -04:00
Adam Baratz
f6b6e97b29 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Add special case for earlier versions of TDS
  Adjust error formatting so ext/pdo/tests/bug_43130.phpt passes with pdo_dblib
  Free error and message strings when cleaning up PDO instances that use pdo_dblib
  Add common suite
2016-09-13 17:02:53 -04:00
Adam Baratz
bcee34c649 Add special case for earlier versions of TDS 2016-09-13 17:01:51 -04:00
Adam Baratz
5f534e09c3 Merge branch 'PHP-7.1'
* PHP-7.1:
  Explicitly allow NULL values for dblib compatibility
  Add dblib-specific query
  Remove test cases don't test distinct behavior
2016-09-13 16:39:29 -04:00
Adam Baratz
45850213bd Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Explicitly allow NULL values for dblib compatibility
  Add dblib-specific query
  Remove test cases don't test distinct behavior
2016-09-13 16:38:56 -04:00
Adam Baratz
9fb94f03e7 Explicitly allow NULL values for dblib compatibility
MSSQL won't necessarily default columns to NULL, see:
https://msdn.microsoft.com/en-us/library/ms174979.aspx
2016-09-13 16:36:23 -04:00
Adam Baratz
69013f6b26 Add dblib-specific query 2016-09-13 16:36:23 -04:00
Adam Baratz
f0a12af65b Remove test cases don't test distinct behavior
These cases are also incompatible with pdo_dblib. Removing is easier.
2016-09-13 16:36:23 -04:00
Julien Pauli
94ed034827 Revert "Fixes #52384: Adds parameter value to dumped output. Also adds output flag indicating presence of PDO::PARAM_INPUT_OUTPUT."
This reverts commit 04115b4e3f.
2016-09-02 17:57:17 +02:00
Julien Pauli
0dbcdceb28 Revert "PHP 7 compat"
This reverts commit 24a57ee03b.
2016-09-02 17:57:09 +02:00
Julien Pauli
24a57ee03b PHP 7 compat 2016-09-02 17:02:39 +02:00
Bishop Bettini
04115b4e3f Fixes #52384: Adds parameter value to dumped output. Also adds output flag indicating presence of PDO::PARAM_INPUT_OUTPUT.
Conflicts:
	ext/pdo/pdo_stmt.c
2016-09-02 17:02:39 +02:00
Adam Baratz
0785a5e6dc Fix message typos in PDO tests 2016-08-24 18:39:37 -04:00
Christoph M. Becker
02d6e4e517 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-13 01:29:49 +02:00
Christoph M. Becker
175d94b6e5 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-13 01:21:57 +02:00
Christoph M. Becker
7938ebf6c1 Fix #60665: call to empty() on NULL result using PDO::FETCH_LAZY returns false
The has_property handler only checked whether a respective column name
exists, but neither whether the column value is set, nor whether it is
empty, respectively. We fix that to match the behavior of POD:FETCH_OBJ in
particular and PHP in general.
2016-08-13 01:11:13 +02:00
Keyur
40059beed8 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Add NEWS
  Fix ASSERT logic
  Bugfix 72791: fix memory leak in PDO persistent connections
2016-08-09 17:30:26 +00:00
Keyur
2ab9a2d4be Fix ASSERT logic 2016-08-09 14:41:20 +00:00
Keyur
98e4d509f6 Bugfix 72791: fix memory leak in PDO persistent connections 2016-08-09 14:01:25 +00:00
Xinchen Hui
3f1e9ed8f8 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72788 (Invalid memory access when using persistent PDO connection)
  Remove typo'd commit
  Fix bug 72788: Invalid memory access when database_object_handle is undefined. Also fix memory leak in dbh_free when using persistent PDO connections.
2016-08-09 11:32:34 +08:00
Keyur
3f25c4228a Fix bug 72788: Invalid memory access when database_object_handle
is undefined. Also fix memory leak in dbh_free when using persistent
PDO connections.
2016-08-09 00:16:46 +00:00
Nikita Popov
9452257b04 Fix leak in PDO row_get_ctor
The __construct function name was leaked. Avoid this by simply
throwing directly from row_get_ctor instead of indirecting through
an actual __construct function.
2016-07-16 23:16:26 +02:00
Julien Pauli
661b560c5f Merge branch 'PHP-7.0'
* PHP-7.0:
  Updated NEWS
  Updated NEWS
  Revert "Fixes #52384: Adds parameter value to dumped output. Also adds output flag indicating presence of PDO::PARAM_INPUT_OUTPUT."
  Revert "Fix test for #52384"

Conflicts:
	ext/pdo/pdo_stmt.c
2016-07-12 15:54:39 +02:00
Julien Pauli
152d53c844 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Updated NEWS
  Revert "Fixes #52384: Adds parameter value to dumped output. Also adds output flag indicating presence of PDO::PARAM_INPUT_OUTPUT."
  Revert "Fix test for #52384"

Conflicts:
	ext/pdo/pdo_stmt.c
2016-07-12 15:50:58 +02:00
Julien Pauli
822498128b Revert "Fixes #52384: Adds parameter value to dumped output. Also adds output flag indicating presence of PDO::PARAM_INPUT_OUTPUT."
This reverts commit 15336b44d9.
2016-07-12 15:46:07 +02:00
Julien Pauli
5cce0d7c7c Revert "Fix test for #52384"
This reverts commit 642e44b98f.
2016-07-12 15:45:49 +02:00
Julien Pauli
8ca401f1b2 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fix test for #52384
2016-07-12 15:28:13 +02:00
Julien Pauli
c96a9ca6f5 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix test for #52384
2016-07-12 15:27:57 +02:00
Julien Pauli
642e44b98f Fix test for #52384 2016-07-12 15:27:37 +02:00
Julien Pauli
1a7e39a469 Merge branch 'PHP-7.0'
* PHP-7.0:
  Updated NEWS
  Updated NEWS
  Fixes #52384: Adds parameter value to dumped output. Also adds output flag indicating presence of PDO::PARAM_INPUT_OUTPUT.

Conflicts:
	ext/pdo/pdo_stmt.c
2016-07-12 11:25:20 +02:00
Julien Pauli
ec28576260 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Updated NEWS
  Fixes #52384: Adds parameter value to dumped output. Also adds output flag indicating presence of PDO::PARAM_INPUT_OUTPUT.

Conflicts:
	ext/pdo/pdo_stmt.c
2016-07-12 11:17:36 +02:00
Bishop Bettini
15336b44d9 Fixes #52384: Adds parameter value to dumped output. Also adds output flag indicating presence of PDO::PARAM_INPUT_OUTPUT. 2016-07-12 10:47:07 +02:00
Dmitry Stogov
323b2733f6 Fixed compilation warnings 2016-06-22 00:40:50 +03:00
Dmitry Stogov
1616038698 Added ZEND_ATTRIBUTE_FORMAT to some middind functions.
"%p" replaced by ZEND_LONG_FMT to avoid compilation warnings.
Fixed most incorrect use cases of format specifiers.
2016-06-21 16:00:37 +03:00
Dmitry Stogov
6499162ff0 - get rid of EG(scope). zend_get_executed_scope() should be used instead.
- ichanged zval_update_constant_ex(). Use IS_TYPE_IMMUTABLE flag on shared constants and AST, instead of "inline_change" parameter.
2016-04-28 04:13:34 +03:00
Dmitry Stogov
f0a2e8eb13 Removed "zend_fcall_info.function_table". It was assigned in many places, but is never used. 2016-04-27 13:46:38 +03:00
Matteo Beccati
b68e89ee7e Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #71447 (Quotes inside comments not properly handled)
  Fixed a few PDO tests to conform to PDO Common standards
  news entry #69537
  Fix #69537: __debugInfo with empty string for key gives error
2016-04-05 00:07:28 +02:00
Matteo Beccati
4090e709aa Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #71447 (Quotes inside comments not properly handled)
  Fixed a few PDO tests to conform to PDO Common standards
  news entry #69537
  Fix #69537: __debugInfo with empty string for key gives error

Conflicts:
	Zend/zend_compile.c
2016-04-05 00:07:02 +02:00
Matteo Beccati
30925cd498 Fixed bug #71447 (Quotes inside comments not properly handled) 2016-04-04 23:50:28 +02:00
Matteo Beccati
9a87108eca Fixed a few PDO tests to conform to PDO Common standards 2016-04-04 23:43:17 +02:00
Julien Pauli
8bf5a60fdd Merge branch 'PHP-7.0'
* PHP-7.0:
  Updated NEWS
  Updated NEWS
  Reworked Fix bug #52098
  Fix bug #52098
2016-03-21 15:40:50 +01:00
Julien Pauli
5ba7b9af1b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Updated NEWS
  Reworked Fix bug #52098
  Fix bug #52098

Conflicts:
	ext/pdo/pdo_dbh.c
	ext/pdo/pdo_stmt.c
2016-03-21 15:39:48 +01:00
Julien Pauli
d3d64b7c62 Reworked Fix bug #52098 2016-03-21 15:23:18 +01:00
Daniel Persson
e541cd8e6b Fix bug #52098 2016-03-21 15:04:11 +01:00
Xinchen Hui
5e2186e5a7 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed pdo_stmt.c: zval* being passed into zend_parse_parameters_ex
2016-03-18 11:50:38 +08:00