зеркало из https://github.com/microsoft/msphpsql.git
added more to test
This commit is contained in:
Родитель
d87c03f5a8
Коммит
9d033e716a
|
@ -2041,7 +2041,6 @@ namespace core {
|
|||
SQLSMALLINT num_cols;
|
||||
r = ::SQLNumResultCols( stmt->handle(), &num_cols );
|
||||
|
||||
|
||||
CHECK_SQL_ERROR_OR_WARNING( r, stmt ) {
|
||||
throw CoreException();
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче