summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-09-11 11:14:18 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-09-11 11:14:18 +0300
commitbcd25e1066bcf545d8f6988ef9f1c0983db2bcfd (patch)
treecd9578d16e088bd57e169d1430a20a5704557545
parent46cb16388a865d9561ba234011085ad2a8e42c44 (diff)
parentac064c2b4721fe3d7cafae3b4dfa5853f0797347 (diff)
downloadmariadb-git-bcd25e1066bcf545d8f6988ef9f1c0983db2bcfd.tar.gz
Merge 10.2 into 10.3
-rw-r--r--mysql-test/suite/innodb/r/alter_partitioned.result4
-rw-r--r--mysql-test/suite/innodb/t/alter_partitioned.test4
-rw-r--r--mysql-test/suite/innodb/t/check_ibd_filesize.test6
-rw-r--r--storage/innobase/fil/fil0fil.cc11
-rw-r--r--storage/innobase/os/os0file.cc7
-rw-r--r--win/packaging/mysql_server.wxs.in2
6 files changed, 27 insertions, 7 deletions
diff --git a/mysql-test/suite/innodb/r/alter_partitioned.result b/mysql-test/suite/innodb/r/alter_partitioned.result
index 145465c6cba..511385a0484 100644
--- a/mysql-test/suite/innodb/r/alter_partitioned.result
+++ b/mysql-test/suite/innodb/r/alter_partitioned.result
@@ -11,10 +11,14 @@ SAVEPOINT sp;
INSERT INTO t1 (pk) VALUES (1);
ROLLBACK TO SAVEPOINT sp;
connection default;
+SET @save_timeout=@@lock_wait_timeout;
+SET @save_innodb_timeout=@@innodb_lock_wait_timeout;
SET lock_wait_timeout=0;
SET innodb_lock_wait_timeout=0;
ALTER TABLE t1 PARTITION BY HASH(pk);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SET lock_wait_timeout=@save_timeout;
+SET innodb_lock_wait_timeout=@save_innodb_timeout;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/suite/innodb/t/alter_partitioned.test b/mysql-test/suite/innodb/t/alter_partitioned.test
index f9cff1bd12f..29b189d3df9 100644
--- a/mysql-test/suite/innodb/t/alter_partitioned.test
+++ b/mysql-test/suite/innodb/t/alter_partitioned.test
@@ -18,10 +18,14 @@ INSERT INTO t1 (pk) VALUES (1);
ROLLBACK TO SAVEPOINT sp;
--connection default
+SET @save_timeout=@@lock_wait_timeout;
+SET @save_innodb_timeout=@@innodb_lock_wait_timeout;
SET lock_wait_timeout=0;
SET innodb_lock_wait_timeout=0;
--error ER_LOCK_WAIT_TIMEOUT
ALTER TABLE t1 PARTITION BY HASH(pk);
+SET lock_wait_timeout=@save_timeout;
+SET innodb_lock_wait_timeout=@save_innodb_timeout;
SHOW CREATE TABLE t1;
--connection con1
diff --git a/mysql-test/suite/innodb/t/check_ibd_filesize.test b/mysql-test/suite/innodb/t/check_ibd_filesize.test
index 92f9061a3f6..b6ab95e1930 100644
--- a/mysql-test/suite/innodb/t/check_ibd_filesize.test
+++ b/mysql-test/suite/innodb/t/check_ibd_filesize.test
@@ -46,6 +46,12 @@ perl;
print "# bytes: ", (-s "$ENV{MYSQLD_DATADIR}/test/t1.ibd"), "\n";
EOF
INSERT INTO t1 SELECT seq,REPEAT('a',30000) FROM seq_1_to_20;
+# Ensure that the file will be extended with the last 1024-byte page
+# after the file was pre-extended in 4096-byte increments.
+--disable_query_log
+FLUSH TABLE t1 FOR EXPORT;
+UNLOCK TABLES;
+--enable_query_log
perl;
print "# bytes: ", (-s "$ENV{MYSQLD_DATADIR}/test/t1.ibd"), "\n";
EOF
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index 16069351651..89f89d60454 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -942,10 +942,15 @@ fil_space_extend_must_retry(
const page_size_t pageSize(space->flags);
const ulint page_size = pageSize.physical();
- /* fil_read_first_page() expects srv_page_size bytes.
- fil_node_open_file() expects at least 4 * srv_page_size bytes.*/
+ /* fil_read_first_page() expects innodb_page_size bytes.
+ fil_node_open_file() expects at least 4 * innodb_page_size bytes.
+ os_file_set_size() expects multiples of 4096 bytes.
+ For ROW_FORMAT=COMPRESSED tables using 1024-byte or 2048-byte
+ pages, we will preallocate up to an integer multiple of 4096 bytes,
+ and let normal writes append 1024, 2048, or 3072 bytes to the file. */
os_offset_t new_size = std::max(
- os_offset_t(size - file_start_page_no) * page_size,
+ (os_offset_t(size - file_start_page_no) * page_size)
+ & ~os_offset_t(4095),
os_offset_t(FIL_IBD_FILE_INITIAL_SIZE << srv_page_size_shift));
*success = os_file_set_size(node->name, node->handle, new_size,
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index 4ec42eb805a..b099f25cd35 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -5351,6 +5351,8 @@ os_file_set_size(
os_offset_t size,
bool is_sparse)
{
+ ut_ad(!(size & 4095));
+
#ifdef _WIN32
/* On Windows, changing file size works well and as expected for both
sparse and normal files.
@@ -5392,7 +5394,7 @@ fallback:
if (current_size >= size) {
return true;
}
- current_size &= ~os_offset_t(statbuf.st_blksize - 1);
+ current_size &= ~4095ULL;
err = posix_fallocate(file, current_size,
size - current_size);
}
@@ -5432,8 +5434,7 @@ fallback:
if (fstat(file, &statbuf)) {
return false;
}
- os_offset_t current_size = statbuf.st_size
- & ~os_offset_t(statbuf.st_blksize - 1);
+ os_offset_t current_size = statbuf.st_size & ~4095ULL;
#endif
if (current_size >= size) {
return true;
diff --git a/win/packaging/mysql_server.wxs.in b/win/packaging/mysql_server.wxs.in
index c10116830e7..6a157c56347 100644
--- a/win/packaging/mysql_server.wxs.in
+++ b/win/packaging/mysql_server.wxs.in
@@ -18,7 +18,7 @@
SummaryCodepage='1252'
Platform='@Platform@'/>
- <Media Id='1' Cabinet='product.cab' EmbedCab='yes' CompressionLevel='high' />
+ <MediaTemplate EmbedCab="yes" MaximumUncompressedMediaSize="2" CompressionLevel="high"/>
<!-- Upgrade -->
<Upgrade Id="@CPACK_WIX_UPGRADE_CODE@">