WL#6885: Flag to indicate session state

Affects: Server-5.7   —   Status: In-Documentation

As part of detecting if it is possible to change connections in a
load-balanced environment, it is necessary to detect if there is any
session-specific state that can affect what connection to use.

For that reason, it is critical to be able to see in the response
packet if there is a session state to take into consideration when
deciding if a switch can be made.

The session state consists of:
- User-defined variables
- Session-specific values for server variables.
- Temporary tables that are created.
- Prepared statements.
- Current database.

This worklog will then add a tracker to the
response packet of the MySQL protocol and all necessary changes to the
server to ensure that it can be detected if a session state exists on
the server.