Comment 2 for bug 1033724

Revision history for this message
Alexey Kopytov (akopytov) wrote :

This has been fixed upstream (apparently in 5.5.27, though I could not find it in changelogs). Here's the commit with the fix:

  bug#13949735: crash regression from bug#13694811.

  There can be cases when the optimizer calls ha_partition::records_in_range
  when there are no matching partitions. So the DBUG_ASSERT of
  !tot_used_partitions does assert.

  Fixed by returning 0 instead when no matching partitions are found.

  This will avoid the crash. records_in_range will then try to find the
  biggest used partition, which will not find any partition and
  records_in_range will then return 0, meaning non rows can be found.

  Patch contributed by Davi Arnaut at twitter.