diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-10-22 08:26:28 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-10-22 08:26:28 +0300 |
commit | e3d692aa092a76415ce1ce0e9662338873d84abb (patch) | |
tree | c6c7fafc561b589f82ed3a0afd696822fd52962d /sql/threadpool_common.cc | |
parent | 88d22f0e65192ca1b1e69b46661ce57ce19dbaa4 (diff) | |
parent | 620ea816adeceaba7c875679ab8505f4c07a22b8 (diff) | |
download | mariadb-git-e3d692aa092a76415ce1ce0e9662338873d84abb.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'sql/threadpool_common.cc')
-rw-r--r-- | sql/threadpool_common.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sql/threadpool_common.cc b/sql/threadpool_common.cc index 1d51f0da411..03c39d65f23 100644 --- a/sql/threadpool_common.cc +++ b/sql/threadpool_common.cc @@ -316,6 +316,16 @@ static void handle_wait_timeout(THD *thd) thd->net.error= 2; } +/** Check if some client data is cached in thd->net or thd->net.vio */ +static bool has_unread_data(THD* thd) +{ + NET *net= &thd->net; + if (net->compress && net->remain_in_buf) + return true; + Vio *vio= net->vio; + return vio->has_data(vio); +} + /** Process a single client request or a single batch. @@ -350,7 +360,6 @@ static int threadpool_process_request(THD *thd) */ for(;;) { - Vio *vio; thd->net.reading_or_writing= 0; if (mysql_audit_release_required(thd)) mysql_audit_release(thd); @@ -366,8 +375,7 @@ static int threadpool_process_request(THD *thd) set_thd_idle(thd); - vio= thd->net.vio; - if (!vio->has_data(vio)) + if (!has_unread_data(thd)) { /* More info on this debug sync is in sql_parse.cc*/ DEBUG_SYNC(thd, "before_do_command_net_read"); |