com php-src: Slightly edited tests and fix for bug #62024: ext/pdo_firebird/firebird_statement.c ext/pdo_firebir d/tests/bug_62024.phpt
| From: | Matteo Beccati | Date: | Fri, 31 May 2013 14:19:58 +0000 |
| Subject: | com php-src: Slightly edited tests and fix for bug #62024: ext/pdo_firebird/firebird_statement.c ext/pdo_firebir d/tests/bug_62024.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-72265@lists.php.net to get a copy of this message | ||
Commit: 510498947ee350a7c60c576bb17911fd2d2880c8
Author: Matteo Beccati <mbeccati@php.net> Fri, 31 May 2013 16:19:58 +0200
Parents: df6ca450ce1bebb7a36c0d2eecb51a28ac2f5118
Branches: PHP-5.3 PHP-5.4 PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=510498947ee350a7c60c576bb17911fd2d2880c8
Log:
Slightly edited tests and fix for bug #62024
Bugs:
https://bugs.php.net/62024
Changed paths:
M ext/pdo_firebird/firebird_statement.c
M ext/pdo_firebird/tests/bug_62024.phpt
Diff:
diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c
index e172133..2b57cd8 100644
--- a/ext/pdo_firebird/firebird_statement.c
+++ b/ext/pdo_firebird/firebird_statement.c
@@ -535,12 +535,14 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct
pdo_bound_param_dat
int force_null;
case IS_LONG:
- var->sqltype = (sizeof(long) == 8 ? SQL_INT64 : SQL_LONG) + (var->sqltype & 1);
+ /* keep the allow-NULL flag */
+ var->sqltype = (sizeof(long) == 8 ? SQL_INT64 : SQL_LONG) | (var->sqltype & 1);
var->sqldata = (void*)&Z_LVAL_P(param->parameter);
var->sqllen = sizeof(long);
break;
case IS_DOUBLE:
- var->sqltype = SQL_DOUBLE + (var->sqltype & 1);
+ /* keep the allow-NULL flag */
+ var->sqltype = SQL_DOUBLE | (var->sqltype & 1);
var->sqldata = (void*)&Z_DVAL_P(param->parameter);
var->sqllen = sizeof(double);
break;
@@ -560,7 +562,8 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
force_null = (Z_STRLEN_P(param->parameter) == 0);
}
if (!force_null) {
- var->sqltype = SQL_TEXT + (var->sqltype & 1);
+ /* keep the allow-NULL flag */
+ var->sqltype = SQL_TEXT | (var->sqltype & 1);
var->sqldata = Z_STRVAL_P(param->parameter);
var->sqllen = Z_STRLEN_P(param->parameter);
break;
diff --git a/ext/pdo_firebird/tests/bug_62024.phpt b/ext/pdo_firebird/tests/bug_62024.phpt
index 3daef68..e046879 100644
--- a/ext/pdo_firebird/tests/bug_62024.phpt
+++ b/ext/pdo_firebird/tests/bug_62024.phpt
@@ -21,8 +21,8 @@ $dbh->commit();
$sql = "insert into test_insert (id, text) values (?, ?)";
$sttmt = $dbh->prepare($sql);
-$args_ok = [1, "test1"];
-$args_err = [2, null];
+$args_ok = array(1, "test1");
+$args_err = array(2, null);
$res = $sttmt->execute($args_ok);
var_dump($res);