Commit graph

236 commits

Author SHA1 Message Date
Adam Baratz
f2f70cfc4b Remove trailing whitespace 2017-01-09 11:41:54 -05:00
Adam Baratz
012cee3fba 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#Nullability Rules Within a Table Definition
2017-01-09 11:40:25 -05:00
Anatol Belski
595453ac91 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fix PDO tests to match SQL standard syntax and pass Firebird tests.
2017-01-03 17:56:22 +01:00
Anatol Belski
b15cc7913a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix PDO tests to match SQL standard syntax and pass Firebird tests.
2017-01-03 17:54:46 +01:00
Dorin Marcoci
e914abff1e Fix PDO tests to match SQL standard syntax and pass Firebird tests. 2017-01-03 17:48:52 +01:00
Adam Baratz
d58231dda3 Add "Sent SQL" to debug dump for emulated prepares 2016-12-20 11:07:04 -05:00
Adam Baratz
6c692313af Remove PDOStatement::activeQueryString() 2016-12-20 11:06:38 -05:00
Anatol Belski
057ab8da76 Merge branch 'PHP-7.1'
* PHP-7.1:
  update NEWS
  update NEWS
  Compatibility with Firebird & Oracle select syntax.
2016-12-19 01:10:58 +01:00
Anatol Belski
8adc86a698 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
  Compatibility with Firebird & Oracle select syntax.
2016-12-19 01:08:44 +01:00
Dorin Marcoci
eb33d08f1e Compatibility with Firebird & Oracle select syntax. 2016-12-19 01:06:24 +01:00
Nikita Popov
5af586bec5 Remove more PHP 6 leftovers from tests 2016-11-24 22:39:39 +01:00
Adam Baratz
07e395a00d Revert "Remove PDOStatement::activeQueryString()"
This reverts commit 552c957500.
2016-11-17 11:25:31 -05:00
Adam Baratz
552c957500 Remove PDOStatement::activeQueryString() 2016-11-16 18:06:14 -05:00
Adam Baratz
5719553ed2 Fix test for pdo_pgsql 2016-11-16 10:50:14 -05:00
Adam Baratz
83086d9a72 Add PDOStatement::activeQueryString() 2016-11-15 17:33:38 -05:00
Amo Chohan
61e15a37a1 Add tests for PDO::getAvailableDrivers 2016-10-20 20:53:53 -07: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
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
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
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
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
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
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
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
Daniel Persson
e541cd8e6b Fix bug #52098 2016-03-21 15:04:11 +01:00
Daniel Persson
73384728ca Fix bug #64172
Check if the SQLSTATE error code is equal to PDO_ERR_NONE before we ask the driver.
And if no error is reported skip the extra call to the driver.
2015-10-18 17:06:54 -07:00
Daniel Persson
307c1f6bf0 Fix bug #64172
Check if the SQLSTATE error code is equal to PDO_ERR_NONE before we ask the driver.
And if no error is reported skip the extra call to the driver.
2015-10-18 17:03:39 -07:00
Christopher Jones
a3c54dd1b7 Add Oracle syntax (Senthil) 2015-07-10 09:47:45 +10:00