1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-06 06:37:33 +02:00

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.
This commit is contained in:
Jakub Vrana
2025-02-23 13:17:08 +01:00
parent 7ece69a8c4
commit 9d992e4be6
3 changed files with 2 additions and 2 deletions

View File

@@ -710,7 +710,7 @@ class Adminer {
if ($field["type"] == "enum") {
return (isset($_GET["select"]) ? "<label><input type='radio'$attrs value='-1' checked><i>" . lang('original') . "</i></label> " : "")
. ($field["null"] ? "<label><input type='radio'$attrs value=''" . ($value !== null || isset($_GET["select"]) ? "" : " checked") . "><i>NULL</i></label> " : "")
. enum_input("radio", $attrs, $field, $value, 0) // 0 - empty
. enum_input("radio", $attrs, $field, $value, $value === 0 ? 0 : null) // 0 - empty value
;
}
return "";

View File

@@ -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

View File

@@ -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