diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 420ab06f..0c40cd10 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -472,7 +472,7 @@ username.form['driver'].onchange(); return $value; // SQL injection } $name = $field["field"]; - $return = ($field["type"] == "bit" && ereg('^[0-9]+$', $value) ? $value : q($value)); + $return = ($field["type"] == "bit" && ereg("^([0-9]+|b'[0-1]+')\$", $value) ? $value : q($value)); if (ereg('^(now|getdate|uuid)$', $function)) { $return = "$function()"; } elseif (ereg('^current_(date|timestamp)$', $function)) { @@ -784,6 +784,7 @@ DROP PROCEDURE adminer_alter; foreach (array("bac", "bra", "sqlite_quo", "mssql_bra") as $val) { echo "jushLinks.$val = jushLinks.$jush;\n"; } + echo "var cmComplete = [ '" . implode("', '", array_map('js_escape', array_keys($tables))) . "' ];\n"; echo "\n"; } } diff --git a/adminer/include/editing.inc.php b/adminer/include/editing.inc.php index 759954ba..00c61a2c 100644 --- a/adminer/include/editing.inc.php +++ b/adminer/include/editing.inc.php @@ -176,7 +176,7 @@ function process_field($field, $type_field) { idf_escape($field["field"]), process_type($type_field), ($field["null"] ? " NULL" : " NOT NULL"), // NULL for timestamp - (isset($field["default"]) ? " DEFAULT " . (($field["type"] == "timestamp" && eregi('^CURRENT_TIMESTAMP$', $field["default"])) || ($field["type"] == "bit" && ereg('^[0-9]+$', $field["default"])) ? $field["default"] : q($field["default"])) : ""), + (isset($field["default"]) ? " DEFAULT " . (($field["type"] == "timestamp" && eregi('^CURRENT_TIMESTAMP$', $field["default"])) || ($field["type"] == "bit" && ereg("^([0-9]+|b'[0-1]+')\$", $field["default"])) ? $field["default"] : q($field["default"])) : ""), ($field["on_update"] ? " ON UPDATE $field[on_update]" : ""), (support("comment") && $field["comment"] != "" ? " COMMENT " . q($field["comment"]) : ""), ($field["auto_increment"] ? auto_increment() : null), diff --git a/changes.txt b/changes.txt index 518684a3..c1963956 100644 --- a/changes.txt +++ b/changes.txt @@ -2,6 +2,7 @@ Adminer 3.3.0-dev: Use Esc to disable in-place edit Highlight SQL code in textarea Append new index with auto index selection (bug #3282127) +Bit type default value Autocomplete for big foreign keys (Editor) Customizable favicon (customization) Method name can return a link (customization)