File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1996,16 +1996,21 @@ PHP_FUNCTION(mysqli_thread_id)
1996
1996
MYSQLI_FETCH_RESOURCE_CONN (mysql , mysql_link , MYSQLI_STATUS_VALID );
1997
1997
1998
1998
static const char * query = "SELECT CONNECTION_ID()" ;
1999
+ size_t query_len = strlen (query );
1999
2000
2000
- if (mysql_real_query (mysql -> mysql , query , strlen (query ))) {
2001
+ if (mysql_ping (mysql -> mysql )) {
2002
+ RETURN_LONG (0 );
2003
+ }
2004
+
2005
+ if (mysql_real_query (mysql -> mysql , query , query_len )) {
2001
2006
MYSQLI_REPORT_MYSQL_ERROR (mysql -> mysql );
2002
- RETURN_LONG ( -1 );
2007
+ RETURN_THROWS ( );
2003
2008
}
2004
2009
2005
2010
result = mysql_store_result (mysql -> mysql );
2006
2011
if (!result ) {
2007
2012
MYSQLI_REPORT_MYSQL_ERROR (mysql -> mysql );
2008
- RETURN_LONG ( -1 );
2013
+ RETURN_THROWS ( );
2009
2014
}
2010
2015
2011
2016
row = mysql_fetch_row (result );
You can’t perform that action at this time.
0 commit comments