Skip to content

Commit

Permalink
Remove notices on mysql query failures
Browse files Browse the repository at this point in the history
Zend only has this sort of behavior when mysql.trace_mode is
enabled, but it's off by default. Since the mysql library is deprecated
and people should be using mysqli, it makes sense to emulate mysqli's
behavior here and not warn at all rather than trying to implement
mysql.trace_mode.

Closes #1140

Reviewed By: @markw65

Differential Revision: D1000998

Pulled By: @scannell
  • Loading branch information
Chad Horohoe authored and sgolemon committed Oct 10, 2013
1 parent bc16425 commit 02cfa05
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hphp/runtime/ext/ext_mysql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1021,8 +1021,10 @@ static Variant php_mysql_do_query_general(const String& query, CVarRef link_id,
}

if (mysql_real_query(conn, query.data(), query.size())) {
#ifdef HHVM_MYSQL_TRACE_MODE
raise_notice("runtime/ext_mysql: failed executing [%s] [%s]", query.data(),
mysql_error(conn));
#endif

// When we are timed out, and we're SELECT-ing, we're potentially
// running a long query on the server without waiting for any results
Expand Down Expand Up @@ -1109,8 +1111,10 @@ Variant f_mysql_multi_query(const String& query, CVarRef link_identifier /* = nu
}

if (mysql_real_query(conn, query.data(), query.size())) {
#ifdef HHVM_MYSQL_TRACE_MODE
raise_notice("runtime/ext_mysql: failed executing [%s] [%s]", query.data(),
mysql_error(conn));
#endif
// turning this off clears the errors
if (!mysql_set_server_option(conn, MYSQL_OPTION_MULTI_STATEMENTS_OFF)) {
mySQL->m_multi_query = false;
Expand Down

0 comments on commit 02cfa05

Please sign in to comment.