protected function createTableInfo($table)
{
list($schemaName, $tableName) = $this->getSchemaTableName($table);
$find = $schemaName === null ? "`{$tableName}`" : "`{$schemaName}`.`{$tableName}`";
$colCase = $this->getDbConnection()->getColumnCase();
if ($colCase != TDbColumnCaseMode::Preserved) {
$this->getDbConnection()->setColumnCase('Preserved');
}
$this->getDbConnection()->setActive(true);
$sql = "SHOW FULL FIELDS FROM {$find}";
$command = $this->getDbConnection()->createCommand($sql);
$tableInfo = $this->createNewTableInfo($table);
$index = 0;
foreach ($command->query() as $col) {
$col['index'] = $index++;
$this->processColumn($tableInfo, $col);
}
if ($index === 0) {
throw new TDbException('dbmetadata_invalid_table_view', $table);
}
if ($colCase != TDbColumnCaseMode::Preserved) {
$this->getDbConnection()->setColumnCase($colCase);
}
return $tableInfo;
}