diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-11-03 19:11:36 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-11-03 19:11:36 +0200 |
commit | c498250888ec126fddda2867d1239b2a7734482f (patch) | |
tree | e308174c977c0981d8e36f6f9b791b1b266d0cb0 /sql/sql_class.cc | |
parent | 09a1f0075a8d5752dd7b2940a20d86a040af1741 (diff) | |
parent | 1418439d3823fe059b41092af72ab32d5e7cd7ab (diff) | |
download | mariadb-git-bb-10.6-georg.tar.gz |
Merge 10.5 into 10.6mariadb-10.5.7bb-10.6-georg10.6-vatu
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r-- | sql/sql_class.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 3db7ebc7997..167b2d20023 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -4982,7 +4982,8 @@ extern "C" size_t thd_query_safe(MYSQL_THD thd, char *buf, size_t buflen) if (!mysql_mutex_trylock(&thd->LOCK_thd_data)) { len= MY_MIN(buflen - 1, thd->query_length()); - memcpy(buf, thd->query(), len); + if (len) + memcpy(buf, thd->query(), len); mysql_mutex_unlock(&thd->LOCK_thd_data); } buf[len]= '\0'; |