]> git.joonet.de Git - adminer.git/commitdiff
Remove InnoDB table comment in Tables and views
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Fri, 3 Oct 2008 12:40:20 +0000 (12:40 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Fri, 3 Oct 2008 12:40:20 +0000 (12:40 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@516 7c3ca157-0c34-0410-bff1-cbf682f78f5c

create.inc.php
functions.inc.php
index.php

index de801a209f53ec8a0fdc88a68dba06acac99b62e..a76b50e46183ce04fcf169113350eb57465dc995 100644 (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 {
index 74be5f71744d658a36523c343f21e9693785e7d3..1a47daecf74aa739415ea022f21db98dc587784b 100644 (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"]);
+       }
+}
index c8f530858bc446b47f52921173ab35387e24ccc5..3cb00c1d29d78425eeb8e5f619737f8c02b42bac 100644 (file)
--- a/index.php
+++ b/index.php
@@ -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) {