[TYPO3-core] Fix for "debug_check_recordset" in t3lib_db

Dmitry Dulepov [typo3] dmitry at typo3.org
Fri Sep 7 09:59:34 CEST 2007


Martin Kutschker wrote:
> Not checking a fuction result is an error... well, slopppy proggramming 
> style.

There is no point to check error inside t3lib_db::sql_fetch_assoc(). It 
is caller's responsibility! Just the same way as there is no point 
aborting application inside PHP's mysql_fetch_assoc() if something 
failed. Such functions cannot take decisions, they can only log them. 
They are not at the point of decision taking.

> Anyway, we could use trigger_error() in that case. Maybe enabled with a 
> config var setting.

No need. mysql_fetch_assoc does this and you will see it if 
error_reporting is enabled. But if it is disabled, your trigger_error 
will not be visible anyway. Existing solution works even if 
error_reporting is disabled.

-- 
Dmitry Dulepov
TYPO3 freelancer / TYPO3 core team member
Web: http://typo3bloke.net/
Skype: callto:liels_bugs


More information about the TYPO3-team-core mailing list