Bug #85294 missing break for case OPT_pipe in function mysql_read_default_options
Submitted: 3 Mar 2017 15:47
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S3 (Non-critical)
Version:5.0+ OS:Any
Assigned to: CPU Architecture:Any

[3 Mar 2017 15:47] Shane Bester
Description:
look here, a missing break:

https://github.com/mysql/mysql-server/blob/5.7/sql-common/client.c#L1826

<cut>
        case OPT_pipe:
          options->protocol = MYSQL_PROTOCOL_PIPE;
	case OPT_connect_timeout:
	case OPT_timeout:
	  if (opt_arg)
	    options->connect_timeout=atoi(opt_arg);
	  break;

How to repeat:
read compiler warnings, code.

Suggested fix:
add a break.
[3 Mar 2017 15:48] Shane Bester
/home/sbester/git/mysql-git/sql-common/client.c:1842:29: warning: this statement may fall through [-Wimplicit-fallthrough=]
           options->protocol = MYSQL_PROTOCOL_PIPE;
           ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/home/sbester/git/mysql-git/sql-common/client.c:1843:2: note: here
  case OPT_connect_timeout:
  ^~~~