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
8b6b2c3e
Commit
8b6b2c3e
authored
Sep 21, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix mariabackup leaks (except my_load_defaults)
parent
82675100
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
22 deletions
+27
-22
extra/mariabackup/backup_copy.cc
extra/mariabackup/backup_copy.cc
+16
-17
extra/mariabackup/backup_mysql.cc
extra/mariabackup/backup_mysql.cc
+1
-0
extra/mariabackup/xtrabackup.cc
extra/mariabackup/xtrabackup.cc
+10
-5
No files found.
extra/mariabackup/backup_copy.cc
View file @
8b6b2c3e
...
...
@@ -1351,7 +1351,8 @@ backup_files(const char *from, bool prep_mode)
if
(
rsync_tmpfile
==
NULL
)
{
msg
(
"Error: can't open file %s
\n
"
,
rsync_tmpfile_name
);
return
(
false
);
ret
=
false
;
goto
out
;
}
while
(
fgets
(
path
,
sizeof
(
path
),
rsync_tmpfile
))
{
...
...
@@ -1390,24 +1391,22 @@ backup_files(const char *from, bool prep_mode)
void
backup_fix_ddl
(
void
);
#define LSN_PREFIX_IN_SHOW_STATUS "\nLog sequence number "
static
lsn_t
get_current_lsn
(
MYSQL
*
connection
)
{
MYSQL_RES
*
res
=
xb_mysql_query
(
connection
,
"SHOW ENGINE INNODB STATUS"
,
true
,
false
);
if
(
!
res
)
return
0
;
MYSQL_ROW
row
=
mysql_fetch_row
(
res
);
DBUG_ASSERT
(
row
);
if
(
row
)
{
const
char
*
p
=
strstr
(
row
[
2
],
LSN_PREFIX_IN_SHOW_STATUS
);
DBUG_ASSERT
(
p
);
if
(
p
)
{
p
+=
sizeof
(
LSN_PREFIX_IN_SHOW_STATUS
)
-
1
;
return
(
lsn_t
)
strtoll
(
p
,
NULL
,
10
);
static
lsn_t
get_current_lsn
(
MYSQL
*
connection
)
{
static
const
char
lsn_prefix
[]
=
"
\n
Log sequence number "
;
lsn_t
lsn
=
0
;
if
(
MYSQL_RES
*
res
=
xb_mysql_query
(
connection
,
"SHOW ENGINE INNODB STATUS"
,
true
,
false
))
{
if
(
MYSQL_ROW
row
=
mysql_fetch_row
(
res
))
{
if
(
const
char
*
p
=
strstr
(
row
[
2
],
lsn_prefix
))
{
p
+=
sizeof
lsn_prefix
-
1
;
lsn
=
lsn_t
(
strtoll
(
p
,
NULL
,
10
));
}
}
mysql_free_result
(
res
);
}
mysql_free_result
(
res
);
return
0
;
return
lsn
;
}
lsn_t
server_lsn_after_lock
;
...
...
extra/mariabackup/backup_mysql.cc
View file @
8b6b2c3e
...
...
@@ -916,6 +916,7 @@ DECLARE_THREAD(kill_mdl_waiters_thread(void *))
exit
(
EXIT_FAILURE
);
}
}
mysql_free_result
(
result
);
}
mysql_close
(
mysql
);
...
...
extra/mariabackup/xtrabackup.cc
View file @
8b6b2c3e
...
...
@@ -523,7 +523,9 @@ static os_event_t dbug_start_query_thread(
mysql_thread_id
(
par
->
con
),
wait_state
);
for
(;;)
{
MYSQL_RES
*
result
=
xb_mysql_query
(
mysql_connection
,
q
,
true
,
true
);
if
(
mysql_fetch_row
(
result
))
{
bool
exists
=
mysql_fetch_row
(
result
)
!=
NULL
;
mysql_free_result
(
result
);
if
(
exists
)
{
goto
end
;
}
msg_ts
(
"Waiting for query '%s' on connection %lu to "
...
...
@@ -578,7 +580,9 @@ std::string filename_to_spacename(const byte *filename, size_t len)
char
*
db
=
strrchr
(
f
,
'/'
);
ut_a
(
db
);
*
table
=
'/'
;
return
std
::
string
(
db
+
1
);
std
::
string
s
(
db
+
1
);
free
(
f
);
return
s
;
}
/** Report an operation to create, delete, or rename a file during backup.
...
...
@@ -4164,7 +4168,6 @@ xtrabackup_backup_func()
/* start back ground thread to copy newer log */
os_thread_id_t
log_copying_thread_id
;
datafiles_iter_t
*
it
;
/* get current checkpoint_lsn */
/* Look for the latest checkpoint from any of the log groups */
...
...
@@ -4322,7 +4325,7 @@ xtrabackup_backup_func()
"Waiting for table metadata lock"
,
1
,
ER_QUERY_INTERRUPTED
););
}
it
=
datafiles_iter_new
(
fil_system
);
datafiles_iter_t
*
it
=
datafiles_iter_new
(
fil_system
);
if
(
it
==
NULL
)
{
msg
(
"mariabackup: Error: datafiles_iter_new() failed.
\n
"
);
goto
fail
;
...
...
@@ -4531,7 +4534,7 @@ void backup_fix_ddl(void)
fil_space_close
(
n
->
space
->
name
);
fil_space_free
(
n
->
space
->
id
,
false
);
}
datafiles_iter_free
(
it
);
for
(
std
::
set
<
std
::
string
>::
iterator
iter
=
new_tables
.
begin
();
iter
!=
new_tables
.
end
();
iter
++
)
{
...
...
@@ -4578,6 +4581,8 @@ void backup_fix_ddl(void)
#endif
xtrabackup_copy_datafile
(
node
,
0
,
dest_name
.
c_str
()
/*, do_full_copy ? ULONGLONG_MAX:UNIV_PAGE_SIZE */
);
}
datafiles_iter_free
(
it
);
}
/* ================= prepare ================= */
...
...
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