1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-01 11:50:15 +02:00

DibiEvent: (SELECT ...) UNION (SELECT ...) is classified as SELECT [Closes #35]

This commit is contained in:
David Grudl
2012-01-19 04:17:39 +01:00
parent b87d3cab81
commit 0f21b6ca5b

View File

@@ -62,7 +62,7 @@ class DibiEvent
$this->sql = trim($sql);
$this->time = -microtime(TRUE);
if ($type === self::QUERY && preg_match('#(SELECT|UPDATE|INSERT|DELETE)#iA', $this->sql, $matches)) {
if ($type === self::QUERY && preg_match('#\(?\s*(SELECT|UPDATE|INSERT|DELETE)#iA', $this->sql, $matches)) {
static $types = array(
'SELECT' => self::SELECT, 'UPDATE' => self::UPDATE,
'INSERT' => self::INSERT, 'DELETE' => self::DELETE,