David Everly wrote:
I have been using Emilda with full debugging (level 5), and have noticed
some issues with the non-sub-select work-around. Essentially, when no
rows are in the artificial sub-select, a debug message indicates that a
non-valid mysql resource was used in mysql_num_rows().
I've read at http://us4.php.net/mysql_query that "Only for
SELECT,SHOW,EXPLAIN or DESCRIBE statements mysql_query() returns a
resource identifier or FALSE if the query was not executed correctly."
Thus, it is sometimes expected that these artificial sub-selects will
return FALSE, indicating that no rows are found. Adding the extra check
for '$res != FALSE' appears to eliminate the message, while seeming to
function properly in my environment.
In this patch is also one instance where the artificial sub-select should
have been used but was not, and also a few "isset" additions that were
noticed.
Patched and committed.
Thanks for noticing the issue. The sub-select workaround is a new
feature and I haven't noticed the message myself yet.
We are aware that some places use less than appropriate mysql error
checking and are grateful for the fixes. It's the kind of stuff that
tends to stay unfixed for some time as more critical bugs get the focus.
In the future, I think we should keep these discussions on the
emilda-devel mailing list, as this list is primarily for Emilda users
and this clearly is a development discussion. ;)
--
Mattias Nordstrom
Partner, Systems Design
Realnode Ltd
nordstrom@xxxxxxxxxxxx
www.realnode.com
|