Commit 2d084781 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.4 into 10.5

parents f99cc0d2 101d10b8
...@@ -11,10 +11,14 @@ SAVEPOINT sp; ...@@ -11,10 +11,14 @@ SAVEPOINT sp;
INSERT INTO t1 (pk) VALUES (1); INSERT INTO t1 (pk) VALUES (1);
ROLLBACK TO SAVEPOINT sp; ROLLBACK TO SAVEPOINT sp;
connection default; connection default;
SET @save_timeout=@@lock_wait_timeout;
SET @save_innodb_timeout=@@innodb_lock_wait_timeout;
SET lock_wait_timeout=0; SET lock_wait_timeout=0;
SET innodb_lock_wait_timeout=0; SET innodb_lock_wait_timeout=0;
ALTER TABLE t1 PARTITION BY HASH(pk); ALTER TABLE t1 PARTITION BY HASH(pk);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction 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; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
......
...@@ -18,10 +18,14 @@ INSERT INTO t1 (pk) VALUES (1); ...@@ -18,10 +18,14 @@ INSERT INTO t1 (pk) VALUES (1);
ROLLBACK TO SAVEPOINT sp; ROLLBACK TO SAVEPOINT sp;
--connection default --connection default
SET @save_timeout=@@lock_wait_timeout;
SET @save_innodb_timeout=@@innodb_lock_wait_timeout;
SET lock_wait_timeout=0; SET lock_wait_timeout=0;
SET innodb_lock_wait_timeout=0; SET innodb_lock_wait_timeout=0;
--error ER_LOCK_WAIT_TIMEOUT --error ER_LOCK_WAIT_TIMEOUT
ALTER TABLE t1 PARTITION BY HASH(pk); 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; SHOW CREATE TABLE t1;
--connection con1 --connection con1
......
...@@ -46,6 +46,12 @@ perl; ...@@ -46,6 +46,12 @@ perl;
print "# bytes: ", (-s "$ENV{MYSQLD_DATADIR}/test/t1.ibd"), "\n"; print "# bytes: ", (-s "$ENV{MYSQLD_DATADIR}/test/t1.ibd"), "\n";
EOF EOF
INSERT INTO t1 SELECT seq,REPEAT('a',30000) FROM seq_1_to_20; 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; perl;
print "# bytes: ", (-s "$ENV{MYSQLD_DATADIR}/test/t1.ibd"), "\n"; print "# bytes: ", (-s "$ENV{MYSQLD_DATADIR}/test/t1.ibd"), "\n";
EOF EOF
......
...@@ -2571,6 +2571,7 @@ dict_load_indexes( ...@@ -2571,6 +2571,7 @@ dict_load_indexes(
goto func_exit; goto func_exit;
} }
#ifdef UNIV_DEBUG
// The following assertion doesn't hold for FTS indexes // The following assertion doesn't hold for FTS indexes
// as it may have prefix_len=1 with any charset // as it may have prefix_len=1 with any charset
if (index->type != DICT_FTS) { if (index->type != DICT_FTS) {
...@@ -2581,6 +2582,7 @@ dict_load_indexes( ...@@ -2581,6 +2582,7 @@ dict_load_indexes(
% f.col->mbmaxlen == 0); % f.col->mbmaxlen == 0);
} }
} }
#endif /* UNIV_DEBUG */
} }
next_rec: next_rec:
btr_pcur_move_to_next_user_rec(&pcur, &mtr); btr_pcur_move_to_next_user_rec(&pcur, &mtr);
......
...@@ -578,10 +578,15 @@ fil_space_extend_must_retry( ...@@ -578,10 +578,15 @@ fil_space_extend_must_retry(
const unsigned page_size = space->physical_size(); const unsigned page_size = space->physical_size();
/* Datafile::read_first_page() expects srv_page_size bytes. /* Datafile::read_first_page() expects innodb_page_size bytes.
fil_node_t::read_page0() expects at least 4 * srv_page_size bytes.*/ fil_node_t::read_page0() 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 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)); os_offset_t(FIL_IBD_FILE_INITIAL_SIZE << srv_page_size_shift));
*success = os_file_set_size(node->name, node->handle, new_size, *success = os_file_set_size(node->name, node->handle, new_size,
......
...@@ -3303,6 +3303,8 @@ os_file_set_size( ...@@ -3303,6 +3303,8 @@ os_file_set_size(
os_offset_t size, os_offset_t size,
bool is_sparse) bool is_sparse)
{ {
ut_ad(!(size & 4095));
#ifdef _WIN32 #ifdef _WIN32
/* On Windows, changing file size works well and as expected for both /* On Windows, changing file size works well and as expected for both
sparse and normal files. sparse and normal files.
...@@ -3344,7 +3346,7 @@ os_file_set_size( ...@@ -3344,7 +3346,7 @@ os_file_set_size(
if (current_size >= size) { if (current_size >= size) {
return true; return true;
} }
current_size &= ~os_offset_t(statbuf.st_blksize - 1); current_size &= ~4095ULL;
err = posix_fallocate(file, current_size, err = posix_fallocate(file, current_size,
size - current_size); size - current_size);
} }
...@@ -3384,8 +3386,7 @@ os_file_set_size( ...@@ -3384,8 +3386,7 @@ os_file_set_size(
if (fstat(file, &statbuf)) { if (fstat(file, &statbuf)) {
return false; return false;
} }
os_offset_t current_size = statbuf.st_size os_offset_t current_size = statbuf.st_size & ~4095ULL;
& ~os_offset_t(statbuf.st_blksize - 1);
#endif #endif
if (current_size >= size) { if (current_size >= size) {
return true; return true;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
SummaryCodepage='1252' SummaryCodepage='1252'
Platform='@Platform@'/> Platform='@Platform@'/>
<Media Id='1' Cabinet='product.cab' EmbedCab='yes' CompressionLevel='high' /> <MediaTemplate EmbedCab="yes" MaximumUncompressedMediaSize="2" CompressionLevel="high"/>
<!-- Upgrade --> <!-- Upgrade -->
<Upgrade Id="@CPACK_WIX_UPGRADE_CODE@"> <Upgrade Id="@CPACK_WIX_UPGRADE_CODE@">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment