added select ? to the pdo output test

This commit is contained in:
Hadis Kakanejadi Fard 2017-05-18 11:55:29 -07:00
parent 063e8b33fc
commit aeac4e649d

View file

@ -6,6 +6,24 @@ parameterized queries is not supported for Sql_Variant columns, this test, verif
<?php
include 'MsCommon.inc';
function TestSimpleSelect($conn)
{
$value = 0;
$stmt = $conn->prepare("SELECT ? = COUNT(* ) FROM cd_info");
$stmt->bindParam( 1, $value, PDO::PARAM_INT, 4 );
$stmt->execute();
echo "Number of items: $value\n";
$title = 'xx';
$stmt = $conn->prepare("SELECT ? = title FROM cd_info WHERE artist LIKE 'Led%'");
$stmt->bindParam( 1, $title, PDO::PARAM_STR, 25 );
$stmt->execute();
echo "CD Title: $title\n\n";
}
function TestReverse($conn)
{
$procName = GetTempProcName('sqlReverse');
@ -109,6 +127,9 @@ function RunTest()
$conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
echo "\n";
// Test a simple select to get output
TestSimpleSelect($conn);
// Test with a simple stored procedure
TestReverse($conn);
@ -133,6 +154,9 @@ RunTest();
?>
--EXPECT--

Number of items: 7
CD Title: Led Zeppelin 1
SQLSTATE[22018]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Operand type clash: nvarchar(max) is incompatible with sql_variant
SQLSTATE[22018]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Operand type clash: nvarchar(max) is incompatible with sql_variant