Skip to content

Commit 6dc897a

Browse files
authored
Fix error check for AE functions (#1489)
* Fix error throw for multiple result sets * Update bvt tests * Fix error code checks for AE
1 parent ef84c4d commit 6dc897a

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

test/functional/pdo_sqlsrv/pdo_AE_functions.inc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,12 @@ function checkErrors($errors, ...$codes)
403403
{
404404
$codeFound = false;
405405

406+
if (is_array($errors[0])) {
407+
$errors = array_merge($errors[0], $errors[1]);
408+
}
409+
406410
foreach ($codes as $code) {
407-
if ($code[0]==$errors[0] and $code[1]==$errors[1]) {
411+
if (in_array($code[0], $errors) && in_array($code[1], $errors)) {
408412
$codeFound = true;
409413
break;
410414
}

test/functional/sqlsrv/sqlsrv_AE_functions.inc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,13 @@ function checkErrors($errors, ...$codes)
410410
{
411411
$codeFound = false;
412412

413+
$e = array();
414+
foreach($errors as $error) {
415+
array_push($e, $error['SQLSTATE'], $error['code']);
416+
}
417+
413418
foreach ($codes as $code) {
414-
if ($code[0]==$errors[0][0] and $code[1]==$errors[0][1]) {
419+
if (in_array($code[0], $e) && in_array($code[1], $e)) {
415420
$codeFound = true;
416421
break;
417422
}

0 commit comments

Comments
 (0)