Bug #76386 INSERT/UPDATE a varbinary field in result grid does not use prepared statement
Submitted: 19 Mar 2015 10:02 Modified: 22 Sep 2015 0:35
Reporter: Liu Yan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S2 (Serious)
Version:6.3.2-rc/6.2.5 OS:Linux (Fedora 21)
Assigned to: CPU Architecture:Any

[19 Mar 2015 10:02] Liu Yan
Description:
When editing a varbinary field in result grid, mysql-workbench-6.3.2-rc reports an error like following:

--------------------------------------
Operation failed: There was an error while applying the SQL script to the database.
Executing:
INSERT INTO `test`.`varbinary` (`a`) VALUES ('asdf');

ERROR 0: 0: MySQL_Prepared_Statement::setBlob: invalid 'parameterIndex'
SQL Statement:
INSERT INTO `test`.`varbinary` (`a`) VALUES ('asdf')
--------------------------------------

it looks like mysql-workbench is trying to execute a prepared statement but the editor does not generated a prepared SQL statement, instead it generated a plain text SQL statement.

How to repeat:
1. Create a table with 1 varbinary column

CREATE TABLE `test`.`varbinary`
(
  `a` varbinary(10) NOT NULL DEFAULT '',
  PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

2. Select Rows - Limit 1000

3. In the result grid, input several characters to the `a` field, press ENTER

4. Click Apply to insert the data

Suggested fix:
Either allow the plain text SQL statement (without parameterized),
or change the plain text value to parameterized form (i mean change it to ?).
[19 Mar 2015 11:14] MySQL Verification Team
Thank you for the bug report. Verified as described.
[17 Sep 2015 20:19] Omar Mendez Andrade
INSERT/UPDATE apply button have no issues about the changes being applied
[22 Sep 2015 0:35] Philip Olson
Posted by developer:
 
Fixed as of the upcoming MySQL Workbench 6.3.5 release, and here's the changelog entry:

The VARBINARY type could not be edited in the results view grid. Clicking
Apply to execute the change would emit an error.

Thank you for the bug report.