From ac5021245d83bfd6621570d30f04db4d1acce0a2 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Mon, 19 Aug 2019 16:56:35 -0700 Subject: [PATCH] Used while loop for fetchColumn --- test/functional/pdo_sqlsrv/PDO81_MemoryCheck.phpt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/functional/pdo_sqlsrv/PDO81_MemoryCheck.phpt b/test/functional/pdo_sqlsrv/PDO81_MemoryCheck.phpt index 42919b193..1153d6ac4 100644 --- a/test/functional/pdo_sqlsrv/PDO81_MemoryCheck.phpt +++ b/test/functional/pdo_sqlsrv/PDO81_MemoryCheck.phpt @@ -244,9 +244,11 @@ function RunTest($noPasses, $noRows, $tableName, $conn, $prepared, $mode) case 6: // fetchColumn $stmt = ExecuteQueryEx($conn, $tsql, ($prepared ? false : true)); $fldCount = $stmt->columnCount(); - $result = $stmt->fetchColumn(); - $rowCount = count($result); - unset($result); + // Check for "false" to terminate because fetchColumn may return NULL + while (($result = $stmt->fetchColumn()) !== false) { + unset($result); + $rowCount++; + } $stmt->closeCursor(); unset($stmt); if ($rowCount != $noRows) {