Skip to content

Commit

Permalink
Merge 10.2 into 10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Apr 6, 2022
2 parents 2d2c3da + 75b9014 commit 7c584d8
Show file tree
Hide file tree
Showing 14 changed files with 84 additions and 306 deletions.
44 changes: 22 additions & 22 deletions extra/innochecksum.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2014, 2021, MariaDB Corporation.
Copyright (c) 2014, 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -884,7 +884,7 @@ parse_page(

is_leaf = (!*(const uint16*) (page + (PAGE_HEADER + PAGE_LEVEL)));

if (page_type_dump) {
if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tIndex page\t\t\t|"
"\tindex id=%llu,", cur_page_num, id);

Expand Down Expand Up @@ -937,7 +937,7 @@ parse_page(
index.total_data_bytes += data_bytes;
index.pages_in_size_range[size_range_id] ++;
}
} else {
} else if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tEncrypted Index page\t\t\t|"
"\tkey_version " UINT32PF ",%s\n", cur_page_num, key_version, str);
}
Expand All @@ -948,7 +948,7 @@ parse_page(
page_type.n_fil_page_undo_log++;
undo_page_type = mach_read_from_2(page +
TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_TYPE);
if (page_type_dump) {
if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tUndo log page\t\t\t|",
cur_page_num);
}
Expand All @@ -958,23 +958,23 @@ parse_page(
switch (undo_page_type) {
case TRX_UNDO_ACTIVE:
page_type.n_undo_state_active++;
if (page_type_dump) {
if (file) {
fprintf(file, ", %s", "Undo log of "
"an active transaction");
}
break;

case TRX_UNDO_CACHED:
page_type.n_undo_state_cached++;
if (page_type_dump) {
if (file) {
fprintf(file, ", %s", "Page is "
"cached for quick reuse");
}
break;

case TRX_UNDO_TO_PURGE:
page_type.n_undo_state_to_purge++;
if (page_type_dump) {
if (file) {
fprintf(file, ", %s", "Will be "
"freed in purge when all undo"
"data in it is removed");
Expand All @@ -983,7 +983,7 @@ parse_page(

case TRX_UNDO_PREPARED:
page_type.n_undo_state_prepared++;
if (page_type_dump) {
if (file) {
fprintf(file, ", %s", "Undo log of "
"an prepared transaction");
}
Expand All @@ -993,110 +993,110 @@ parse_page(
page_type.n_undo_state_other++;
break;
}
if(page_type_dump) {
if(file) {
fprintf(file, ", %s\n", str);
}
break;

case FIL_PAGE_INODE:
page_type.n_fil_page_inode++;
if (page_type_dump) {
if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tInode page\t\t\t|"
"\t%s\n",cur_page_num, str);
}
break;

case FIL_PAGE_IBUF_FREE_LIST:
page_type.n_fil_page_ibuf_free_list++;
if (page_type_dump) {
if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tInsert buffer free list"
" page\t|\t%s\n", cur_page_num, str);
}
break;

case FIL_PAGE_TYPE_ALLOCATED:
page_type.n_fil_page_type_allocated++;
if (page_type_dump) {
if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tFreshly allocated "
"page\t\t|\t%s\n", cur_page_num, str);
}
break;

case FIL_PAGE_IBUF_BITMAP:
page_type.n_fil_page_ibuf_bitmap++;
if (page_type_dump) {
if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tInsert Buffer "
"Bitmap\t\t|\t%s\n", cur_page_num, str);
}
break;

case FIL_PAGE_TYPE_SYS:
page_type.n_fil_page_type_sys++;
if (page_type_dump) {
if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tSystem page\t\t\t|"
"\t%s\n", cur_page_num, str);
}
break;

case FIL_PAGE_TYPE_TRX_SYS:
page_type.n_fil_page_type_trx_sys++;
if (page_type_dump) {
if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tTransaction system "
"page\t\t|\t%s\n", cur_page_num, str);
}
break;

case FIL_PAGE_TYPE_FSP_HDR:
page_type.n_fil_page_type_fsp_hdr++;
if (page_type_dump) {
if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tFile Space "
"Header\t\t|\t%s\n", cur_page_num, str);
}
break;

case FIL_PAGE_TYPE_XDES:
page_type.n_fil_page_type_xdes++;
if (page_type_dump) {
if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tExtent descriptor "
"page\t\t|\t%s\n", cur_page_num, str);
}
break;

case FIL_PAGE_TYPE_BLOB:
page_type.n_fil_page_type_blob++;
if (page_type_dump) {
if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tBLOB page\t\t\t|\t%s\n",
cur_page_num, str);
}
break;

case FIL_PAGE_TYPE_ZBLOB:
page_type.n_fil_page_type_zblob++;
if (page_type_dump) {
if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tCompressed BLOB "
"page\t\t|\t%s\n", cur_page_num, str);
}
break;

case FIL_PAGE_TYPE_ZBLOB2:
page_type.n_fil_page_type_zblob2++;
if (page_type_dump) {
if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tSubsequent Compressed "
"BLOB page\t|\t%s\n", cur_page_num, str);
}
break;

case FIL_PAGE_PAGE_COMPRESSED:
page_type.n_fil_page_type_page_compressed++;
if (page_type_dump) {
if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tPage compressed "
"page\t|\t%s\n", cur_page_num, str);
}
break;

case FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED:
page_type.n_fil_page_type_page_compressed_encrypted++;
if (page_type_dump) {
if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tPage compressed encrypted "
"page\t|\t%s\n", cur_page_num, str);
}
Expand Down
5 changes: 4 additions & 1 deletion include/my_time.h
Expand Up @@ -217,9 +217,12 @@ static inline void my_time_trunc(MYSQL_TIME *ltime, uint decimals)
{
ltime->second_part-= my_time_fraction_remainder(ltime->second_part, decimals);
}
#ifdef _WIN32
#define suseconds_t long
#endif
static inline void my_timeval_trunc(struct timeval *tv, uint decimals)
{
tv->tv_usec-= my_time_fraction_remainder(tv->tv_usec, decimals);
tv->tv_usec-= (suseconds_t) my_time_fraction_remainder(tv->tv_usec, decimals);
}


Expand Down
22 changes: 22 additions & 0 deletions mysql-test/main/ps.result
Expand Up @@ -5564,6 +5564,28 @@ a
DEALLOCATE PREPARE stmt;
DROP VIEW v1;
DROP TABLE t1;
#
# MDEV-19631: Assertion `0' failed in st_select_lex_unit::optimize or
# different plan upon 2nd execution of PS with EXPLAIN
#
CREATE TABLE t1 (a INT);
PREPARE stmt FROM 'EXPLAIN SELECT * FROM t1 HAVING 6 IN ( SELECT 6 UNION SELECT 5 )';
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
# Without the patch the second execution of the 'stmt' prepared statement
# would result in server crash.
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
# End of 10.2 tests
#
#
Expand Down
13 changes: 13 additions & 0 deletions mysql-test/main/ps.test
Expand Up @@ -5013,6 +5013,19 @@ DEALLOCATE PREPARE stmt;
DROP VIEW v1;
DROP TABLE t1;

--echo #
--echo # MDEV-19631: Assertion `0' failed in st_select_lex_unit::optimize or
--echo # different plan upon 2nd execution of PS with EXPLAIN
--echo #
CREATE TABLE t1 (a INT);
PREPARE stmt FROM 'EXPLAIN SELECT * FROM t1 HAVING 6 IN ( SELECT 6 UNION SELECT 5 )';
EXECUTE stmt;
--echo # Without the patch the second execution of the 'stmt' prepared statement
--echo # would result in server crash.
EXECUTE stmt;
# Cleanup
DEALLOCATE PREPARE stmt;
DROP TABLE t1;

--echo # End of 10.2 tests
--echo #
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/encryption/r/innochecksum.result
Expand Up @@ -7,7 +7,7 @@ CREATE TABLE t3 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB ROW_FOR
CREATE TABLE t4 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED=1;
CREATE TABLE t5 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED=1 ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
CREATE TABLE t6 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
# Run innochecksum on t1
# Run innochecksum on t1, check -S does not cause crash for encrypted file
# Run innochecksum on t2
# Run innochecksum on t3
# Run innochecksum on t4
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/suite/encryption/t/innochecksum.test
Expand Up @@ -55,9 +55,9 @@ let MYSQLD_DATADIR=`select @@datadir`;

--source include/shutdown_mysqld.inc

--echo # Run innochecksum on t1
-- disable_result_log
--exec $INNOCHECKSUM $t1_IBD
--echo # Run innochecksum on t1, check -S does not cause crash for encrypted file
--exec $INNOCHECKSUM -S $t1_IBD

--echo # Run innochecksum on t2

Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/mariabackup/full_backup.result
@@ -1,6 +1,7 @@
CREATE TABLE t(i INT) ENGINE INNODB;
INSERT INTO t VALUES(1);
# xtrabackup backup
NOT FOUND /InnoDB: Allocated tablespace ID/ in backup.log
INSERT INTO t VALUES(2);
# xtrabackup prepare
# shutdown server
Expand Down
9 changes: 8 additions & 1 deletion mysql-test/suite/mariabackup/full_backup.test
Expand Up @@ -4,11 +4,18 @@ CREATE TABLE t(i INT) ENGINE INNODB;
INSERT INTO t VALUES(1);
echo # xtrabackup backup;
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
--let $backup_log=$MYSQLTEST_VARDIR/tmp/backup.log

--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir > $backup_log 2>&1;
--enable_result_log

# The following warning must not appear after MDEV-27343 fix
--let SEARCH_PATTERN=InnoDB: Allocated tablespace ID
--let SEARCH_FILE=$backup_log
--source include/search_pattern_in_file.inc
--remove_file $backup_log

INSERT INTO t VALUES(2);


Expand Down
6 changes: 1 addition & 5 deletions sql/ha_partition.h
Expand Up @@ -3,7 +3,7 @@

/*
Copyright (c) 2005, 2012, Oracle and/or its affiliates.
Copyright (c) 2009, 2021, MariaDB Corporation.
Copyright (c) 2009, 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -1093,10 +1093,6 @@ class ha_partition :public handler
NOTE: This cannot be cached since it can depend on TRANSACTION ISOLATION
LEVEL which is dynamic, see bug#39084.
HA_READ_RND_SAME:
Not currently used. (Means that the handler supports the rnd_same() call)
(MyISAM, HEAP)
HA_TABLE_SCAN_ON_INDEX:
Used to avoid scanning full tables on an index. If this flag is set then
the handler always has a primary key (hidden if not defined) and this
Expand Down

0 comments on commit 7c584d8

Please sign in to comment.