[TYPO3-core] RFC: Bug #7015: t3lib_DB displays wrong SQL in error case
Christian Kuhn
lolli at schwarzbu.ch
Sat May 15 13:59:46 CEST 2010
Hey.
CC to Xavier as he should probably take a look, too.
Lars Houmark wrote:
> Okay, so I tested this one and from reading the notes in the bug
> tracker, it seems that Martin wanted to actually display the query that
> had empty fields, to give the best information.
>
> Testing the patch you provided, seems not to do that, so I guess you
> think it should just should show "Query was empty" or?
>
> I agree with Martin, and would personally like to see the query in the
> lastBuiltQuery, since this gives the most debug information to work from.
Thats my feeling, too. Attached patch:
- Do not return FALSE if field list is empty, but return the (wrong)
query instead. FALSE / NULL was imho a stupid idea in the first place. I
checked the core and did not find any code where this method signature
change might lead to problems, UPDATEquery is wrapped by
exec_UPDATEquery most of the time anyway, which until now leaded to the
'empty query' message for an empty field list.
- Always write the built query to debug_lastBuiltQuery, even if it's wrong.
This way we always get the correct failing query in debug output,
together with an appropriate mysql error message.
Regards
Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 7015_v2.diff
Type: text/x-patch
Size: 1828 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100515/543c4e39/attachment.bin>
More information about the TYPO3-team-core
mailing list