Bug #22519 Editing table data causes error
Submitted: 20 Sep 2006 14:23 Modified: 6 Jan 2007 0:16
Reporter: Daniel Ratzlaff Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.2.2 beta OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any
Tags: error, primary key, recordset.c

[20 Sep 2006 14:23] Daniel Ratzlaff
Description:
My server versions are 4.1.11 on Windows2k and 4.1.11 on Linux.  When I try to edit table data within the Query Browser, I first have to check "Enforce queries to be editable by adding primary key columns to the select", since otherwise the edit function is not available.  This happens even during a "SELECT *" operation.

But the program seems to be picking up the wrong column as the primary key.  In an example I will attach, a small table has a tinyint primary key column and a varchar non-indexed field.  The screenshot seems to indicate that it picked the varchar field as the primary key.  When I then try to edit a value in a varchar field and Apply Changes, I get this error:

** ERROR **:  file source\myx_recordset.c:  line 953:  assertion failed:  (rs->columns_num == query->columns_num)  aborting...

Then the program crashes with a MSVC++ Runtime error.

This seems to happen with both myISAM tables and InnoDB tables.

How to repeat:
The problem seems to be somewhat intermittent.  While trying to get a screenshot of this sample table showing the key icon on the wrong column, it starting working fine again.  But tables on a different server (with confidential info) still aren't working correctly.  When it does work correctly, I don't need the "adding primary key columns to the select" option checked.
[20 Sep 2006 14:23] Daniel Ratzlaff
Sample table dump

Attachment: table.dump.txt (text/plain), 1.79 KiB.

[21 Sep 2006 13:59] Daniel Ratzlaff
Screenshot showing Query Browser picking the wrong PK

Attachment: mysql_wrongkey.jpg (image/jpeg, text), 148.41 KiB.

[6 Jan 2007 0:16] MySQL Verification Team
Thank you for the feedback. Could you please try the latest released
version. Thanks in advance.