Skip to content

Commit 19061e3

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Fix #81252: PDO_ODBC doesn't account for SQL_NO_TOTAL
2 parents a1c1ee6 + 3244e07 commit 19061e3

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

ext/pdo_odbc/odbc_stmt.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -491,11 +491,7 @@ static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *p
491491
}
492492
zval_ptr_dtor(parameter);
493493

494-
switch (P->len) {
495-
case SQL_NULL_DATA:
496-
ZVAL_NULL(parameter);
497-
break;
498-
default:
494+
if (P->len >= 0) {
499495
ZVAL_STRINGL(parameter, P->outbuf, P->len);
500496
switch (pdo_odbc_ucs22utf8(stmt, P->is_unicode, parameter)) {
501497
case PDO_ODBC_CONV_FAIL:
@@ -505,6 +501,8 @@ static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *p
505501
case PDO_ODBC_CONV_OK:
506502
break;
507503
}
504+
} else {
505+
ZVAL_NULL(parameter);
508506
}
509507
}
510508
return 1;

0 commit comments

Comments
 (0)