Bug #85329

Functional tests are broken on sql_mode STRICT_TRANS_TABLES

Added by Tymoteusz Motylewski over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2018-06-21
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
On Location Sprint

Description

change in:
https://review.typo3.org/#/c/57141/

changed some columns from double to tinytext.
The problem is that mysql doesn't accept default value for text columns.

This in combination with

sql_mode = STRICT_TRANS_TABLES

result in error when you try to run functinal tests.
1) TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Modify\ActionTest::changeParentContentSorting
SQL Error for table "tx_irretutorial_1nff_price": 
An exception occurred while executing 'INSERT INTO `tx_irretutorial_1nff_price` (`uid`, `pid`, `sorting`, `deleted`, `sys_language_uid`, `l18n_parent`, `l18n_diffsource`, `t3ver_wsid`, `t3ver_state`, `t3ver_stage`, `t3ver_oid`, `t3ver_move_id`, `title`, `parentid`, `parenttable`, `parentidentifier`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["7", "89", "1", "0", "0", "0", "", "0", "0", "0", "0", "0", "Price #1.1.1", "5", "tx_irretutorial_1nff_offer", ""]:

Field 'price' doesn't have a default value


Related issues

Related to TYPO3 Core - Task #85178: Align impexp functional export tests between db engines Closed 2018-06-07

Associated revisions

Revision 6a88e81b (diff)
Added by Tymoteusz Motylewski over 1 year ago

[BUGFIX] Make functional tests run with sql_mode STRICT_TRANS_TABLES

The text columns do not support default value.
Let's change the definition of the columns in irre_tutorial to varchar.

Resolves: #85329
Releases: master
Change-Id: Ida0d98b114a78289a5f695d7097c6d067c1e5556
Reviewed-on: https://review.typo3.org/57286
Tested-by: TYPO3com <>
Reviewed-by: Wouter Wolters <>
Reviewed-by: Andreas Fernandez <>
Tested-by: Andreas Fernandez <>
Reviewed-by: Stefan Neufeind <>
Tested-by: Stefan Neufeind <>

History

#1 Updated by Tymoteusz Motylewski over 1 year ago

  • Related to Task #85178: Align impexp functional export tests between db engines added

#2 Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57286

#3 Updated by Tymoteusz Motylewski over 1 year ago

How to test it:
set mysql setting in my.cnf:

sql_mode = ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION


This is the default fro mysql 5.7
run some functional test, like:
typo3DatabaseName='t37_core_test' typo3DatabaseHost='localhost' typo3DatabaseUsername='user' typo3DatabasePassword='password' bin/phpunit -c vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTests.xml typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/ActionTest.php --filter changeParentContentSorting

without a patch you should see an error:

1) TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Modify\ActionTest::changeParentContentSorting
SQL Error for table "tx_irretutorial_1nff_price": 
An exception occurred while executing 'INSERT INTO `tx_irretutorial_1nff_price` (`uid`, `pid`, `sorting`, `deleted`, `sys_language_uid`, `l18n_parent`, `l18n_diffsource`, `t3ver_wsid`, `t3ver_state`, `t3ver_stage`, `t3ver_oid`, `t3ver_move_id`, `title`, `parentid`, `parenttable`, `parentidentifier`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["7", "89", "1", "0", "0", "0", "", "0", "0", "0", "0", "0", "Price #1.1.1", "5", "tx_irretutorial_1nff_offer", ""]:

Field 'price' doesn't have a default value

#4 Updated by Georg Ringer over 1 year ago

  • Sprint Focus set to On Location Sprint

#5 Updated by Tymoteusz Motylewski over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#6 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF