- Added identifier escaping to match differents PDO drivers

This commit is contained in:
Dave Mc Nicoll committed 2020-04-09 13:20:07 -04:00
1 parent def8decb4e
commit 3ff97f3bf0
8 files changed
+71 -30

No files matched your search

+9 -18
View File
@@ -15,14 +15,9 @@ class PdoObject extends PDO {
return $statement;
}
} catch (\PDOException $e) {
switch ( $e->getCode() ) {
case 42000:
throw new \PdoException($e->getMessage() . " `$sql` with data:" . json_encode($parameters));
default:
throw $e;
}
}
catch (\PDOException $e) {
throw new \PdoException($e->getMessage() . " `$sql` with data:" . json_encode($parameters));
}
}
@@ -31,14 +26,9 @@ class PdoObject extends PDO {
if (false !== ( $statement = $this->prepare($sql) )) {
return $this->execute($statement, $parameters, true);
}
} catch (\PDOException $e) {
switch ( $e->getCode() ) {
case 42000:
throw new \PdoException($e->getMessage() . " `$sql` with data:" . json_encode($parameters));
default:
throw $e;
}
}
catch (\PDOException $e) {
throw new \PdoException($e->getMessage() . " `$sql` with data:" . json_encode($parameters));
}
return null;
@@ -62,10 +52,11 @@ class PdoObject extends PDO {
else {
throw new \PDOException($statement->errorCode() . " - " . json_encode($statement->errorInfo()));
}
} catch (\PDOException $e) {
}
catch (\PDOException $e) {
$this->rollback();
throw $e;
throw new \PdoException($e->getMessage() . " `$sql` with data:" . json_encode($parameters));
}
return null;