Skip to content

Commit 115b9ed

Browse files
committed
using old call as fallback
1 parent bac062b commit 115b9ed

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

ext/mysqli/mysqli_api.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,9 @@ PHP_FUNCTION(mysqli_kill)
10601060

10611061
// 1317 is ER_QUERY_INTERRUPTED from server's side
10621062
if (mysql_real_query(mysql->mysql, query, strlen(query)) && mysql_errno(mysql->mysql) != 1317) {
1063+
if (!mysql_kill(mysql->mysql, processid)) {
1064+
RETURN_TRUE;
1065+
}
10631066
MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
10641067
RETURN_FALSE;
10651068
}
@@ -1998,13 +2001,8 @@ PHP_FUNCTION(mysqli_thread_id)
19982001
static const char *query = "SELECT CONNECTION_ID()";
19992002
size_t query_len = strlen(query);
20002003

2001-
if (mysql_ping(mysql->mysql)) {
2002-
RETURN_LONG(0);
2003-
}
2004-
20052004
if (mysql_real_query(mysql->mysql, query, query_len)) {
2006-
MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
2007-
RETURN_THROWS();
2005+
goto fail;
20082006
}
20092007

20102008
result = mysql_store_result(mysql->mysql);
@@ -2020,6 +2018,9 @@ PHP_FUNCTION(mysqli_thread_id)
20202018
mysql_free_result(result);
20212019

20222020
RETURN_LONG(processid);
2021+
2022+
fail:
2023+
RETURN_LONG((zend_long)mysql_thread_id(mysql->mysql));
20232024
}
20242025
/* }}} */
20252026

0 commit comments

Comments
 (0)