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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
edf784f4
Commit
edf784f4
authored
Jul 30, 2007
by
malff/marcsql@weblab.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed ressource leak when activation of LOGGER failed.
parent
5a687561
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
sql/log.cc
sql/log.cc
+15
-6
No files found.
sql/log.cc
View file @
edf784f4
...
@@ -1096,38 +1096,47 @@ void LOGGER::init_general_log(uint general_log_printer)
...
@@ -1096,38 +1096,47 @@ void LOGGER::init_general_log(uint general_log_printer)
bool
LOGGER
::
activate_log_handler
(
THD
*
thd
,
uint
log_type
)
bool
LOGGER
::
activate_log_handler
(
THD
*
thd
,
uint
log_type
)
{
{
MYSQL_QUERY_LOG
*
file_log
;
bool
res
=
FALSE
;
bool
res
=
FALSE
;
lock_exclusive
();
lock_exclusive
();
switch
(
log_type
)
{
switch
(
log_type
)
{
case
QUERY_LOG_SLOW
:
case
QUERY_LOG_SLOW
:
if
(
!
opt_slow_log
)
if
(
!
opt_slow_log
)
{
{
file_log
_handler
->
get_mysql_slow_log
()
->
file_log
=
file_log_handler
->
get_mysql_slow_log
();
open_slow_log
(
sys_var_slow_log_path
.
value
);
init_slow_log
(
log_output_options
);
file_log
->
open_slow_log
(
sys_var_slow_log_path
.
value
);
if
(
table_log_handler
->
activate_log
(
thd
,
QUERY_LOG_SLOW
))
if
(
table_log_handler
->
activate_log
(
thd
,
QUERY_LOG_SLOW
))
{
{
/* Error printed by open table in activate_log() */
/* Error printed by open table in activate_log() */
res
=
TRUE
;
res
=
TRUE
;
file_log
->
close
(
0
);
}
}
else
else
{
init_slow_log
(
log_output_options
);
opt_slow_log
=
TRUE
;
opt_slow_log
=
TRUE
;
}
}
}
break
;
break
;
case
QUERY_LOG_GENERAL
:
case
QUERY_LOG_GENERAL
:
if
(
!
opt_log
)
if
(
!
opt_log
)
{
{
file_log
_handler
->
get_mysql_log
()
->
file_log
=
file_log_handler
->
get_mysql_log
();
open_query_log
(
sys_var_general_log_path
.
value
);
init_general_log
(
log_output_options
);
file_log
->
open_query_log
(
sys_var_general_log_path
.
value
);
if
(
table_log_handler
->
activate_log
(
thd
,
QUERY_LOG_GENERAL
))
if
(
table_log_handler
->
activate_log
(
thd
,
QUERY_LOG_GENERAL
))
{
{
/* Error printed by open table in activate_log() */
/* Error printed by open table in activate_log() */
res
=
TRUE
;
res
=
TRUE
;
file_log
->
close
(
0
);
}
}
else
else
{
init_general_log
(
log_output_options
);
opt_log
=
TRUE
;
opt_log
=
TRUE
;
}
}
}
break
;
break
;
default:
default:
DBUG_ASSERT
(
0
);
DBUG_ASSERT
(
0
);
...
...
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