protected function getShowCreateTable($schemaName, $tableName)
{
if (version_compare(PHP_VERSION, '5.1.3', '<')) {
throw new TDbException('dbmetadata_requires_php_version', 'Mysql 4.1.x', '5.1.3');
}
//See http://netevil.org/node.php?nid=795&SC=1
$this->getDbConnection()->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
if ($schemaName !== null) {
$sql = "SHOW CREATE TABLE `{$schemaName}`.`{$tableName}`";
} else {
$sql = "SHOW CREATE TABLE `{$tableName}`";
}
$command = $this->getDbConnection()->createCommand($sql);
$result = $command->queryRow();
return isset($result['Create Table']) ? $result['Create Table'] : (isset($result['Create View']) ? $result['Create View'] : '');
}