Bug #68564

Epic #68397: Make TYPO3 work with MySQL strict mode

Data too long for column 'NEWid' at row 1

Added by Morton Jonuschat 7 days ago. Updated 7 days ago.

Status:Resolved Start date:2015-07-27
Priority:Should have Due date:
Assigned To:Morton Jonuschat % Done:

100%

Category:Database API Spent time: -
Target version:7 LTS
TYPO3 Version:7 Is Regression:No
PHP Version:5.6 Sprint Focus:
Complexity:

Description

Inserting records into sys_log fails with the following error:

array(4 items)
   caller => "TYPO3\CMS\Core\Database\DatabaseConnection::exec_INSERTquery" (60 chars)
   ERROR => "Data too long for column 'NEWid' at row 1" (41 chars)
   lastBuiltQuery => "INSERT INTO sys_log (userid,type,action,error,details_nr,details,log_data,ta
      blename,recuid,IP,tstamp,event_pid,NEWid,workspace) VALUES ('1','1','1','0',
      '10','Record \'%s\' (%s) was inserted on page \'%s\' (%s)','a:4:{i:0;s:4:\"T
      est\";i:1;s:16:\"backend_layout:1\";i:2;s:4:\"Root\";i:3;s:1:\"1\";}','backe
      nd_layout','1','::1','1438021446','1','NEW55b677382adb74.33276945','0')" (375 chars)

Associated revisions

Revision 73ed7fd7
Added by Morton Jonuschat 7 days ago

[BUGFIX] Logging: Make sys_log NEWid column larger

Update the table definition for the sys_log table to store the whole
NEWid value from TCEMAIN. NEWid typically is 'NEW' with a uniqid of 23
characters appended, so 20 characters is not enough to store the whole
id. For MySQL not running in strict mode this fixes silent truncation
of the data, with strict mode it fixes a "data too long for column"
error.

Resolves: #68564
Releases: master
Change-Id: Id89bc9c5759974379da20f6af8b945e5f4fbefc6
Reviewed-on: http://review.typo3.org/41996
Reviewed-by: Wouter Wolters <>
Tested-by: Wouter Wolters <>
Reviewed-by: Daniel Goerz <>
Reviewed-by: Tomas Norre Mikkelsen <>
Tested-by: Tomas Norre Mikkelsen <>
Reviewed-by: Georg Ringer <>
Tested-by: Georg Ringer <>

History

#1 Updated by Morton Jonuschat 7 days ago

  • Status changed from New to In Progress

On MySQL without strict mode silent data truncation is happening, instead of NEW55b677382adb74.33276945 the value being stored is NEW55b677382adb74.33

#2 Updated by Gerrit Code Review 7 days ago

  • Status changed from In Progress 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 http://review.typo3.org/41996

#3 Updated by Morton Jonuschat 7 days ago

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

Also available in: Atom PDF