Skip to content
Snippets Groups Projects
Unverified Commit 43d8b16f authored by Thomas Flori's avatar Thomas Flori
Browse files

find insert into and allow 'IF (NOT )EXISTS' in statements

parent 8d823aae
Branches master
Tags v1.0.0
No related merge requests found
......@@ -35,6 +35,7 @@ class BasicAdapter implements AdapterInterface
'/^(alter|create|drop) ' . // action
'(?>[a-z=]+ )*?' . // something between like 'OR REPLACE', 'DEFINER = user' etc...
'(?>(table|index|function|trigger|view|procedure|type) )' . // type
'(?>IF (?>NOT )?EXISTS )?' . // 'IF EXISTS'
'(' . $namePattern . ')' . // name
'(?> |$|;)/i',
$statement,
......@@ -45,7 +46,7 @@ class BasicAdapter implements AdapterInterface
$statement->type = strtolower($match[2]);
$statement->name = str_replace(['"', '`'], '', $match[3]);
} elseif (preg_match(
'/^(update|delete) ' . // action
'/^(update|delete|insert into) ' . // action
'(' . $namePattern . ')' . // name
' /i',
$statement,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment