]> git.joonet.de Git - adminer.git/commitdiff
MariaDB: Parse COLLATE in routine definition (fix #1104) master origin/HEAD origin/master
authorJakub Vrana <jakub@vrana.cz>
Thu, 19 Jun 2025 08:03:12 +0000 (10:03 +0200)
committerJakub Vrana <jakub@vrana.cz>
Thu, 19 Jun 2025 08:03:39 +0000 (10:03 +0200)
CHANGELOG.md
adminer/drivers/mysql.inc.php

index dd7bc56a08c1e093d46da3cd57ef12349ea084a2..c8aa54d9ed4594016e3c36e4b646776994de3849 100644 (file)
@@ -5,6 +5,7 @@
 - Add section links in database overview
 - Warn about exceeded max_file_uploads in import
 - MySQL 5.0-: Do not load partitioning info in alter table (bug #1099)
 - Add section links in database overview
 - Warn about exceeded max_file_uploads in import
 - MySQL 5.0-: Do not load partitioning info in alter table (bug #1099)
+- MariaDB: Parse COLLATE in routine definition (bug #1104)
 - PostgreSQL: Show structure of inherited tables
 - PostgreSQL: Display index expressions
 - PostgreSQL: Add SQL operator to select
 - PostgreSQL: Show structure of inherited tables
 - PostgreSQL: Display index expressions
 - PostgreSQL: Add SQL operator to select
index a3ec0c424dc4b7dcb2bb251eae38021f9b2e195c..0f5d850c965e7edd554f7b4a05a234cc5106f534 100644 (file)
@@ -896,7 +896,7 @@ if (!defined('Adminer\DRIVER')) {
                $space = "(?:\\s|/\\*[\s\S]*?\\*/|(?:#|-- )[^\n]*\n?|--\r?\n)";
                $enum = driver()->enumLength;
                $type_pattern = "((" . implode("|", array_merge(array_keys(driver()->types()), $aliases)) . ")\\b(?:\\s*\\(((?:[^'\")]|$enum)++)\\))?"
                $space = "(?:\\s|/\\*[\s\S]*?\\*/|(?:#|-- )[^\n]*\n?|--\r?\n)";
                $enum = driver()->enumLength;
                $type_pattern = "((" . implode("|", array_merge(array_keys(driver()->types()), $aliases)) . ")\\b(?:\\s*\\(((?:[^'\")]|$enum)++)\\))?"
-                       . "\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s,]+)['\"]?)?";
+                       . "\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s,]+)['\"]?)?(?:\\s*COLLATE\\s*['\"]?([^'\"\\s,]+)['\"]?)?"; //! store COLLATE
                $pattern = "$space*(" . ($type == "FUNCTION" ? "" : driver()->inout) . ")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$type_pattern";
                $create = get_val("SHOW CREATE $type " . idf_escape($name), 2);
                preg_match("~\\(((?:$pattern\\s*,?)*)\\)\\s*" . ($type == "FUNCTION" ? "RETURNS\\s+$type_pattern\\s+" : "") . "(.*)~is", $create, $match);
                $pattern = "$space*(" . ($type == "FUNCTION" ? "" : driver()->inout) . ")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$type_pattern";
                $create = get_val("SHOW CREATE $type " . idf_escape($name), 2);
                preg_match("~\\(((?:$pattern\\s*,?)*)\\)\\s*" . ($type == "FUNCTION" ? "RETURNS\\s+$type_pattern\\s+" : "") . "(.*)~is", $create, $match);