fixed metadata tests

This commit is contained in:
yitam 2017-05-02 16:26:32 -07:00
parent 041cc628d4
commit f846fa68c9
3 changed files with 9 additions and 5 deletions

View file

@ -32,8 +32,8 @@ def executeSQLscriptUnix(sqlfile, conn_options, dbname):
redirect_string = '(echo :setvar dbname {0}) > {2}; cat {1} >> {2}; '
sqlcmd = 'sqlcmd ' + conn_options + ' -i ' + tmpFileName
# show_cmd = 'sqlcmd ' + conn_options + ' -Q \"select @@Version\" '
# executeCommmand(show_cmd)
show_cmd = 'sqlcmd ' + conn_options + ' -Q \"select @@Version\" '
executeCommmand(show_cmd)
# inst_command = redirect_string.format(dbname, sqlfile, tmpFileName) + sqlcmd
inst_command = redirect_string.format(dbname, sqlfile, tmpFileName)

View file

@ -12,10 +12,10 @@ if( !$conn ) {
FatalError("Connection could not be established.\n");
}
$tableName = GetTempTableName('test_srv_031');
$tableName = 'test_srv_031';
// Create table
$stmt = sqlsrv_query($conn, "create table $tableName (FirstName VARCHAR(10), LastName NVARCHAR(20), Age INT)");
$stmt = sqlsrv_query($conn, "CREATE TABLE $tableName (FirstName VARCHAR(10), LastName NVARCHAR(20), Age INT)");
if( $stmt === false ) { die( print_r( sqlsrv_errors(), true )); }
sqlsrv_free_stmt( $stmt);
@ -40,6 +40,8 @@ if ( ! $metadata )
else
var_dump($metadata);
sqlsrv_query($conn, "DROP TABLE $tableName");
sqlsrv_free_stmt( $stmt);
sqlsrv_close($conn);
print "Done";

View file

@ -12,7 +12,7 @@ if( !$conn ) {
FatalError("Connection could not be established.\n");
}
$tableName = GetTempTableName('test_srv_034');
$tableName = 'test_srv_034';
// Create table. Column names: passport
$sql = "CREATE TABLE $tableName (पासपोर्ट CHAR(2), پاسپورٹ VARCHAR(2), Διαβατήριο VARCHAR(MAX))";
@ -29,6 +29,8 @@ if ( ! $metadata )
else
var_dump($metadata);
sqlsrv_query($conn, "DROP TABLE $tableName");
// Free statement and connection resources
sqlsrv_free_stmt($stmt);
sqlsrv_close($conn);