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
769f6d2d
Commit
769f6d2d
authored
Aug 03, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix -Wclass-memaccess in WSREP,InnoDB,XtraDB
parent
0d3972c6
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
44 additions
and
42 deletions
+44
-42
extra/mariabackup/backup_copy.cc
extra/mariabackup/backup_copy.cc
+16
-3
extra/mariabackup/wsrep.cc
extra/mariabackup/wsrep.cc
+1
-2
sql/handler.h
sql/handler.h
+2
-2
sql/wsrep_xid.cc
sql/wsrep_xid.cc
+2
-3
storage/innobase/dict/dict0stats_bg.cc
storage/innobase/dict/dict0stats_bg.cc
+3
-8
storage/innobase/trx/trx0sys.cc
storage/innobase/trx/trx0sys.cc
+7
-5
storage/innobase/trx/trx0trx.cc
storage/innobase/trx/trx0trx.cc
+1
-2
storage/xtradb/dict/dict0stats_bg.cc
storage/xtradb/dict/dict0stats_bg.cc
+4
-10
storage/xtradb/trx/trx0sys.cc
storage/xtradb/trx/trx0sys.cc
+7
-5
storage/xtradb/trx/trx0trx.cc
storage/xtradb/trx/trx0trx.cc
+1
-2
No files found.
extra/mariabackup/backup_copy.cc
View file @
769f6d2d
...
...
@@ -460,6 +460,21 @@ struct datafile_cur_t {
size_t
buf_size
;
size_t
buf_read
;
size_t
buf_offset
;
explicit
datafile_cur_t
(
const
char
*
filename
=
NULL
)
:
file
(),
thread_n
(
0
),
orig_buf
(
NULL
),
buf
(
NULL
),
buf_size
(
0
),
buf_read
(
0
),
buf_offset
(
0
)
{
memset
(
rel_path
,
0
,
sizeof
rel_path
);
if
(
filename
)
{
strncpy
(
abs_path
,
filename
,
sizeof
abs_path
);
abs_path
[(
sizeof
abs_path
)
-
1
]
=
0
;
}
else
{
abs_path
[
0
]
=
'\0'
;
}
rel_path
[
0
]
=
'\0'
;
memset
(
&
statinfo
,
0
,
sizeof
statinfo
);
}
};
static
...
...
@@ -478,9 +493,7 @@ datafile_open(const char *file, datafile_cur_t *cursor, uint thread_n)
{
ulint
success
;
memset
(
cursor
,
0
,
sizeof
(
datafile_cur_t
));
strncpy
(
cursor
->
abs_path
,
file
,
sizeof
(
cursor
->
abs_path
));
new
(
cursor
)
datafile_cur_t
(
file
);
/* Get the relative path for the destination tablespace name, i.e. the
one that can be appended to the backup root directory. Non-system
...
...
extra/mariabackup/wsrep.cc
View file @
769f6d2d
...
...
@@ -179,8 +179,7 @@ xb_write_galera_info(bool incremental_prepare)
return
;
}
memset
(
&
xid
,
0
,
sizeof
(
xid
));
xid
.
formatID
=
-
1
;
xid
.
null
();
if
(
!
trx_sys_read_wsrep_checkpoint
(
&
xid
))
{
...
...
sql/handler.h
View file @
769f6d2d
...
...
@@ -2,7 +2,7 @@
#define HANDLER_INCLUDED
/*
Copyright (c) 2000, 2016, Oracle and/or its affiliates.
Copyright (c) 2009, 201
6
, MariaDB
Copyright (c) 2009, 201
8
, MariaDB
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
...
...
@@ -602,7 +602,7 @@ struct xid_t {
bqual_length
=
b
;
memcpy
(
data
,
d
,
g
+
b
);
}
bool
is_null
()
{
return
formatID
==
-
1
;
}
bool
is_null
()
const
{
return
formatID
==
-
1
;
}
void
null
()
{
formatID
=
-
1
;
}
my_xid
quick_get_my_xid
()
{
...
...
sql/wsrep_xid.cc
View file @
769f6d2d
...
...
@@ -129,12 +129,11 @@ void wsrep_get_SE_checkpoint(wsrep_uuid_t& uuid, wsrep_seqno_t& seqno)
seqno
=
WSREP_SEQNO_UNDEFINED
;
XID
xid
;
memset
(
&
xid
,
0
,
sizeof
(
xid
));
xid
.
formatID
=
-
1
;
xid
.
null
();
wsrep_get_SE_checkpoint
(
xid
);
if
(
xid
.
formatID
==
-
1
)
return
;
// nil XID
if
(
xid
.
is_null
())
return
;
if
(
!
wsrep_is_wsrep_xid
(
&
xid
))
{
...
...
storage/innobase/dict/dict0stats_bg.cc
View file @
769f6d2d
/*****************************************************************************
Copyright (c) 2012, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation.
Copyright (c) 2017,
2018,
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
...
...
@@ -95,10 +95,7 @@ dict_stats_pool_init()
/*****************************************************************//**
Free the resources occupied by the recalc pool, called once during
thread de-initialization. */
static
void
dict_stats_pool_deinit
()
/*====================*/
static
void
dict_stats_pool_deinit
()
{
ut_ad
(
!
srv_read_only_mode
);
...
...
@@ -114,9 +111,7 @@ dict_stats_pool_deinit()
*/
recalc_pool_t
recalc_empty_pool
;
defrag_pool_t
defrag_empty_pool
;
memset
(
&
recalc_empty_pool
,
0
,
sizeof
(
recalc_pool_t
));
memset
(
&
defrag_empty_pool
,
0
,
sizeof
(
defrag_pool_t
));
recalc_pool
.
swap
(
recalc_empty_pool
);
recalc_pool
.
swap
(
recalc_empty_pool
);
defrag_pool
.
swap
(
defrag_empty_pool
);
}
...
...
storage/innobase/trx/trx0sys.cc
View file @
769f6d2d
/*****************************************************************************
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation.
Copyright (c) 2017,
2018,
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
...
...
@@ -347,7 +347,7 @@ trx_sys_update_wsrep_checkpoint(
mtr_t
*
mtr
)
{
#ifdef UNIV_DEBUG
if
(
xid
->
formatID
!=
-
1
if
(
!
xid
->
is_null
()
&&
mach_read_from_4
(
sys_header
+
TRX_SYS_WSREP_XID_INFO
+
TRX_SYS_WSREP_XID_MAGIC_N_FLD
)
==
TRX_SYS_WSREP_XID_MAGIC_N
)
{
...
...
@@ -368,7 +368,7 @@ trx_sys_update_wsrep_checkpoint(
#endif
/* UNIV_DEBUG */
ut_ad
(
xid
&&
mtr
);
ut_a
(
xid
->
formatID
==
-
1
||
wsrep_is_wsrep_xid
((
const
XID
*
)
xid
));
ut_a
(
xid
->
is_null
()
||
wsrep_is_wsrep_xid
((
const
XID
*
)
xid
));
if
(
mach_read_from_4
(
sys_header
+
TRX_SYS_WSREP_XID_INFO
+
TRX_SYS_WSREP_XID_MAGIC_N_FLD
)
...
...
@@ -417,8 +417,10 @@ trx_sys_read_wsrep_checkpoint(XID* xid)
if
((
magic
=
mach_read_from_4
(
sys_header
+
TRX_SYS_WSREP_XID_INFO
+
TRX_SYS_WSREP_XID_MAGIC_N_FLD
))
!=
TRX_SYS_WSREP_XID_MAGIC_N
)
{
memset
(
xid
,
0
,
sizeof
(
*
xid
));
xid
->
formatID
=
-
1
;
xid
->
null
();
xid
->
gtrid_length
=
0
;
xid
->
bqual_length
=
0
;
memset
(
xid
->
data
,
0
,
sizeof
xid
->
data
);
trx_sys_update_wsrep_checkpoint
(
xid
,
sys_header
,
&
mtr
);
mtr_commit
(
&
mtr
);
return
false
;
...
...
storage/innobase/trx/trx0trx.cc
View file @
769f6d2d
...
...
@@ -851,8 +851,7 @@ trx_start_low(
}
#ifdef WITH_WSREP
memset
(
&
trx
->
xid
,
0
,
sizeof
(
trx
->
xid
));
trx
->
xid
.
formatID
=
-
1
;
trx
->
xid
.
null
();
#endif
/* WITH_WSREP */
/* The initial value for trx->no: TRX_ID_MAX is used in
...
...
storage/xtradb/dict/dict0stats_bg.cc
View file @
769f6d2d
/*****************************************************************************
Copyright (c) 2012, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation.
Copyright (c) 2017,
2018,
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
...
...
@@ -95,17 +95,13 @@ dict_stats_pool_init()
/*****************************************************************//**
Free the resources occupied by the recalc pool, called once during
thread de-initialization. */
static
void
dict_stats_pool_deinit
()
/*===========================*/
static
void
dict_stats_pool_deinit
()
{
ut_ad
(
!
srv_read_only_mode
);
recalc_pool
.
clear
();
defrag_pool
.
clear
();
/*
/*
recalc_pool may still have its buffer allocated. It will free it when
its destructor is called.
The problem is, memory leak detector is run before the recalc_pool's
...
...
@@ -115,9 +111,7 @@ dict_stats_pool_deinit()
*/
recalc_pool_t
recalc_empty_pool
;
defrag_pool_t
defrag_empty_pool
;
memset
(
&
recalc_empty_pool
,
0
,
sizeof
(
recalc_pool_t
));
memset
(
&
defrag_empty_pool
,
0
,
sizeof
(
defrag_pool_t
));
recalc_pool
.
swap
(
recalc_empty_pool
);
recalc_pool
.
swap
(
recalc_empty_pool
);
defrag_pool
.
swap
(
defrag_empty_pool
);
}
...
...
storage/xtradb/trx/trx0sys.cc
View file @
769f6d2d
/*****************************************************************************
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation.
Copyright (c) 2017,
2018,
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
...
...
@@ -351,7 +351,7 @@ trx_sys_update_wsrep_checkpoint(
mtr_t
*
mtr
)
{
#ifdef UNIV_DEBUG
if
(
xid
->
formatID
!=
-
1
if
(
!
xid
->
is_null
()
&&
mach_read_from_4
(
sys_header
+
TRX_SYS_WSREP_XID_INFO
+
TRX_SYS_WSREP_XID_MAGIC_N_FLD
)
==
TRX_SYS_WSREP_XID_MAGIC_N
)
{
...
...
@@ -372,7 +372,7 @@ trx_sys_update_wsrep_checkpoint(
#endif
/* UNIV_DEBUG */
ut_ad
(
xid
&&
mtr
);
ut_a
(
xid
->
formatID
==
-
1
||
wsrep_is_wsrep_xid
((
const
XID
*
)
xid
));
ut_a
(
xid
->
is_null
()
||
wsrep_is_wsrep_xid
((
const
XID
*
)
xid
));
if
(
mach_read_from_4
(
sys_header
+
TRX_SYS_WSREP_XID_INFO
+
TRX_SYS_WSREP_XID_MAGIC_N_FLD
)
...
...
@@ -421,8 +421,10 @@ trx_sys_read_wsrep_checkpoint(XID* xid)
if
((
magic
=
mach_read_from_4
(
sys_header
+
TRX_SYS_WSREP_XID_INFO
+
TRX_SYS_WSREP_XID_MAGIC_N_FLD
))
!=
TRX_SYS_WSREP_XID_MAGIC_N
)
{
memset
(
xid
,
0
,
sizeof
(
*
xid
));
xid
->
formatID
=
-
1
;
xid
->
null
();
xid
->
gtrid_length
=
0
;
xid
->
bqual_length
=
0
;
memset
(
xid
->
data
,
0
,
sizeof
xid
->
data
);
trx_sys_update_wsrep_checkpoint
(
xid
,
sys_header
,
&
mtr
);
mtr_commit
(
&
mtr
);
return
false
;
...
...
storage/xtradb/trx/trx0trx.cc
View file @
769f6d2d
...
...
@@ -1041,8 +1041,7 @@ trx_start_low(
}
#ifdef WITH_WSREP
memset
(
&
trx
->
xid
,
0
,
sizeof
(
trx
->
xid
));
trx
->
xid
.
formatID
=
-
1
;
trx
->
xid
.
null
();
#endif
/* WITH_WSREP */
/* The initial value for trx->no: TRX_ID_MAX is used in
...
...
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