Remove InnoDB table comment in Tables and views

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@516 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2008-10-03 12:40:20 +00:00
parent af4fbca33a
commit 3920ebbe37
3 changed files with 8 additions and 3 deletions

View file

@ -71,9 +71,7 @@ if ($_POST) {
process_fields($row["fields"]);
} elseif (strlen($_GET["create"])) {
$row = table_status($_GET["create"]);
if ($row["Engine"] == "InnoDB") {
$row["Comment"] = preg_replace('~(?:(.+); )?InnoDB free: .*~', '\\1', $row["Comment"]);
}
table_comment($row);
$row["name"] = $_GET["create"];
$row["fields"] = array_values($orig_fields);
} else {

View file

@ -334,3 +334,9 @@ function shorten_utf8($string, $length) {
}
return nl2br(htmlspecialchars($string));
}
function table_comment(&$row) {
if ($row["Engine"] == "InnoDB") {
$row["Comment"] = preg_replace('~(?:(.+); )?InnoDB free: .*~', '\\1', $row["Comment"]);
}
}

View file

@ -177,6 +177,7 @@ if (isset($_GET["download"])) {
echo "<table border='1' cellspacing='0' cellpadding='2'>\n";
echo '<thead><tr><td><input type="checkbox" onclick="var elems = this.form.elements; for (var i=0; elems.length > i; i++) if (elems[i].name == \'tables[]\') elems[i].checked = this.checked;" /></td><th>' . lang('Table') . '</th><td>' . lang('Engine') . '</td><td>' . lang('Comment') . '</td><td>' . lang('Collation') . '</td><td>' . lang('Data Length') . '</td><td>' . lang('Index Length') . '</td><td>' . lang('Data Free') . '</td><td>' . lang('Auto Increment') . '</td><td>' . lang('Rows') . "</td></tr></thead>\n";
while ($row = $result->fetch_assoc()) {
table_comment($row);
echo '<tr class="nowrap"><td>' . (isset($row["Rows"]) ? '<input type="checkbox" name="tables[]" value="' . htmlspecialchars($row["Name"]) . '"' . (in_array($row["Name"], (array) $_POST["tables"], true) ? ' checked="checked"' : '') . ' /></td><th><a href="' . htmlspecialchars($SELF) . 'table=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . "</a></th><td>$row[Engine]</td><td>" . htmlspecialchars($row["Comment"]) . "</td><td>$row[Collation]" : '&nbsp;</td><th><a href="' . htmlspecialchars($SELF) . 'view=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . '</a></th><td colspan="7">' . lang('View'));
$row["count"] = $mysql->result($mysql->query("SELECT COUNT(*) FROM " . idf_escape($row["Name"])));
foreach ((isset($row["Rows"]) ? array("Data_length" => "create", "Index_length" => "indexes", "Data_free" => "edit", "Auto_increment" => "create") : array()) + array("count" => "select") as $key => $link) {