1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-22 14:12:51 +02:00

MySQL: Allow setting default values of json column

This commit is contained in:
Jakub Vrana
2025-03-12 14:25:19 +01:00
parent 434a8f7705
commit 3b1189cd3c
4 changed files with 4 additions and 3 deletions

View File

@@ -603,7 +603,7 @@ if (!defined('Adminer\DRIVER')) {
preg_match('~^([^( ]+)(?:\((.+)\))?( unsigned)?( zerofill)?$~', $type, $match_type);
$default = $row["COLUMN_DEFAULT"];
if ($default != "") {
$is_text = preg_match('~text~', $match_type[1]);
$is_text = preg_match('~text|json~', $match_type[1]);
if (!$maria && $is_text) {
// default value a'b of text column is stored as _utf8mb4\'a\\\'b\' in MySQL
$default = preg_replace("~^(_\w+)?('.*')$~", '\2', stripslashes($default));