Unverified Commit c15f772f authored by Michael Moravec's avatar Michael Moravec Committed by Sergei Morozov

SqliteSchemaManager: Drop unnecessary `x` PCRE modifier

parent cfd9c0ac
...@@ -438,7 +438,7 @@ class SqliteSchemaManager extends AbstractSchemaManager ...@@ -438,7 +438,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
private function parseColumnCollationFromSQL(string $column, string $sql) : ?string private function parseColumnCollationFromSQL(string $column, string $sql) : ?string
{ {
$pattern = '{(?:\W' . preg_quote($column) . '\W|\W' . preg_quote($this->_platform->quoteSingleIdentifier($column)) $pattern = '{(?:\W' . preg_quote($column) . '\W|\W' . preg_quote($this->_platform->quoteSingleIdentifier($column))
. '\W)[^,(]+(?:\([^()]+\)[^,]*)?(?:(?:DEFAULT|CHECK)\s*(?:\(.*?\))?[^,]*)*COLLATE\s+["\']?([^\s,"\')]+)}isx'; . '\W)[^,(]+(?:\([^()]+\)[^,]*)?(?:(?:DEFAULT|CHECK)\s*(?:\(.*?\))?[^,]*)*COLLATE\s+["\']?([^\s,"\')]+)}is';
if (preg_match($pattern, $sql, $match) !== 1) { if (preg_match($pattern, $sql, $match) !== 1) {
return null; return null;
...@@ -450,7 +450,7 @@ class SqliteSchemaManager extends AbstractSchemaManager ...@@ -450,7 +450,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
private function parseColumnCommentFromSQL(string $column, string $sql) : ?string private function parseColumnCommentFromSQL(string $column, string $sql) : ?string
{ {
$pattern = '{[\s(,](?:\W' . preg_quote($this->_platform->quoteSingleIdentifier($column)) . '\W|\W' . preg_quote($column) $pattern = '{[\s(,](?:\W' . preg_quote($this->_platform->quoteSingleIdentifier($column)) . '\W|\W' . preg_quote($column)
. '\W)(?:\(.*?\)|[^,(])*?,?((?:(?!\n))(?:\s*--[^\n]*\n?)+)}ix'; . '\W)(?:\(.*?\)|[^,(])*?,?((?:(?!\n))(?:\s*--[^\n]*\n?)+)}i';
if (preg_match($pattern, $sql, $match) !== 1) { if (preg_match($pattern, $sql, $match) !== 1) {
return null; return null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment