From 9d992e4be64b6f3885428a65e28bc71565755abb Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sun, 23 Feb 2025 13:17:08 +0100 Subject: [PATCH] MySQL: Don't offer empty enum value in edit MySQL errors if there's an invalid value on the first row of INSERT or UPDATE, regardless of the sql_mode variable. --- adminer/include/adminer.inc.php | 2 +- changes.txt | 1 + todo.txt | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index ec3260aa..33ddef29 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -710,7 +710,7 @@ class Adminer { if ($field["type"] == "enum") { return (isset($_GET["select"]) ? " " : "") . ($field["null"] ? " " : "") - . enum_input("radio", $attrs, $field, $value, 0) // 0 - empty + . enum_input("radio", $attrs, $field, $value, $value === 0 ? 0 : null) // 0 - empty value ; } return ""; diff --git a/changes.txt b/changes.txt index a52d8d16..a4f76d67 100644 --- a/changes.txt +++ b/changes.txt @@ -1,6 +1,7 @@ Adminer 4.17.0-dev: Hide index column options by default MySQL, PostgreSQL, MS SQL: Support CHECK constraint +MySQL: Don't offer empty enum value in edit PostgreSQL: Link user defined types PostgreSQL: Constraint enum values in editing (bug #270) SQLite: Show all supported pragmas in Variables diff --git a/todo.txt b/todo.txt index 87332ba0..19b6b215 100644 --- a/todo.txt +++ b/todo.txt @@ -14,7 +14,6 @@ Skinnable plus.gif and other images - http://typo3.org/extensions/repository/vie ? Branch binary_compile: LZW compression of all texts can save 11 KB, using chars 127-255 in minification can save 1 KB https://github.com/vrana/adminer/compare/master...adminneo-org:adminneo:main -MySQL: Do not show 'empty' enum value in strict mode MySQL: Print comments of stored procedures and functions Add drag-n-drop moving of rows in table editing PostgreSQL: Show list of schemas in database