Backport for the Shopware 6.6 line. When the server is MariaDB but only
MySQL 8's mysqldump is installed (e.g. dockware/web), the dump aborted
with "Unknown table 'COLUMN_STATISTICS' in information_schema (1109)".
flowchart LR
A["DumpService"] -- "builds command" --> B["DumpBinaryLocator"]
B -- "runs --version" --> C["MySqlVariant"]
C -- "decides flag" --> D["--column-statistics=0"]
D -- "added to command" --> A
Backport for the Shopware 6.6 line. When the server is MariaDB but only
MySQL 8's mysqldump is installed (e.g. dockware/web), the dump aborted
with "Unknown table 'COLUMN_STATISTICS' in information_schema (1109)".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The newest shopware/core in ~6.6.0 is 6.6.10.31, but shopware/production
is only tagged up to 6.6.10.30, so create-project failed. Install the newest
template inside the constraint and require the resolved core version on top.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
haylan
scheduled this pull request to auto merge when all checks succeed 2026-11-02 22:37:33 +00:00
haylan
merged commit 00d959e661 into main2026-11-02 22:39:42 +00:00
The flag is added for any MySQL client major version >= 8, but --column-statistics=0 is only available from MySQL 8.0.13 onward. On a MariaDB server with a MySQL 8.0.0-8.0.12 client, mysqldump may reject the unknown option and the dump will fail. Consider requiring 8.0.13+ or checking the full version.
## PR Reviewer Guide 🔍
<!-- pr-agent:review:full -->
Here are some key observations to aid the review process:
<table>
<tr><td>⏱️ <strong>Estimated effort to review</strong>: 2 🔵🔵⚪⚪⚪</td></tr>
<tr><td>🧪 <strong>PR contains tests</strong></td></tr>
<tr><td>🔒 <strong>No security concerns identified</strong></td></tr>
<tr><td>⚡ <strong>Recommended focus areas for review</strong><br><br>
<details><summary><a href='https://git.arthurerlich.de/haylan/AeonDumpManager/src/branch/fix/0.0.7-column-statistics/src/Service/MySqlVariant.php#L28-L29'><strong>Possible Issue</strong></a>
The flag is added for any MySQL client major version >= 8, but --column-statistics=0 is only available from MySQL 8.0.13 onward. On a MariaDB server with a MySQL 8.0.0-8.0.12 client, mysqldump may reject the unknown option and the dump will fail. Consider requiring 8.0.13+ or checking the full version.
</summary>
```php
&& (preg_match('/Distrib (\d+)\./', $clientVersion, $m) === 1 || preg_match('/\bVer (\d+)\./', $clientVersion, $m) === 1)
&& (int) $m[1] >= 8;
```
</details>
</td></tr>
</table>
The --column-statistics=0 option is only available from MySQL 8.0.11 onward, so a major-version check can pass it to earlier 8.0 clients. Parse the full client version and compare against 8.0.11 before enabling the flag. Also avoid treating a bare Ver 10.x protocol string as a release version.
- return $serverIsMariaDb
- && !self::isMariaDb($clientVersion)
- // MySQL < 8 prints "Ver 10.13 Distrib 5.7.x": the Distrib number is the real version.
- && (preg_match('/Distrib (\d+)\./', $clientVersion, $m) === 1 || preg_match('/\bVer (\d+)\./', $clientVersion, $m) === 1)
- && (int) $m[1] >= 8;
+ if (! $serverIsMariaDb || self::isMariaDb($clientVersion)) {
+ return false;
+ }
+ $version = null;
+ $hasDistrib = preg_match('/Distrib\s+(\d+(?:\.\d+){1,2})/', $clientVersion, $m) === 1;
+ if ($hasDistrib) {
+ $version = $m[1];
+ } elseif (preg_match('/\bVer\s+(\d+(?:\.\d+){1,2})/', $clientVersion, $m) === 1) {
+ $version = $m[1];
+ }
+
+ if ($version === null) {
+ return false;
+ }
+
+ // Without "Distrib", "Ver 10.x" is the client protocol version, not a MySQL release.
+ if (! $hasDistrib && (int) explode('.', $version)[0] >= 10) {
+ return false;
+ }
+
+ while (substr_count($version, '.') < 2) {
+ $version .= '.0';
+ }
+
+ return version_compare($version, '8.0.11', '>=');
+
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly tightens the check to 8.0.11, avoiding an unsupported --column-statistics=0 on early MySQL 8 clients, and the improved parsing handles Distrib and protocol Ver strings. It is a meaningful correctness improvement, though it mainly affects older 8.0 clients.
Medium
## PR Code Suggestions ✨
<!-- pr-agent:improve:summary -->
<!-- 6b7ba3b -->
Explore these optional code suggestions:
<table><thead><tr><td><strong>Category</strong></td><td align=left><strong>Suggestion </strong></td><td align=center><strong>Impact</strong></td></tr><tbody><tr><td rowspan=1>Possible issue</td>
<td>
<details><summary>Require MySQL 8.0.11 or newer</summary>
___
**The <code>--column-statistics=0</code> option is only available from MySQL 8.0.11 onward, so a <br>major-version check can pass it to earlier 8.0 clients. Parse the full client <br>version and compare against <code>8.0.11</code> before enabling the flag. Also avoid treating a <br>bare <code>Ver 10.x</code> protocol string as a release version.**
[src/Service/MySqlVariant.php [25-29]](https://git.arthurerlich.de/haylan/AeonDumpManager/src/branch/fix/0.0.7-column-statistics/src/Service/MySqlVariant.php#L25-L29)
```diff
- return $serverIsMariaDb
- && !self::isMariaDb($clientVersion)
- // MySQL < 8 prints "Ver 10.13 Distrib 5.7.x": the Distrib number is the real version.
- && (preg_match('/Distrib (\d+)\./', $clientVersion, $m) === 1 || preg_match('/\bVer (\d+)\./', $clientVersion, $m) === 1)
- && (int) $m[1] >= 8;
+ if (! $serverIsMariaDb || self::isMariaDb($clientVersion)) {
+ return false;
+ }
+ $version = null;
+ $hasDistrib = preg_match('/Distrib\s+(\d+(?:\.\d+){1,2})/', $clientVersion, $m) === 1;
+ if ($hasDistrib) {
+ $version = $m[1];
+ } elseif (preg_match('/\bVer\s+(\d+(?:\.\d+){1,2})/', $clientVersion, $m) === 1) {
+ $version = $m[1];
+ }
+
+ if ($version === null) {
+ return false;
+ }
+
+ // Without "Distrib", "Ver 10.x" is the client protocol version, not a MySQL release.
+ if (! $hasDistrib && (int) explode('.', $version)[0] >= 10) {
+ return false;
+ }
+
+ while (substr_count($version, '.') < 2) {
+ $version .= '.0';
+ }
+
+ return version_compare($version, '8.0.11', '>=');
+
```
<details><summary>Suggestion importance[1-10]: 7</summary>
__
Why: The suggestion correctly tightens the check to `8.0.11`, avoiding an unsupported `--column-statistics=0` on early MySQL 8 clients, and the improved parsing handles `Distrib` and protocol `Ver` strings. It is a meaningful correctness improvement, though it mainly affects older 8.0 clients.
</details></details></td><td align=center>Medium
</td></tr></tr></tbody></table>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
User description
Backport for the Shopware 6.6 line. When the server is MariaDB but only
MySQL 8's mysqldump is installed (e.g. dockware/web), the dump aborted
with "Unknown table 'COLUMN_STATISTICS' in information_schema (1109)".
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
PR Type
Bug fix, Tests
Description
Add
--column-statistics=0for MySQL 8 clients.Detect MariaDB server and MySQL client version.
Apply flag only when needed.
Add tests and release
0.0.7.Diagram Walkthrough
File Walkthrough
DumpBinaryLocator.php
Add binary-specific dump flags for clientssrc/Service/DumpBinaryLocator.php
extraArguments()to inspect binary version.--column-statistics=0when needed.Processto run--version.DumpService.php
Include extra dump flags in commandsrc/Service/DumpService.php
extraArguments()into dump command.MySqlVariant.php
Detect MySQL 8 client compatibilitysrc/Service/MySqlVariant.php
needsColumnStatisticsOff()helper.DistriborVerversion numbers.MySqlVariantTest.php
Add column statistics flag teststests/Service/MySqlVariantTest.php
needsColumnStatisticsOff().CHANGELOG.md
Document version 0.0.7 dump fixCHANGELOG.md
0.0.7release entry.COLUMN_STATISTICSdump fix.composer.json
Bump plugin version to 0.0.7composer.json
0.0.6to0.0.7.PR Reviewer Guide 🔍
Here are some key observations to aid the review process:
Possible Issue
The flag is added for any MySQL client major version >= 8, but --column-statistics=0 is only available from MySQL 8.0.13 onward. On a MariaDB server with a MySQL 8.0.0-8.0.12 client, mysqldump may reject the unknown option and the dump will fail. Consider requiring 8.0.13+ or checking the full version.
PR Code Suggestions ✨
Explore these optional code suggestions:
Require MySQL 8.0.11 or newer
The
--column-statistics=0option is only available from MySQL 8.0.11 onward, so amajor-version check can pass it to earlier 8.0 clients. Parse the full client
version and compare against
8.0.11before enabling the flag. Also avoid treating abare
Ver 10.xprotocol string as a release version.src/Service/MySqlVariant.php [25-29]
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly tightens the check to
8.0.11, avoiding an unsupported--column-statistics=0on early MySQL 8 clients, and the improved parsing handlesDistriband protocolVerstrings. It is a meaningful correctness improvement, though it mainly affects older 8.0 clients.