From 80c97f8c0c496a4ef9372172704b7d0d9115325f Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Tue, 17 Dec 2019 22:36:26 +0100 Subject: [PATCH 1/2] MDEV-21343 Threadpool/Unix- wait_begin() function does not wake/create threads, when it should Fixed the condition for waking up/creating another thread. If there is some work to do (if the request queue is not empty), a thread should be woken or created. The condition was incorrect since 18c9b34 --- sql/threadpool_unix.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/threadpool_unix.cc b/sql/threadpool_unix.cc index b505ec3dff5..3a90f24f6e9 100644 --- a/sql/threadpool_unix.cc +++ b/sql/threadpool_unix.cc @@ -1173,7 +1173,7 @@ void wait_begin(thread_group_t *thread_group) DBUG_ASSERT(thread_group->connection_count > 0); if ((thread_group->active_thread_count == 0) && - (thread_group->queue.is_empty() || !thread_group->listener)) + (!thread_group->queue.is_empty() || !thread_group->listener)) { /* Group might stall while this thread waits, thus wake From 3c94c5b8fab0c3bb0febe62d72b89bc8d51c3932 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Fri, 3 Jan 2020 10:25:46 +0100 Subject: [PATCH 2/2] MDEV-21416: main.events_bugs fails due to 2020-01-01 date Moved to the next problematic year (2038). --- mysql-test/r/events_bugs.result | 4 ++-- mysql-test/t/events_bugs.test | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result index 30bc4f89d8c..1729862dba8 100644 --- a/mysql-test/r/events_bugs.result +++ b/mysql-test/r/events_bugs.result @@ -643,7 +643,7 @@ SET GLOBAL READ_ONLY = 1; # Connection: u1_con (mysqltest_u1@localhost/events_test). # -CREATE EVENT e1 ON SCHEDULE AT '2020-01-01 00:00:00' DO SET @a = 1; +CREATE EVENT e1 ON SCHEDULE AT '2038-01-01 00:00:00' DO SET @a = 1; ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement ALTER EVENT e1 COMMENT 'comment'; @@ -656,7 +656,7 @@ ERROR HY000: The MariaDB server is running with the --read-only option so it can # Connection: root_con (root@localhost/events_test). # -CREATE EVENT e1 ON SCHEDULE AT '2020-01-01 00:00:00' DO SET @a = 1; +CREATE EVENT e1 ON SCHEDULE AT '2038-01-01 00:00:00' DO SET @a = 1; ALTER EVENT e1 COMMENT 'comment'; diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test index dc31556998a..aca1f144ec3 100644 --- a/mysql-test/t/events_bugs.test +++ b/mysql-test/t/events_bugs.test @@ -1033,7 +1033,7 @@ SET GLOBAL READ_ONLY = 1; --echo --error ER_OPTION_PREVENTS_STATEMENT -CREATE EVENT e1 ON SCHEDULE AT '2020-01-01 00:00:00' DO SET @a = 1; +CREATE EVENT e1 ON SCHEDULE AT '2038-01-01 00:00:00' DO SET @a = 1; --echo @@ -1057,7 +1057,7 @@ DROP EVENT e1; --echo -CREATE EVENT e1 ON SCHEDULE AT '2020-01-01 00:00:00' DO SET @a = 1; +CREATE EVENT e1 ON SCHEDULE AT '2038-01-01 00:00:00' DO SET @a = 1; --echo