Skip to content

Commit

Permalink
Safely skip over unsupported session tracking types
Browse files Browse the repository at this point in the history
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 2, 2018
1 parent cc4c998 commit b4ae418
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions sql-common/client.c
Expand Up @@ -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),
Expand Down Expand Up @@ -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);
/*
Expand Down

0 comments on commit b4ae418

Please sign in to comment.