File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,8 @@ public function getSupplementalDriver()
124124 public function getInsertId ($ name = NULL )
125125 {
126126 try {
127- return $ this ->getPdo ()->lastInsertId ($ name );
127+ $ res = $ this ->getPdo ()->lastInsertId ($ name );
128+ return $ res === FALSE ? '0 ' : $ res ;
128129 } catch (PDOException $ e ) {
129130 throw $ this ->driver ->convertException ($ e );
130131 }
Original file line number Diff line number Diff line change @@ -19,10 +19,10 @@ $connection->query('
1919 ' );
2020
2121$ connection ->query ('INSERT INTO primarykey (prim) VALUES (5) ' );
22- Assert::equal (PHP_VERSION_ID < 70011 ? FALSE : '0 ' , $ connection ->getInsertId ());
22+ Assert::equal ('0 ' , $ connection ->getInsertId ());
2323
2424$ connection ->query ('INSERT INTO primarykey (prim) VALUES (6) ' );
25- Assert::equal (PHP_VERSION_ID < 70011 ? FALSE : '0 ' , $ connection ->getInsertId ());
25+ Assert::equal ('0 ' , $ connection ->getInsertId ());
2626
2727
2828$ connection ->query ('
You can’t perform that action at this time.
0 commit comments