added more to test
This commit is contained in:
parent
d87c03f5a8
commit
9d033e716a
|
@ -2041,7 +2041,6 @@ namespace core {
|
||||||
SQLSMALLINT num_cols;
|
SQLSMALLINT num_cols;
|
||||||
r = ::SQLNumResultCols( stmt->handle(), &num_cols );
|
r = ::SQLNumResultCols( stmt->handle(), &num_cols );
|
||||||
|
|
||||||
|
|
||||||
CHECK_SQL_ERROR_OR_WARNING( r, stmt ) {
|
CHECK_SQL_ERROR_OR_WARNING( r, stmt ) {
|
||||||
throw CoreException();
|
throw CoreException();
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,17 +25,27 @@ $stmt = $conn->prepare($sql);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
if ($conn->errorCode() == "00000")
|
if ($conn->errorCode() == "00000")
|
||||||
echo "prepare OK\n";
|
echo "prepare OK\n";
|
||||||
|
else
|
||||||
|
echo "unexpected error at prepare";
|
||||||
|
|
||||||
//test prepare, with args
|
//test prepare, with args
|
||||||
$stmt = $conn->prepare($sqlWithParameter);
|
$stmt = $conn->prepare($sqlWithParameter);
|
||||||
$stmt->execute(array(':id' => $sqlParameter));
|
$stmt->execute(array(':id' => $sqlParameter));
|
||||||
if ($conn->errorCode() == "00000")
|
if ($conn->errorCode() == "00000")
|
||||||
echo "prepare with args OK\n";
|
echo "prepare with args OK\n";
|
||||||
|
else
|
||||||
|
echo "unexpected error at prepare with args";
|
||||||
|
|
||||||
//test direct exec
|
//test direct exec
|
||||||
$stmt = $conn->exec($sql);
|
$stmt = $conn->exec($sql);
|
||||||
if ($conn->errorCode() == "00000")
|
$err = $conn->errorCode();
|
||||||
|
if ($stmt == 0 && $err == "00000")
|
||||||
echo "direct exec OK\n";
|
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");
|
$Statement = $conn->exec("IF OBJECT_ID('foo_table', 'U') IS NOT NULL DROP TABLE foo_table");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue