Skip to content
Snippets Groups Projects
Commit de6fd229 authored by Garvin Hicking's avatar Garvin Hicking Committed by Stefan Bürk
Browse files

[BUGFIX] Fix type cast error in DB Compare for 'default' definition

The change in #97498 introduced a specific handling for ENUM/SET
definitions in MariaDB systems. The check may be performed with a
NULL value instead of a string, which can result in a PHP type
mismatch error.

Due to other refactoring, the issue does not exist in main (v13),
but only affects v12 and v11.

Resolves: #104621
Related: #97498
Releases: 12.4, 11.5
Change-Id: Ia28aae519b1aebcabe9a5f5c620124dfd22edc6a
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/85628


Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarAndreas Kienast <a.fernandez@scripting-base.de>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarAndreas Kienast <a.fernandez@scripting-base.de>
parent f1dd4408
Branches
Tags
No related merge requests found
......@@ -66,7 +66,7 @@ class SchemaColumnDefinitionListener
// Doctrine DBAL retrieves for MariaDB `ENUM()` and `SET()` field default values quotes with single quotes,
// which leads to an endless field change reporting recursion in the database analyzer. The default value
// is now trimmed to ensure a working field compare within `TYPO3\CMS\Core\Database\Schema\Comparator`.
if ($platform instanceof MariaDBPlatform && str_starts_with($default, "'") && str_ends_with($default, "'")) {
if (is_string($default) && $platform instanceof MariaDBPlatform && str_starts_with($default, "'") && str_ends_with($default, "'")) {
$default = trim($default, "'");
}
$options = [
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment