[TYPO3-core] Fix for "debug_check_recordset" in t3lib_db
Dmitry Dulepov [typo3]
dmitry at typo3.org
Thu Sep 6 10:11:31 CEST 2007
Hi!
While I like the patch, I have two questions :)
Bernhard Kraft wrote:
> Even if the variable contains for example a numeric "1" the check would
> not fail and
> would give a mysql-error afterwards.
Can it really happen that $res is not a resource or null or false?
mysql_fetch_xxx returns only those three I think. Or you want to extend
it generally, for custom extensions?
> Additionaly the query which failed isn't logged to devLog - which would
> (in my opinion)
> be another good feature helping debug.
Yes!
> Solution:
> Use the PHP function "is_resource" to check wheter the given $res
> variable is a valid PHP
> resource variable. Then use the PHP function "get_resource_type" to
> check wheter the variable
> contains a valid "mysql result" resource-var.
This may impact dbal. I am not sure if dbal uses this function in any
way (it should) but we may want to think how to ensure that dbal also
works with this modified version.
> PS: At least a patch/bugfix from me again :)
Welcome back ;) Always noice to see you :)
--
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