From dc2e945aef36d43146630bde6ee5275c2bf8912f Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Tue, 11 Mar 2025 20:25:52 +0100 Subject: [PATCH] MySQL: Convert binary default value to hex when editing --- adminer/include/functions.inc.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index aa3dc034..8b3aa84d 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -1436,6 +1436,9 @@ function edit_form($table, $fields, $row, $update) { if ($field["type"] == "bit" && preg_match("~^b'([01]*)'\$~", $default, $regs)) { $default = $regs[1]; } + if (JUSH == "sql" && preg_match('~binary~', $field["type"])) { + $default = bin2hex($default); // same as UNHEX + } } $value = ($row !== null ? ($row[$name] != "" && JUSH == "sql" && preg_match("~enum|set~", $field["type"]) && is_array($row[$name])