mirror of
https://github.com/vrana/adminer.git
synced 2025-08-17 20:01:25 +02:00
Auto-free result-set
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1026 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
@@ -449,7 +449,6 @@ class Adminer {
|
||||
echo '<a href="' . h(ME) . 'table=' . urlencode($row[0]) . '">' . $this->tableName(array("Name" => $row[0])) . "</a><br>\n"; //! Adminer::tableName may work with full table status
|
||||
}
|
||||
}
|
||||
$result->free();
|
||||
}
|
||||
echo '<p><a href="' . h(ME) . 'create=">' . lang('Create new table') . "</a>\n";
|
||||
}
|
||||
|
@@ -13,7 +13,6 @@ function dump_table($table, $style, $is_view = false) {
|
||||
echo "DROP " . ($is_view ? "VIEW" : "TABLE") . " IF EXISTS " . idf_escape($table) . ";\n";
|
||||
}
|
||||
$create = $dbh->result($result, 1);
|
||||
$result->free();
|
||||
echo ($style != "CREATE+ALTER" ? $create : ($is_view ? substr_replace($create, " OR REPLACE", 6, 0) : substr_replace($create, " IF NOT EXISTS", 12, 0))) . ";\n\n";
|
||||
}
|
||||
if ($style == "CREATE+ALTER" && !$is_view) {
|
||||
@@ -48,7 +47,6 @@ CREATE PROCEDURE adminer_alter () BEGIN
|
||||
$fields[] = $row;
|
||||
$after = $row["COLUMN_NAME"];
|
||||
}
|
||||
$result->free();
|
||||
?>';
|
||||
DECLARE columns CURSOR FOR <?php echo $query; ?>;
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
|
||||
@@ -142,7 +140,6 @@ function dump_data($table, $style, $select = "") {
|
||||
if ($_POST["format"] != "csv" && $style != "INSERT+UPDATE" && $result->num_rows) {
|
||||
echo ";\n";
|
||||
}
|
||||
$result->free();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -51,7 +51,6 @@ function get_vals($query, $column = 0) {
|
||||
while ($row = $result->fetch_row()) {
|
||||
$return[] = $row[$column];
|
||||
}
|
||||
$result->free();
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
@@ -245,7 +244,6 @@ function select($result, $dbh2 = null) {
|
||||
}
|
||||
echo "</table>\n";
|
||||
}
|
||||
$result->free();
|
||||
}
|
||||
|
||||
function is_utf8($val) {
|
||||
|
@@ -118,8 +118,8 @@ if (extension_loaded("mysqli")) {
|
||||
return $row;
|
||||
}
|
||||
|
||||
function free() {
|
||||
return mysql_free_result($this->_result);
|
||||
function __destruct() {
|
||||
mysql_free_result($this->_result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,7 +176,6 @@ function table_status($name = "") {
|
||||
}
|
||||
$return[$row["Name"]] = $row;
|
||||
}
|
||||
$result->free();
|
||||
return (strlen($name) ? $return[$name] : $return);
|
||||
}
|
||||
|
||||
@@ -213,7 +212,6 @@ function fields($table) {
|
||||
"primary" => ($row["Key"] == "PRI"),
|
||||
);
|
||||
}
|
||||
$result->free();
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
@@ -231,7 +229,6 @@ function indexes($table, $dbh2 = null) {
|
||||
$return[$row["Key_name"]]["columns"][$row["Seq_in_index"]] = $row["Column_name"];
|
||||
$return[$row["Key_name"]]["lengths"][$row["Seq_in_index"]] = $row["Sub_part"];
|
||||
}
|
||||
$result->free();
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
@@ -243,7 +240,6 @@ function foreign_keys($table) {
|
||||
$result = $dbh->query("SHOW CREATE TABLE " . idf_escape($table));
|
||||
if ($result) {
|
||||
$create_table = $dbh->result($result, 1);
|
||||
$result->free();
|
||||
preg_match_all("~CONSTRAINT `($pattern)` FOREIGN KEY \\(((?:`$pattern`,? ?)+)\\) REFERENCES `($pattern)`(?:\\.`($pattern)`)? \\(((?:`$pattern`,? ?)+)\\)(?: ON DELETE (" . implode("|", $on_actions) . "))?(?: ON UPDATE (" . implode("|", $on_actions) . "))?~", $create_table, $matches, PREG_SET_ORDER);
|
||||
foreach ($matches as $match) {
|
||||
preg_match_all("~`($pattern)`~", $match[2], $source);
|
||||
@@ -273,7 +269,6 @@ function collations() {
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$return[$row["Charset"]][] = $row["Collation"];
|
||||
}
|
||||
$result->free();
|
||||
ksort($return);
|
||||
foreach ($return as $key => $val) {
|
||||
sort($return[$key]);
|
||||
|
@@ -78,9 +78,5 @@ if (extension_loaded('pdo')) {
|
||||
$row->charsetnr = (in_array("blob", $row->flags) ? 63 : 0);
|
||||
return $row;
|
||||
}
|
||||
|
||||
function free() {
|
||||
// $this->__destruct() is not callable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user