]> git.joonet.de Git - adminer.git/commitdiff
MySQL: Don't quote default value of text fields (bug #779)
authorJakub Vrana <jakub@vrana.cz>
Sun, 7 Feb 2021 08:17:44 +0000 (09:17 +0100)
committerJakub Vrana <jakub@vrana.cz>
Sun, 7 Feb 2021 08:31:31 +0000 (09:31 +0100)
adminer/drivers/mysql.inc.php
changes.txt

index 942c0dfc82ad31022550e540e51b26796999e5dd..1d7922114bcabb76291c977ab73a8fe1abe624f6 100644 (file)
@@ -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
index 3efc970bb91c804ef20111bccffbb0518ffafa21..b9241bc8a51ffed8b44bdf80365b3e4d80ad9499 100644 (file)
@@ -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)