Skip to content

Commit

Permalink
Merge pull request #3194 from sysown/v2.0.16-2619
Browse files Browse the repository at this point in the history
Closes #2619: ProxySQL is creating more than 'max_connections' connections
  • Loading branch information
renecannao authored Dec 20, 2020
2 parents 209ebb9 + b2b6cf2 commit 009df2f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/MySQL_Protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1549,6 +1549,14 @@ bool MySQL_Protocol::process_pkt_handshake_response(unsigned char *pkt, unsigned
}

capabilities = CPY4(pkt);
// see bug #2916. If CLIENT_MULTI_STATEMENTS is set by the client
// we enforce setting CLIENT_MULTI_RESULTS, this is the proper and expected
// behavior (refer to 'https://dev.mysql.com/doc/c-api/8.0/en/c-api-multiple-queries.html').
// Don't enforcing this would cause a mismatch between client and backend
// connections flags.
if (capabilities & CLIENT_MULTI_STATEMENTS) {
capabilities |= CLIENT_MULTI_RESULTS;
}
(*myds)->myconn->options.client_flag = capabilities;
pkt += sizeof(uint32_t);
max_pkt = CPY4(pkt);
Expand Down

0 comments on commit 009df2f

Please sign in to comment.