Browse Source

Closes #17057. `\yii\db\mssql\Schema::findTableNames` should return quoted table names. (#17409)

tags/2.0.22
Alexander Kartavenko 5 years ago committed by Alexander Makarov
parent
commit
6b10bbcec2
  1. 6
      framework/db/mssql/Schema.php

6
framework/db/mssql/Schema.php

@ -177,8 +177,12 @@ FROM [INFORMATION_SCHEMA].[TABLES] AS [t]
WHERE [t].[table_schema] = :schema AND [t].[table_type] IN ('BASE TABLE', 'VIEW')
ORDER BY [t].[table_name]
SQL;
$tables = $this->db->createCommand($sql, [':schema' => $schema])->queryColumn();
$tables = array_map(static function ($item) {
return '[' . $item . ']';
}, $tables);
return $this->db->createCommand($sql, [':schema' => $schema])->queryColumn();
return $tables;
}
/**

Loading…
Cancel
Save