Changed db to tempdb and random table name
This commit is contained in:
parent
c89c46415d
commit
f559610293
|
@ -2,21 +2,18 @@
|
|||
Test fetch from binary, varbinary, varbinary(max), image columns, without setting binary encoding.
|
||||
--DESCRIPTION--
|
||||
Verifies GitHub issue 270 is fixed, users could not retrieve the data as inserted in binary columns without setting the binary encoding either on stmt or using bindCoulmn encoding.
|
||||
This test versifies that the data inserted in binary columns can be retrieved using fetch, fetchColumn, fetchObject, and fetchALL functions.
|
||||
This test verifies that the data inserted in binary columns can be retrieved using fetch, fetchColumn, fetchObject, and fetchAll functions.
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once("autonomous_setup.php");
|
||||
|
||||
$tableName = 'test_binary';
|
||||
$tableName = 'test_binary'.rand();
|
||||
$columns = array( 'col1', 'col2', 'col3', 'col4');
|
||||
|
||||
// Connect
|
||||
$conn = new PDO( "sqlsrv:server=$serverName", "$username", "$password" );
|
||||
|
||||
// CREATE database
|
||||
$conn->query("CREATE DATABASE ". $dbName) ?: die();
|
||||
$conn = new PDO( "sqlsrv:server=$serverName;Database=tempdb", "$username", "$password" );
|
||||
|
||||
$sql = "CREATE TABLE $tableName ( $columns[0] binary(50), $columns[1] VARBINARY(50), $columns[2] VARBINARY(MAX), $columns[3] image)";
|
||||
$conn->exec($sql);
|
||||
|
@ -37,7 +34,7 @@ foreach ($columns as $col){
|
|||
test_fetch($conn, $tableName, $col, $icon);
|
||||
}
|
||||
// DROP database
|
||||
$conn->query("DROP DATABASE ". $dbName) ?: die();
|
||||
$conn->query("DROP TABLE ". $tableName) ?: die();
|
||||
|
||||
//free connection
|
||||
$conn=null;
|
||||
|
|
Loading…
Reference in a new issue