--TEST-- Fix for output string parameters length prior to output being delivered --SKIPIF-- --FILE-- $id, 'Intro' => $intro)); } else { $stmt = sqlsrv_query($conn, "INSERT INTO Studies (studyID, Intro) VALUES (" . $id . ", N'". $intro ."')"); } if ($stmt === false) { fatalError("Failed to insert $id and $intro!\n"); } } sqlsrv_configure('WarningsReturnAsErrors', 0); sqlsrv_configure('LogSeverity', SQLSRV_LOG_SEVERITY_ALL); require_once('MsCommon.inc'); $conn = AE\connect(); if ($conn === false) { die(print_r(sqlsrv_errors(), true)); } dropProc($conn, 'sp_MakeSubject78'); // Create Table 'Subjects' but do not encrypt the first column because in the stored procedure // we rely on the server to get the current date time. With Column Encryption, all input values // have to be provided by the client $columns = array(new AE\ColumnMeta('datetime', 'StartTime', null, true, true), new AE\ColumnMeta('nchar(32)', 'sn'), new AE\ColumnMeta('nvarchar(50)', 'extref')); $stmt = AE\createTable($conn, 'Subjects', $columns); unset($columns); // Create table 'sn_x_study' $columns = array(new AE\ColumnMeta('int', 'studyID'), new AE\ColumnMeta('nchar(32)', 'sn')); $stmt = AE\createTable($conn, 'sn_x_study', $columns); unset($columns); // Create table 'Studies'. When AE is enabled, the sql type must match // the column definition, but because this test wants to convert the // output of column 'Intro' to nvarchar(256), we do not encrypt this second column $columns = array(new AE\ColumnMeta('int', 'studyID'), new AE\ColumnMeta('nchar(32)', 'Intro', null, true, true)); $stmt = AE\createTable($conn, 'Studies', $columns); unset($columns); // Insert 3 rows into table 'Studies' insertIntoStudies($conn, 1, "Test class 1"); insertIntoStudies($conn, 2, "12345678901234567890123456789012"); insertIntoStudies($conn, 3, "Test class 3"); $proc = << --EXPECT-- 64 12345678901234567890123456789012 32 12345678901234567890123456789012 64 12345678901234567890123456789012 64 12345678901234567890123456789012 32 12345678901234567890123456789012 64 12345678901234567890123456789012