From 7f9099a35dba6b34dde8873439c4a010a7772a22 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Mon, 29 Nov 2021 15:17:08 -0800 Subject: [PATCH] Fixed emulate prepare test to run with always encrypted enabled (#1336) --- ..._140_emulate_prepare_pos_placehodlers.phpt | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/test/functional/pdo_sqlsrv/pdo_140_emulate_prepare_pos_placehodlers.phpt b/test/functional/pdo_sqlsrv/pdo_140_emulate_prepare_pos_placehodlers.phpt index c04eb5b7..6f964654 100644 --- a/test/functional/pdo_sqlsrv/pdo_140_emulate_prepare_pos_placehodlers.phpt +++ b/test/functional/pdo_sqlsrv/pdo_140_emulate_prepare_pos_placehodlers.phpt @@ -41,23 +41,29 @@ EOF; $st->execute(); - $data = selectAll($cnn, $tbname); - var_dump($data); - - $system_param = 'another string'; + $system_param2 = 'another string'; $utf8_param = 'Привет'; $binary_param = fopen('php://memory', 'a'); fwrite($binary_param, hex2bin('80838790a9')); // testing some extended characters rewind($binary_param); - $st->bindParam(1, $system_param, PDO::PARAM_STR); + $st->bindParam(1, $system_param2, PDO::PARAM_STR); $st->bindParam(2, $utf8_param, PDO::PARAM_STR, 0, PDO::SQLSRV_ENCODING_UTF8); $st->bindParam(3, $binary_param, PDO::PARAM_LOB, 0, PDO::SQLSRV_ENCODING_BINARY); $st->execute(); - $sql = "SELECT * FROM $tbname WHERE system_encoding = 'another string'"; - $st = $cnn->query($sql); + $select = "SELECT * FROM $tbname WHERE system_encoding = ?"; + $st = $cnn->prepare($select); + $st->bindParam(1, $system_param); + $st->execute(); + + $data = $st->fetchAll(PDO::FETCH_BOTH); + var_dump($data); + + $st->bindParam(1, $system_param2); + $st->execute(); + $st->bindColumn('utf8_encoding', $param2); $st->bindColumn('binary_encoding', $param3); $row = $st->fetch(PDO::FETCH_BOUND);