| Bug #30590 | delete from memory table with composite btree primary key | ||
|---|---|---|---|
| Submitted: | 23 Aug 2007 12:26 | Modified: | 23 Oct 2007 0:08 |
| Reporter: | Shane Bester | ||
| Status: | Closed | ||
| Category: | Server: Memory | Severity: | S1 (Critical) |
| Version: | 5.0.48,5.1.22 | OS: | Any |
| Assigned to: | Sergey Vojtovich | Target Version: | 5.1.23 |
[23 Aug 2007 12:26]
Shane Bester
[23 Aug 2007 12:26]
Shane Bester
this leads to wrong data! related might be bug #23764
[30 Aug 2007 21:59]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/33471 ChangeSet@1.2680, 2007-08-30 23:47:04+05:00, svoj@april.(none) +4 -0 BUG#30590 - delete from memory table with composite btree primary key DELETE query against memory table with btree index may remove not all matching rows. This happens only when DELETE uses index read method to find matching rows. E.g. for queries like DELETE FROM t1 WHERE a=1. Fixed by reverting fix for BUG9719 and applying proper solution.
[3 Sep 2007 18:28]
Ingo Strüwing
IMHO a second reviewer is not absolutely required. May Calvin decide.
[13 Sep 2007 13:39]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/34168 ChangeSet@1.2680, 2007-09-13 15:39:16+05:00, svoj@mysql.com +5 -0 BUG#30590 - delete from memory table with composite btree primary key DELETE query against memory table with btree index may remove not all matching rows. This happens only when DELETE uses index read method to find matching rows. E.g. for queries like DELETE FROM t1 WHERE a=1. Fixed by reverting fix for BUG9719 and applying proper solution.
[22 Oct 2007 19:03]
Bugs System
Pushed into 5.1.23-beta
[22 Oct 2007 19:05]
Bugs System
Pushed into 5.0.52
[22 Oct 2007 19:08]
Bugs System
Pushed into 4.1.24
[23 Oct 2007 0:08]
Paul DuBois
Noted in 4.1.24, 5.0.52, 5.1.23 changelogs. For MEMORY tables, DELETE statements that remove rows based on an index read could fail to remove all matching rows.
[20 Mar 2008 11:39]
ronnie mist
I have this issue always on memory table with unique composite btree key. But also SOMETIMES I have similar issue on memory table with simple btree key: ... KEY `key` USING BTREE (`key`) ... SELECT COUNT(*) AS rows_count FROM `table` WHERE `key` = <SOME_VALUE>; +------------+ | rows_count | +------------+ |<ROWS_COUNT>| +------------+ 1 row in set (0.00 sec) DELETE FROM `table` WHERE `key` = <SOME_VALUE>; Query OK, <X> rows affected (0.00 sec) 0 <= X <= ROWS_COUNT
[4 Feb 9:28]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/65096 2768 Anurag Shekhar 2009-02-04 Bug#30590 delete from memory table with composite btree primary key While evaluating self join with delete server uses two instance of handler (with both holding reference to same file). During query evaluation last_pos is cached in handler to improve search performance. But in the mean while second handler is used to delete the node last_pos is holding. This makes the last_pos an invalid and when accessed results in segmentation fault. To fix this I have introduced a new variable in HP_INFO structure (deleted) which remembers the number of deleted (initialized while opening the file) nodes since last_pos is updated. If this value differs from the value of deleted nodes in shared structure last_pos is invalidated (set to zero).
[4 Feb 11:52]
Anurag Shekhar
My patch wasn't meant for this bug. I had given wrong id in the comment which caused this confusion sorry about that.
