Unverified Commit 4c258314 authored by Sergei Morozov's avatar Sergei Morozov

Merge branch '2.11.x' into 3.0.x

parents e27d6558 0bb2e66d
......@@ -130,6 +130,10 @@ Please use other database client applications for import, e.g.:
# Upgrade to 2.11
## Deprecated `EchoSQLLogger`
The `EchoSQLLogger` is has been deprecated. Implement your logger with the desired logic.
## Deprecated database platforms:
1. PostgreSQL 9.3 and older
......
......@@ -499,7 +499,7 @@ CREATE\sTABLE # Match "CREATE TABLE"
private function parseColumnCommentFromSQL(string $column, string $sql) : ?string
{
$pattern = '{[\s(,](?:\W' . preg_quote($this->_platform->quoteSingleIdentifier($column)) . '\W|\W' . preg_quote($column)
. '\W)(?:\(.*?\)|[^,(])*?,?((?:(?!\n))(?:\s*--[^\n]*\n?)+)}i';
. '\W)(?:\([^)]*?\)|[^,(])*?,?((?:(?!\n))(?:\s*--[^\n]*\n?)+)}i';
if (preg_match($pattern, $sql, $match) !== 1) {
return null;
......
......@@ -278,4 +278,19 @@ SQL;
// with an empty table, non autoincrement rowid is always 1
self::assertEquals(1, $lastUsedIdAfterDelete);
}
public function testOnlyOwnCommentIsParsed() : void
{
$table = new Table('own_column_comment');
$table->addColumn('col1', 'string', ['length' => 16]);
$table->addColumn('col2', 'string', ['length' => 16, 'comment' => 'Column #2']);
$table->addColumn('col3', 'string', ['length' => 16]);
$sm = $this->connection->getSchemaManager();
$sm->createTable($table);
self::assertNull($sm->listTableDetails('own_column_comment')
->getColumn('col1')
->getComment());
}
}
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