[wp-trac] [WordPress Trac] #20838: Don't populate $col_info in production
WordPress Trac
wp-trac at lists.automattic.com
Wed Aug 8 07:03:00 UTC 2012
#20838: Don't populate $col_info in production
-------------------------+---------------------
Reporter: GrahamKelly | Owner: nacin
Type: enhancement | Status: closed
Priority: normal | Milestone: 3.5
Component: Database | Version: 3.3.2
Severity: normal | Resolution: fixed
Keywords: has-patch |
-------------------------+---------------------
Changes (by josephscott):
* cc: joseph@… (added)
Comment:
The committed code - r21472 - includes error suppression:
{{{
@mysql_free_result( $this->result );
}}}
The PHP docs for [http://us2.php.net/mysql_free_result mysql_free_result]
indicate that this is a problem only when a non-resource is provided:
If a non-resource is used for the result, an error of level E_WARNING
will be emitted. It's worth noting that mysql_query() only returns a
resource for SELECT, SHOW, EXPLAIN, and DESCRIBE queries.
Can we get a way with not having the @ with something like:
{{{
if ( is_resource( $this->result ) ) {
mysql_free_result( $this->result );
}
}}}
?
It would be worth while to avoid the use of @ when ever possible.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20838#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list