1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 19:23:22 +02:00

Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5

* 'PHP-5.5' of git.php.net:php-src:
  Fixed bug #68351 (PDO::PARAM_BOOL and ATTR_EMULATE_PREPARES misbehaving)
This commit is contained in:
Rasmus Lerdorf
2014-11-06 09:49:11 -08:00
3 changed files with 18 additions and 0 deletions
+2
View File
@@ -36,6 +36,8 @@ PHP NEWS
. Fixed bug #66584 (Segmentation fault on statement deallocation) (Matteo)
. Fixed bug #67462 (PDO_PGSQL::beginTransaction() wrongly throws exception
when not in transaction) (Matteo)
. Fixed bug #68351 (PDO::PARAM_BOOL and ATTR_EMULATE_PREPARES misbehaving)
(Matteo)
- SPL:
. Fixed bug #68128 (Regression in RecursiveRegexIterator) (Tjerk)
+1
View File
@@ -370,6 +370,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *
((param->param_type & PDO_PARAM_INPUT_OUTPUT) != PDO_PARAM_INPUT_OUTPUT)) {
SEPARATE_ZVAL(&param->parameter);
param->param_type = PDO_PARAM_STR;
convert_to_boolean(param->parameter);
ZVAL_STRINGL(param->parameter, Z_BVAL_P(param->parameter) ? "t" : "f", 1, 1);
}
}
+15
View File
@@ -34,6 +34,19 @@ $query->execute();
$errors[] = $query->errorInfo();
var_dump($value);
// Try with strings - Bug #68351
$value = '0';
$query->bindParam(':foo', $value, PDO::PARAM_BOOL);
$query->execute();
$errors[] = $query->errorInfo();
var_dump($query->fetchColumn());
$value = "abc";
$query->bindParam(':foo', $value, PDO::PARAM_BOOL);
$query->execute();
$errors[] = $query->errorInfo();
var_dump($query->fetchColumn());
$expect = 'No errors found';
foreach ($errors as $error)
@@ -48,4 +61,6 @@ echo $expect;
--EXPECTF--
bool(true)
bool(false)
bool(true)
bool(false)
No errors found