1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-26 15:54:34 +02:00

Big numbers without E

This commit is contained in:
Jakub Vrana
2010-10-23 00:02:24 +02:00
parent e9ae743578
commit 5002b89bd5
10 changed files with 20 additions and 19 deletions

View File

@@ -399,7 +399,7 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table)
}
function auto_increment() {
return " IDENTITY" . ($_POST["Auto_increment"] != "" ? "(" . preg_replace('~\\D+~', '', $_POST["Auto_increment"]) . ",1)" : "");
return " IDENTITY" . ($_POST["Auto_increment"] != "" ? "(" . (+$_POST["Auto_increment"]) . ",1)" : "");
}
function alter_table($table, $name, $fields, $foreign, $comment, $engine, $collation, $auto_increment, $partitioning) {

View File

@@ -212,7 +212,7 @@ if (!defined("DRIVER")) {
var $extension = "PDO_MySQL";
function connect($server, $username, $password) {
$this->dsn("mysql:host=" . str_replace(":", ";unix_socket=", preg_replace('~:([0-9])~', ';port=\\1', $server)), $username, $password);
$this->dsn("mysql:host=" . str_replace(":", ";unix_socket=", preg_replace('~:(\\d)~', ';port=\\1', $server)), $username, $password);
$this->query("SET NAMES utf8"); // charset in DSN is ignored
return true;
}
@@ -820,7 +820,7 @@ if (!defined("DRIVER")) {
global $connection;
$return = $connection->result("SHOW CREATE TABLE " . table($table), 1);
if (!$auto_increment) {
$return = preg_replace('~ AUTO_INCREMENT=[0-9]+~', '', $return); //! skip comments
$return = preg_replace('~ AUTO_INCREMENT=\\d+~', '', $return); //! skip comments
}
return $return;
}