Bug #85291 missing break for case HA_EXTRA_RESET_STATE in function heap_extra
Submitted: 3 Mar 2017 11:41
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Memory storage engine Severity:S3 (Non-critical)
Version:5.1+ OS:Any
Assigned to: CPU Architecture:Any

[3 Mar 2017 11:41] Shane Bester
Description:
There's a missing "break;" in heap_extra since early 5.1 days.

/git/storage/heap/hp_extra.c: In function ‘heap_extra’:
/git/storage/heap/hp_extra.c:38:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
     heap_reset(info);
     ^~~~~~~~~~~~~~~~
/home/sbester/git/mysql-git/storage/heap/hp_extra.c:39:3: note: here
   case HA_EXTRA_NO_READCHECK:
   ^~~~

int heap_extra(HP_INFO *info, enum ha_extra_function function)
{
  DBUG_ENTER("heap_extra");

  switch (function) {
  case HA_EXTRA_RESET_STATE:
    heap_reset(info);
  case HA_EXTRA_NO_READCHECK:
    info->opt_flag&= ~READ_CHECK_USED;	/* No readcheck */
    break;
  case HA_EXTRA_READCHECK:
    info->opt_flag|= READ_CHECK_USED;
    break;
  case HA_EXTRA_CHANGE_KEY_TO_UNIQUE:
  case HA_EXTRA_CHANGE_KEY_TO_DUP:
    heap_extra_keyflag(info, function);
    break;
  default:
    break;
  }
  DBUG_RETURN(0);
} /* heap_extra */

How to repeat:
read compiler warnings.

Suggested fix:
Change was introduced by patch for;
Commit 74cc73d4
monty@mysql.com2006/06/04 17:52:22
This changeset is largely a handler cleanup changeset (WL#3281), but includes fixes and cleanups that was found necessary while testing the handler changes
<cut>