Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
b7a6bf12
Commit
b7a6bf12
authored
May 24, 2024
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 11.1 into 11.2
parents
b793feb1
94999c16
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
113 additions
and
16 deletions
+113
-16
extra/mariabackup/xtrabackup.cc
extra/mariabackup/xtrabackup.cc
+2
-2
mysql-test/suite/innodb/r/row_format_redundant.result
mysql-test/suite/innodb/r/row_format_redundant.result
+4
-4
mysql-test/suite/innodb/r/undo_upgrade.result
mysql-test/suite/innodb/r/undo_upgrade.result
+24
-0
mysql-test/suite/innodb/t/row_format_redundant.test
mysql-test/suite/innodb/t/row_format_redundant.test
+5
-1
mysql-test/suite/innodb/t/table_flags.test
mysql-test/suite/innodb/t/table_flags.test
+5
-1
mysql-test/suite/innodb/t/undo_upgrade.test
mysql-test/suite/innodb/t/undo_upgrade.test
+43
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+6
-0
storage/innobase/buf/buf0buf.cc
storage/innobase/buf/buf0buf.cc
+10
-0
storage/innobase/buf/buf0dblwr.cc
storage/innobase/buf/buf0dblwr.cc
+1
-0
storage/innobase/include/buf0buf.h
storage/innobase/include/buf0buf.h
+1
-0
storage/innobase/log/log0recv.cc
storage/innobase/log/log0recv.cc
+3
-3
storage/innobase/srv/srv0start.cc
storage/innobase/srv/srv0start.cc
+6
-1
storage/innobase/trx/trx0undo.cc
storage/innobase/trx/trx0undo.cc
+3
-4
No files found.
extra/mariabackup/xtrabackup.cc
View file @
b7a6bf12
...
...
@@ -1600,11 +1600,11 @@ struct my_option xb_client_options[]= {
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"rsync"
,
OPT_RSYNC
,
"Obsolete
depri
cated option"
,
"Obsolete
, depre
cated option"
,
&
ignored_option
,
&
ignored_option
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"no-backup-locks"
,
OPT_NO_BACKUP_LOCKS
,
"Obsolete
depri
cated option"
,
"Obsolete
, depre
cated option"
,
&
ignored_option
,
&
ignored_option
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"force-non-empty-directories"
,
OPT_FORCE_NON_EMPTY_DIRS
,
...
...
mysql-test/suite/innodb/r/row_format_redundant.result
View file @
b7a6bf12
SET GLOBAL innodb_fast_shutdown=0;
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-data-file-path=ibdata1:1M:autoextend --innodb-undo-tablespaces=0 --innodb-stats-persistent=0
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-data-file-path=ibdata1:1M:autoextend --innodb
_undo_directory=MYSQLTEST_VARDIR/tmp/undo_dir --innodb
-undo-tablespaces=0 --innodb-stats-persistent=0
#
# Bug#21644827 - FTS, ASSERT !SRV_READ_ONLY_MODE || M_IMPL.M_LOG_MODE ==
# MTR_LOG_NO_REDO
...
...
@@ -25,7 +25,7 @@ c varchar(150), index k1(c(99), b(56)), index k2(b(5), c(10))) engine=InnoDB
row_format=redundant;
insert into t3 values(444, 'dddd', 'bbbbb', 'aaaaa');
insert into t3 values(555, 'eeee', 'ccccc', 'aaaaa');
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-data-file-path=ibdata1:1M:autoextend --innodb-undo-tablespaces=0 --innodb-stats-persistent=0 --innodb-read-only
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-data-file-path=ibdata1:1M:autoextend --innodb
_undo_directory=MYSQLTEST_VARDIR/tmp/undo_dir --innodb
-undo-tablespaces=0 --innodb-stats-persistent=0 --innodb-read-only
SELECT COUNT(*) FROM t1;
COUNT(*)
4096
...
...
@@ -41,14 +41,14 @@ TRUNCATE TABLE t2;
ERROR HY000: Table 't2' is read only
TRUNCATE TABLE t3;
ERROR HY000: Table 't3' is read only
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-data-file-path=ibdata1:1M:autoextend --innodb-undo-tablespaces=0 --innodb-stats-persistent=0 --skip-innodb-fast-shutdown
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-data-file-path=ibdata1:1M:autoextend --innodb
_undo_directory=MYSQLTEST_VARDIR/tmp/undo_dir --innodb
-undo-tablespaces=0 --innodb-stats-persistent=0 --skip-innodb-fast-shutdown
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
TRUNCATE TABLE t3;
corrupted SYS_TABLES.MIX_LEN for test/t1
corrupted SYS_TABLES.MIX_LEN for test/t2
corrupted SYS_TABLES.MIX_LEN for test/t3
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-data-file-path=ibdata1:1M:autoextend --innodb-undo-tablespaces=0 --innodb-stats-persistent=0 --skip-innodb-fast-shutdown
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-data-file-path=ibdata1:1M:autoextend --innodb
_undo_directory=MYSQLTEST_VARDIR/tmp/undo_dir --innodb
-undo-tablespaces=0 --innodb-stats-persistent=0 --skip-innodb-fast-shutdown
TRUNCATE TABLE t1;
ERROR 42S02: Table 'test.t1' doesn't exist in engine
TRUNCATE TABLE t2;
...
...
mysql-test/suite/innodb/r/undo_upgrade.result
View file @
b7a6bf12
...
...
@@ -62,3 +62,27 @@ SELECT @@global.innodb_undo_tablespaces;
# Should list 2 undo log tablespaces, not 4
undo001
undo002
#
# MDEV-34200 InnoDB tries to write to read-only
# system tablespace in buf_dblwr_t::init_or_load_pages()
#
SET GLOBAL innodb_fast_shutdown=0;
# restart: --innodb_undo_tablespaces=4
# Should list 4 undo log tablespaces
undo001
undo002
undo003
undo004
set global innodb_fast_shutdown=0;
# restart: --innodb_read_only=1
set global innodb_fast_shutdown=0;
# restart: --innodb-data-file-path=ibdata1:1M:autoextend --innodb_undo_directory=MYSQLTEST_VARDIR/tmp/undo_dir --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/bugdir --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/bugdir --innodb_undo_tablespaces=3
# Should list 3 undo log tablespaces
undo001
undo002
undo003
set global innodb_fast_shutdown=0;
# restart: --innodb-data-file-path=ibdata1:1M:autoextend --innodb_undo_directory=MYSQLTEST_VARDIR/tmp/undo_dir --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/bugdir_1 --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/bugdir_1 --innodb_undo_tablespaces=0
# Shouldn't list 0 undo log tablespaces
set global innodb_fast_shutdown=0;
# restart
mysql-test/suite/innodb/t/row_format_redundant.test
View file @
b7a6bf12
...
...
@@ -16,11 +16,14 @@ let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
let
bugdir
=
$MYSQLTEST_VARDIR
/
tmp
/
row_format_redundant
;
--
mkdir
$bugdir
let
undodir
=
$MYSQLTEST_VARDIR
/
tmp
/
undo_dir
;
--
mkdir
$undodir
--
let
SEARCH_FILE
=
$MYSQLTEST_VARDIR
/
log
/
mysqld
.
1.
err
--
let
$d
=--
innodb
-
data
-
home
-
dir
=
$bugdir
--
innodb
-
log
-
group
-
home
-
dir
=
$bugdir
--
let
$d
=
$d
--
innodb
-
data
-
file
-
path
=
ibdata1
:
1
M
:
autoextend
--
let
$d
=
$d
--
innodb
-
undo
-
tablespaces
=
0
--
innodb
-
stats
-
persistent
=
0
--
let
$d
=
$d
--
innodb
_undo_directory
=
$undodir
--
innodb
-
undo
-
tablespaces
=
0
--
innodb
-
stats
-
persistent
=
0
--
let
$restart_parameters
=
$d
# Ensure that any DDL records from previous tests have been purged.
SET
GLOBAL
innodb_fast_shutdown
=
0
;
...
...
@@ -153,6 +156,7 @@ DROP TABLE t2,t3;
--
list_files
$bugdir
--
remove_files_wildcard
$bugdir
--
rmdir
$bugdir
--
rmdir
$undodir
# Remove the data file, because DROP TABLE skipped it for the "corrupted" table
--
let
MYSQLD_DATADIR
=
`select @@datadir`
...
...
mysql-test/suite/innodb/t/table_flags.test
View file @
b7a6bf12
...
...
@@ -29,12 +29,15 @@ let MYSQLD_DATADIR=`select @@datadir`;
let
bugdir
=
$MYSQLTEST_VARDIR
/
tmp
/
table_flags
;
--
mkdir
$bugdir
let
undodir
=
$MYSQLTEST_VARDIR
/
tmp
/
undo_dir
;
--
mkdir
$undodir
--
let
SEARCH_FILE
=
$MYSQLTEST_VARDIR
/
log
/
mysqld
.
1.
err
--
let
$d
=--
innodb
-
data
-
home
-
dir
=
$bugdir
--
innodb
-
log
-
group
-
home
-
dir
=
$bugdir
--
let
$d
=
$d
--
innodb
-
data
-
file
-
path
=
ibdata1
:
1
M
:
autoextend
--
let
$d
=
$d
--
innodb
-
undo
-
tablespaces
=
0
--
let
$d
=
$d
--
skip
-
innodb
-
fast
-
shutdown
--
let
$d
=
$d
--
skip
-
innodb
-
fast
-
shutdown
--
innodb_undo_directory
=
$undodir
--
let
$restart_noprint
=
1
--
let
$restart_parameters
=
$d
--
innodb
-
stats
-
persistent
=
0
--
source
include
/
restart_mysqld
.
inc
...
...
@@ -233,6 +236,7 @@ DROP TABLE tr,tc,td,tz,tp;
--
list_files
$bugdir
--
remove_files_wildcard
$bugdir
--
rmdir
$bugdir
--
rmdir
$undodir
call
mtr
.
add_suppression
(
"ERROR HY000: Can't create table `test`.`t1`"
);
--
error
ER_CANT_CREATE_TABLE
...
...
mysql-test/suite/innodb/t/undo_upgrade.test
View file @
b7a6bf12
...
...
@@ -76,3 +76,46 @@ SELECT @@global.innodb_undo_tablespaces;
--
echo
# Should list 2 undo log tablespaces, not 4
list_files
$MYSQLD_DATADIR
undo
*
;
--
echo
#
--
echo
# MDEV-34200 InnoDB tries to write to read-only
--
echo
# system tablespace in buf_dblwr_t::init_or_load_pages()
--
echo
#
SET
GLOBAL
innodb_fast_shutdown
=
0
;
let
$restart_parameters
=--
innodb_undo_tablespaces
=
4
;
--
source
include
/
restart_mysqld
.
inc
--
echo
# Should list 4 undo log tablespaces
list_files
$MYSQLD_DATADIR
undo
*
;
set
global
innodb_fast_shutdown
=
0
;
let
$restart_parameters
=--
innodb_read_only
=
1
;
--
source
include
/
restart_mysqld
.
inc
set
global
innodb_fast_shutdown
=
0
;
let
bugdir
=
$MYSQLTEST_VARDIR
/
tmp
/
bugdir
;
mkdir
$bugdir
;
let
undodir
=
$MYSQLTEST_VARDIR
/
tmp
/
undo_dir
;
mkdir
$undodir
;
let
$d
=
--
innodb
-
data
-
file
-
path
=
ibdata1
:
1
M
:
autoextend
;
let
$d
=
$d
--
innodb_undo_directory
=
$undodir
;
let
$restart_parameters
=
$d
--
innodb
-
data
-
home
-
dir
=
$bugdir
--
innodb
-
log
-
group
-
home
-
dir
=
$bugdir
--
innodb_undo_tablespaces
=
3
;
--
source
include
/
restart_mysqld
.
inc
--
echo
# Should list 3 undo log tablespaces
list_files
$undodir
undo
*
;
let
bugdir_1
=
$MYSQLTEST_VARDIR
/
tmp
/
bugdir_1
;
mkdir
$bugdir_1
;
set
global
innodb_fast_shutdown
=
0
;
let
$restart_parameters
=
$d
--
innodb
-
data
-
home
-
dir
=
$bugdir_1
--
innodb
-
log
-
group
-
home
-
dir
=
$bugdir_1
--
innodb_undo_tablespaces
=
0
;
--
source
include
/
restart_mysqld
.
inc
--
echo
# Shouldn't list 0 undo log tablespaces
list_files
$undodir
undo
*
;
set
global
innodb_fast_shutdown
=
0
;
let
$restart_parameters
=
;
--
source
include
/
restart_mysqld
.
inc
rmdir
$bugdir
;
rmdir
$bugdir_1
;
rmdir
$undodir
;
sql/item_strfunc.cc
View file @
b7a6bf12
...
...
@@ -1428,6 +1428,12 @@ bool Item_func_sformat::fix_length_and_dec(THD *thd)
*/
namespace
fmt
{
template
<
>
struct
formatter
<
String
>:
formatter
<
string_view
>
{
template
<
typename
FormatContext
>
auto
format
(
String
c
,
FormatContext
&
ctx
)
const
->
decltype
(
ctx
.
out
())
{
string_view
name
=
{
c
.
ptr
(),
c
.
length
()
};
return
formatter
<
string_view
>::
format
(
name
,
ctx
);
};
/* needed below function for libfmt-7.1.3 compatibility, (not 9.1.0+) */
template
<
typename
FormatContext
>
auto
format
(
String
c
,
FormatContext
&
ctx
)
->
decltype
(
ctx
.
out
())
{
string_view
name
=
{
c
.
ptr
(),
c
.
length
()
};
...
...
storage/innobase/buf/buf0buf.cc
View file @
b7a6bf12
...
...
@@ -2587,6 +2587,15 @@ buf_page_get_gen(
{
ulint
retries
=
0
;
/* BUF_GET_RECOVER is only used by recv_sys_t::recover(),
which must be invoked during early server startup when crash
recovery may be in progress. The only case when it may be
invoked outside recovery is when dict_create() has initialized
a new database and is invoking dict_boot(). In this case, the
LSN will be small. */
ut_ad
(
mode
==
BUF_GET_RECOVER
?
recv_recovery_is_on
()
||
log_sys
.
get_lsn
()
<
50000
:
!
recv_recovery_is_on
()
||
recv_sys
.
after_apply
);
ut_ad
(
!
mtr
||
mtr
->
is_active
());
ut_ad
(
mtr
||
mode
==
BUF_PEEK_IF_IN_POOL
);
ut_ad
((
rw_latch
==
RW_S_LATCH
)
...
...
@@ -2608,6 +2617,7 @@ buf_page_get_gen(
/* The caller may pass a dummy page size,
because it does not really matter. */
break
;
case
BUF_GET_RECOVER
:
case
BUF_GET
:
ut_ad
(
!
mtr
->
is_freeing_tree
());
fil_space_t
*
s
=
fil_space_get
(
page_id
.
space
());
...
...
storage/innobase/buf/buf0dblwr.cc
View file @
b7a6bf12
...
...
@@ -284,6 +284,7 @@ dberr_t buf_dblwr_t::init_or_load_pages(pfs_os_file_t file, const char *path)
init
(
TRX_SYS_DOUBLEWRITE
+
read_buf
);
const
bool
upgrade_to_innodb_file_per_table
=
!
srv_read_only_mode
&&
mach_read_from_4
(
TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED
+
TRX_SYS_DOUBLEWRITE
+
read_buf
)
!=
TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED_N
;
...
...
storage/innobase/include/buf0buf.h
View file @
b7a6bf12
...
...
@@ -45,6 +45,7 @@ Created 11/5/1995 Heikki Tuuri
/** @name Modes for buf_page_get_gen */
/* @{ */
#define BUF_GET 10
/*!< get always */
#define BUF_GET_RECOVER 9
/*!< like BUF_GET, but in recv_sys.recover() */
#define BUF_GET_IF_IN_POOL 11
/*!< get if in pool */
#define BUF_PEEK_IF_IN_POOL 12
/*!< get if in pool, do not make
the block young in the LRU list */
...
...
storage/innobase/log/log0recv.cc
View file @
b7a6bf12
...
...
@@ -3678,8 +3678,8 @@ recv_sys_t::recover(const page_id_t page_id, mtr_t *mtr, dberr_t *err)
{
if
(
!
recovery_on
)
must_read:
return
buf_page_get_gen
(
page_id
,
0
,
RW_
S_LATCH
,
nullptr
,
BUF_GET
,
mtr
,
err
);
return
buf_page_get_gen
(
page_id
,
0
,
RW_
NO_LATCH
,
nullptr
,
BUF_GET_RECOVER
,
mtr
,
err
);
mysql_mutex_lock
(
&
mutex
);
map
::
iterator
p
=
pages
.
find
(
page_id
);
...
...
@@ -3728,7 +3728,7 @@ recv_sys_t::recover(const page_id_t page_id, mtr_t *mtr, dberr_t *err)
goto
corrupted
;
}
mtr
->
page_lock
(
block
,
RW_
S
_LATCH
);
mtr
->
page_lock
(
block
,
RW_
NO
_LATCH
);
return
block
;
}
...
...
storage/innobase/srv/srv0start.cc
View file @
b7a6bf12
...
...
@@ -369,6 +369,11 @@ inline dberr_t trx_sys_t::reset_page(mtr_t *mtr)
sys_header
->
page
.
frame
+
TRX_SYS_DOUBLEWRITE
+
FSEG_HEADER_SIZE
+
TRX_SYS_DOUBLEWRITE_REPEAT
,
sys_header
->
page
.
frame
+
TRX_SYS_DOUBLEWRITE
+
FSEG_HEADER_SIZE
,
12
);
mtr
->
write
<
4
>
(
*
sys_header
,
TRX_SYS_DOUBLEWRITE
+
TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED
+
sys_header
->
page
.
frame
,
TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED_N
);
}
return
DB_SUCCESS
;
...
...
@@ -822,7 +827,7 @@ static dberr_t srv_all_undo_tablespaces_open(bool create_new_undo,
{
char
name
[
OS_FILE_MAX_PATH
];
snprintf
(
name
,
sizeof
name
,
"%s/undo%03u"
,
srv_undo_dir
,
i
);
uint32_t
space_id
=
srv_undo_tablespace_open
(
create_new_undo
,
name
,
i
);
uint32_t
space_id
=
srv_undo_tablespace_open
(
false
,
name
,
i
);
if
(
!
space_id
||
space_id
==
~
0U
)
break
;
if
(
0
==
srv_undo_tablespaces_open
++
)
...
...
storage/innobase/trx/trx0undo.cc
View file @
b7a6bf12
...
...
@@ -980,7 +980,7 @@ trx_undo_mem_create_at_db_start(trx_rseg_t *rseg, ulint id, uint32_t page_no)
mtr
.
start
();
const
page_id_t
page_id
{
rseg
->
space
->
id
,
page_no
};
const
buf_block_t
*
block
=
buf_page_get
(
page_id
,
0
,
RW_X_LATCH
,
&
m
tr
);
const
buf_block_t
*
block
=
recv_sys
.
recover
(
page_id
,
&
mtr
,
nullp
tr
);
if
(
UNIV_UNLIKELY
(
!
block
))
{
corrupted:
mtr
.
commit
();
...
...
@@ -1094,9 +1094,8 @@ trx_undo_mem_create_at_db_start(trx_rseg_t *rseg, ulint id, uint32_t page_no)
undo
->
last_page_no
=
last_addr
.
page
;
undo
->
top_page_no
=
last_addr
.
page
;
const
buf_block_t
*
last
=
buf_page_get
(
page_id_t
(
rseg
->
space
->
id
,
undo
->
last_page_no
),
0
,
RW_X_LATCH
,
&
mtr
);
const
buf_block_t
*
last
=
recv_sys
.
recover
(
page_id_t
(
rseg
->
space
->
id
,
undo
->
last_page_no
),
&
mtr
,
nullptr
);
if
(
UNIV_UNLIKELY
(
!
last
))
{
goto
corrupted_undo
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment