From 19f23fe9eecb88a7636e3c70679787e531cfd841 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sun, 7 Feb 2021 09:17:44 +0100 Subject: [PATCH] MySQL: Don't quote default value of text fields (bug #779) --- adminer/drivers/mysql.inc.php | 2 +- changes.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/adminer/drivers/mysql.inc.php b/adminer/drivers/mysql.inc.php index 942c0dfc..1d792211 100644 --- a/adminer/drivers/mysql.inc.php +++ b/adminer/drivers/mysql.inc.php @@ -547,7 +547,7 @@ if (!defined("DRIVER")) { "type" => $match[1], "length" => $match[2], "unsigned" => ltrim($match[3] . $match[4]), - "default" => ($row["Default"] != "" || preg_match("~char|set~", $match[1]) ? $row["Default"] : null), + "default" => ($row["Default"] != "" || preg_match("~char|set~", $match[1]) ? (preg_match('~text~', $match[1]) ? stripslashes(preg_replace("~^'(.*)'\$~", '\1', $row["Default"])) : $row["Default"]) : null), "null" => ($row["Null"] == "YES"), "auto_increment" => ($row["Extra"] == "auto_increment"), "on_update" => (preg_match('~^on update (.+)~i', $row["Extra"], $match) ? $match[1] : ""), //! available since MySQL 5.1.23 diff --git a/changes.txt b/changes.txt index 3efc970b..b9241bc8 100644 --- a/changes.txt +++ b/changes.txt @@ -4,6 +4,7 @@ Elasticsearch, ClickHouse: Do not print response if HTTP code is not 200 Don't syntax highlight during IME composition (bug #747) MySQL: Do not export names in quotes with sql_mode='ANSI_QUOTES' (bug #749) MySQL: Avoid error in PHP 8 when connecting to socket (PR #409) +MySQL: Don't quote default value of text fields (bug #779) PostgreSQL: Export all FKs after all CREATE TABLE (PR #351) PostgreSQL: Fix dollar-quoted syntax highlighting (bug #738) PostgreSQL: Do not show view definition from other schema (PR #392)