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
0d3aefcd
Commit
0d3aefcd
authored
Mar 21, 2007
by
iggy@recycle.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-5.1-new-maint
into recycle.(none):/src/bug23736/my51-bug23736
parents
a0c2fae0
13398ccb
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
34 deletions
+29
-34
client/mysqlbinlog.cc
client/mysqlbinlog.cc
+13
-14
include/my_sys.h
include/my_sys.h
+9
-8
mysys/array.c
mysys/array.c
+0
-4
mysys/mf_tempdir.c
mysys/mf_tempdir.c
+7
-8
No files found.
client/mysqlbinlog.cc
View file @
0d3aefcd
...
@@ -158,11 +158,7 @@ class Load_log_processor
...
@@ -158,11 +158,7 @@ class Load_log_processor
public:
public:
Load_log_processor
()
{}
Load_log_processor
()
{}
~
Load_log_processor
()
~
Load_log_processor
()
{}
{
destroy
();
delete_dynamic
(
&
file_names
);
}
int
init
()
int
init
()
{
{
...
@@ -185,7 +181,7 @@ class Load_log_processor
...
@@ -185,7 +181,7 @@ class Load_log_processor
{
{
File_name_record
*
ptr
=
(
File_name_record
*
)
file_names
.
buffer
;
File_name_record
*
ptr
=
(
File_name_record
*
)
file_names
.
buffer
;
File_name_record
*
end
=
ptr
+
file_names
.
elements
;
File_name_record
*
end
=
ptr
+
file_names
.
elements
;
for
(;
ptr
<
end
;
ptr
++
)
for
(;
ptr
<
end
;
ptr
++
)
{
{
if
(
ptr
->
fname
)
if
(
ptr
->
fname
)
{
{
...
@@ -194,6 +190,8 @@ class Load_log_processor
...
@@ -194,6 +190,8 @@ class Load_log_processor
bzero
((
char
*
)
ptr
,
sizeof
(
File_name_record
));
bzero
((
char
*
)
ptr
,
sizeof
(
File_name_record
));
}
}
}
}
delete_dynamic
(
&
file_names
);
}
}
/*
/*
...
@@ -1577,6 +1575,7 @@ int main(int argc, char** argv)
...
@@ -1577,6 +1575,7 @@ int main(int argc, char** argv)
cleanup
();
cleanup
();
free_defaults
(
defaults_argv
);
free_defaults
(
defaults_argv
);
my_free_open_file_info
();
my_free_open_file_info
();
load_processor
.
destroy
();
/* We cannot free DBUG, it is used in global destructors after exit(). */
/* We cannot free DBUG, it is used in global destructors after exit(). */
my_end
((
info_flag
?
MY_CHECK_ERROR
:
0
)
|
MY_DONT_FREE_DBUG
);
my_end
((
info_flag
?
MY_CHECK_ERROR
:
0
)
|
MY_DONT_FREE_DBUG
);
...
...
include/my_sys.h
View file @
0d3aefcd
...
@@ -312,8 +312,17 @@ struct st_my_file_info
...
@@ -312,8 +312,17 @@ struct st_my_file_info
extern
struct
st_my_file_info
*
my_file_info
;
extern
struct
st_my_file_info
*
my_file_info
;
typedef
struct
st_dynamic_array
{
char
*
buffer
;
uint
elements
,
max_element
;
uint
alloc_increment
;
uint
size_of_element
;
}
DYNAMIC_ARRAY
;
typedef
struct
st_my_tmpdir
typedef
struct
st_my_tmpdir
{
{
DYNAMIC_ARRAY
full_list
;
char
**
list
;
char
**
list
;
uint
cur
,
max
;
uint
cur
,
max
;
#ifdef THREAD
#ifdef THREAD
...
@@ -321,14 +330,6 @@ typedef struct st_my_tmpdir
...
@@ -321,14 +330,6 @@ typedef struct st_my_tmpdir
#endif
#endif
}
MY_TMPDIR
;
}
MY_TMPDIR
;
typedef
struct
st_dynamic_array
{
char
*
buffer
;
uint
elements
,
max_element
;
uint
alloc_increment
;
uint
size_of_element
;
}
DYNAMIC_ARRAY
;
typedef
struct
st_dynamic_string
typedef
struct
st_dynamic_string
{
{
char
*
str
;
char
*
str
;
...
...
mysys/array.c
View file @
0d3aefcd
...
@@ -15,10 +15,6 @@
...
@@ -15,10 +15,6 @@
/* Handling of arrays that can grow dynamicly. */
/* Handling of arrays that can grow dynamicly. */
#if defined(WIN32) || defined(__WIN__)
#undef SAFEMALLOC
/* Problems with threads */
#endif
#include "mysys_priv.h"
#include "mysys_priv.h"
#include "m_string.h"
#include "m_string.h"
...
...
mysys/mf_tempdir.c
View file @
0d3aefcd
...
@@ -26,12 +26,11 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
...
@@ -26,12 +26,11 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
{
{
char
*
end
,
*
copy
;
char
*
end
,
*
copy
;
char
buff
[
FN_REFLEN
];
char
buff
[
FN_REFLEN
];
DYNAMIC_ARRAY
t_arr
;
DBUG_ENTER
(
"init_tmpdir"
);
DBUG_ENTER
(
"init_tmpdir"
);
DBUG_PRINT
(
"enter"
,
(
"pathlist: %s"
,
pathlist
?
pathlist
:
"NULL"
));
DBUG_PRINT
(
"enter"
,
(
"pathlist: %s"
,
pathlist
?
pathlist
:
"NULL"
));
pthread_mutex_init
(
&
tmpdir
->
mutex
,
MY_MUTEX_INIT_FAST
);
pthread_mutex_init
(
&
tmpdir
->
mutex
,
MY_MUTEX_INIT_FAST
);
if
(
my_init_dynamic_array
(
&
t
_arr
,
sizeof
(
char
*
),
1
,
5
))
if
(
my_init_dynamic_array
(
&
t
mpdir
->
full_list
,
sizeof
(
char
*
),
1
,
5
))
goto
err
;
goto
err
;
if
(
!
pathlist
||
!
pathlist
[
0
])
if
(
!
pathlist
||
!
pathlist
[
0
])
{
{
...
@@ -53,19 +52,19 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
...
@@ -53,19 +52,19 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
strmake
(
buff
,
pathlist
,
(
uint
)
(
end
-
pathlist
));
strmake
(
buff
,
pathlist
,
(
uint
)
(
end
-
pathlist
));
length
=
cleanup_dirname
(
buff
,
buff
);
length
=
cleanup_dirname
(
buff
,
buff
);
if
(
!
(
copy
=
my_strndup
(
buff
,
length
,
MYF
(
MY_WME
)))
||
if
(
!
(
copy
=
my_strndup
(
buff
,
length
,
MYF
(
MY_WME
)))
||
insert_dynamic
(
&
t
_arr
,
(
gptr
)
&
copy
))
insert_dynamic
(
&
t
mpdir
->
full_list
,
(
gptr
)
&
copy
))
DBUG_RETURN
(
TRUE
);
DBUG_RETURN
(
TRUE
);
pathlist
=
end
+
1
;
pathlist
=
end
+
1
;
}
}
while
(
*
end
);
while
(
*
end
);
freeze_size
(
&
t
_arr
);
freeze_size
(
&
t
mpdir
->
full_list
);
tmpdir
->
list
=
(
char
**
)
t
_arr
.
buffer
;
tmpdir
->
list
=
(
char
**
)
t
mpdir
->
full_list
.
buffer
;
tmpdir
->
max
=
t
_arr
.
elements
-
1
;
tmpdir
->
max
=
t
mpdir
->
full_list
.
elements
-
1
;
tmpdir
->
cur
=
0
;
tmpdir
->
cur
=
0
;
DBUG_RETURN
(
FALSE
);
DBUG_RETURN
(
FALSE
);
err:
err:
delete_dynamic
(
&
t
_arr
);
/* Safe to free */
delete_dynamic
(
&
t
mpdir
->
full_list
);
/* Safe to free */
pthread_mutex_destroy
(
&
tmpdir
->
mutex
);
pthread_mutex_destroy
(
&
tmpdir
->
mutex
);
DBUG_RETURN
(
TRUE
);
DBUG_RETURN
(
TRUE
);
}
}
...
@@ -88,7 +87,7 @@ void free_tmpdir(MY_TMPDIR *tmpdir)
...
@@ -88,7 +87,7 @@ void free_tmpdir(MY_TMPDIR *tmpdir)
uint
i
;
uint
i
;
for
(
i
=
0
;
i
<=
tmpdir
->
max
;
i
++
)
for
(
i
=
0
;
i
<=
tmpdir
->
max
;
i
++
)
my_free
(
tmpdir
->
list
[
i
],
MYF
(
0
));
my_free
(
tmpdir
->
list
[
i
],
MYF
(
0
));
my_free
((
gptr
)
tmpdir
->
list
,
MYF
(
0
)
);
delete_dynamic
(
&
tmpdir
->
full_list
);
pthread_mutex_destroy
(
&
tmpdir
->
mutex
);
pthread_mutex_destroy
(
&
tmpdir
->
mutex
);
}
}
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