diff --git a/src/Connection.php b/src/Connection.php index b8e1228..fdc4d6d 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -285,6 +285,6 @@ private function resetTransactionNestingLevel() */ public function isUpdateQuery($query) { - return !preg_match('/^[\s\n\r\t(]*(select|show) /i', $query); + return !preg_match('/^[\s\n\r\t(]*(select|show|describe)[\s\n\r\t(]+/i', $query); } } diff --git a/tests/unit/ConnectionTest.php b/tests/unit/ConnectionTest.php index 3267d1a..bb2b3c1 100644 --- a/tests/unit/ConnectionTest.php +++ b/tests/unit/ConnectionTest.php @@ -103,6 +103,7 @@ public function isUpdateQueryDataProvider() ['DELETE ', true], ['SELECT ', false], ['select ', false], + ["\n\tSELECT\n", false], ['(select ', false], [' (select ', false], ['