From dece420198f06dc155ae4253164ba68039e62368 Mon Sep 17 00:00:00 2001 From: David Puglielli Date: Thu, 22 Mar 2018 17:17:36 -0700 Subject: [PATCH] removed offending test altogether --- .../sqlsrv_ae_type_conversion_select.phpt | 331 ------------------ 1 file changed, 331 deletions(-) delete mode 100644 test/functional/sqlsrv/sqlsrv_ae_type_conversion_select.phpt diff --git a/test/functional/sqlsrv/sqlsrv_ae_type_conversion_select.phpt b/test/functional/sqlsrv/sqlsrv_ae_type_conversion_select.phpt deleted file mode 100644 index ee4b4e2a..00000000 --- a/test/functional/sqlsrv/sqlsrv_ae_type_conversion_select.phpt +++ /dev/null @@ -1,331 +0,0 @@ ---TEST-- -Test fetching data by conversion with CAST in the SELECT statement ---SKIPIF-- - ---FILE-- -"UTF-8"); -$conn = AE\connect($connectionInfo); -if (!$conn) { - fatalError("Could not connect.\n"); -} - -$tableName = "type_conversion_table"; -$columns = array(); -$insertQuery = ""; - -FormulateSetupQuery($tableName, $dataTypes, $columns, $insertQuery, $strsize, $strsize2); - -$stmt = AE\createTable($conn, $tableName, $columns); -if (!$stmt) { - fatalError("Failed to create table $tableName\n"); -} - -// The data we test against is in values.php -for ($v = 0; $v < sizeof($values); ++$v) -{ - // Each value must be inserted twice because the AE and non-AE column are side by side. - $testValues = array(); - for ($i = 0; $i < sizeof($values[$v]); ++$i) { - $testValues[] = $values[$v][$i]; - $testValues[] = $values[$v][$i]; - } - - // Insert the data using sqlsrv_prepare() - $stmt = sqlsrv_prepare($conn, $insertQuery, $testValues); - if ($stmt == false) { - print_r(sqlsrv_errors()); - fatalError("sqlsrv_prepare failed\n"); - } - - if (!sqlsrv_execute($stmt)) { - print_r(sqlsrv_errors()); - fatalError("sqlsrv_execute failed\n"); - } - - sqlsrv_free_stmt($stmt); - - // Formulate the matrix of SELECT queries and iterate over each index. - $selectQuery = array(); - $selectQueryAE = array(); - FormulateSelectQuery($tableName, $selectQuery, $selectQueryAE, $dataTypes, $strsize, $strsize2); - - for ($i = 8; $i < sizeof($dataTypes); ++$i) { - for ($j = 0; $j < sizeof($dataTypes); ++$j) { - $stmt = sqlsrv_query($conn, $selectQuery[$i][$j]); - - if ($stmt == false) { - $convError = sqlsrv_errors(); - - checkAcceptableErrors($convError); - - if (AE\isDataEncrypted()) { - $stmtAE = sqlsrv_query($conn, $selectQueryAE[$i][$j]); - $convError = sqlsrv_errors(); - - // if the non-AE conversion fails, certainly the AE conversion - // should fail but only with error 22018. - if ($stmtAE != false) fatalError("AE conversion should have failed. i=$i, j=$j, v=$v\n\n"); - if ($convError[0][0] != '22018') { - print_r($convError); - fatalError("AE conversion failed with unexpected error message. i=$i, j=$j, v=$v\n"); - } - } - } else { - if ($conversionMatrix[$i][$j] == 'x') fatalError("Conversion succeeded, should have failed. i=$i, j=$j, v=$v\n"); - if (AE\isDataEncrypted()) { - $stmtAE = sqlsrv_query($conn, $selectQueryAE[$i][$j]); - - // Check every combination of statement value and conversion. - // The last else if block covers the case where the select - // query worked and the retrieved values are compared. - if ($stmtAE == false and $conversionMatrixAE[$i][$j] == 'x') { - $convError = sqlsrv_errors(); - if ($convError[0][0] != '22018') { - print_r($convError); - fatalError("AE conversion failed with unexpected error message. i=$i, j=$j, v=$v\n"); - } - } elseif ($stmtAE == false and $conversionMatrixAE[$i][$j] == 'y') { - print_r(sqlsrv_errors()); - fatalError("AE conversion failed, should have succeeded. i=$i, j=$j, v=$v\n"); - } elseif ($stmtAE != false and $conversionMatrixAE[$i][$j] == 'x') { - fatalError("AE conversion succeeded, should have failed. i=$i, j=$j, v=$v\n"); - } elseif ($stmtAE != false and $conversionMatrixAE[$i][$j] == 'y') { - $row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC); - $rowAE = sqlsrv_fetch_array($stmtAE, SQLSRV_FETCH_NUMERIC); - - // rtrim strips whitespace from the end of the string, which - // takes care of a bug where some conversions lead to extraneous - // whitespace padding the end of the string - if (is_string($row[0])) { - $row[0] = rtrim($row[0]); - $rowAE[0] = rtrim($rowAE[0]); - } - - if ($row[0] != $rowAE[0]) { - echo "Values do not match! i=$i, j=$j, v=$v\n"; - print_r($row[0]); - print_r($rowAE[0]); - print_r($selectQuery[$i][$j]);echo "\n"; - print_r($selectQueryAE[$i][$j]);echo "\n"; - fatalError("Test failed, values do not match\n"); - } - } - } - } - } - } - - $deleteQuery = "DELETE FROM $tableName"; - $stmt = sqlsrv_query($conn, $deleteQuery); - if ($stmt == false) { - print_r(sqlsrv_errors()); - fatalError("Delete statement failed"); - } - - echo "Step $v done\n"; -} - -dropTable($conn, $tableName); - -sqlsrv_close($conn); - -echo "Test successful\n"; -?> ---EXPECT-- -Step 0 done -Step 1 done -Step 2 done -Step 3 done -Step 4 done -Step 5 done -Step 6 done -Step 7 done -Step 8 done -Step 9 done -Step 10 done -Step 11 done -Step 12 done -Step 13 done -Step 14 done -Step 15 done -Step 16 done -Step 17 done -Step 18 done -Step 19 done -Step 20 done -Test successful