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

MySQL: Convert binary default value to hex when editing

This commit is contained in:
Jakub Vrana
2025-03-11 20:25:52 +01:00
parent 43d86287c4
commit dc2e945aef

View File

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