Skip to content

Commit 5a33a37

Browse files
committed
Merge 10.8 into 10.9
2 parents cd1de25 + 31fc2eb commit 5a33a37

File tree

214 files changed

+8255
-9251
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

214 files changed

+8255
-9251
lines changed

client/client_priv.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Copyright (c) 2001, 2012, Oracle and/or its affiliates.
3-
Copyright (c) 2009, 2020, MariaDB
3+
Copyright (c) 2009, 2022, MariaDB
44
55
This program is free software; you can redistribute it and/or modify
66
it under the terms of the GNU General Public License as published by
@@ -102,6 +102,7 @@ enum options_client
102102
OPT_IGNORE_DATA,
103103
OPT_PRINT_ROW_COUNT, OPT_PRINT_ROW_EVENT_POSITIONS,
104104
OPT_CHECK_IF_UPGRADE_NEEDED,
105+
OPT_COMPATIBILTY_CLEARTEXT_PLUGIN,
105106
OPT_SHUTDOWN_WAIT_FOR_SLAVES,
106107
OPT_COPY_S3_TABLES,
107108
OPT_PRINT_TABLE_METADATA,

client/mysql.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,6 +1660,8 @@ static struct my_option my_long_options[] =
16601660
&delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
16611661
{"execute", 'e', "Execute command and quit. (Disables --force and history file.)", 0,
16621662
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1663+
{"enable-cleartext-plugin", OPT_COMPATIBILTY_CLEARTEXT_PLUGIN, "Obsolete option. Exists only for MySQL compatibility.",
1664+
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
16631665
{"vertical", 'E', "Print the output of a query (rows) vertically.",
16641666
&vertical, &vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
16651667
0},
@@ -1969,6 +1971,14 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi
19691971
printf("WARNING: --server-arg option not supported in this configuration.\n");
19701972
#endif
19711973
break;
1974+
case OPT_COMPATIBILTY_CLEARTEXT_PLUGIN:
1975+
/*
1976+
This option exists in MySQL client but not in MariaDB. Users switching from
1977+
MySQL might still have this option in their commands, and it will not work
1978+
in MariaDB unless it is handled. Therefore output a warning and continue.
1979+
*/
1980+
printf("WARNING: option '--enable-cleartext-plugin' is obsolete.\n");
1981+
break;
19721982
case 'A':
19731983
opt_rehash= 0;
19741984
break;

extra/mariabackup/ds_compress.cc

Lines changed: 33 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/******************************************************
22
Copyright (c) 2011-2013 Percona LLC and/or its affiliates.
3+
Copyright (c) 2022, MariaDB Corporation.
34
45
Compressing datasink implementation for XtraBackup.
56
@@ -32,11 +33,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
3233
typedef struct {
3334
pthread_t id;
3435
uint num;
35-
pthread_mutex_t ctrl_mutex;
36-
pthread_cond_t ctrl_cond;
3736
pthread_mutex_t data_mutex;
3837
pthread_cond_t data_cond;
39-
my_bool started;
4038
my_bool data_avail;
4139
my_bool cancelled;
4240
const char *from;
@@ -206,14 +204,13 @@ compress_write(ds_file_t *file, const uchar *buf, size_t len)
206204

207205
thd = threads + i;
208206

209-
pthread_mutex_lock(&thd->ctrl_mutex);
207+
pthread_mutex_lock(&thd->data_mutex);
210208

211209
chunk_len = (len > COMPRESS_CHUNK_SIZE) ?
212210
COMPRESS_CHUNK_SIZE : len;
213211
thd->from = ptr;
214212
thd->from_len = chunk_len;
215213

216-
pthread_mutex_lock(&thd->data_mutex);
217214
thd->data_avail = TRUE;
218215
pthread_cond_signal(&thd->data_cond);
219216
pthread_mutex_unlock(&thd->data_mutex);
@@ -239,26 +236,24 @@ compress_write(ds_file_t *file, const uchar *buf, size_t len)
239236

240237
xb_a(threads[i].to_len > 0);
241238

242-
if (ds_write(dest_file, "NEWBNEWB", 8) ||
243-
write_uint64_le(dest_file,
244-
comp_file->bytes_processed)) {
245-
msg("compress: write to the destination stream "
246-
"failed.");
247-
return 1;
239+
bool fail = ds_write(dest_file, "NEWBNEWB", 8) ||
240+
write_uint64_le(dest_file,
241+
comp_file->bytes_processed);
242+
comp_file->bytes_processed += threads[i].from_len;
243+
244+
if (!fail) {
245+
fail = write_uint32_le(dest_file, threads[i].adler) ||
246+
ds_write(dest_file, threads[i].to,
247+
threads[i].to_len);
248248
}
249249

250-
comp_file->bytes_processed += threads[i].from_len;
250+
pthread_mutex_unlock(&threads[i].data_mutex);
251251

252-
if (write_uint32_le(dest_file, threads[i].adler) ||
253-
ds_write(dest_file, threads[i].to,
254-
threads[i].to_len)) {
252+
if (fail) {
255253
msg("compress: write to the destination stream "
256254
"failed.");
257255
return 1;
258256
}
259-
260-
pthread_mutex_unlock(&threads[i].data_mutex);
261-
pthread_mutex_unlock(&threads[i].ctrl_mutex);
262257
}
263258
}
264259

@@ -328,6 +323,23 @@ write_uint64_le(ds_file_t *file, ulonglong n)
328323
return ds_write(file, tmp, sizeof(tmp));
329324
}
330325

326+
static
327+
void
328+
destroy_worker_thread(comp_thread_ctxt_t *thd)
329+
{
330+
pthread_mutex_lock(&thd->data_mutex);
331+
thd->cancelled = TRUE;
332+
pthread_cond_signal(&thd->data_cond);
333+
pthread_mutex_unlock(&thd->data_mutex);
334+
335+
pthread_join(thd->id, NULL);
336+
337+
pthread_cond_destroy(&thd->data_cond);
338+
pthread_mutex_destroy(&thd->data_mutex);
339+
340+
my_free(thd->to);
341+
}
342+
331343
static
332344
comp_thread_ctxt_t *
333345
create_worker_threads(uint n)
@@ -342,53 +354,31 @@ create_worker_threads(uint n)
342354
comp_thread_ctxt_t *thd = threads + i;
343355

344356
thd->num = i + 1;
345-
thd->started = FALSE;
346357
thd->cancelled = FALSE;
347358
thd->data_avail = FALSE;
348359

349360
thd->to = (char *) my_malloc(PSI_NOT_INSTRUMENTED,
350361
COMPRESS_CHUNK_SIZE + MY_QLZ_COMPRESS_OVERHEAD, MYF(MY_FAE));
351362

352-
/* Initialize the control mutex and condition var */
353-
if (pthread_mutex_init(&thd->ctrl_mutex, NULL) ||
354-
pthread_cond_init(&thd->ctrl_cond, NULL)) {
355-
goto err;
356-
}
357-
358363
/* Initialize and data mutex and condition var */
359364
if (pthread_mutex_init(&thd->data_mutex, NULL) ||
360365
pthread_cond_init(&thd->data_cond, NULL)) {
361366
goto err;
362367
}
363368

364-
pthread_mutex_lock(&thd->ctrl_mutex);
365-
366369
if (pthread_create(&thd->id, NULL, compress_worker_thread_func,
367370
thd)) {
368371
msg("compress: pthread_create() failed: "
369372
"errno = %d", errno);
370-
pthread_mutex_unlock(&thd->ctrl_mutex);
371373
goto err;
372374
}
373375
}
374376

375-
/* Wait for the threads to start */
376-
for (i = 0; i < n; i++) {
377-
comp_thread_ctxt_t *thd = threads + i;
378-
379-
while (thd->started == FALSE)
380-
pthread_cond_wait(&thd->ctrl_cond, &thd->ctrl_mutex);
381-
pthread_mutex_unlock(&thd->ctrl_mutex);
382-
}
383-
384377
return threads;
385378

386379
err:
387-
while (i > 0) {
388-
comp_thread_ctxt_t *thd;
389-
i--;
390-
thd = threads + i;
391-
pthread_mutex_unlock(&thd->ctrl_mutex);
380+
for (; i; i--) {
381+
destroy_worker_thread(threads + i);
392382
}
393383

394384
my_free(threads);
@@ -402,21 +392,7 @@ destroy_worker_threads(comp_thread_ctxt_t *threads, uint n)
402392
uint i;
403393

404394
for (i = 0; i < n; i++) {
405-
comp_thread_ctxt_t *thd = threads + i;
406-
407-
pthread_mutex_lock(&thd->data_mutex);
408-
threads[i].cancelled = TRUE;
409-
pthread_cond_signal(&thd->data_cond);
410-
pthread_mutex_unlock(&thd->data_mutex);
411-
412-
pthread_join(thd->id, NULL);
413-
414-
pthread_cond_destroy(&thd->data_cond);
415-
pthread_mutex_destroy(&thd->data_mutex);
416-
pthread_cond_destroy(&thd->ctrl_cond);
417-
pthread_mutex_destroy(&thd->ctrl_mutex);
418-
419-
my_free(thd->to);
395+
destroy_worker_thread(threads + i);
420396
}
421397

422398
my_free(threads);
@@ -428,19 +404,9 @@ compress_worker_thread_func(void *arg)
428404
{
429405
comp_thread_ctxt_t *thd = (comp_thread_ctxt_t *) arg;
430406

431-
pthread_mutex_lock(&thd->ctrl_mutex);
432-
433407
pthread_mutex_lock(&thd->data_mutex);
434408

435-
thd->started = TRUE;
436-
pthread_cond_signal(&thd->ctrl_cond);
437-
438-
pthread_mutex_unlock(&thd->ctrl_mutex);
439-
440409
while (1) {
441-
thd->data_avail = FALSE;
442-
pthread_cond_signal(&thd->data_cond);
443-
444410
while (!thd->data_avail && !thd->cancelled) {
445411
pthread_cond_wait(&thd->data_cond, &thd->data_mutex);
446412
}

extra/mariabackup/xtrabackup.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,8 @@ void CorruptedPages::zero_out_free_pages()
580580
space_it->second.pages.begin();
581581
page_it != space_it->second.pages.end(); ++page_it)
582582
{
583-
bool is_free= fseg_page_is_free(space, *page_it);
584-
if (!is_free) {
583+
if (fseg_page_is_allocated(space, *page_it))
584+
{
585585
space_info_t &space_info = non_free_pages[space_id];
586586
space_info.pages.insert(*page_it);
587587
if (space_info.space_name.empty())

man/mysql.1

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,21 @@ the section called \(lqMYSQL COMMANDS\(rq\&.
507507
.sp -1
508508
.IP \(bu 2.3
509509
.\}
510+
.\" mysql: enable cleartext plugin option
511+
.\" enable cleartext plugin option: mysql
512+
\fB\-\-enable\-cleartext\-plugin\fR
513+
.sp
514+
Obsolete option\&. Exists only for MySQL compatibility\&.
515+
.RE
516+
.sp
517+
.RS 4
518+
.ie n \{\
519+
\h'-04'\(bu\h'+03'\c
520+
.\}
521+
.el \{\
522+
.sp -1
523+
.IP \(bu 2.3
524+
.\}
510525
.\" mysql: execute option
511526
.\" execute option: mysql
512527
\fB\-\-execute=\fR\fB\fIstatement\fR\fR,

mysql-test/include/not_valgrind.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
--require include/not_valgrind.require
22
--disable_query_log
3-
eval select $VALGRIND_TEST as using_valgrind;
3+
eval select $VALGRIND_TEST+0 as using_valgrind;
44
--enable_query_log

0 commit comments

Comments
 (0)