Skip to content

Commit 41f54da

Browse files
committed
MDEV-35342 Server crashes when creating index on a rocksdb table
Debug assertion, added with MDEV-34880, did not take into account that MyRocks sometimes uses hidden indexes that SQL layer isn't aware of. This commit adds a proper handling for such cases
1 parent f10d120 commit 41f54da

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sql/handler.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3761,8 +3761,11 @@ int handler::ha_index_init(uint idx, bool sorted)
37613761
end_range= NULL;
37623762
/*
37633763
Do not allow reads from UNIQUE HASH indexes.
3764+
(1) MyRocks sometimes uses hidden indexes that SQL layer isn't aware of,
3765+
skip the check for such cases
37643766
*/
3765-
DBUG_ASSERT(!(table->key_info[active_index].flags & HA_UNIQUE_HASH));
3767+
DBUG_ASSERT(active_index >= table->s->keys || // (1)
3768+
!(table->key_info[active_index].flags & HA_UNIQUE_HASH));
37663769
}
37673770

37683771
DBUG_RETURN(result);

0 commit comments

Comments
 (0)