From 045bb460b12ea3f0452808cc693b804344ce0d91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Sat, 7 Nov 2020 19:17:04 +0100 Subject: [PATCH 1/3] Reset client connection when client issues a CHANGE_USER command --- lib/MySQL_Session.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index d3917386a..39a2491f6 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -550,6 +550,11 @@ void MySQL_Session::reset() { } } } + if (client_myds) { + if (client_myds->myconn) { + client_myds->myconn->reset(); + } + } } MySQL_Session::~MySQL_Session() { From d8e32d672a87e59625593e819b9ab24a4c7446ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Mon, 9 Nov 2020 18:04:16 +0100 Subject: [PATCH 2/3] Several error codes are now not considered severe enough to shun a node Those error codes are: * from 1099 to 1104 * from 1106 to 1113 * from 1116 to 1118 * 1120 * 1136 * from 1138 to 1149 --- lib/MySQL_HostGroups_Manager.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/MySQL_HostGroups_Manager.cpp b/lib/MySQL_HostGroups_Manager.cpp index 2a3dd6c17..b78558547 100644 --- a/lib/MySQL_HostGroups_Manager.cpp +++ b/lib/MySQL_HostGroups_Manager.cpp @@ -872,6 +872,14 @@ void MySrvC::connect_error(int err_num) { return; if (err_num >= 1054 && err_num <= 1075) return; + if (err_num >= 1099 && err_num <= 1104) + return; + if (err_num >= 1106 && err_num <= 1113) + return; + if (err_num >= 1116 && err_num <= 1118) + return; + if (err_num == 1136 || (err_num >= 1138 && err_num <= 1149)) + return; switch (err_num) { case 1007: // Can't create database case 1008: // Can't drop database @@ -884,6 +892,7 @@ void MySrvC::connect_error(int err_num) { case 1051: // Unknown table case 1052: // Column is ambiguous */ + case 1120: case 1203: // User %s already has more than 'max_user_connections' active connections case 1226: // User '%s' has exceeded the '%s' resource (current value: %ld) return; From f9a7914407b2928356a5d400e972a516db27d186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Tue, 10 Nov 2020 11:45:54 +0100 Subject: [PATCH 3/3] Fix sqlite3 tap test --- test/tap/tests/sqlite3-t.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/tap/tests/sqlite3-t.cpp b/test/tap/tests/sqlite3-t.cpp index 5a25eaf56..010bc6686 100644 --- a/test/tap/tests/sqlite3-t.cpp +++ b/test/tap/tests/sqlite3-t.cpp @@ -11,8 +11,17 @@ #include "sqlite3db.h" int main() { - plan(8); SQLite3DB::LoadPlugin(NULL); + plan(9); + + { + int i=sqlite3_config(SQLITE_CONFIG_URI, 1); + if (i!=SQLITE_OK) { + fprintf(stderr,"SQLITE: Error on sqlite3_config(SQLITE_CONFIG_URI,1)\n"); + } + ok(i==SQLITE_OK, "Setting SQLITE_CONFIG_URI"); + } + SQLite3DB *db; // in memory db = new SQLite3DB(); db->open((char *)"file:mem_db?mode=memory&cache=shared", SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_FULLMUTEX);