From 2973a65638a4f7040091ed9c719104fc7668e831 Mon Sep 17 00:00:00 2001 From: Nicolai Ehrhardt <245527909+predictor2718@users.noreply.github.com> Date: Sat, 11 Apr 2026 11:08:21 +0200 Subject: [PATCH 1/5] Fix #19939 - Use TEXT instead of VARCHAR when CSV column exceeds max length Signed-off-by: Nicolai Ehrhardt <245527909+predictor2718@users.noreply.github.com> --- libraries/classes/Import.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/libraries/classes/Import.php b/libraries/classes/Import.php index 143a9906d5..b647a544db 100644 --- a/libraries/classes/Import.php +++ b/libraries/classes/Import.php @@ -1098,9 +1098,19 @@ class Import $size = 10; } + $colType = $typeArray[$analyses[$i][self::TYPES][$j]]; + + // Use TEXT instead of VARCHAR when the length exceeds + // the maximum allowed for VARCHAR. The limit depends on + // the charset (e.g. 16383 for utf8mb4, 65535 for latin1). + // We use the most restrictive limit (utf8mb4) to be safe. + if ($colType === 'varchar' && (int) $size > 16383) { + $colType = 'text'; + } + $tempSQLStr .= Util::backquote($tables[$i][self::COL_NAMES][$j]) . ' ' - . $typeArray[$analyses[$i][self::TYPES][$j]]; - if ($analyses[$i][self::TYPES][$j] != self::GEOMETRY) { + . $colType; + if ($colType !== 'text' && $analyses[$i][self::TYPES][$j] != self::GEOMETRY) { $tempSQLStr .= '(' . $size . ')'; } From a012644b37a5c138aae6a8776adfa99c1e151a3b Mon Sep 17 00:00:00 2001 From: Nicolai Ehrhardt <245527909+predictor2718@users.noreply.github.com> Date: Sat, 11 Apr 2026 11:20:06 +0200 Subject: [PATCH 2/5] Update PHPStan baseline for Import.php Signed-off-by: Nicolai Ehrhardt <245527909+predictor2718@users.noreply.github.com> --- phpstan-baseline.neon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 1799919405..64fc5e9016 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -20242,7 +20242,7 @@ parameters: - message: "#^Cannot cast mixed to int\\.$#" - count: 3 + count: 4 path: libraries/classes/Import.php - From 912c25822c66068342a36dbc3498d15cea3ec521 Mon Sep 17 00:00:00 2001 From: Nicolai Ehrhardt <245527909+predictor2718@users.noreply.github.com> Date: Sat, 11 Apr 2026 11:38:50 +0200 Subject: [PATCH 3/5] Fix #19084 - Skip CREATE DATABASE when exporting data only Signed-off-by: Nicolai Ehrhardt <245527909+predictor2718@users.noreply.github.com> --- .../classes/Plugins/Export/ExportSql.php | 5 ++++ test/classes/Plugins/Export/ExportSqlTest.php | 25 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/libraries/classes/Plugins/Export/ExportSql.php b/libraries/classes/Plugins/Export/ExportSql.php index a4417c41ab..bf756b11ee 100644 --- a/libraries/classes/Plugins/Export/ExportSql.php +++ b/libraries/classes/Plugins/Export/ExportSql.php @@ -879,6 +879,11 @@ class ExportSql extends ExportPlugin return true; } + // Skip CREATE DATABASE when only exporting data + if (! $exportStructure) { + return $this->exportUseStatement($dbAlias, $compat); + } + $createQuery = 'CREATE DATABASE IF NOT EXISTS ' . Util::backquoteCompat($dbAlias, $compat, isset($GLOBALS['sql_backquotes'])); $collation = $dbi->getDbCollation($db); diff --git a/test/classes/Plugins/Export/ExportSqlTest.php b/test/classes/Plugins/Export/ExportSqlTest.php index 9cb24d392b..5d26114bea 100644 --- a/test/classes/Plugins/Export/ExportSqlTest.php +++ b/test/classes/Plugins/Export/ExportSqlTest.php @@ -471,6 +471,31 @@ class ExportSqlTest extends AbstractTestCase self::assertStringContainsString('USE db;', $result); } + public function testExportDBCreateDataOnly(): void + { + $GLOBALS['sql_compatibility'] = 'NONE'; + $GLOBALS['sql_backquotes'] = true; + $GLOBALS['sql_create_database'] = true; + $GLOBALS['sql_structure_or_data'] = 'data'; + $GLOBALS['crlf'] = "\n"; + + $dbi = $this->getMockBuilder(DatabaseInterface::class) + ->disableOriginalConstructor() + ->getMock(); + $dbi->expects($this->any())->method('escapeString') + ->will($this->returnArgument(0)); + + $GLOBALS['dbi'] = $dbi; + + ob_start(); + self::assertTrue($this->object->exportDBCreate('db', 'server')); + $result = ob_get_clean(); + + self::assertIsString($result); + self::assertStringNotContainsString('CREATE DATABASE', $result); + self::assertStringContainsString('USE `db`;', $result); + } + public function testExportDBHeader(): void { $GLOBALS['sql_compatibility'] = 'MSSQL'; From 9b8719f22414a252d000cc6e16a3d1fdc197c5cb Mon Sep 17 00:00:00 2001 From: Nicolai Ehrhardt <245527909+predictor2718@users.noreply.github.com> Date: Sat, 11 Apr 2026 11:54:34 +0200 Subject: [PATCH 4/5] Update PHPStan baseline for ExportSql changes Signed-off-by: Nicolai Ehrhardt <245527909+predictor2718@users.noreply.github.com> --- phpstan-baseline.neon | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 1799919405..11aa67b363 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -27002,7 +27002,7 @@ parameters: - message: "#^Parameter \\#2 \\$compat of method PhpMyAdmin\\\\Plugins\\\\Export\\\\ExportSql\\:\\:exportUseStatement\\(\\) expects string, mixed given\\.$#" - count: 2 + count: 3 path: libraries/classes/Plugins/Export/ExportSql.php - @@ -46512,7 +46512,7 @@ parameters: - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 25 + count: 26 path: test/classes/Plugins/Export/ExportSqlTest.php - @@ -46532,7 +46532,7 @@ parameters: - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnArgument\\(\\)\\.$#" - count: 15 + count: 16 path: test/classes/Plugins/Export/ExportSqlTest.php - From d99d340e2b424836f49daead34e5338e292a02bb Mon Sep 17 00:00:00 2001 From: kjo-sdds Date: Thu, 23 Apr 2026 10:59:43 +0200 Subject: [PATCH 5/5] Translated using Weblate (French) Currently translated at 99.9% (3434 of 3435 strings) [ci skip] Translation: phpMyAdmin/5.2 Translate-URL: https://hosted.weblate.org/projects/phpmyadmin/5-2/fr/ Signed-off-by: kjo-sdds --- po/fr.po | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/po/fr.po b/po/fr.po index 798390e8e2..b757b13572 100644 --- a/po/fr.po +++ b/po/fr.po @@ -4,16 +4,16 @@ msgstr "" "Project-Id-Version: phpMyAdmin-docs 4.0.0-dev\n" "Report-Msgid-Bugs-To: translators@phpmyadmin.net\n" "POT-Creation-Date: 2026-02-25 10:35-0300\n" -"PO-Revision-Date: 2026-01-01 18:01+0000\n" -"Last-Translator: tmtisfree \n" -"Language-Team: French \n" +"PO-Revision-Date: 2026-04-24 09:09+0000\n" +"Last-Translator: kjo-sdds \n" +"Language-Team: French \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 5.15.1\n" +"X-Generator: Weblate 5.17.1-dev\n" #: libraries/advisory_rules_generic.php:9 msgid "Uptime below one day" @@ -1013,7 +1013,7 @@ msgstr "" "le serveur, enlever les journaux InnoDB, placer la nouvelle valeur dans " "my.cnf, démarrer le serveur, puis vérifier les journaux d'erreurs. Voir " "aussi cet article de blogue." +"increase-innodblogfilesize-proper-way.html\">cet article de blogue" #: libraries/advisory_rules_generic.php:626 #: libraries/advisory_rules_generic.php:653 @@ -1054,7 +1054,7 @@ msgstr "" "les journaux InnoDB, placer la nouvelle valeur dans my.cnf, démarrer le " "serveur, puis vérifier les journaux d'erreurs. Voir aussi cet article de blogue." +"proper-way.html\">cet article de blogue" #: libraries/advisory_rules_generic.php:676 #, php-format @@ -5423,34 +5423,27 @@ msgstr "" "Veuillez consulter la [doc@cfg_blowfish_secret]documentation[/doc]." #: libraries/classes/Controllers/HomeController.php:363 -#, fuzzy -#| msgid "" -#| "The configuration file needs a valid key for cookie encryption. A " -#| "temporary key was automatically generated for you. Please refer to the " -#| "[doc@cfg_blowfish_secret]documentation[/doc]." msgid "" "The configuration file needs a valid key for query encryption. A temporary " "key was automatically generated for you. Please refer to the " "[doc@cfg_URLQueryEncryptionSecretKey]documentation[/doc]." msgstr "" -"Le fichier de configuration a besoin d'une clé valide pour le chiffrement " -"des cookies. Une clé temporaire a été générée automatiquement pour vous. " -"Veuillez vous référer à la [doc@cfg_blowfish_secret]documentation[/doc]." +"Le fichier de configuration a besoin d'une clé valide pour le chiffrement de " +"requêtes. Une clé temporaire a été générée automatiquement pour vous. " +"Veuillez vous référer à la " +"[doc@cfg_URLQueryEncryptionSecretKey]documentation[/doc]." #: libraries/classes/Controllers/HomeController.php:373 -#, fuzzy, php-format -#| msgid "" -#| "The cookie encryption key in the configuration file is longer than " -#| "necessary. It should only be %d bytes long. Please refer to the " -#| "[doc@cfg_blowfish_secret]documentation[/doc]." +#, php-format msgid "" "The query encryption key in the configuration file is longer than necessary. " "It should only be %d bytes long. Please refer to the " "[doc@cfg_URLQueryEncryptionSecretKey]documentation[/doc]." msgstr "" -"La clé de chiffrement des cookies dans le fichier de configuration est plus " +"La clé de chiffrement de requêtes dans le fichier de configuration est plus " "longue que nécessaire. Elle ne devrait avoir qu'une longueur de %d octets. " -"Veuillez consulter la [doc@cfg_blowfish_secret]documentation[/doc]." +"Veuillez consulter la [doc@cfg_URLQueryEncryptionSecretKey]documentation[/" +"doc]." #: libraries/classes/Controllers/HomeController.php:391 msgid "" @@ -5537,7 +5530,7 @@ msgstr "" #: libraries/classes/Controllers/Import/ImportController.php:324 msgid "Sorry an unexpected error happened!" -msgstr "" +msgstr "Désolé, une erreur inattendue s'est produite !" #: libraries/classes/Controllers/Import/ImportController.php:372 #: libraries/classes/Controllers/Import/ImportController.php:610 @@ -7699,6 +7692,8 @@ msgid "" "The fullscreen request was denied because the Fullscreen API is disabled by " "user preference in the browser." msgstr "" +"La requête de plein écran a été rejetée car l'API Plein écran est désactivée " +"par l'utilisateur dans les préférences du navigateur." #: libraries/classes/Controllers/NavigationController.php:46 msgid "Fatal error: The navigation can only be accessed via AJAX" @@ -13497,6 +13492,8 @@ msgid "" "Stores vector data optimized for operations such as similarity search and " "machine learning applications" msgstr "" +"Stocke des données vectorielles optimisées pour des opérations telles que " +"des recherches de similarités et des applications de machine learning" #: libraries/classes/Types.php:798 msgctxt "numeric types"