Skip to content

Commit

Permalink
add exception handling for pdo_transaction.phpt
Browse files Browse the repository at this point in the history
  • Loading branch information
yukiwongky committed Nov 4, 2017
1 parent a60992f commit e09dd91
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions test/functional/pdo_sqlsrv/pdo_transaction.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,21 @@ require_once("MsCommon_mid-refactor.inc");

function deleteRows($conn, $tbname)
{
if (!isColEncrypted()) {
$rows = $conn->exec("DELETE FROM $tbname WHERE col1 = 'a'");
} else {
// needs to find parameter for encrypted columns
$sql = "DELETE FROM $tbname WHERE col1 = ?";
$stmt = $conn->prepare($sql);
$col1 = "a";
$stmt->execute(array($col1));
$rows = $stmt->rowCount();
try {
if (!isColEncrypted()) {
$rows = $conn->exec("DELETE FROM $tbname WHERE col1 = 'a'");
} else {
// needs to find parameter for encrypted columns
$sql = "DELETE FROM $tbname WHERE col1 = ?";
$stmt = $conn->prepare($sql);
$col1 = "a";
$stmt->execute(array($col1));
$rows = $stmt->rowCount();
}
return $rows;
} catch (PDOException $e) {
var_dump($e->errorInfo);
}
return $rows;
}

try {
Expand Down

0 comments on commit e09dd91

Please sign in to comment.