Skip to content

Commit

Permalink
Merge 10.6 into 10.7
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Jul 22, 2021
2 parents 593885f + 5f4314f commit cee37b5
Show file tree
Hide file tree
Showing 67 changed files with 442 additions and 378 deletions.
4 changes: 2 additions & 2 deletions debian/salsa-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -733,8 +733,8 @@ mariadb.org-10.2 to mariadb-10.7 upgrade:
# prepending with --defaults-file=/etc/mysql/debian.cnf is needed in upstream 5.5–10.3
- mysql --defaults-file=/etc/mysql/debian.cnf --skip-column-names -e "SELECT @@version, @@version_comment"
- echo 'SHOW DATABASES;' | mysql --defaults-file=/etc/mysql/debian.cnf
- mysql --defaults-file=/etc/mysql/debian.cnf -e "SELECT Host,User,plugin,authentication_string FROM user;" mysql
- mysql --defaults-file=/etc/mysql/debian.cnf -e "SELECT * FROM plugin;" mysql
- mysql --defaults-file=/etc/mysql/debian.cnf -e "SELECT * FROM mysql.global_priv; SHOW CREATE USER root@localhost; SHOW CREATE USER 'mariadb.sys'@localhost"
- mysql --defaults-file=/etc/mysql/debian.cnf -e "SELECT * FROM mysql.plugin; SHOW PLUGINS"
- *test-install
- service mysql status
- sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server
Expand Down
3 changes: 3 additions & 0 deletions extra/innochecksum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ FILE* log_file = NULL;
/* Enabled for log write option. */
static bool is_log_enabled = false;

static byte field_ref_zero_buf[UNIV_PAGE_SIZE_MAX];
const byte *field_ref_zero = field_ref_zero_buf;

#ifndef _WIN32
/* advisory lock for non-window system. */
struct flock lk;
Expand Down
84 changes: 27 additions & 57 deletions extra/mariabackup/xtrabackup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4479,6 +4479,14 @@ static bool xtrabackup_backup_func()
goto fail;
}


if (auto b = aligned_malloc(UNIV_PAGE_SIZE_MAX, 4096)) {
field_ref_zero = static_cast<byte*>(
memset_aligned<4096>(b, 0, UNIV_PAGE_SIZE_MAX));
} else {
goto fail;
}

{
/* definition from recv_recovery_from_checkpoint_start() */
ulint max_cp_field;
Expand All @@ -4493,14 +4501,17 @@ static bool xtrabackup_backup_func()

if (err != DB_SUCCESS) {
msg("Error: cannot read redo log header");
unlock_and_fail:
mysql_mutex_unlock(&log_sys.mutex);
free_and_fail:
aligned_free(const_cast<byte*>(field_ref_zero));
field_ref_zero = nullptr;
goto fail;
}

if (log_sys.log.format == 0) {
msg("Error: cannot process redo log before MariaDB 10.2.2");
mysql_mutex_unlock(&log_sys.mutex);
goto fail;
goto unlock_and_fail;
}

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

if (!select_history()) {
goto fail;
goto free_and_fail;
}

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

/* label it */
byte MY_ALIGNED(OS_FILE_LOG_BLOCK_SIZE) log_hdr_buf[LOG_FILE_HDR_SIZE];
memset(log_hdr_buf, 0, sizeof log_hdr_buf);
byte* log_hdr_buf = static_cast<byte*>(
aligned_malloc(LOG_FILE_HDR_SIZE, OS_FILE_LOG_BLOCK_SIZE));
memset(log_hdr_buf, 0, LOG_FILE_HDR_SIZE);

byte *log_hdr_field = log_hdr_buf;
mach_write_to_4(LOG_HEADER_FORMAT + log_hdr_field, log_sys.log.format);
Expand Down Expand Up @@ -4564,11 +4576,13 @@ static bool xtrabackup_backup_func()
log_block_calc_checksum_crc32(log_hdr_field));

/* Write log header*/
if (ds_write(dst_log_file, log_hdr_buf, sizeof(log_hdr_buf))) {
if (ds_write(dst_log_file, log_hdr_buf, LOG_FILE_HDR_SIZE)) {
msg("error: write to logfile failed");
goto fail;
aligned_free(log_hdr_buf);
goto free_and_fail;
}

aligned_free(log_hdr_buf);
log_copying_running = true;
/* start io throttle */
if(xtrabackup_throttle) {
Expand All @@ -4586,7 +4600,7 @@ static bool xtrabackup_backup_func()
" error %s.", ut_strerr(err));
fail_before_log_copying_thread_start:
log_copying_running = false;
goto fail;
goto free_and_fail;
}

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

/* FLUSH CHANGED_PAGE_BITMAPS call */
if (!flush_changed_page_bitmaps()) {
goto fail;
goto free_and_fail;
}

ut_a(xtrabackup_parallel > 0);
Expand Down Expand Up @@ -4677,6 +4691,9 @@ static bool xtrabackup_backup_func()
if (opt_log_innodb_page_corruption)
ok = corrupted_pages.print_to_file(MB_CORRUPTED_PAGES_FILE);

aligned_free(const_cast<byte*>(field_ref_zero));
field_ref_zero = nullptr;

if (!ok) {
goto fail;
}
Expand Down Expand Up @@ -4909,53 +4926,6 @@ xb_space_create_file(
return ret;
}

/* Align the memory for file i/o if we might have O_DIRECT set */
byte* page = static_cast<byte*>(aligned_malloc(2 * srv_page_size,
srv_page_size));

memset(page, '\0', srv_page_size);

fsp_header_init_fields(page, space_id, flags);
mach_write_to_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, space_id);

const ulint zip_size = fil_space_t::zip_size(flags);

if (!zip_size) {
buf_flush_init_for_writing(
NULL, page, NULL,
fil_space_t::full_crc32(flags));

ret = os_file_write(IORequestWrite, path, *file, page, 0,
srv_page_size);
} else {
page_zip_des_t page_zip;
page_zip_set_size(&page_zip, zip_size);
page_zip.data = page + srv_page_size;
fprintf(stderr, "zip_size = " ULINTPF "\n", zip_size);

#ifdef UNIV_DEBUG
page_zip.m_start = 0;
#endif /* UNIV_DEBUG */
page_zip.m_end = 0;
page_zip.m_nonempty = 0;
page_zip.n_blobs = 0;

buf_flush_init_for_writing(NULL, page, &page_zip, false);

ret = os_file_write(IORequestWrite, path, *file,
page_zip.data, 0, zip_size);
}

aligned_free(page);

if (ret != DB_SUCCESS) {
msg("mariabackup: could not write the first page to %s",
path);
os_file_close(*file);
os_file_delete(0, path);
return ret;
}

return TRUE;
}

Expand Down
2 changes: 1 addition & 1 deletion libmariadb
2 changes: 1 addition & 1 deletion mysql-test/main/crash_commit_before-master.opt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
--skip-stack-trace --skip-core-file
--loose-skip-stack-trace --skip-core-file
--default-storage-engine=MyISAM
--loose-skip-innodb-file-per-table
2 changes: 1 addition & 1 deletion mysql-test/main/cte_nonrecursive.result
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ NULL UNION RESULT <union4,5> ALL NULL NULL NULL NULL NULL NULL
NULL UNION RESULT <union11,12> ALL NULL NULL NULL NULL NULL NULL
NULL UNION RESULT <union1,6> ALL NULL NULL NULL NULL NULL NULL
Warnings:
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`
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`
drop table t1;
#
# MDEV-13753: embedded CTE in a VIEW created in prepared statement
Expand Down
19 changes: 19 additions & 0 deletions mysql-test/main/cte_recursive.result
Original file line number Diff line number Diff line change
Expand Up @@ -4790,3 +4790,22 @@ a
NULL
DROP TABLE t1;
# End of 10.3 tests
#
# MDEV-26108: Recursive CTE embedded into another CTE which is used twice
#
create table t1 (a int);
insert into t1 values (5), (7);
with cte_e as (
with recursive cte_r as (
select a from t1 union select a+1 as a from cte_r r where a < 10
) select * from cte_r
) select * from cte_e s1, cte_e s2 where s1.a=s2.a;
a a
5 5
7 7
6 6
8 8
9 9
10 10
drop table t1;
# End of 10.4 tests
17 changes: 17 additions & 0 deletions mysql-test/main/cte_recursive.test
Original file line number Diff line number Diff line change
Expand Up @@ -3091,3 +3091,20 @@ SELECT * FROM cte;
DROP TABLE t1;

--echo # End of 10.3 tests

--echo #
--echo # MDEV-26108: Recursive CTE embedded into another CTE which is used twice
--echo #

create table t1 (a int);
insert into t1 values (5), (7);

with cte_e as (
with recursive cte_r as (
select a from t1 union select a+1 as a from cte_r r where a < 10
) select * from cte_r
) select * from cte_e s1, cte_e s2 where s1.a=s2.a;

drop table t1;

--echo # End of 10.4 tests
4 changes: 0 additions & 4 deletions mysql-test/main/fetch_first.test
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
if (`SELECT $PS_PROTOCOL != 0`)
{
--skip Test temporarily disabled for ps-protocol
}
--echo #
--echo # The following entries are meant for testing the parser, ensuring
--echo # the right values are passed down to the executor, for all possible
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/main/myisam_crash_before_flush_keys-master.opt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--skip-stack-trace --skip-core-file
--loose-skip-stack-trace --skip-core-file
92 changes: 92 additions & 0 deletions mysql-test/main/opt_trace,ps.rdiff
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
--- /Users/shulga/projects/mariadb/server-10.6/mysql-test/main/opt_trace.result 2021-07-21 19:17:11.000000000 +0700
+++ /Users/shulga/projects/mariadb/server-10.6/mysql-test/main/opt_trace.reject 2021-07-21 19:17:48.000000000 +0700
@@ -2829,14 +2829,6 @@
}
},
{
- "transformation": {
- "select_id": 2,
- "from": "IN (SELECT)",
- "to": "semijoin",
- "chosen": true
- }
- },
- {
"expanded_query": "/* select#2 */ select t10.pk from t10"
}
]
@@ -4402,14 +4394,6 @@
}
},
{
- "transformation": {
- "select_id": 2,
- "from": "IN (SELECT)",
- "to": "semijoin",
- "chosen": true
- }
- },
- {
"expanded_query": "/* select#2 */ select t_inner_1.a from t1 t_inner_1 join t1 t_inner_2"
}
]
@@ -4852,14 +4836,6 @@
}
},
{
- "transformation": {
- "select_id": 2,
- "from": "IN (SELECT)",
- "to": "semijoin",
- "chosen": true
- }
- },
- {
"expanded_query": "/* select#2 */ select t_inner_1.a from t2 t_inner_2 join t1 t_inner_1"
}
]
@@ -4879,14 +4855,6 @@
}
},
{
- "transformation": {
- "select_id": 3,
- "from": "IN (SELECT)",
- "to": "semijoin",
- "chosen": true
- }
- },
- {
"expanded_query": "/* select#3 */ select t_inner_3.a from t2 t_inner_3 join t1 t_inner_4"
}
]
@@ -6432,14 +6400,6 @@
}
},
{
- "transformation": {
- "select_id": 2,
- "from": "IN (SELECT)",
- "to": "semijoin",
- "chosen": true
- }
- },
- {
"expanded_query": "/* select#2 */ select t_inner_1.a from t2 t_inner_2 join t1 t_inner_1"
}
]
@@ -6459,14 +6419,6 @@
}
},
{
- "transformation": {
- "select_id": 3,
- "from": "IN (SELECT)",
- "to": "semijoin",
- "chosen": true
- }
- },
- {
"expanded_query": "/* select#3 */ select t_inner_3.a from t2 t_inner_3 join t1 t_inner_4"
}
]
3 changes: 3 additions & 0 deletions mysql-test/main/wolfssl.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT @@ssl_cipher;
@@ssl_cipher
ECDHE-RSA-AES256-GCM-SHA384
2 changes: 1 addition & 1 deletion mysql-test/suite/binlog/t/binlog_index-master.opt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--skip-stack-trace --log-warnings=0 --log-bin=master-bin --log-bin-index=master-bin
--loose-skip-stack-trace --log-warnings=0 --log-bin=master-bin --log-bin-index=master-bin
2 changes: 1 addition & 1 deletion mysql-test/suite/binlog/t/binlog_mdev342-master.opt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--skip-stack-trace --skip-core-file
--loose-skip-stack-trace --skip-core-file
2 changes: 1 addition & 1 deletion mysql-test/suite/binlog/t/binlog_xa_recover.opt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--skip-stack-trace --skip-core-file --loose-debug-dbug=+d,xa_recover_expect_master_bin_000004
--loose-skip-stack-trace --skip-core-file --loose-debug-dbug=+d,xa_recover_expect_master_bin_000004
2 changes: 2 additions & 0 deletions mysql-test/suite/compat/oracle/r/sp-row.result
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ AS
BEGIN
RETURN a;
END;
$$
CREATE PROCEDURE p1()
AS
a ROW (a INT,b INT);
Expand All @@ -268,6 +269,7 @@ AS
BEGIN
RETURN a;
END;
$$
CREATE PROCEDURE p1()
AS
a ROW (a INT);
Expand Down
Loading

0 comments on commit cee37b5

Please sign in to comment.