Permalink
Browse files

Safely skip over unsupported session tracking types

Summary:
When we backported session tracking from 5.7, we did not backport all types, which is fine. However, we weren't skipping over them properly, since we just break out prematurely.

The fix is to move the cases down with the default cases where they will safely get skipped. Note that the assert won't fire because we still have all the enums defined properly.

Closes #781
Closes #766

Reviewed By: jkedgar

Differential Revision: D6874150

fbshipit-source-id: 21532fe
  • Loading branch information...
lth authored and facebook-github-bot committed Feb 1, 2018
1 parent cc4c998 commit b4ae418dbbd4913cbf0d523569a3d4ec9ba85343
Showing with 5 additions and 6 deletions.
  1. +5 −6 sql-common/client.c
@@ -780,12 +780,6 @@ void read_ok_ex(MYSQL *mysql, ulong length)
switch (type)
{
case SESSION_TRACK_SYSTEM_VARIABLES:
case SESSION_TRACK_SCHEMA:
case SESSION_TRACK_TRANSACTION_CHARACTERISTICS:
case SESSION_TRACK_TRANSACTION_STATE:
/* not backported */
break;
case SESSION_TRACK_GTIDS:
if (!my_multi_malloc(MYF(0),
&element, sizeof(LIST),
@@ -858,6 +852,11 @@ void read_ok_ex(MYSQL *mysql, ulong length)
}
break;
case SESSION_TRACK_SYSTEM_VARIABLES:
case SESSION_TRACK_SCHEMA:
case SESSION_TRACK_TRANSACTION_CHARACTERISTICS:
case SESSION_TRACK_TRANSACTION_STATE:
/* not backported */
default:
DBUG_ASSERT(type <= SESSION_TRACK_END);
/*

0 comments on commit b4ae418

Please sign in to comment.