Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL client add CLIENT_SESSION_TRACK. #1354

Merged
merged 1 commit into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/protocol/MySQLMessage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ std::string MySQLRequest::get_query() const
#define MYSQL_CAPFLAG_CLIENT_PS_MULTI_RESULTS 0x00040000
#define MYSQL_CAPFLAG_CLIENT_PLUGIN_AUTH 0x00080000
#define MYSQL_CAPFLAG_CLIENT_LOCAL_FILES 0x00000080
#define MYSQL_CAPFLAG_CLIENT_SESSION_TRACK (1 << 23)

int MySQLHandshakeResponse::encode(struct iovec vectors[], int max)
{
Expand Down Expand Up @@ -336,7 +337,8 @@ int MySQLSSLRequest::encode(struct iovec vectors[], int max)
MYSQL_CAPFLAG_CLIENT_LOCAL_FILES |
MYSQL_CAPFLAG_CLIENT_MULTI_STATEMENTS |
MYSQL_CAPFLAG_CLIENT_PS_MULTI_RESULTS |
MYSQL_CAPFLAG_CLIENT_PLUGIN_AUTH);
MYSQL_CAPFLAG_CLIENT_PLUGIN_AUTH |
MYSQL_CAPFLAG_CLIENT_SESSION_TRACK);
pos += 4;
int4store(pos, 0);
pos += 4;
Expand Down Expand Up @@ -374,7 +376,8 @@ int MySQLAuthRequest::encode(struct iovec vectors[], int max)
MYSQL_CAPFLAG_CLIENT_LOCAL_FILES |
MYSQL_CAPFLAG_CLIENT_MULTI_STATEMENTS |
MYSQL_CAPFLAG_CLIENT_PS_MULTI_RESULTS |
MYSQL_CAPFLAG_CLIENT_PLUGIN_AUTH);
MYSQL_CAPFLAG_CLIENT_PLUGIN_AUTH |
MYSQL_CAPFLAG_CLIENT_SESSION_TRACK);
pos += 4;
int4store(pos, 0);
pos += 4;
Expand Down
8 changes: 7 additions & 1 deletion src/protocol/mysql_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,17 @@ static int parse_ok_packet(const void *buf, size_t len, mysql_parser_t *parser)

if (server_status & MYSQL_SERVER_SESSION_STATE_CHANGED)
{
const unsigned char *tmp_str;
unsigned long long tmp_len;

if (decode_string(&str, &info_len, &p, buf_end) == 0)
return -2;

if (decode_string(&tmp_str, &tmp_len, &p, buf_end) == 0)
return -2;
} else {
info_len = 0;
str = p;
info_len = 0;
}

result_set = (struct __mysql_result_set *)malloc(sizeof(struct __mysql_result_set));
Expand Down
Loading