Bug #86578 Workbench is unresponsive after refocusing with a large selection selected
Submitted: 4 Jun 2017 13:27 Modified: 11 Oct 2022 11:19
Reporter: Lee Butler Email Updates:
Status: Verified Impact on me:
Category:MySQL Workbench: SQL Editor Severity:S2 (Serious)
Version:6.3.9 OS:Windows (10)
Assigned to: CPU Architecture:Any
Tags: sql editor, workbench

[4 Jun 2017 13:27] Lee Butler
Workbench freezes when it is reactivated if a large amount of cells in the results grid are selected. This is noticed on a selection involving at least 30k cells in the results grid, across about 10k rows. 

Each time this happens while workbench is running the delay gets worse. It may be limited to selecting all cells and then copying them from workbench into another application, so it might be the clipboard interaction, or it might be the selection part. 

This freeze also invoices high CPU usage from workbench (Consistently around 35% usage on an i5-4460)

How to repeat:
SELECT a large amount of rows from a table. 10k should easily do the trick. 

Ctrl A to select all (I'm not sure if selecting all is a required part but it definitely causes it to happen)and then (at least I was doing this anyway)copy it to your clipboard. 

If you want to, you can then paste it into another applicaiton (I was pasting into Excel.

Return to workbench and wait a while for it to respond. Rinse and repeat until workbench stops recovering from the freeze.
[4 Jun 2017 17:34] MySQL Verification Team
Thank you for the bug report. I think this issue has the same root cause as bug you reported https://bugs.mysql.com/bug.php?id=86579 (handle of large data set), you agree?. Thanks in advance.
[4 Jun 2017 18:49] Lee Butler
I'm not sure it is, but it will depend on the control used for the results grid. 

I'll have a look shortly but the results grid looks to be a System.Windows.Forms.DataGridView (or something derived from it) which seems to usually have decent handling on ctrl a ctrl c, which can copy 200k cells pretty easily with just a little lag when actually copying to the clipboard. I don't notice anything when reactivating the window on it in my own applications. 

I think the DataGridView uses some Win32 calls to do it's huge copy job, where building a massive .Net managed string makes the framework go a bit crazy. 

They might be related but I'm not sure. Unless there's some custom handling on the results grid for selections or doing something on refocus. Though that reminds me of another issue which I'll make sure I can reproduce first before putting it here, but it does make me think something is going on while workbench is "idle"
[5 Jun 2017 13:20] MySQL Verification Team
Thank you for the feedback.
[18 Jun 2017 14:23] Lee Butler
Just to extend thi s alittle, refocus is not actually required. I've just verified it happens if you just click the grid the everything selected immediately after selecting.

Workbench will not recover at all in this instance. Or at least not after about 25 minutes of waiting. Tested with 21k rows and 16 columns
[15 Jun 2020 3:14] Moises Chavez
Hello, is there an update on this, workbench on W10 still gets stuck after copying a lot of data to the clipboard (personally I run multiple queries, copy and paste data into other Apps, so having to wait or to close/reopen the workbench is not ideal). This behavior is not an issue on MacOS.
[22 Dec 2020 23:48] Tree Kuharich
Any update for this? This happens to me all the time. The amount of data copied doesn't even have to be that large. I have to force quit workbench and re-open. Thanks!
[22 Dec 2020 23:51] Tree Kuharich
It also seemed to impact clipboard. Sometimes I go into clipboard after I've done a couple copy/paste from workbench to clear it. Today workbench froze then I tried to open clipboard to clear it and clipboard wouldn't open. There seems to be some interaction there that is causing issues.
[11 Jan 2022 10:55] Harikrishna Konduru
when user try to copy or export more than 10000 recods from My SQL work bench, it went to unresponsive
My SQL Workbench application is published through citrix. 

Kindly assist us
[12 Jun 2022 5:57] Boaz Yahav
This is a very old bug that has never been fixed.
As i see it, reports about it are from 2017... 5 years.

The more records i copy to the clipboard from the result grid the longer it takes MySQL WB to respond.

If copying 10K records there is no use in waiting... i just kill it and start over.
[11 Oct 2022 8:22] Shaun Moss
This has been an issue for years, I literally have to force close workbench multiple times a day.

It makes me wonder what its doing in the background after a copy to the clipboard?