summaryrefslogtreecommitdiff
path: root/sql/threadpool_common.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-10-22 17:08:49 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-10-22 17:08:49 +0300
commit1657b7a583c62deb72267d485bfe201f43909e11 (patch)
treea750e2a44fdd296837b566623331e8a9a707d290 /sql/threadpool_common.cc
parentcca75c95bc3c5d0d4a2efb920d3942da3e658654 (diff)
parent9868253b32877554a2707634dc6a6fd79c491053 (diff)
downloadmariadb-git-1657b7a583c62deb72267d485bfe201f43909e11.tar.gz
Merge 10.4 to 10.5
Diffstat (limited to 'sql/threadpool_common.cc')
-rw-r--r--sql/threadpool_common.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/sql/threadpool_common.cc b/sql/threadpool_common.cc
index 877428e67ac..e8eb0dcc29d 100644
--- a/sql/threadpool_common.cc
+++ b/sql/threadpool_common.cc
@@ -312,6 +312,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.
@@ -346,7 +356,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);
@@ -362,8 +371,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");