Bug #32900 Can not set zero-length field to NULL using context menu option
Submitted: 1 Dec 2007 22:00 Modified: 3 Apr 2008 7:00
Reporter: David Ward Email Updates:
Status: Can't repeat Impact on me:
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.2.12 OS:Linux (Ubuntu Linux 7.10.)
Assigned to: CPU Architecture:Any

[1 Dec 2007 22:00] David Ward
If a row contains text in a VARCHAR field, I can set the value of the VARCHAR field to NULL by clicking "Start Editing" in the status bar, right-clicking the text in the VARCHAR field, and selecting "Set Field To NULL".  However, if the VARCHAR field is zero-length but is not NULL, then attempting to set it to NULL in this manner does nothing.

How to repeat:
Perform a query in Query Browser that is editable and that includes a VARCHAR field in the result.  Click "Start Editing" in the status bar.  Click on the VARCHAR field in a particular row, and if it contains any text, use the Delete or Backspace keys to remove it.  Click "Apply Changes" in the status bar, and the field will be set to zero length, but it will not be NULL.  Click "Start Editing" again.  Right-click the VARCHAR field in this same row and choose "Set Field to NULL".  Nothing happens, even after "Apply Changes" is clicked.

Suggested fix:
Set the field to NULL when the appropriate menu option is selected, even if it contains a zero-length string.
[2 Dec 2007 11:42] Sveta Smirnova
Thank you for the report.

Please indicate operating system you running MySQL Query Browser on.
[2 Dec 2007 15:43] David Ward
I am running on Ubuntu Linux 7.10.  MySQL GUI Tools was compiled from source.

(I checked to see if the problem exists under Windows, and it does not.  However I also noticed that the context menu is quite different under Windows!  It's in a different order, there's a couple of additional options (like "Export Resultset"), and "Set Field to NULL" is actually labeled on Windows as "Clear Field Content"...)
[3 Dec 2007 22:10] MySQL Verification Team
Thank you for the feedback. I wasn't able to repeat the behavior reported
on Fedora Core 6.0 and GUI-Tools from our download web page. Could you please
try with the packages released from our download page?. Thanks in advance.
[3 Dec 2007 22:39] David Ward
I extracted the binaries into /opt/mysql-gui-tools-5.0/ (while leaving the source-compiled version in tact in /usr/local/).  I did observe the correct behavior when I tried to set an empty VARCHAR field to NULL.

However, in the past I have experienced repeated instability problems with these binaries under Ubuntu.  MySQL Administrator doesn't even work beyond the login screen (it crashes with "symbol lookup error: /usr/lib/libbonoboui-2.so.0: undefined symbol: g_once_init_enter_impl").  These problems are all resolved when I compile from source.  Because I can't live with the instabilities, I'd like to know what the problem is...

[4 Dec 2007 17:29] David Ward
The problem is not limited to VARCHAR fields either.  I just noticed the same issue when working with a DATE field.
[3 Apr 2008 7:00] Sveta Smirnova
Thank you for the feedback.

But I am afraid we don't support custom builds of MySQL GUI Tools for platforms we provide binaries for. You can ask question on our forum though. MySQL GUIT Tools forums located at http://forums.mysql.com/index.php?82