Commit fc9005ad authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.5 into 10.6

parents fcd21d3e f2eda615
......@@ -5922,14 +5922,20 @@ int connect_n_handle_errors(struct st_command *command,
stay clear of trying to work out which exact user-limit was
exceeded.
*/
auto my_err= mysql_errno(con);
if(my_err == 0)
{
/* Workaround client library bug, not indicating connection error. */
my_err= CR_SERVER_LOST;
}
if (((mysql_errno(con) == ER_TOO_MANY_USER_CONNECTIONS) ||
(mysql_errno(con) == ER_USER_LIMIT_REACHED)) &&
if (((my_err == ER_TOO_MANY_USER_CONNECTIONS) ||
(my_err == ER_USER_LIMIT_REACHED)) &&
(failed_attempts++ < opt_max_connect_retries))
{
int i;
i= match_expected_error(command, mysql_errno(con), mysql_sqlstate(con));
i= match_expected_error(command, my_err, mysql_sqlstate(con));
if (i >= 0)
goto do_handle_error; /* expected error, handle */
......@@ -5939,9 +5945,9 @@ int connect_n_handle_errors(struct st_command *command,
}
do_handle_error:
var_set_errno(mysql_errno(con));
handle_error(command, mysql_errno(con), mysql_error(con),
mysql_sqlstate(con), ds);
var_set_errno(my_err);
handle_error(command, my_err, mysql_error(con),
mysql_sqlstate(con), ds);
return 0; /* Not connected */
}
......
......@@ -398,7 +398,8 @@ sub collect_suite_name($$)
{
my @dirs = my_find_dir(dirname($::glob_mysql_test_dir),
["mysql-test/suite", @plugin_suitedirs ],
$suitename);
$suitename,
$::opt_skip_not_found ? NOT_REQUIRED : undef);
#
# if $suitename contained wildcards, we'll have many suites and
# their overlays here. Let's group them appropriately.
......
......@@ -1158,7 +1158,9 @@ SELECT JSON_REMOVE('{"A": { "B": 1 }}', '$.A.B.C.D');
SET @save_collation_connection= @@collation_connection;
SET collation_connection='utf16_bin';
--disable_service_connection
SELECT JSON_EXTRACT('{"a": 1,"b": 2}','$.a');
--enable_service_connection
SET @@collation_connection= @save_collation_connection;
......
......@@ -3108,6 +3108,15 @@ static void start_signal_handler(void)
DBUG_VOID_RETURN;
}
/** Called only from signal_hand function. */
static void* exit_signal_handler()
{
my_thread_end();
signal_thread_in_use= 0;
pthread_exit(0); // Safety
return nullptr; // Avoid compiler warnings
}
/** This threads handles all signals and alarms. */
/* ARGSUSED */
......@@ -3168,10 +3177,7 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused)))
if (abort_loop)
{
DBUG_PRINT("quit",("signal_handler: calling my_thread_end()"));
my_thread_end();
signal_thread_in_use= 0;
pthread_exit(0); // Safety
return 0; // Avoid compiler warnings
return exit_signal_handler();
}
switch (sig) {
case SIGTERM:
......@@ -3190,6 +3196,7 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused)))
PSI_CALL_delete_current_thread();
my_sigset(sig, SIG_IGN);
break_connect_loop(); // MIT THREAD has a alarm thread
return exit_signal_handler();
}
break;
case SIGHUP:
......
INSTALL PLUGIN Spider SONAME 'ha_spider.so';
CREATE TABLE t (c DATE, c2 VARCHAR(1025) CHARACTER SET utf8mb3, UNIQUE KEY k(c2)) ENGINE=SPIDER;
UPDATE t SET c='2';
ERROR HY000: Unable to connect to foreign data source: localhost
drop table t;
Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown
Note 1305 PLUGIN SPIDER_ALLOC_MEM does not exist
Note 1305 PLUGIN SPIDER_WRAPPER_PROTOCOLS does not exist
INSTALL PLUGIN Spider SONAME 'ha_spider.so';
CREATE TABLE t (c DATE, c2 VARCHAR(1025) CHARACTER SET utf8mb3, UNIQUE KEY k(c2)) ENGINE=SPIDER;
--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
UPDATE t SET c='2';
drop table t;
--disable_query_log
--source ../../include/clean_up_spider.inc
......@@ -1134,11 +1134,8 @@ class spider_db_handler
ha_spider *spider;
spider_db_share *db_share;
int first_link_idx;
#ifdef SPIDER_HAS_GROUP_BY_HANDLER
SPIDER_LINK_IDX_CHAIN *link_idx_chain;
#endif
bool strict_group_by;
bool no_where_cond;
bool strict_group_by= false;
bool no_where_cond= false;
spider_db_handler(ha_spider *spider, spider_db_share *db_share) :
dbton_id(db_share->dbton_id), spider(spider), db_share(db_share),
first_link_idx(-1) {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment