Bug #108308 wbcopytables occasionally fails copying data only when using --table-where
Submitted: 27 Aug 2022 16:02 Modified: 28 Sep 2022 7:13
Reporter: Lefteris Goumas Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Workbench: Migration Severity:S2 (Serious)
Version:8.0.22-8.0.30 OS:Ubuntu (20.04, 22.04)
Assigned to: CPU Architecture:x86
Tags: wbcopytables

[27 Aug 2022 16:02] Lefteris Goumas
Description:
I have an Ubuntu 20 server. I used to copy data from a remote sql server to my local mysql server, using wbcopytables along with option --table-where.
All was ok, until I upgraded workbench from 8.0.21 to 8.0.22.
If I downgrade to 8.0.21 all work ok again. I tried all versions from 8.0.22-8.0.30 and they all have the same problem.
The error comes out ocassionally so in order to determine that it comes from wbcopytables and not from freetds or iodbc, I tried copying data , always using option '--table-where' from a table of my local mysql server to a clone table of the same server, and it comes up ocassionally too!
 

How to repeat:
In an ubuntu 20 server:
1.Install mysql-workbench version >= 8.0.22
2.Create a table in a mysql db , create data in that table (insert at least 10 records).
3.Execute several times the command:
/usr/bin/wbcopytables --mysql-source="dbuser@127.0.0.1:3306" --source-password="password" --count-only --log-level=none --table-where dbname tablename primarykeyfield "1=1"

Usually you will get the message: ROW_COUNT:dbname:TABLE: #records
But sometimes you will get: ROW_COUNT:dbname:TABLE: 2

For some weird reason sometimes the count result is 2, which is totally wrong.
The above never happens with version 8.0.21 only after 8.0.22.
The above is a simple example to replicate the problem, but the problem is really serious when copying data because it fails to copy all rows. 
Usually when the count is wrong it copies 100 rows , at least from what I noticed.
[2 Sep 2022 5:01] Lefteris Goumas
I just changed version and OS fields
[14 Sep 2022 11:39] MySQL Verification Team
Hello Lefteris Goumas,

Thank you for the bug report.
I tried to reproduce your issue on Ubuntu 22.04 with workbench 8.0.30 but I am not seeing any issues at my end.

Regards,
Ashwini Patil
[28 Sep 2022 7:13] Lefteris Goumas
I have sent a private comment 2 weeks before, 
about how to repeat the bug in a private server. 
Can someone check it out?

Thank you