Skip to content

Commit 1dd3c8f

Browse files
committed
Merge branch '10.1' into 10.2
2 parents 04677f4 + 45cabf1 commit 1dd3c8f

File tree

7 files changed

+50
-10
lines changed

7 files changed

+50
-10
lines changed

mysql-test/r/max_statement_time.result

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,6 @@ ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
181181
set max_statement_time = 0;
182182
drop procedure pr;
183183
drop table t1;
184+
SET max_statement_time= 1;
185+
CREATE TABLE t ENGINE=InnoDB SELECT * FROM seq_1_to_50000;
186+
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)

mysql-test/suite/plugins/r/auth_ed25519.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ PLUGIN_AUTHOR Sergei Golubchik
3232
PLUGIN_DESCRIPTION Elliptic curve ED25519 based authentication
3333
PLUGIN_LICENSE GPL
3434
LOAD_OPTION ON
35-
PLUGIN_MATURITYBeta
35+
PLUGIN_MATURITYStable
3636
PLUGIN_AUTH_VERSION 1.0-alpha
3737
create user test1@localhost identified via ed25519 using 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY';
3838
show grants for test1@localhost;

mysql-test/t/max_statement_time.test

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
--source include/not_embedded.inc
77
--source include/have_innodb.inc
8+
--source include/have_sequence.inc
89
--source include/not_valgrind.inc
910

1011
--echo
@@ -226,3 +227,10 @@ call pr();
226227
set max_statement_time = 0;
227228
drop procedure pr;
228229
drop table t1;
230+
231+
#
232+
# MDEV-16615 ASAN SEGV in handler::print_error or server crash after error upon CREATE TABLE
233+
#
234+
SET max_statement_time= 1;
235+
--error ER_STATEMENT_TIMEOUT
236+
CREATE TABLE t ENGINE=InnoDB SELECT * FROM seq_1_to_50000;

plugin/auth_ed25519/server_ed25519.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ maria_declare_plugin(ed25519)
101101
NULL,
102102
NULL,
103103
"1.0-alpha",
104-
MariaDB_PLUGIN_MATURITY_BETA
104+
MariaDB_PLUGIN_MATURITY_STABLE
105105
}
106106
maria_declare_plugin_end;
107107

sql/handler.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3418,8 +3418,8 @@ void handler::print_error(int error, myf errflag)
34183418
break;
34193419
case HA_ERR_ABORTED_BY_USER:
34203420
{
3421-
DBUG_ASSERT(table->in_use->killed);
3422-
table->in_use->send_kill_message();
3421+
DBUG_ASSERT(ha_thd()->killed);
3422+
ha_thd()->send_kill_message();
34233423
DBUG_VOID_RETURN;
34243424
}
34253425
case HA_ERR_WRONG_MRG_TABLE_DEF:

sql/sql_class.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5809,8 +5809,6 @@ inline int handler::ha_ft_read(uchar *buf)
58095809
inline int handler::ha_rnd_pos_by_record(uchar *buf)
58105810
{
58115811
int error= rnd_pos_by_record(buf);
5812-
if (!error)
5813-
update_rows_read();
58145812
table->status=error ? STATUS_NOT_FOUND: 0;
58155813
return error;
58165814
}

sql/wsrep_sst.cc

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
#include <cstdio>
3131
#include <cstdlib>
3232

33+
#include <my_service_manager.h>
34+
3335
static char wsrep_defaults_file[FN_REFLEN * 2 + 10 + 30 +
3436
sizeof(WSREP_SST_OPT_CONF) +
3537
sizeof(WSREP_SST_OPT_CONF_SUFFIX) +
@@ -177,6 +179,9 @@ bool wsrep_before_SE()
177179
static bool sst_complete = false;
178180
static bool sst_needed = false;
179181

182+
#define WSREP_EXTEND_TIMEOUT_INTERVAL 30
183+
#define WSREP_TIMEDWAIT_SECONDS 10
184+
180185
void wsrep_sst_grab ()
181186
{
182187
WSREP_INFO("wsrep_sst_grab()");
@@ -188,11 +193,25 @@ void wsrep_sst_grab ()
188193
// Wait for end of SST
189194
bool wsrep_sst_wait ()
190195
{
191-
if (mysql_mutex_lock (&LOCK_wsrep_sst)) abort();
196+
struct timespec wtime = {WSREP_TIMEDWAIT_SECONDS, 0};
197+
uint32 total_wtime = 0;
198+
199+
if (mysql_mutex_lock (&LOCK_wsrep_sst))
200+
abort();
201+
202+
WSREP_INFO("Waiting for SST to complete.");
203+
192204
while (!sst_complete)
193205
{
194-
WSREP_INFO("Waiting for SST to complete.");
195-
mysql_cond_wait (&COND_wsrep_sst, &LOCK_wsrep_sst);
206+
mysql_cond_timedwait (&COND_wsrep_sst, &LOCK_wsrep_sst, &wtime);
207+
208+
if (!sst_complete)
209+
{
210+
total_wtime += wtime.tv_sec;
211+
WSREP_DEBUG("Waiting for SST to complete. waited %u secs.", total_wtime);
212+
service_manager_extend_timeout(WSREP_EXTEND_TIMEOUT_INTERVAL,
213+
"WSREP state transfer ongoing, current seqno: %ld", local_seqno);
214+
}
196215
}
197216

198217
if (local_seqno >= 0)
@@ -1347,10 +1366,22 @@ void wsrep_SE_init_grab()
13471366

13481367
void wsrep_SE_init_wait()
13491368
{
1369+
struct timespec wtime = {WSREP_TIMEDWAIT_SECONDS, 0};
1370+
uint32 total_wtime=0;
1371+
13501372
while (SE_initialized == false)
13511373
{
1352-
mysql_cond_wait (&COND_wsrep_sst_init, &LOCK_wsrep_sst_init);
1374+
mysql_cond_timedwait (&COND_wsrep_sst_init, &LOCK_wsrep_sst_init, &wtime);
1375+
1376+
if (!SE_initialized)
1377+
{
1378+
total_wtime += wtime.tv_sec;
1379+
WSREP_DEBUG("Waiting for SST to complete. waited %u secs.", total_wtime);
1380+
service_manager_extend_timeout(WSREP_EXTEND_TIMEOUT_INTERVAL,
1381+
"WSREP SE initialization ongoing.");
1382+
}
13531383
}
1384+
13541385
mysql_mutex_unlock (&LOCK_wsrep_sst_init);
13551386
}
13561387

0 commit comments

Comments
 (0)