Skip to content

Commit

Permalink
[TASK] Enable corrected test for default value parsing
Browse files Browse the repository at this point in the history
Test covering the SQL file parser has been streamlined
and enriched with #103602, adding a disabled test with
a todo to enable it when the SuT is fixed.

Turns out the parser already handles the case well,
the patch just enables the test.

Resolves: #103605
Related: #103602
Releases: main, 12.4
Change-Id: I4b39dce5265c2504a9dc5f11a70dfe94702d0451
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83746
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Simon Schaufelberger <simonschaufi+typo3@gmail.com>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Simon Schaufelberger <simonschaufi+typo3@gmail.com>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Garvin Hicking <gh@faktor-e.de>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Garvin Hicking <gh@faktor-e.de>
  • Loading branch information
sbuerk committed Apr 11, 2024
1 parent 335c59d commit 8fd5230
Showing 1 changed file with 15 additions and 15 deletions.
Expand Up @@ -335,21 +335,21 @@ public static function canParseColumnDefinitionAttributesDataProvider(): array
'columnFormat' => 'dynamic',
'storage' => null,
],
// @todo Parsing default values with quoted quotes throws a "Error: Expected ... GOT: 'can" exception, but
// should work. Enable dataset along with the bugfix.
//"DEFAULT 'quoted single-quote \' can be parsed'" => [
// 'columnAttribute' => "DEFAULT 'quoted single-quote (\') can be parsed'",
// 'allowNull' => true,
// 'hasDefaultValue' => true,
// 'defaultValue' => "quoted single-quote (') is parsed properly",
// 'autoIncrement' => false,
// 'createIndex' => false,
// 'createUniqueIndex' => false,
// 'isPrimaryKey' => false,
// 'comment' => null,
// 'columnFormat' => null,
// 'storage' => null,
//],
// MySQL and MariaDB way to quote ' for a value string is to use double single-quotes "''" instead of
// using some sort of escape sequences, which is covered by the following testcase.
"DEFAULT 'quoted single-quote '' can be parsed'" => [
'columnAttribute' => "DEFAULT 'quoted single-quote ('') can be parsed'",
'allowNull' => true,
'hasDefaultValue' => true,
'defaultValue' => "quoted single-quote (') can be parsed",
'autoIncrement' => false,
'createIndex' => false,
'createUniqueIndex' => false,
'isPrimaryKey' => false,
'comment' => null,
'columnFormat' => null,
'storage' => null,
],
"DEFAULT 'double-quote (\") can be parsed'" => [
'columnAttribute' => "DEFAULT 'quoted single-quote (\") can be parsed'",
'allowNull' => true,
Expand Down

0 comments on commit 8fd5230

Please sign in to comment.