Unverified Commit 4f1320ce authored by Gawain Lynch's avatar Gawain Lynch Committed by Luís Cobucci

Match column collation based on word boundaries

parent fb0d0a5c
...@@ -443,11 +443,10 @@ class SqliteSchemaManager extends AbstractSchemaManager ...@@ -443,11 +443,10 @@ class SqliteSchemaManager extends AbstractSchemaManager
*/ */
private function parseColumnCollationFromSQL($column, $sql) private function parseColumnCollationFromSQL($column, $sql)
{ {
if (preg_match( $pattern = '{(?:\W' . preg_quote($column) . '\W|\W' . preg_quote($this->_platform->quoteSingleIdentifier($column))
'{(?:'.preg_quote($column).'|'.preg_quote($this->_platform->quoteSingleIdentifier($column)).') . '\W)[^,(]+(?:\([^()]+\)[^,]*)?(?:(?:DEFAULT|CHECK)\s*(?:\(.*?\))?[^,]*)*COLLATE\s+["\']?([^\s,"\')]+)}isx';
[^,(]+(?:\([^()]+\)[^,]*)?
(?:(?:DEFAULT|CHECK)\s*(?:\(.*?\))?[^,]*)* if (preg_match($pattern, $sql, $match) === 1) {
COLLATE\s+["\']?([^\s,"\')]+)}isx', $sql, $match)) {
return $match[1]; return $match[1];
} }
......
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