Bug #189 Wrong host name/port displayed for DELAYED thread
Submitted: 25 Mar 2003 4:48 Modified: 26 Mar 2003 12:35
Reporter: jocelyn fournier (Silver Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.12 / 4.0.13 bk tree OS:Any (ALL)
Assigned to: Oleksandr Byelkin CPU Architecture:Any

[25 Mar 2003 4:48] jocelyn fournier
Description:
When using delayed insert, show processlist displays the following :
+-----+---------+-----------+-------------------+----------------+------+--------------------+------------------+
| Id  | User    | Host      | db                | Command        | Time | State              | Info             |
+-----+---------+-----------+-------------------+----------------+------+--------------------+------------------+
|  78 | DELAYED |           | forum_foldinghome | Delayed_insert | 22   | Waiting for INSERT |                  |
|  79 | DELAYED |           | forum_foldinghome | Delayed_insert | 22   | Waiting for INSERT |                  |
| 341 | DELAYED | :29806    | forum_overclex    | Delayed_insert | 1    | Waiting for INSERT |                  |
| 342 | DELAYED |           | forum_overclex    | Delayed_insert | 1    | Waiting for INSERT |                  |
| 326 | mysql   | localhost | presence          | Sleep          | 3    |                    | NULL             |
| 337 | mysql   | localhost | presence          | Sleep          | 2    |                    | NULL             |
| 1032 | DELAYED | :35853    | forum_presencepc  | Delayed_insert | 14   | Waiting for INSERT |                  |
| 1033 | DELAYED | :45568    | forum_presencepc  | Delayed_insert | 14   | Waiting for INSERT |                  |
| 1144 | DELAYED | :8307     | forum_rezo        | Delayed_insert | 185  | Waiting for INSERT |                  |

The host name is not displayed here. More over some client TCP port are displayed whereas a socket connection is used.

How to repeat:
Run a delayed insert and then use show processlist.
[26 Mar 2003 12:35] Oleksandr Byelkin
--- 1.103/sql/sql_show.cc       Wed Mar 19 21:43:40 2003 
+++ 1.104/sql/sql_show.cc       Wed Mar 26 22:04:14 2003 
@@ -1060,7 +1060,7 @@ 
         thd_info->user=thd->strdup(tmp->user ? tmp->user : 
                                   (tmp->system_thread ? 
                                    "system user" : "unauthenticated user")); 
-       if (tmp->peer_port && (tmp->host || tmp->ip)) 
+       if (tmp->peer_port && (tmp->host || tmp->ip) && 
thd->host_or_ip[0]) 
        { 
          if ((thd_info->host= 
thd->alloc(LIST_PROCESS_HOST_LEN+1))) 
            my_snprintf((char *) thd_info->host, 
LIST_PROCESS_HOST_LEN,