[BUGFIX] mssql: Proper types inserting / updating rows 52/53152/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Mon, 22 May 2017 13:39:09 +0000 (15:39 +0200)
committerFrank Naegler <frank.naegler@typo3.org>
Wed, 7 Jun 2017 13:00:39 +0000 (15:00 +0200)
commita116b0bc8707148f0c06bbd8e974e5d1b976fc57
treea47733cf0969d8dc51a796c7bafb07d1965a2558
parent2259d79dcfeb26dafdc6dd058397ad85cb74d29d
[BUGFIX] mssql: Proper types inserting / updating rows

MS SQL server is more picky about types than postgres and
mysql. This is especially true for LOB columns - even empty
strings need a proper cast and specific handling.

Various parts of the core deal with arbitrary tables and
don't know if a column is int, text or lob, or whatever.
Those are blindly updated / inserted, resulting in mssql
saying "no".

Solution is to fetch column schema and to set proper types
based on that schema. This is expensive. We will have to
refactor that again, and we will probably end up with a
(cache?) entry that knows the entire table schema of an
instance.

Solving that in a good way would also fix various mysql strict
issues we still have in the core. However, this needs more work.

Goal of the current patch is to bring mssql to a working state.
The solution must be seen as hacky, but is restricted to that
platform only and can be relaxed and improved as soon as we
take the next steps with schema handling in the TYPO3 core.

Change-Id: I9b582a9bde7461cfbcc2414192518fb7b7b1341d
Resolves: #81498
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/53152
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/core/Classes/DataHandling/DataHandler.php
typo3/sysext/core/Classes/Resource/Index/MetaDataRepository.php
typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/AbstractActionTestCase.php
typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php
typo3/sysext/version/Classes/Hook/DataHandlerHook.php