]> git.joonet.de Git - adminer.git/commitdiff
MySQL: Display default values of binary columns
authorJakub Vrana <jakub@vrana.cz>
Tue, 11 Mar 2025 18:25:42 +0000 (19:25 +0100)
committerJakub Vrana <jakub@vrana.cz>
Tue, 11 Mar 2025 18:25:42 +0000 (19:25 +0100)
adminer/drivers/mysql.inc.php
changes.txt

index 699f0399cf1dedff3afd728a34dec281d278470a..62eb7578a7f9d076c455a5ed3cd0c70c13b7964e 100644 (file)
@@ -612,6 +612,11 @@ if (!defined('Adminer\DRIVER')) {
                                        return stripslashes(str_replace("''", "'", $match[1]));
                                }, $default);
                        }
+                       if (!$maria && preg_match('~binary~', $match_type[1]) && preg_match('~^0x(\w*)$~', $default, $match)) {
+                               $default = preg_replace_callback('~..~', function ($match) {
+                                       return chr(hexdec($match[0]));
+                               }, $match[1]);
+                       }
                        $return[$field] = array(
                                "field" => $field,
                                "full_type" => $type,
index c441f6c53f3114c7f545cc59fb3ffa59464b2506..f2f52eeaab460758bb60743fde2d4748866dffde 100644 (file)
@@ -1,4 +1,5 @@
 Adminer dev:
+MySQL: Display default values of binary columns
 
 Adminer 5.0.4 (released 2025-03-11):
 Compile: Fix shortening in private methods (regression from 5.0.3)