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

also find type statements and when they end after name

In postgres you can also create, alter and drop types. Also drop
statements may end after the type name for example `DROP TABLE animals`.
parent 4febf8be
No related branches found
No related tags found
No related merge requests found
...@@ -34,9 +34,9 @@ class BasicAdapter implements AdapterInterface ...@@ -34,9 +34,9 @@ class BasicAdapter implements AdapterInterface
if (preg_match( if (preg_match(
'/^(alter|create|drop) ' . // action '/^(alter|create|drop) ' . // action
'(?>[a-z=]+ )*?' . // something between like 'OR REPLACE', 'DEFINER = user' etc... '(?>[a-z=]+ )*?' . // something between like 'OR REPLACE', 'DEFINER = user' etc...
'(?>(table|index|function|trigger|view|procedure) )' . // type '(?>(table|index|function|trigger|view|procedure|type) )' . // type
'(' . $namePattern . ')' . // name '(' . $namePattern . ')' . // name
' /i', '(?> |$|;)/i',
$statement, $statement,
$match $match
)) { )) {
......
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