mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 13:58:55 +08:00
Fixes #14211: Fixed regression in Unique and Exist validators
This commit is contained in:
@ -822,7 +822,7 @@ class ActiveQuery extends Query implements ActiveQueryInterface
|
||||
.*?
|
||||
(?:['"`\]]|}})
|
||||
|
|
||||
\w+
|
||||
.*?
|
||||
)
|
||||
(?:
|
||||
(?:
|
||||
@ -835,7 +835,7 @@ class ActiveQuery extends Query implements ActiveQueryInterface
|
||||
.*?
|
||||
(?:['"`\]]|}})
|
||||
|
|
||||
\w+
|
||||
.*?
|
||||
)
|
||||
)?
|
||||
\s*
|
||||
|
||||
@ -357,4 +357,19 @@ abstract class ActiveQueryTest extends DatabaseTestCase
|
||||
'{{%order_item}}' => '{{%order_item}}',
|
||||
], $tables);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://github.com/yiisoft/yii2/issues/14211
|
||||
*/
|
||||
public function testGetTableAliasFromTableNameWithDatabase()
|
||||
{
|
||||
$query = new ActiveQuery(null);
|
||||
$query->from = 'tickets.workflows';
|
||||
|
||||
$tables = $query->getTablesUsedInFrom();
|
||||
|
||||
$this->assertEquals([
|
||||
'{{tickets.workflows}}' => '{{tickets.workflows}}',
|
||||
], $tables);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user