Skip to content

Commit cee37b5

Browse files
committed
Merge 10.6 into 10.7
2 parents 593885f + 5f4314f commit cee37b5

File tree

67 files changed

+442
-378
lines changed

Some content is hidden

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

67 files changed

+442
-378
lines changed

debian/salsa-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -733,8 +733,8 @@ mariadb.org-10.2 to mariadb-10.7 upgrade:
733733
# prepending with --defaults-file=/etc/mysql/debian.cnf is needed in upstream 5.5–10.3
734734
- mysql --defaults-file=/etc/mysql/debian.cnf --skip-column-names -e "SELECT @@version, @@version_comment"
735735
- echo 'SHOW DATABASES;' | mysql --defaults-file=/etc/mysql/debian.cnf
736-
- mysql --defaults-file=/etc/mysql/debian.cnf -e "SELECT Host,User,plugin,authentication_string FROM user;" mysql
737-
- mysql --defaults-file=/etc/mysql/debian.cnf -e "SELECT * FROM plugin;" mysql
736+
- mysql --defaults-file=/etc/mysql/debian.cnf -e "SELECT * FROM mysql.global_priv; SHOW CREATE USER root@localhost; SHOW CREATE USER 'mariadb.sys'@localhost"
737+
- mysql --defaults-file=/etc/mysql/debian.cnf -e "SELECT * FROM mysql.plugin; SHOW PLUGINS"
738738
- *test-install
739739
- service mysql status
740740
- sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server

extra/innochecksum.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ FILE* log_file = NULL;
9494
/* Enabled for log write option. */
9595
static bool is_log_enabled = false;
9696

97+
static byte field_ref_zero_buf[UNIV_PAGE_SIZE_MAX];
98+
const byte *field_ref_zero = field_ref_zero_buf;
99+
97100
#ifndef _WIN32
98101
/* advisory lock for non-window system. */
99102
struct flock lk;

extra/mariabackup/xtrabackup.cc

Lines changed: 27 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -4479,6 +4479,14 @@ static bool xtrabackup_backup_func()
44794479
goto fail;
44804480
}
44814481

4482+
4483+
if (auto b = aligned_malloc(UNIV_PAGE_SIZE_MAX, 4096)) {
4484+
field_ref_zero = static_cast<byte*>(
4485+
memset_aligned<4096>(b, 0, UNIV_PAGE_SIZE_MAX));
4486+
} else {
4487+
goto fail;
4488+
}
4489+
44824490
{
44834491
/* definition from recv_recovery_from_checkpoint_start() */
44844492
ulint max_cp_field;
@@ -4493,14 +4501,17 @@ static bool xtrabackup_backup_func()
44934501

44944502
if (err != DB_SUCCESS) {
44954503
msg("Error: cannot read redo log header");
4504+
unlock_and_fail:
44964505
mysql_mutex_unlock(&log_sys.mutex);
4506+
free_and_fail:
4507+
aligned_free(const_cast<byte*>(field_ref_zero));
4508+
field_ref_zero = nullptr;
44974509
goto fail;
44984510
}
44994511

45004512
if (log_sys.log.format == 0) {
45014513
msg("Error: cannot process redo log before MariaDB 10.2.2");
4502-
mysql_mutex_unlock(&log_sys.mutex);
4503-
goto fail;
4514+
goto unlock_and_fail;
45044515
}
45054516

45064517
byte* buf = log_sys.checkpoint_buf;
@@ -4521,7 +4532,7 @@ static bool xtrabackup_backup_func()
45214532
xtrabackup_init_datasinks();
45224533

45234534
if (!select_history()) {
4524-
goto fail;
4535+
goto free_and_fail;
45254536
}
45264537

45274538
/* open the log file */
@@ -4530,12 +4541,13 @@ static bool xtrabackup_backup_func()
45304541
if (dst_log_file == NULL) {
45314542
msg("Error: failed to open the target stream for '%s'.",
45324543
LOG_FILE_NAME);
4533-
goto fail;
4544+
goto free_and_fail;
45344545
}
45354546

45364547
/* label it */
4537-
byte MY_ALIGNED(OS_FILE_LOG_BLOCK_SIZE) log_hdr_buf[LOG_FILE_HDR_SIZE];
4538-
memset(log_hdr_buf, 0, sizeof log_hdr_buf);
4548+
byte* log_hdr_buf = static_cast<byte*>(
4549+
aligned_malloc(LOG_FILE_HDR_SIZE, OS_FILE_LOG_BLOCK_SIZE));
4550+
memset(log_hdr_buf, 0, LOG_FILE_HDR_SIZE);
45394551

45404552
byte *log_hdr_field = log_hdr_buf;
45414553
mach_write_to_4(LOG_HEADER_FORMAT + log_hdr_field, log_sys.log.format);
@@ -4564,11 +4576,13 @@ static bool xtrabackup_backup_func()
45644576
log_block_calc_checksum_crc32(log_hdr_field));
45654577

45664578
/* Write log header*/
4567-
if (ds_write(dst_log_file, log_hdr_buf, sizeof(log_hdr_buf))) {
4579+
if (ds_write(dst_log_file, log_hdr_buf, LOG_FILE_HDR_SIZE)) {
45684580
msg("error: write to logfile failed");
4569-
goto fail;
4581+
aligned_free(log_hdr_buf);
4582+
goto free_and_fail;
45704583
}
45714584

4585+
aligned_free(log_hdr_buf);
45724586
log_copying_running = true;
45734587
/* start io throttle */
45744588
if(xtrabackup_throttle) {
@@ -4586,7 +4600,7 @@ static bool xtrabackup_backup_func()
45864600
" error %s.", ut_strerr(err));
45874601
fail_before_log_copying_thread_start:
45884602
log_copying_running = false;
4589-
goto fail;
4603+
goto free_and_fail;
45904604
}
45914605

45924606
/* copy log file by current position */
@@ -4609,7 +4623,7 @@ static bool xtrabackup_backup_func()
46094623

46104624
/* FLUSH CHANGED_PAGE_BITMAPS call */
46114625
if (!flush_changed_page_bitmaps()) {
4612-
goto fail;
4626+
goto free_and_fail;
46134627
}
46144628

46154629
ut_a(xtrabackup_parallel > 0);
@@ -4677,6 +4691,9 @@ static bool xtrabackup_backup_func()
46774691
if (opt_log_innodb_page_corruption)
46784692
ok = corrupted_pages.print_to_file(MB_CORRUPTED_PAGES_FILE);
46794693

4694+
aligned_free(const_cast<byte*>(field_ref_zero));
4695+
field_ref_zero = nullptr;
4696+
46804697
if (!ok) {
46814698
goto fail;
46824699
}
@@ -4909,53 +4926,6 @@ xb_space_create_file(
49094926
return ret;
49104927
}
49114928

4912-
/* Align the memory for file i/o if we might have O_DIRECT set */
4913-
byte* page = static_cast<byte*>(aligned_malloc(2 * srv_page_size,
4914-
srv_page_size));
4915-
4916-
memset(page, '\0', srv_page_size);
4917-
4918-
fsp_header_init_fields(page, space_id, flags);
4919-
mach_write_to_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, space_id);
4920-
4921-
const ulint zip_size = fil_space_t::zip_size(flags);
4922-
4923-
if (!zip_size) {
4924-
buf_flush_init_for_writing(
4925-
NULL, page, NULL,
4926-
fil_space_t::full_crc32(flags));
4927-
4928-
ret = os_file_write(IORequestWrite, path, *file, page, 0,
4929-
srv_page_size);
4930-
} else {
4931-
page_zip_des_t page_zip;
4932-
page_zip_set_size(&page_zip, zip_size);
4933-
page_zip.data = page + srv_page_size;
4934-
fprintf(stderr, "zip_size = " ULINTPF "\n", zip_size);
4935-
4936-
#ifdef UNIV_DEBUG
4937-
page_zip.m_start = 0;
4938-
#endif /* UNIV_DEBUG */
4939-
page_zip.m_end = 0;
4940-
page_zip.m_nonempty = 0;
4941-
page_zip.n_blobs = 0;
4942-
4943-
buf_flush_init_for_writing(NULL, page, &page_zip, false);
4944-
4945-
ret = os_file_write(IORequestWrite, path, *file,
4946-
page_zip.data, 0, zip_size);
4947-
}
4948-
4949-
aligned_free(page);
4950-
4951-
if (ret != DB_SUCCESS) {
4952-
msg("mariabackup: could not write the first page to %s",
4953-
path);
4954-
os_file_close(*file);
4955-
os_file_delete(0, path);
4956-
return ret;
4957-
}
4958-
49594929
return TRUE;
49604930
}
49614931

libmariadb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
--skip-stack-trace --skip-core-file
1+
--loose-skip-stack-trace --skip-core-file
22
--default-storage-engine=MyISAM
33
--loose-skip-innodb-file-per-table

mysql-test/main/cte_nonrecursive.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ NULL UNION RESULT <union4,5> ALL NULL NULL NULL NULL NULL NULL
11261126
NULL UNION RESULT <union11,12> ALL NULL NULL NULL NULL NULL NULL
11271127
NULL UNION RESULT <union1,6> ALL NULL NULL NULL NULL NULL NULL
11281128
Warnings:
1129-
Note 1003 with cte_e as (with cte_o as (with cte_i as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 7)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 1)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 and `test`.`t1`.`a` > 1 union select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 4 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 and `test`.`t1`.`a` > 1)select `cte_e1`.`a` AS `a` from `cte_e` `cte_e1` where `cte_e1`.`a` > 1 union select `cte_e2`.`a` AS `a` from `cte_e` `cte_e2`
1129+
Note 1003 with cte_e as (with cte_o as (with cte_i as (/* select#2 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 7)/* select#3 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 1)/* select#4 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 and `test`.`t1`.`a` > 1 union /* select#5 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 4 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 and `test`.`t1`.`a` > 1)/* select#1 */ select `cte_e1`.`a` AS `a` from `cte_e` `cte_e1` where `cte_e1`.`a` > 1 union /* select#6 */ select `cte_e2`.`a` AS `a` from `cte_e` `cte_e2`
11301130
drop table t1;
11311131
#
11321132
# MDEV-13753: embedded CTE in a VIEW created in prepared statement

mysql-test/main/cte_recursive.result

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4790,3 +4790,22 @@ a
47904790
NULL
47914791
DROP TABLE t1;
47924792
# End of 10.3 tests
4793+
#
4794+
# MDEV-26108: Recursive CTE embedded into another CTE which is used twice
4795+
#
4796+
create table t1 (a int);
4797+
insert into t1 values (5), (7);
4798+
with cte_e as (
4799+
with recursive cte_r as (
4800+
select a from t1 union select a+1 as a from cte_r r where a < 10
4801+
) select * from cte_r
4802+
) select * from cte_e s1, cte_e s2 where s1.a=s2.a;
4803+
a a
4804+
5 5
4805+
7 7
4806+
6 6
4807+
8 8
4808+
9 9
4809+
10 10
4810+
drop table t1;
4811+
# End of 10.4 tests

mysql-test/main/cte_recursive.test

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3091,3 +3091,20 @@ SELECT * FROM cte;
30913091
DROP TABLE t1;
30923092

30933093
--echo # End of 10.3 tests
3094+
3095+
--echo #
3096+
--echo # MDEV-26108: Recursive CTE embedded into another CTE which is used twice
3097+
--echo #
3098+
3099+
create table t1 (a int);
3100+
insert into t1 values (5), (7);
3101+
3102+
with cte_e as (
3103+
with recursive cte_r as (
3104+
select a from t1 union select a+1 as a from cte_r r where a < 10
3105+
) select * from cte_r
3106+
) select * from cte_e s1, cte_e s2 where s1.a=s2.a;
3107+
3108+
drop table t1;
3109+
3110+
--echo # End of 10.4 tests

mysql-test/main/fetch_first.test

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
if (`SELECT $PS_PROTOCOL != 0`)
2-
{
3-
--skip Test temporarily disabled for ps-protocol
4-
}
51
--echo #
62
--echo # The following entries are meant for testing the parser, ensuring
73
--echo # the right values are passed down to the executor, for all possible
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--skip-stack-trace --skip-core-file
1+
--loose-skip-stack-trace --skip-core-file

0 commit comments

Comments
 (0)