Bug #37550 SHOW PROCESSLIST displays "copy to tmp table" even this does not happen
Submitted: 20 Jun 2008 16:17 Modified: 19 Feb 2009 19:45
Reporter: Sveta Smirnova Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DDL Severity:S3 (Non-critical)
Version:5.1 bzr OS:Any (Linux)
Assigned to: Konstantin Osipov CPU Architecture:Any

[20 Jun 2008 16:17] Sveta Smirnova
Description:
Even if no copying to temporary table happnens while query is running, SHOW PROCESSLIST displays "copy to tmp table" message.

This affects InnoDB plugin, for example.

How to repeat:
Use InnoDB plugin.

Open 3 clients.

In client c1:

CREATE TABLE T1(A INT PRIMARY KEY AUTO_INCREMENT, B INT, C CHAR(1)) ENGINE=InnoDB; 
fill table with big enough amount of values, so ALTER TABLE T1 ADD INDEX ( B );  will take ~ 1 min, then run
ALTER TABLE T1 ADD INDEX ( B ); 

In client c2:

SELECT * FROM T1 LIMIT 24; 

In client c3:

SHOW PROCESSLIST;

You will see message "copy to tmp table" for ALTER query.

Suggested fix:
Don't display "copy to tmp table" if this does not happen.
[2 Oct 2008 14:16] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/55087

2718 Konstantin Osipov	2008-10-02
      A fix for Bug#37550 SHOW PROCESSLIST displays "copy to tmp table" 
      even this does not happen.
      Only set thd->proc_info if we're about to copy data in ALTER.
[2 Oct 2008 14:16] Konstantin Osipov
Queued into 6.0-runtime.
[2 Oct 2008 14:18] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/55090

2718 Konstantin Osipov	2008-10-02
      A fix for Bug#37550 SHOW PROCESSLIST displays "copy to tmp table" 
      even this does not happen.
      Only set thd->proc_info if we're about to copy data in ALTER.
[24 Oct 2008 1:18] Bugs System
Pushed into 6.0.8-alpha  (revid:kostja@sun.com-20081002141601-mkdt73zhxyo97dt3) (version source revid:kostja@sun.com-20081002141601-mkdt73zhxyo97dt3) (pib:5)
[26 Oct 2008 0:33] Paul DuBois
Noted in 6.0.8 changelog.

SHOW PROCESSLIST displayed "copy to tmp table" when no such copy was
occurring. 

Setting report to NDI pending push into 5.1.x.
[29 Oct 2008 22:25] Mattias Jonsson
A fix for this in 5.1 is done in bug#37453. (That patch will not go to 6.0 since the fast/online alter interfaces differs between 5.1 and 6.0!)
Instead of "copy to tmp table" it will show "manage keys" in this case in 5.1.
[19 Feb 2009 19:45] Paul DuBois
Noted in 5.1.31 changelog.