Bug #116763 extra letter b is added to query after bit field
Submitted: 24 Nov 2024 11:23 Modified: 24 Nov 2024 17:36
Reporter: Joseph Pace Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:8.0.40 OS:Windows (Microsoft Windows 10 Pro N)
Assigned to: CPU Architecture:Any
Tags: WBBugReporter

[24 Nov 2024 11:23] Joseph Pace
Description:
----[For better reports, please attach the log file after submitting. You can find it in C:\Users\VM-User\AppData\Roaming\MySQL\Workbench\log\wb.log]

When records are modified /added in WorkBench, and there is a binary field (bit field), the program adds a letter b infornt of the field. (e.g. b'1' or b'0'). It then keeps adding a b infornt of all other fields in the subsequent code. 
e.g. 

insert into test(varcharfield1, bitfield, varcharfield2) values ('value', b'1', b'value2');
Insert into testvarcharfield1, bitfield, varcharfield2) values (b'value3', b'0', b'value4');
Obviously, MySQl reports an error when trying to insert these records because the binay fields are funny and are not compatible with the varchar fields.
One has to edit out the extra Bs from the query presented.

How to repeat:
Create table testtable(field1 int, field2 varchar(10), field3 bit, field4 text);

Then open the table in workBench editor and add data manually. Click APPLY and inspect the SQL created by workbench

Suggested fix:
The extra b letters should not be appended to the data being inserted into fields that are not binary.
[24 Nov 2024 17:36] MySQL Verification Team
Hello Joseph Pace,

Thank you for the report and feedback.

regards,
Umesh