Skip to content

Commit

Permalink
Improve PDO error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
benmerckx committed Dec 28, 2019
1 parent 68d571b commit 9f41b98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tink/sql/drivers/php/PDO.hx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class PDOConnection<Db:DatabaseInfo> implements Connection<Db> implements Saniti
public function new(db, cnx) {
this.db = db;
this.cnx = cnx;
cnx.setAttribute(PDO.ATTR_ERRMODE, PDO.ERRMODE_EXCEPTION);
this.formatter = new MySqlFormatter(this);
this.parser = new ResultParser(new ExprTyper(db));
}
Expand All @@ -74,7 +75,6 @@ class PDOConnection<Db:DatabaseInfo> implements Connection<Db> implements Saniti
var row: Any;
return Stream.ofIterator({
hasNext: function() {
if ((cast res) == false) return false;
row = res.fetchObject();
return row != false;
},
Expand Down

0 comments on commit 9f41b98

Please sign in to comment.