Commit 714f27ab by Alexander Makarov

Fixes #3241

parent b01e6de9
......@@ -63,7 +63,7 @@ Yii Framework 2 Change Log
- Enh #3298: Supported configuring `View::theme` using a class name (netyum, qiangxue)
- Enh #3328: `BaseMailer` generates better text body from html body (armab)
- Enh #3380: Allow `value` in `defaultValueValidator` to be a closure (Alex-Code)
- Enh #3399: Added support for MS SQL Server older than 2012 (fourteenmeister, samdark)
- Enh #3399, #3241: Added support for MS SQL Server older than 2012 (fourteenmeister, samdark)
- Enh #3472: Added configurable option to encode spaces in dropDownLists and listBoxes (kartik-v)
- Enh #3518: `yii\helpers\Html::encode()` now replaces invalid code sequences with "�" (DaSourcerer)
- Enh #3520: Added `unlinkAll()`-method to active record to remove all records of a model relation (NmDimas, samdark, cebe)
......
......@@ -235,7 +235,7 @@ class Schema extends \yii\db\Schema
*/
protected function findColumns($table)
{
$columnsTableName = 'information_schema.columns';
$columnsTableName = 'INFORMATION_SCHEMA.COLUMNS';
$whereSql = "[t1].[table_name] = '{$table->name}'";
if ($table->catalogName !== null) {
$columnsTableName = "{$table->catalogName}.{$columnsTableName}";
......@@ -292,8 +292,8 @@ SQL;
*/
protected function findPrimaryKeys($table)
{
$keyColumnUsageTableName = 'information_schema.key_column_usage';
$tableConstraintsTableName = 'information_schema.table_constraints';
$keyColumnUsageTableName = 'INFORMATION_SCHEMA.KEY_COLUMN_USAGE';
$tableConstraintsTableName = 'INFORMATION_SCHEMA.TABLE_CONSTRAINTS';
if ($table->catalogName !== null) {
$keyColumnUsageTableName = $table->catalogName . '.' . $keyColumnUsageTableName;
$tableConstraintsTableName = $table->catalogName . '.' . $tableConstraintsTableName;
......@@ -325,8 +325,8 @@ SQL;
*/
protected function findForeignKeys($table)
{
$referentialConstraintsTableName = 'information_schema.referential_constraints';
$keyColumnUsageTableName = 'information_schema.key_column_usage';
$referentialConstraintsTableName = 'INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS';
$keyColumnUsageTableName = 'INFORMATION_SCHEMA.KEY_COLUMN_USAGE';
if ($table->catalogName !== null) {
$referentialConstraintsTableName = $table->catalogName . '.' . $referentialConstraintsTableName;
$keyColumnUsageTableName = $table->catalogName . '.' . $keyColumnUsageTableName;
......@@ -374,7 +374,7 @@ SQL;
$sql = <<<SQL
SELECT [t].[table_name]
FROM [information_schema].[tables] AS [t]
FROM [INFORMATION_SCHEMA].[TABLES] AS [t]
WHERE [t].[table_schema] = :schema AND [t].[table_type] = 'BASE TABLE'
SQL;
......
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