You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[BUGFIX] Ensure correct default value normalization
Default value support for TEXT, JSON and BLOB fields
has been added with #103578 by implementing the use
of default value expression for MySQL. That required
to add custom normalization on data schema reads to
be comparable.
MySQL requires to use a single-quote to quote a single
quote in a value string, and due to the expression way
this needs to be properly decoded now in two steps:
Revert escape sequences in the retrieved default value
Unquote the unescaped retrieved default value
JSON field defaults shows a similar issue for double
quotes in the json value and can be fixed in the same
way.
Added test revealed, that Doctrine DBAL has an issue
with double single-quotes for PostgreSQL too. To fix
this the issue has been reported [1] and a pull-request
provided [2].
This change ensure correct unescaping and unquoting of
the retrieved column default value for TEXT, JSON and
BLOB column types for MySQL connections, enriched with
further tests.
The extended PostreSQLSchemaManager now clones method _getPortableTableColumnDefinition() to incorporate
the bugfix directly until a fixed Doctrine DBAL version
has been released.
@@ -43,6 +43,21 @@ Example
]
);
+Advanced example with value quoting+-----------------------------------++.. code-block:: sql+ :caption: EXT:my_extension/ext_tables.sql++ CREATE TABLE a_textfield_test_table+ (+ # JSON object default value containting single quote in json field+ field1 JSON NOT NULL DEFAULT '{"key1": "value1", "key2": 123, "key3": "value with a '' single quote"}',++ # JSON object default value containing double-quote in json field+ field2 JSON NOT NULL DEFAULT '{"key1": "value1", "key2": 123, "key3": "value with a \" double quote"}',+ );+
Impact
======
The text was updated successfully, but these errors were encountered:
ℹ️ View this commit on Github
👥 Authored by Stefan Bürk stefan@buerk.tech
✔️ Merged by Stefan Bürk stefan@buerk.tech
Commit message
[BUGFIX] Ensure correct default value normalization
Default value support for TEXT, JSON and BLOB fields
has been added with #103578 by implementing the use
of default value expression for MySQL. That required
to add custom normalization on data schema reads to
be comparable.
MySQL requires to use a single-quote to quote a single
quote in a value string, and due to the expression way
this needs to be properly decoded now in two steps:
JSON field defaults shows a similar issue for double
quotes in the json value and can be fixed in the same
way.
Added test revealed, that Doctrine DBAL has an issue
with double single-quotes for PostgreSQL too. To fix
this the issue has been reported [1] and a pull-request
provided [2].
This change ensure correct unescaping and unquoting of
the retrieved column default value for TEXT, JSON and
BLOB column types for MySQL connections, enriched with
further tests.
The extended PostreSQLSchemaManager now clones method
_getPortableTableColumnDefinition()
to incorporatethe bugfix directly until a fixed Doctrine DBAL version
has been released.
[1] doctrine/dbal#6357
[2] doctrine/dbal#6358
Resolves: #103610
Related: #103578
Releases: main
Change-Id: Icb39cdb8c87ae7907f84e5c38adcde4ef545ed1b
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83745
Tested-by: Stefan Bürk stefan@buerk.tech
Tested-by: Garvin Hicking gh@faktor-e.de
Reviewed-by: Christian Kuhn lolli@schwarzbu.ch
Reviewed-by: Stefan Bürk stefan@buerk.tech
Reviewed-by: Garvin Hicking gh@faktor-e.de
Tested-by: core-ci typo3@b13.com
Tested-by: Christian Kuhn lolli@schwarzbu.ch
➗ Modified files
13.1/Feature-103578-AddDatabaseDefaultValueSupportForTEXTBLOBAndJSONFieldTypes.rst
The text was updated successfully, but these errors were encountered: