From a8895c82380fe2ee1ae1f19d3bcd8cd7d72ba5da Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 6 May 2011 15:48:38 +0200 Subject: [PATCH] Bit type default value (thanks to Jan Tojnar) --- adminer/include/editing.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adminer/include/editing.inc.php b/adminer/include/editing.inc.php index 4e6f8945..759954ba 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["default"] : q($field["default"])) : ""), + (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"])) : ""), ($field["on_update"] ? " ON UPDATE $field[on_update]" : ""), (support("comment") && $field["comment"] != "" ? " COMMENT " . q($field["comment"]) : ""), ($field["auto_increment"] ? auto_increment() : null),