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
*/
private function parseColumnCollationFromSQL($column, $sql)
{
if (preg_match(
'{(?:'.preg_quote($column).'|'.preg_quote($this->_platform->quoteSingleIdentifier($column)).')
[^,(]+(?:\([^()]+\)[^,]*)?
(?:(?:DEFAULT|CHECK)\s*(?:\(.*?\))?[^,]*)*
COLLATE\s+["\']?([^\s,"\')]+)}isx', $sql, $match)) {
$pattern = '{(?:\W' . preg_quote($column) . '\W|\W' . preg_quote($this->_platform->quoteSingleIdentifier($column))
. '\W)[^,(]+(?:\([^()]+\)[^,]*)?(?:(?:DEFAULT|CHECK)\s*(?:\(.*?\))?[^,]*)*COLLATE\s+["\']?([^\s,"\')]+)}isx';
if (preg_match($pattern, $sql, $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