Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: 10.0.3, 5.5.31
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
The following test case (based on Bug #32268: Indexed queries give bogus MIN and MAX results, from group_min_max.test) leads to a crash during the cleanup phase:
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 (a, b) VALUES (1,1), (1,2), (1,3);
INSERT INTO t1 SELECT a + 1, b FROM t1;
INSERT INTO t1 SELECT a + 2, b FROM t1;
CREATE INDEX break_it ON t1 (a, b);
SELECT distinct a, b FROM t1 where a = '3' ORDER BY b;
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
The crash is due to the following failed assert:
int ha_index_end()
{
DBUG_ENTER("ha_index_end");
DBUG_ASSERT(inited==INDEX);
...
}
Call stack:
#3 0x00007f1ae1927192 in _GI_assert_fail (assertion=0xd478de "inited==INDEX", file=0xd47890 "/home/tsk/mprog/src/5.5/sql/handler.h", line=1861, function=0xd4a570 <handler::ha_index_end()::PRETTY_FUNCTION_> "int handler::ha_index_end()") at assert.c:103
#4 0x00000000005a9f32 in handler::ha_index_end (this=0x7f1a7400c4f8) at /home/tsk/mprog/src/5.5/sql/handler.h:1861
#5 0x00000000008ecd4b in QUICK_GROUP_MIN_MAX_SELECT::~QUICK_GROUP_MIN_MAX_SELECT (this=0x7f1a74016cd0, __in_chrg=<optimized out>) at /home/tsk/mprog/src/5.5/sql/opt_range.cc:13181
#6 0x00000000008ece2e in QUICK_GROUP_MIN_MAX_SELECT::~QUICK_GROUP_MIN_MAX_SELECT (this=0x7f1a74016cd0, __in_chrg=<optimized out>) at /home/tsk/mprog/src/5.5/sql/opt_range.cc:13190
#7 0x00000000008d280d in SQL_SELECT::cleanup (this=0x7f1a74013420) at /home/tsk/mprog/src/5.5/sql/opt_range.cc:1745
#8 0x0000000000672543 in JOIN::clean_pre_sort_join_tab (this=0x7f1a74007110) at /home/tsk/mprog/src/5.5/sql/sql_select.cc:19395
#9 0x000000000065d446 in JOIN::cleanup (this=0x7f1a74007110, full=true) at /home/tsk/mprog/src/5.5/sql/sql_select.cc:10635
#10 0x000000000065d10c in JOIN::join_free (this=0x7f1a74007110) at /home/tsk/mprog/src/5.5/sql/sql_select.cc:10547