--TEST-- Test for inserting encrypted nvarchar data of variable lengths and retrieving encrypted and decrypted data --SKIPIF-- --FILE-- $data)); } $selectSql = "SELECT * FROM $tbname"; $stmt = $conn->query($selectSql); while ($decrypted_row = $stmt->fetch(PDO::FETCH_ASSOC)) { if ($decrypted_row['CharCount'] != strlen($decrypted_row[getDefaultColName("nvarchar(1000)")])) { $rowInd = $decrypted_row['CharCount'] + 1; echo "Failed to decrypted at row $rowInd\n"; $testPass = false; } } unset($stmt); } catch (PDOException $e) { echo $e->getMessage(); } // for AE only if (isColEncrypted()) { try { $conn1 = connect('', array(), PDO::ERRMODE_EXCEPTION, true); $stmt = $conn1->query($selectSql); while ($decrypted_row = $stmt->fetch(PDO::FETCH_ASSOC)) { if ($decrypted_row['CharCount'] == strlen($decrypted_row[getDefaultColName("nvarchar(1000)")])) { $rowInd = $decrypted_row[ 'CharCount' ] + 1; echo "Failed to encrypted at row $rowInd\n"; $testPass = false; } } unset($stmt); unset($conn1); } catch (PDOException $e) { echo $e->getMessage(); } } dropTable($conn, $tbname); unset($conn); if ($testPass) { echo "Test successfully done.\n"; } ?> --EXPECT-- Test successfully done.