Skip to content
This repository was archived by the owner on Mar 1, 2026. It is now read-only.

Commit c7d42ee

Browse files
jkedgarHerman Lee
authored andcommitted
Reserve new client error for connection throttling
Summary: We need a new error reserved for higher level connection throttling. Add a new client error in MySQL to support this. Reviewed By: abal147 Differential Revision: D39623157
1 parent da81ffd commit c7d42ee

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎include/errmsg.h‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,10 @@ extern const char *client_errors[]; /* Error messages */
262262
#define CR_NET_READ_INTERRUPTED 2200
263263
#define CR_NET_WRITE_INTERRUPTED 2201
264264
#define CR_TLS_SERVER_NOT_FOUND 2202
265-
#define CR_ERROR_LAST /*Copy last error nr:*/ 2202
265+
// CR_CONN_THROTTLED is not directly used in MySQL - reserved for FB usage at
266+
// a higher level
267+
#define CR_CONN_THROTTLED 2203
268+
#define CR_ERROR_LAST /*Copy last error nr:*/ 2203
266269
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */
267270

268271
#define CR_PLACEHOLDER_FIRST CR_PLACEHOLDER_2074

‎include/mysql.h.pp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@
418418
client_errno <= 2199;
419419
}
420420
static inline const char *ER_CLIENT(int client_errno) {
421-
if (client_errno >= 2000 && client_errno <= 2202 &&
421+
if (client_errno >= 2000 && client_errno <= 2203 &&
422422
!isPlaceHolder(client_errno)) {
423423
return client_errors[client_errno - 2000];
424424
}

‎libmysql/errmsg.cc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ const char *client_errors[] = {
249249
"Write timeout is reached",
250250
"Server rejected the ssl handshake for specified sni servername, sslerror: "
251251
"%-.100s",
252+
"Connection attempt throttled",
252253
""};
253254

254255
static const char *get_client_errmsg(int nr) {

0 commit comments

Comments
 (0)