($row["Comment"] != $table_status["Comment"] ? $row["Comment"] : null),
($row["Engine"] && $row["Engine"] != $table_status["Engine"] ? $row["Engine"] : ""),
($row["Collation"] && $row["Collation"] != $table_status["Collation"] ? $row["Collation"] : ""),
- ($row["Auto_increment"] != "" ? +$row["Auto_increment"] : ""),
+ ($row["Auto_increment"] != "" ? number($row["Auto_increment"]) : ""),
$partitioning
));
}
}
function auto_increment() {
- return " IDENTITY" . ($_POST["Auto_increment"] != "" ? "(" . (+$_POST["Auto_increment"]) . ",1)" : "") . " PRIMARY KEY";
+ return " IDENTITY" . ($_POST["Auto_increment"] != "" ? "(" . number($_POST["Auto_increment"]) . ",1)" : "") . " PRIMARY KEY";
}
function alter_table($table, $name, $fields, $foreign, $comment, $engine, $collation, $auto_increment, $partitioning) {
* @param string
* @param string
* @param string
- * @param int
+ * @param string number
* @param string
* @return bool
*/
return substr(q($val), 1, -1);
}
+/** Remove non-digits from a string
+* @param string
+* @return string
+*/
+function number($val) {
+ return preg_replace('~[^0-9]+~', '', $val);
+}
+
/** Disable magic_quotes_gpc
* @param array e.g. (&$_GET, &$_POST, &$_COOKIE)
* @param bool whether to leave values as is
if (support("kill") && $_POST && !$error) {
$killed = 0;
foreach ((array) $_POST["kill"] as $val) {
- if (queries("KILL " . (+$val))) {
+ if (queries("KILL " . number($val))) {
$killed++;
}
}
json_row("");
} elseif ($_GET["script"] == "kill") {
- $connection->query("KILL " . (+$_POST["kill"]));
+ $connection->query("KILL " . number($_POST["kill"]));
} else { // connect
foreach (count_tables($adminer->databases()) as $db => $val) {
Report offline and other AJAX errors (bug #419)
Don't alter table comment if not changed
Add links to documentation on table status page
+Fix handling of 64 bit numbers in auto_increment
MySQL: Use utf8mb4 if available
MySQL: Support foreign keys in NDB storage
PostgreSQL: Materialized views
<?php
if ($_GET["script"] == "kill") {
- $connection->query("KILL " . (+$_POST["kill"]));
+ $connection->query("KILL " . number($_POST["kill"]));
} elseif (list($table, $id, $name) = $adminer->_foreignColumn(column_foreign_keys($_GET["source"]), $_GET["field"])) {
$limit = 11;