[TYPO3-core] RFC: Bugfix: #6953: Mapping of fieldnames in SQL-functions like MIN(), MAX() or SUM() does not work

Michael Miousse michael.miousse at infoglobe.ca
Thu Feb 12 15:20:50 CET 2009


This is an SVN patch request.

Type: bugfix

Branches: trunk (revision 4432)

Bugtracker reference: http://bugs.typo3.org/view.php?id=6953

Problem:
If you use SQL-Functions like MIN(), MAX() or SUM() in SQL-Queries the fieldmapping does not work. Example:

SELECT tstamp, script, SUM(exec_time) as calc_sum, count(*) AS qrycount, MAX(errorFlag) as error FROM tx_dbal_debuglog

will produce

SELECT tstamp, script, SUM(exec_time) as calc_sum, count(*) AS qrycount, MAX(errorFlag) as error FROM tx_dbal_debuglog


even if the mapping for the field "errorFlag" would be "errorflag" (with a small f).



This gets problematic if your database supports only lowercase fieldnames and the fieldname has upper-case letters (eg. tx_dbal_debuglog:errorFlag), because the field can not be found, which results in an error message.


Solution:
new condition in class.ux_t3lib_db.php->map_sqlParts() which checks for content in "func_content". If a mapping instruction for "func_content" can be found, the mapping will be processed

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug_6953_trunkrevision_4432.patch
Type: text/x-patch
Size: 1379 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20090212/62b0182f/attachment.bin 


More information about the TYPO3-team-core mailing list