diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 183ae83198..259b51aa5c 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -20,6 +20,7 @@ Yii Framework 2 Change Log - Bug #18101: Fix behavior of OUTPUT INSERTED.* for SQL Server query: "insert default values"; correct MSSQL unit tests; turn off profiling echo message in migration test (darkdef) - Bug #18105: Fix for old trigger in RBAC migration with/without prefixTable (darkdef) - Enh #18120: Include path to the log file into error message if `FileTarget::export` fails (uaoleg) +- Bug #18110: Add quotes to return value of viewName in MSSQL schema. It is `[someView]` now (darkdef) 2.0.35 May 02, 2020 diff --git a/framework/db/mssql/Schema.php b/framework/db/mssql/Schema.php index fdeb546194..469e54e784 100644 --- a/framework/db/mssql/Schema.php +++ b/framework/db/mssql/Schema.php @@ -595,7 +595,12 @@ WHERE [t].[table_schema] = :schema AND [t].[table_type] = 'VIEW' ORDER BY [t].[table_name] SQL; - return $this->db->createCommand($sql, [':schema' => $schema])->queryColumn(); + $views = $this->db->createCommand($sql, [':schema' => $schema])->queryColumn(); + $views = array_map(static function ($item) { + return '[' . $item . ']'; + }, $views); + + return $views; } /**