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
16418793
Commit
16418793
authored
Oct 03, 2017
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.2 into bb-10.2-ext
parents
64bfad63
ebc2f0da
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
70 additions
and
83 deletions
+70
-83
scripts/wsrep_sst_common.sh
scripts/wsrep_sst_common.sh
+2
-2
scripts/wsrep_sst_xtrabackup-v2.sh
scripts/wsrep_sst_xtrabackup-v2.sh
+6
-6
sql/opt_range.cc
sql/opt_range.cc
+4
-4
sql/sql_statistics.cc
sql/sql_statistics.cc
+4
-1
storage/innobase/dict/dict0boot.cc
storage/innobase/dict/dict0boot.cc
+5
-3
storage/innobase/dict/dict0stats.cc
storage/innobase/dict/dict0stats.cc
+0
-1
storage/innobase/include/dict0dict.h
storage/innobase/include/dict0dict.h
+1
-18
storage/innobase/include/dict0dict.ic
storage/innobase/include/dict0dict.ic
+0
-26
storage/innobase/include/dict0mem.h
storage/innobase/include/dict0mem.h
+6
-0
storage/innobase/row/row0ins.cc
storage/innobase/row/row0ins.cc
+7
-4
storage/innobase/row/row0uins.cc
storage/innobase/row/row0uins.cc
+14
-8
storage/innobase/row/row0umod.cc
storage/innobase/row/row0umod.cc
+21
-9
storage/innobase/row/row0undo.cc
storage/innobase/row/row0undo.cc
+0
-1
No files found.
scripts/wsrep_sst_common.sh
View file @
16418793
...
...
@@ -256,12 +256,12 @@ parse_cnf()
# look in group+suffix
if
[[
-n
$WSREP_SST_OPT_CONF_SUFFIX
]]
;
then
reval
=
$(
$MY_PRINT_DEFAULTS
-c
$WSREP_SST_OPT_CONF
"
${
group
}${
WSREP_SST_OPT_CONF_SUFFIX
}
"
|
awk
-F
=
'{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}'
|
grep
--
"--
$var
="
|
cut
-d
=
-f2-
|
tail
-1
)
reval
=
$(
$MY_PRINT_DEFAULTS
"
${
group
}${
WSREP_SST_OPT_CONF_SUFFIX
}
"
|
awk
-F
=
'{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}'
|
grep
--
"--
$var
="
|
cut
-d
=
-f2-
|
tail
-1
)
fi
# look in group
if
[[
-z
$reval
]]
;
then
reval
=
$(
$MY_PRINT_DEFAULTS
-c
$WSREP_SST_OPT_CONF
$group
|
awk
-F
=
'{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}'
|
grep
--
"--
$var
="
|
cut
-d
=
-f2-
|
tail
-1
)
reval
=
$(
$MY_PRINT_DEFAULTS
$group
|
awk
-F
=
'{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}'
|
grep
--
"--
$var
="
|
cut
-d
=
-f2-
|
tail
-1
)
fi
# use default if we haven't found a value
...
...
scripts/wsrep_sst_xtrabackup-v2.sh
View file @
16418793
...
...
@@ -494,7 +494,7 @@ read_cnf()
ssystag+
=
"-"
if
[[
$ssyslog
-ne
-1
]]
;
then
if
$MY_PRINT_DEFAULTS
-c
$WSREP_SST_OPT_CONF
mysqld_safe |
tr
'_'
'-'
|
grep
-q
--
"--syslog"
;
then
if
$MY_PRINT_DEFAULTS
mysqld_safe |
tr
'_'
'-'
|
grep
-q
--
"--syslog"
;
then
ssyslog
=
1
fi
fi
...
...
@@ -671,7 +671,7 @@ check_extra()
local
use_socket
=
1
if
[[
$uextra
-eq
1
]]
;
then
if
$MY_PRINT_DEFAULTS
--mysqld
|
tr
'_'
'-'
|
grep
--
"--thread-handling="
|
grep
-q
'pool-of-threads'
;
then
local
eport
=
$(
$MY_PRINT_DEFAULTS
-c
$WSREP_SST_OPT_CONF
mysqld |
tr
'_'
'-'
|
grep
--
"--extra-port="
|
cut
-d
=
-f2
)
local
eport
=
$(
$MY_PRINT_DEFAULTS
mysqld |
tr
'_'
'-'
|
grep
--
"--extra-port="
|
cut
-d
=
-f2
)
if
[[
-n
$eport
]]
;
then
# Xtrabackup works only locally.
# Hence, setting host to 127.0.0.1 unconditionally.
...
...
@@ -867,14 +867,14 @@ if [[ $ssyslog -eq 1 ]];then
}
INNOAPPLY
=
"
${
INNOBACKUPEX_BIN
}
$disver
$iapts
--apply-log
\$
rebuildcmd
\$
{DATA} 2>&1 | logger -p daemon.err -t
${
ssystag
}
innobackupex-apply "
INNOMOVE
=
"
${
INNOBACKUPEX_BIN
}
--defaults-file=
${
WSREP_SST_OPT_CONF
}
$disver
$impts
--datadir=
${
DATA
}
--move-back --force-non-empty-directories
\$
{DATA} 2>&1 | logger -p daemon.err -t
${
ssystag
}
innobackupex-move "
INNOBACKUP
=
"
${
INNOBACKUPEX_BIN
}
${
WSREP_SST_OPT_
CONF
}
$disver
$iopts
\$
tmpopts
\$
INNOEXTRA --galera-info --stream=
\$
sfmt
\$
itmpdir 2> >(logger -p daemon.err -t
${
ssystag
}
innobackupex-backup)"
INNOMOVE
=
"
${
INNOBACKUPEX_BIN
}
${
WSREP_SST_OPT_DEFAULT
}
$disver
$impts
--datadir=
${
DATA
}
--move-back --force-non-empty-directories
\$
{DATA} 2>&1 | logger -p daemon.err -t
${
ssystag
}
innobackupex-move "
INNOBACKUP
=
"
${
INNOBACKUPEX_BIN
}
${
WSREP_SST_OPT_
DEFAULT
}
$disver
$iopts
\$
tmpopts
\$
INNOEXTRA --galera-info --stream=
\$
sfmt
\$
itmpdir 2> >(logger -p daemon.err -t
${
ssystag
}
innobackupex-backup)"
fi
else
INNOAPPLY
=
"
${
INNOBACKUPEX_BIN
}
$disver
$iapts
--apply-log
\$
rebuildcmd
\$
{DATA} &>
\$
{DATA}/innobackup.prepare.log"
INNOMOVE
=
"
${
INNOBACKUPEX_BIN
}
--defaults-file=
${
WSREP_SST_OPT_CONF
}
--defaults-group=mysqld
${
WSREP_SST_OPT_CONF_SUFFIX
}
$disver
$impts
--datadir=
${
DATA
}
--move-back --force-non-empty-directories
\$
{DATA} &>
\$
{DATA}/innobackup.move.log"
INNOBACKUP
=
"
${
INNOBACKUPEX_BIN
}
${
WSREP_SST_OPT_
CONF
}
$disver
$iopts
\$
tmpopts
\$
INNOEXTRA --galera-info --stream=
\$
sfmt
\$
itmpdir 2>
\$
{DATA}/innobackup.backup.log"
INNOMOVE
=
"
${
INNOBACKUPEX_BIN
}
${
WSREP_SST_OPT_DEFAULT
}
--defaults-group=mysqld
${
WSREP_SST_OPT_CONF_SUFFIX
}
$disver
$impts
--datadir=
${
DATA
}
--move-back --force-non-empty-directories
\$
{DATA} &>
\$
{DATA}/innobackup.move.log"
INNOBACKUP
=
"
${
INNOBACKUPEX_BIN
}
${
WSREP_SST_OPT_
DEFAULT
}
$disver
$iopts
\$
tmpopts
\$
INNOEXTRA --galera-info --stream=
\$
sfmt
\$
itmpdir 2>
\$
{DATA}/innobackup.backup.log"
fi
get_stream
...
...
sql/opt_range.cc
View file @
16418793
...
...
@@ -2827,7 +2827,7 @@ double records_in_column_ranges(PARAM *param, uint idx,
/* Handle cases when we don't have a valid non-empty list of range */
if
(
!
tree
)
return
HA_POS_ERROR
;
return
DBL_MAX
;
if
(
tree
->
type
==
SEL_ARG
::
IMPOSSIBLE
)
return
(
0L
);
...
...
@@ -2847,9 +2847,9 @@ double records_in_column_ranges(PARAM *param, uint idx,
max_endp
=
range
.
end_key
.
length
?
&
range
.
end_key
:
NULL
;
rows
=
get_column_range_cardinality
(
field
,
min_endp
,
max_endp
,
range
.
range_flag
);
if
(
HA_POS_ERROR
==
rows
)
if
(
DBL_MAX
==
rows
)
{
total_rows
=
HA_POS_ERROR
;
total_rows
=
DBL_MAX
;
break
;
}
total_rows
+=
rows
;
...
...
@@ -3083,7 +3083,7 @@ bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item **cond)
else
{
rows
=
records_in_column_ranges
(
&
param
,
idx
,
key
);
if
(
rows
!=
HA_POS_ERROR
)
if
(
rows
!=
DBL_MAX
)
key
->
field
->
cond_selectivity
=
rows
/
table_records
;
}
}
...
...
sql/sql_statistics.cc
View file @
16418793
...
...
@@ -3751,7 +3751,10 @@ double get_column_avg_frequency(Field * field)
using the statistical data from the table column_stats.
@retval
The required estimate of the rows in the column range
- The required estimate of the rows in the column range
- If there is some kind of error, this function should return DBL_MAX (and
not HA_POS_ERROR as that is an integer constant).
*/
double
get_column_range_cardinality
(
Field
*
field
,
...
...
storage/innobase/dict/dict0boot.cc
View file @
16418793
...
...
@@ -79,7 +79,9 @@ dict_hdr_get_new_id(
mtr_start
(
&
mtr
);
if
(
table
)
{
dict_disable_redo_if_temporary
(
table
,
&
mtr
);
if
(
table
->
is_temporary
())
{
mtr
.
set_log_mode
(
MTR_LOG_NO_REDO
);
}
}
else
if
(
disable_redo
)
{
/* In non-read-only mode we need to ensure that space-id header
page is written to disk else if page is removed from buffer
...
...
@@ -87,8 +89,8 @@ dict_hdr_get_new_id(
to another tablespace.
This is not a case with read-only mode as there is no new object
that is created except temporary tablespace. */
mtr
_set_log_mode
(
&
mtr
,
(
srv_read_only_mode
?
MTR_LOG_NONE
:
MTR_LOG_NO_REDO
)
);
mtr
.
set_log_mode
(
srv_read_only_mode
?
MTR_LOG_NONE
:
MTR_LOG_NO_REDO
);
}
/* Server started and let's say space-id = x
...
...
storage/innobase/dict/dict0stats.cc
View file @
16418793
...
...
@@ -887,7 +887,6 @@ dict_stats_update_transient_for_index(
ulint
size
;
mtr_start
(
&
mtr
);
dict_disable_redo_if_temporary
(
index
->
table
,
&
mtr
);
mtr_s_lock
(
dict_index_get_lock
(
index
),
&
mtr
);
...
...
storage/innobase/include/dict0dict.h
View file @
16418793
...
...
@@ -1946,24 +1946,7 @@ dict_table_is_discarded(
const
dict_table_t
*
table
)
/*!< in: table to check */
MY_ATTRIBUTE
((
warn_unused_result
));
/********************************************************************//**
Check if it is a temporary table.
@return true if temporary table flag is set. */
UNIV_INLINE
bool
dict_table_is_temporary
(
/*====================*/
const
dict_table_t
*
table
)
/*!< in: table to check */
MY_ATTRIBUTE
((
warn_unused_result
));
/********************************************************************//**
Turn-off redo-logging if temporary table. */
UNIV_INLINE
void
dict_disable_redo_if_temporary
(
/*===========================*/
const
dict_table_t
*
table
,
/*!< in: table to check */
mtr_t
*
mtr
);
/*!< out: mini-transaction */
#define dict_table_is_temporary(table) (table)->is_temporary()
/*********************************************************************//**
This function should be called whenever a page is successfully
...
...
storage/innobase/include/dict0dict.ic
View file @
16418793
...
...
@@ -1525,32 +1525,6 @@ dict_table_is_discarded(
return(DICT_TF2_FLAG_IS_SET(table, DICT_TF2_DISCARDED));
}
/********************************************************************//**
Check if it is a temporary table.
@return true if temporary table flag is set. */
UNIV_INLINE
bool
dict_table_is_temporary(
/*====================*/
const dict_table_t* table) /*!< in: table to check */
{
return(DICT_TF2_FLAG_IS_SET(table, DICT_TF2_TEMPORARY));
}
/********************************************************************//**
Turn-off redo-logging if temporary table. */
UNIV_INLINE
void
dict_disable_redo_if_temporary(
/*===========================*/
const dict_table_t* table, /*!< in: table to check */
mtr_t* mtr) /*!< out: mini-transaction */
{
if (dict_table_is_temporary(table)) {
mtr_set_log_mode(mtr, MTR_LOG_NO_REDO);
}
}
/** Check if the table is found is a file_per_table tablespace.
This test does not use table flags2 since some REDUNDANT tables in the
system tablespace may have garbage in the MIX_LEN field where flags2 is
...
...
storage/innobase/include/dict0mem.h
View file @
16418793
...
...
@@ -1313,6 +1313,12 @@ struct dict_table_t {
{
return
!
(
~
flags
&
DICT_TF_MASK_NO_ROLLBACK
);
}
/** @return whether this is a temporary table */
bool
is_temporary
()
const
{
return
flags2
&
DICT_TF2_TEMPORARY
;
}
/** @return whether this table is readable
@retval true normally
@retval false if this is a single-table tablespace
...
...
storage/innobase/row/row0ins.cc
View file @
16418793
...
...
@@ -2487,9 +2487,12 @@ row_ins_index_entry_big_rec(
DEBUG_SYNC_C_IF_THD
(
thd
,
"before_row_ins_extern_latch"
);
mtr_start
(
&
mtr
);
mtr
.
set_named_space
(
index
->
space
);
dict_disable_redo_if_temporary
(
index
->
table
,
&
mtr
);
mtr
.
start
();
if
(
index
->
table
->
is_temporary
())
{
mtr
.
set_log_mode
(
MTR_LOG_NO_REDO
);
}
else
{
mtr
.
set_named_space
(
index
->
space
);
}
btr_pcur_open
(
index
,
entry
,
PAGE_CUR_LE
,
BTR_MODIFY_TREE
,
&
pcur
,
&
mtr
);
...
...
@@ -2508,7 +2511,7 @@ row_ins_index_entry_big_rec(
index
,
offsets
);
}
mtr
_commit
(
&
mtr
);
mtr
.
commit
(
);
btr_pcur_close
(
&
pcur
);
...
...
storage/innobase/row/row0uins.cc
View file @
16418793
...
...
@@ -76,9 +76,12 @@ row_undo_ins_remove_clust_rec(
ut_ad
(
dict_index_is_clust
(
index
));
ut_ad
(
node
->
trx
->
in_rollback
);
mtr_start
(
&
mtr
);
mtr
.
set_named_space
(
index
->
space
);
dict_disable_redo_if_temporary
(
index
->
table
,
&
mtr
);
mtr
.
start
();
if
(
index
->
table
->
is_temporary
())
{
mtr
.
set_log_mode
(
MTR_LOG_NO_REDO
);
}
else
{
mtr
.
set_named_space
(
index
->
space
);
}
/* This is similar to row_undo_mod_clust(). The DDL thread may
already have copied this row from the log to the new table.
...
...
@@ -125,9 +128,9 @@ row_undo_ins_remove_clust_rec(
dict_drop_index_tree
(
btr_pcur_get_rec
(
&
node
->
pcur
),
&
(
node
->
pcur
),
&
mtr
);
mtr
_commit
(
&
mtr
);
mtr
.
commit
(
);
mtr
_start
(
&
mtr
);
mtr
.
start
(
);
success
=
btr_pcur_restore_position
(
BTR_MODIFY_LEAF
,
&
node
->
pcur
,
&
mtr
);
...
...
@@ -142,9 +145,12 @@ row_undo_ins_remove_clust_rec(
btr_pcur_commit_specify_mtr
(
&
node
->
pcur
,
&
mtr
);
retry:
/* If did not succeed, try pessimistic descent to tree */
mtr_start
(
&
mtr
);
mtr
.
set_named_space
(
index
->
space
);
dict_disable_redo_if_temporary
(
index
->
table
,
&
mtr
);
mtr
.
start
();
if
(
index
->
table
->
is_temporary
())
{
mtr
.
set_log_mode
(
MTR_LOG_NO_REDO
);
}
else
{
mtr
.
set_named_space
(
index
->
space
);
}
success
=
btr_pcur_restore_position
(
BTR_MODIFY_TREE
|
BTR_LATCH_FOR_DELETE
,
...
...
storage/innobase/row/row0umod.cc
View file @
16418793
...
...
@@ -272,9 +272,12 @@ row_undo_mod_clust(
pcur
=
&
node
->
pcur
;
index
=
btr_cur_get_index
(
btr_pcur_get_btr_cur
(
pcur
));
mtr_start
(
&
mtr
);
mtr
.
set_named_space
(
index
->
space
);
dict_disable_redo_if_temporary
(
index
->
table
,
&
mtr
);
mtr
.
start
();
if
(
index
->
table
->
is_temporary
())
{
mtr
.
set_log_mode
(
MTR_LOG_NO_REDO
);
}
else
{
mtr
.
set_named_space
(
index
->
space
);
}
online
=
dict_index_is_online_ddl
(
index
);
if
(
online
)
{
...
...
@@ -304,8 +307,11 @@ row_undo_mod_clust(
descent down the index tree */
mtr_start_trx
(
&
mtr
,
thr_get_trx
(
thr
));
mtr
.
set_named_space
(
index
->
space
);
dict_disable_redo_if_temporary
(
index
->
table
,
&
mtr
);
if
(
index
->
table
->
is_temporary
())
{
mtr
.
set_log_mode
(
MTR_LOG_NO_REDO
);
}
else
{
mtr
.
set_named_space
(
index
->
space
);
}
err
=
row_undo_mod_clust_low
(
node
,
&
offsets
,
&
offsets_heap
,
...
...
@@ -363,8 +369,11 @@ row_undo_mod_clust(
if
(
err
==
DB_SUCCESS
&&
node
->
rec_type
==
TRX_UNDO_UPD_DEL_REC
)
{
mtr_start_trx
(
&
mtr
,
thr_get_trx
(
thr
));
mtr
.
set_named_space
(
index
->
space
);
dict_disable_redo_if_temporary
(
index
->
table
,
&
mtr
);
if
(
index
->
table
->
is_temporary
())
{
mtr
.
set_log_mode
(
MTR_LOG_NO_REDO
);
}
else
{
mtr
.
set_named_space
(
index
->
space
);
}
/* It is not necessary to call row_log_table,
because the record is delete-marked and would thus
...
...
@@ -378,8 +387,11 @@ row_undo_mod_clust(
pessimistic descent down the index tree */
mtr_start_trx
(
&
mtr
,
thr_get_trx
(
thr
));
mtr
.
set_named_space
(
index
->
space
);
dict_disable_redo_if_temporary
(
index
->
table
,
&
mtr
);
if
(
index
->
table
->
is_temporary
())
{
mtr
.
set_log_mode
(
MTR_LOG_NO_REDO
);
}
else
{
mtr
.
set_named_space
(
index
->
space
);
}
err
=
row_undo_mod_remove_clust_low
(
node
,
&
mtr
,
...
...
storage/innobase/row/row0undo.cc
View file @
16418793
...
...
@@ -172,7 +172,6 @@ row_undo_search_clust_to_pcur(
rec_offs_init
(
offsets_
);
mtr_start
(
&
mtr
);
dict_disable_redo_if_temporary
(
node
->
table
,
&
mtr
);
clust_index
=
dict_table_get_first_index
(
node
->
table
);
...
...
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