added more to test

This commit is contained in:
v-kaywon 2017-03-31 13:59:30 -07:00
parent d87c03f5a8
commit 9d033e716a
2 changed files with 11 additions and 2 deletions

View file

@ -2041,7 +2041,6 @@ namespace core {
SQLSMALLINT num_cols;
r = ::SQLNumResultCols( stmt->handle(), &num_cols );
CHECK_SQL_ERROR_OR_WARNING( r, stmt ) {
throw CoreException();
}

View file

@ -25,17 +25,27 @@ $stmt = $conn->prepare($sql);
$stmt->execute();
if ($conn->errorCode() == "00000")
echo "prepare OK\n";
else
echo "unexpected error at prepare";
//test prepare, with args
$stmt = $conn->prepare($sqlWithParameter);
$stmt->execute(array(':id' => $sqlParameter));
if ($conn->errorCode() == "00000")
echo "prepare with args OK\n";
else
echo "unexpected error at prepare with args";
//test direct exec
$stmt = $conn->exec($sql);
if ($conn->errorCode() == "00000")
$err = $conn->errorCode();
if ($stmt == 0 && $err == "00000")
echo "direct exec OK\n";
else
if ($stmt != 0)
echo "unexpected row returned at direct exec\n";
if ($err != "00000")
echo "unexpected error at direct exec";
$Statement = $conn->exec("IF OBJECT_ID('foo_table', 'U') IS NOT NULL DROP TABLE foo_table");