Bug #93060 paste rows create wrong insert queries on apply
Submitted: 2 Nov 2018 12:21 Modified: 13 Nov 2018 18:15
Reporter: Peter Szabo Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:8.0.12/8.0.13 OS:Ubuntu (18.04.1)
Assigned to: CPU Architecture:Any

[2 Nov 2018 12:21] Peter Szabo
Description:
"paste rows" to result set creates invalid insert queries on apply

How to repeat:
1) select a table which has VARCHAR and boolean columns.
2) copy row from the result set
3) modify and add another rows also in the text editor
4) paste back the multiple rows
5) apply

the insert query contains from the first boolean column b'', even if the type is varchar.

I need to remove the b from each of individual value manually, which is tedious.

generated insert queries
INSERT INTO `zeno` (`parent_uid`, `priv`) VALUES ('cc84c4ac-586a-8d65-27ba-08b1a073fd43', 'en', 'Nonreligious', b'0');
INSERT INTO `zeno` (`parent_uid`, `priv`) VALUES (b'cc84c4ac-586a-8d65-27ba-08b1a073fd43', b'0');

I wrote a regex replace workaround:
b('[^0-1]+(.*?),) -> $1
[2 Nov 2018 12:47] Peter Szabo
version updated
[2 Nov 2018 14:59] Miguel Solorzano
Thank you for the bug report. Please provide a test case with create table, data insert, etc. Just the description of how to repeat isn't effective way to repeat. Thanks.
[2 Nov 2018 17:16] Peter Szabo
zero table has two columns

Attachment: myscoutee_db_zero.sql (application/sql, text), 1.88 KiB.

[2 Nov 2018 17:17] Peter Szabo
Pls. select the "zero" table, and follow the instruction on how to repeat
[2 Nov 2018 17:21] Peter Szabo
1)
right click on the row in the result set and copy to clipboard
Pls. notice if you pase back, than it fails b'0' should be there.

'1', 'errr', '0'

2)
NULL, 'Akos', b'0'
NULL, 'Pete', b'0'

paste back these two rows, and apply

please notice that the insert queries are invalid
[13 Nov 2018 18:15] Miguel Solorzano
Thank you for the feedback. Windows version affected too.
[12 Feb 20:15] Miguel Solorzano
https://bugs.mysql.com/bug.php?id=94298 marked as duplicate of this one.
[13 Mar 22:06] Miguel Solorzano
https://bugs.mysql.com/bug.php?id=94644 marked as duplicate of this one.
[21 Mar 13:17] Miguel Solorzano
https://bugs.mysql.com/bug.php?id=94734 marked as duplicate of this one.