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
2daf3b14
Commit
2daf3b14
authored
Jan 31, 2020
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.1 into 10.2
parents
f37a56de
0b36c27e
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
68 additions
and
129 deletions
+68
-129
.gitignore
.gitignore
+2
-0
man/CMakeLists.txt
man/CMakeLists.txt
+4
-3
sql/log.cc
sql/log.cc
+12
-18
sql/log.h
sql/log.h
+13
-2
storage/innobase/dict/dict0dict.cc
storage/innobase/dict/dict0dict.cc
+5
-2
storage/innobase/fil/fil0crypt.cc
storage/innobase/fil/fil0crypt.cc
+4
-45
storage/xtradb/dict/dict0dict.cc
storage/xtradb/dict/dict0dict.cc
+5
-2
storage/xtradb/fil/fil0crypt.cc
storage/xtradb/fil/fil0crypt.cc
+3
-42
support-files/CMakeLists.txt
support-files/CMakeLists.txt
+20
-15
No files found.
.gitignore
View file @
2daf3b14
...
...
@@ -244,6 +244,8 @@ support-files/mysqld_multi.server
support-files/wsrep.cnf
support-files/wsrep_notify
support-files/policy/selinux/mysqld-safe.pp
support-files/sysusers.conf
support-files/tmpfiles.conf
support-files/mariadb.pp
tags
tests/async_queries
...
...
man/CMakeLists.txt
View file @
2daf3b14
# Copyright (c) 2012,
Monty Program Ab
# Copyright (c) 2012,
2020, MariaDB
#
# 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
...
...
@@ -21,7 +21,7 @@ SET(MAN1_SERVER innochecksum.1 my_print_defaults.1 myisam_ftdump.1 myisamchk.1
mysql_secure_installation.1 mysql_setpermission.1
mysql_tzinfo_to_sql.1 mysql_upgrade.1
mysqld_multi.1 mysqld_safe.1 mysqldumpslow.1 mysqlhotcopy.1
mysqltest.1
perror.1 replace.1 resolve_stack_dump.1
perror.1 replace.1 resolve_stack_dump.1
resolveip.1 mariadb-service-convert.1
mysqld_safe_helper.1 wsrep_sst_common.1
wsrep_sst_mysqldump.1 wsrep_sst_rsync.1
...
...
@@ -37,7 +37,8 @@ SET(MAN1_CLIENT msql2mysql.1 mysql.1 mysql_find_rows.1 mysql_waitpid.1
mysql_plugin.1 mysql_embedded.1
)
SET
(
MAN1_DEVEL mysql_config.1
)
SET
(
MAN1_TEST mysql-stress-test.pl.1 mysql-test-run.pl.1 mysql_client_test.1
mysqltest_embedded.1 mysql_client_test_embedded.1 my_safe_process.1
)
mysqltest.1 mysqltest_embedded.1 mysql_client_test_embedded.1
my_safe_process.1
)
INSTALL
(
FILES
${
MAN1_SERVER
}
DESTINATION
${
INSTALL_MANDIR
}
/man1 COMPONENT ManPagesServer
)
INSTALL
(
FILES
${
MAN8_SERVER
}
DESTINATION
${
INSTALL_MANDIR
}
/man8 COMPONENT ManPagesServer
)
...
...
sql/log.cc
View file @
2daf3b14
/* Copyright (c) 2000, 2018, Oracle and/or its affiliates.
Copyright (c) 2009, 20
19, MariaDB Corporation
Copyright (c) 2009, 20
20, 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
...
...
@@ -3211,7 +3211,7 @@ void MYSQL_BIN_LOG::cleanup()
DBUG_ASSERT
(
!
binlog_xid_count_list
.
head
());
WSREP_XID_LIST_ENTRY
(
"MYSQL_BIN_LOG::cleanup(): Removing xid_list_entry "
"for %s (%lu)"
,
b
);
my_free
(
b
)
;
delete
b
;
}
mysql_mutex_destroy
(
&
LOCK_log
);
...
...
@@ -3575,18 +3575,9 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
*/
uint
off
=
dirname_length
(
log_file_name
);
uint
len
=
strlen
(
log_file_name
)
-
off
;
char
*
entry_mem
,
*
name_mem
;
if
(
!
(
new_xid_list_entry
=
(
xid_count_per_binlog
*
)
my_multi_malloc
(
MYF
(
MY_WME
),
&
entry_mem
,
sizeof
(
xid_count_per_binlog
),
&
name_mem
,
len
,
NULL
)))
new_xid_list_entry
=
new
xid_count_per_binlog
(
log_file_name
+
off
,
(
int
)
len
);
if
(
!
new_xid_list_entry
)
goto
err
;
memcpy
(
name_mem
,
log_file_name
+
off
,
len
);
new_xid_list_entry
->
binlog_name
=
name_mem
;
new_xid_list_entry
->
binlog_name_len
=
len
;
new_xid_list_entry
->
xid_count
=
0
;
new_xid_list_entry
->
notify_count
=
0
;
/*
Find the name for the Initial binlog checkpoint.
...
...
@@ -3603,7 +3594,10 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
mysql_mutex_unlock
(
&
LOCK_xid_list
);
if
(
!
b
)
b
=
new_xid_list_entry
;
if
(
b
->
binlog_name
)
strmake
(
buf
,
b
->
binlog_name
,
b
->
binlog_name_len
);
else
goto
err
;
Binlog_checkpoint_log_event
ev
(
buf
,
len
);
DBUG_EXECUTE_IF
(
"crash_before_write_checkpoint_event"
,
flush_io_cache
(
&
log_file
);
...
...
@@ -3707,7 +3701,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
{
WSREP_XID_LIST_ENTRY
(
"MYSQL_BIN_LOG::open(): Removing xid_list_entry for "
"%s (%lu)"
,
b
);
my_free
(
binlog_xid_count_list
.
get
()
);
delete
binlog_xid_count_list
.
get
(
);
}
mysql_cond_broadcast
(
&
COND_xid_list
);
WSREP_XID_LIST_ENTRY
(
"MYSQL_BIN_LOG::open(): Adding new xid_list_entry for "
...
...
@@ -3754,7 +3748,7 @@ Turning logging off for the whole duration of the MySQL server process. \
To turn it on again: fix the cause, \
shutdown the MySQL server and restart it."
,
name
,
errno
);
if
(
new_xid_list_entry
)
my_free
(
new_xid_list_entry
)
;
delete
new_xid_list_entry
;
if
(
file
>=
0
)
mysql_file_close
(
file
,
MYF
(
0
));
close
(
LOG_CLOSE_INDEX
);
...
...
@@ -4248,7 +4242,7 @@ bool MYSQL_BIN_LOG::reset_logs(THD *thd, bool create_new_log,
DBUG_ASSERT
(
b
->
xid_count
==
0
);
WSREP_XID_LIST_ENTRY
(
"MYSQL_BIN_LOG::reset_logs(): Removing "
"xid_list_entry for %s (%lu)"
,
b
);
my_free
(
binlog_xid_count_list
.
get
()
);
delete
binlog_xid_count_list
.
get
(
);
}
mysql_cond_broadcast
(
&
COND_xid_list
);
reset_master_pending
--
;
...
...
@@ -9791,7 +9785,7 @@ TC_LOG_BINLOG::mark_xid_done(ulong binlog_id, bool write_checkpoint)
break
;
WSREP_XID_LIST_ENTRY
(
"TC_LOG_BINLOG::mark_xid_done(): Removing "
"xid_list_entry for %s (%lu)"
,
b
);
my_free
(
binlog_xid_count_list
.
get
()
);
delete
binlog_xid_count_list
.
get
(
);
}
mysql_mutex_unlock
(
&
LOCK_xid_list
);
...
...
sql/log.h
View file @
2daf3b14
/* Copyright (c) 2005, 2016, Oracle and/or its affiliates.
Copyright (c) 2009, 20
17
, MariaDB Corporation.
Copyright (c) 2009, 20
20
, 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
...
...
@@ -589,7 +589,18 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
long
notify_count
;
/* For linking in requests to the binlog background thread. */
xid_count_per_binlog
*
next_in_queue
;
xid_count_per_binlog
();
/* Give link error if constructor used. */
xid_count_per_binlog
(
char
*
log_file_name
,
uint
log_file_name_len
)
:
binlog_id
(
0
),
xid_count
(
0
),
notify_count
(
0
)
{
binlog_name_len
=
log_file_name_len
;
binlog_name
=
(
char
*
)
my_malloc
(
binlog_name_len
,
MYF
(
MY_ZEROFILL
));
if
(
binlog_name
)
memcpy
(
binlog_name
,
log_file_name
,
binlog_name_len
);
}
~
xid_count_per_binlog
()
{
my_free
(
binlog_name
);
}
};
I_List
<
xid_count_per_binlog
>
binlog_xid_count_list
;
mysql_mutex_t
LOCK_binlog_background_thread
;
...
...
storage/innobase/dict/dict0dict.cc
View file @
2daf3b14
...
...
@@ -2,7 +2,7 @@
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
Copyright (c) 2013, 20
19
, MariaDB Corporation.
Copyright (c) 2013, 20
20
, 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 the Free Software
...
...
@@ -528,7 +528,10 @@ dict_table_close(
mutex_exit
(
&
dict_sys
->
mutex
);
if
(
drop_aborted
)
{
/* dict_table_try_drop_aborted() can generate undo logs.
So it should be avoided after shutdown of background
threads */
if
(
drop_aborted
&&
!
srv_undo_sources
)
{
dict_table_try_drop_aborted
(
NULL
,
table_id
,
0
);
}
}
...
...
storage/innobase/fil/fil0crypt.cc
View file @
2daf3b14
/*****************************************************************************
Copyright (C) 2013, 2015, Google Inc. All Rights Reserved.
Copyright (c) 2014, 20
19
, MariaDB Corporation.
Copyright (c) 2014, 20
20
, 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 the Free Software
...
...
@@ -655,51 +655,10 @@ fil_space_encrypt(
return
(
src_frame
);
}
fil_space_crypt_t
*
crypt_data
=
space
->
crypt_data
;
const
page_size_t
page_size
(
space
->
flags
);
ut_ad
(
space
->
n_pending_ios
>
0
);
byte
*
tmp
=
fil_encrypt_buf
(
crypt_data
,
space
->
id
,
offset
,
lsn
,
src_frame
,
page_size
,
dst_frame
);
#ifdef UNIV_DEBUG
if
(
tmp
)
{
/* Verify that encrypted buffer is not corrupted */
dberr_t
err
=
DB_SUCCESS
;
byte
*
src
=
src_frame
;
bool
page_compressed_encrypted
=
(
mach_read_from_2
(
tmp
+
FIL_PAGE_TYPE
)
==
FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED
);
byte
uncomp_mem
[
UNIV_PAGE_SIZE_MAX
];
byte
tmp_mem
[
UNIV_PAGE_SIZE_MAX
];
if
(
page_compressed_encrypted
)
{
memcpy
(
uncomp_mem
,
src
,
srv_page_size
);
ulint
unzipped1
=
fil_page_decompress
(
tmp_mem
,
uncomp_mem
);
ut_ad
(
unzipped1
);
if
(
unzipped1
!=
srv_page_size
)
{
src
=
uncomp_mem
;
}
}
ut_ad
(
!
buf_page_is_corrupted
(
true
,
src
,
page_size
,
space
));
ut_ad
(
fil_space_decrypt
(
crypt_data
,
tmp_mem
,
page_size
,
tmp
,
&
err
));
ut_ad
(
err
==
DB_SUCCESS
);
/* Need to decompress the page if it was also compressed */
if
(
page_compressed_encrypted
)
{
byte
buf
[
UNIV_PAGE_SIZE_MAX
];
memcpy
(
buf
,
tmp_mem
,
srv_page_size
);
ulint
unzipped2
=
fil_page_decompress
(
tmp_mem
,
buf
);
ut_ad
(
unzipped2
);
}
memcpy
(
tmp_mem
+
FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
,
src
+
FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
,
8
);
ut_ad
(
!
memcmp
(
src
,
tmp_mem
,
page_size
.
physical
()));
}
#endif
/* UNIV_DEBUG */
return
tmp
;
return
fil_encrypt_buf
(
space
->
crypt_data
,
space
->
id
,
offset
,
lsn
,
src_frame
,
page_size_t
(
space
->
flags
),
dst_frame
);
}
/** Decrypt a page.
...
...
storage/xtradb/dict/dict0dict.cc
View file @
2daf3b14
...
...
@@ -2,7 +2,7 @@
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
Copyright (c) 2013, 20
19
, MariaDB Corporation.
Copyright (c) 2013, 20
20
, 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 the Free Software
...
...
@@ -604,7 +604,10 @@ dict_table_close(
mutex_exit
(
&
dict_sys
->
mutex
);
if
(
drop_aborted
)
{
/* dict_table_try_drop_aborted() can generate undo logs.
So it should be avoided after shutdown of background
threads */
if
(
drop_aborted
&&
srv_undo_sources
)
{
dict_table_try_drop_aborted
(
NULL
,
table_id
,
0
);
}
}
...
...
storage/xtradb/fil/fil0crypt.cc
View file @
2daf3b14
/*****************************************************************************
Copyright (C) 2013, 2015, Google Inc. All Rights Reserved.
Copyright (c) 2014, 20
19
, MariaDB Corporation.
Copyright (c) 2014, 20
20
, 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 the Free Software
...
...
@@ -706,47 +706,8 @@ fil_space_encrypt(
fil_space_crypt_t
*
crypt_data
=
space
->
crypt_data
;
ut_ad
(
space
->
n_pending_ios
>
0
);
ulint
zip_size
=
fsp_flags_get_zip_size
(
space
->
flags
);
byte
*
tmp
=
fil_encrypt_buf
(
crypt_data
,
space
->
id
,
offset
,
lsn
,
src_frame
,
zip_size
,
dst_frame
);
#ifdef UNIV_DEBUG
if
(
tmp
)
{
/* Verify that encrypted buffer is not corrupted */
dberr_t
err
=
DB_SUCCESS
;
byte
*
src
=
src_frame
;
bool
page_compressed_encrypted
=
(
mach_read_from_2
(
tmp
+
FIL_PAGE_TYPE
)
==
FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED
);
byte
uncomp_mem
[
UNIV_PAGE_SIZE_MAX
];
byte
tmp_mem
[
UNIV_PAGE_SIZE_MAX
];
ulint
size
=
(
zip_size
)
?
zip_size
:
UNIV_PAGE_SIZE
;
if
(
page_compressed_encrypted
)
{
memcpy
(
uncomp_mem
,
src
,
srv_page_size
);
ulint
unzipped1
=
fil_page_decompress
(
tmp_mem
,
uncomp_mem
);
ut_ad
(
unzipped1
);
if
(
unzipped1
!=
srv_page_size
)
{
src
=
uncomp_mem
;
}
}
ut_ad
(
!
buf_page_is_corrupted
(
true
,
src
,
zip_size
,
space
));
ut_ad
(
fil_space_decrypt
(
crypt_data
,
tmp_mem
,
size
,
tmp
,
&
err
));
ut_ad
(
err
==
DB_SUCCESS
);
/* Need to decompress the page if it was also compressed */
if
(
page_compressed_encrypted
)
{
byte
buf
[
UNIV_PAGE_SIZE_MAX
];
memcpy
(
buf
,
tmp_mem
,
srv_page_size
);
ulint
unzipped2
=
fil_page_decompress
(
tmp_mem
,
buf
);
ut_ad
(
unzipped2
);
}
memcpy
(
tmp_mem
+
FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
,
src
+
FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
,
8
);
ut_ad
(
!
memcmp
(
src
,
tmp_mem
,
size
));
}
#endif
/* UNIV_DEBUG */
return
tmp
;
return
fil_encrypt_buf
(
crypt_data
,
space
->
id
,
offset
,
lsn
,
src_frame
,
zip_size
,
dst_frame
);
}
/******************************************************************
...
...
support-files/CMakeLists.txt
View file @
2daf3b14
...
...
@@ -123,21 +123,6 @@ IF(UNIX)
${
CMAKE_CURRENT_BINARY_DIR
}
/mariadb.service
DESTINATION
${
inst_location
}
/systemd COMPONENT SupportFiles
)
IF
(
INSTALL_SYSTEMD_SYSUSERSDIR
)
CONFIGURE_FILE
(
sysusers.conf.in
${
CMAKE_CURRENT_BINARY_DIR
}
/sysusers.conf @ONLY
)
INSTALL
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/sysusers.conf
DESTINATION
${
INSTALL_SYSTEMD_SYSUSERSDIR
}
COMPONENT Server
)
ENDIF
()
IF
(
INSTALL_SYSTEMD_TMPFILESDIR
)
get_filename_component
(
MYSQL_UNIX_DIR
${
MYSQL_UNIX_ADDR
}
DIRECTORY
)
CONFIGURE_FILE
(
tmpfiles.conf.in
${
CMAKE_CURRENT_BINARY_DIR
}
/tmpfiles.conf @ONLY
)
INSTALL
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/tmpfiles.conf
DESTINATION
${
INSTALL_SYSTEMD_TMPFILESDIR
}
COMPONENT Server
)
ENDIF
()
# @ in directory name broken between CMake version 2.8.12.2 and 3.3
# http://public.kitware.com/Bug/view.php?id=14782
IF
(
NOT CMAKE_VERSION VERSION_LESS 3.3.0 OR NOT RPM
)
...
...
@@ -164,6 +149,26 @@ IF(UNIX)
ENDIF
()
ENDIF
()
# Allow installing sysusers and tmpusers without requiring SYSTEMD on the
# system. This is useful for distributions running other init systems to
# parse these files and create appropriate users & tmpfiles.
IF
((
HAVE_SYSTEMD OR INSTALL_SYSTEMD_SYSUSERS
)
AND INSTALL_SYSTEMD_SYSUSERSDIR
)
CONFIGURE_FILE
(
sysusers.conf.in
${
CMAKE_CURRENT_BINARY_DIR
}
/sysusers.conf @ONLY
)
INSTALL
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/sysusers.conf
DESTINATION
${
INSTALL_SYSTEMD_SYSUSERSDIR
}
RENAME mariadb.conf COMPONENT Server
)
ENDIF
()
IF
((
HAVE_SYSTEMD OR INSTALL_SYSTEMD_TMPUSERS
)
AND INSTALL_SYSTEMD_TMPFILESDIR
)
get_filename_component
(
MYSQL_UNIX_DIR
${
MYSQL_UNIX_ADDR
}
DIRECTORY
)
CONFIGURE_FILE
(
tmpfiles.conf.in
${
CMAKE_CURRENT_BINARY_DIR
}
/tmpfiles.conf @ONLY
)
INSTALL
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/tmpfiles.conf
DESTINATION
${
INSTALL_SYSTEMD_TMPFILESDIR
}
RENAME mariadb.conf COMPONENT Server
)
ENDIF
()
IF
(
INSTALL_SYSCONFDIR
)
INSTALL
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/mysql-log-rotate DESTINATION
${
INSTALL_SYSCONFDIR
}
/logrotate.d
RENAME mysql COMPONENT SupportFiles
)
...
...
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