mirror of
https://github.com/vrana/adminer.git
synced 2025-08-08 07:36:44 +02:00
MySQL: Convert binary default value to hex when editing
This commit is contained in:
@@ -1436,6 +1436,9 @@ function edit_form($table, $fields, $row, $update) {
|
|||||||
if ($field["type"] == "bit" && preg_match("~^b'([01]*)'\$~", $default, $regs)) {
|
if ($field["type"] == "bit" && preg_match("~^b'([01]*)'\$~", $default, $regs)) {
|
||||||
$default = $regs[1];
|
$default = $regs[1];
|
||||||
}
|
}
|
||||||
|
if (JUSH == "sql" && preg_match('~binary~', $field["type"])) {
|
||||||
|
$default = bin2hex($default); // same as UNHEX
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$value = ($row !== null
|
$value = ($row !== null
|
||||||
? ($row[$name] != "" && JUSH == "sql" && preg_match("~enum|set~", $field["type"]) && is_array($row[$name])
|
? ($row[$name] != "" && JUSH == "sql" && preg_match("~enum|set~", $field["type"]) && is_array($row[$name])
|
||||||
|
Reference in New Issue
Block a user