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
7cf6bf62
Commit
7cf6bf62
authored
Jul 28, 2010
by
Luis Soares
Browse files
Options
Browse Files
Download
Plain Diff
BUG 55387: Automerged bzr bundle from bug report.
parents
a6102416
65357cd8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
11 deletions
+30
-11
sql/log_event.cc
sql/log_event.cc
+4
-3
sql/sql_base.cc
sql/sql_base.cc
+25
-7
sql/sql_base.h
sql/sql_base.h
+1
-1
No files found.
sql/log_event.cc
View file @
7cf6bf62
...
...
@@ -3719,6 +3719,7 @@ bool Start_log_event_v3::write(IO_CACHE* file)
int
Start_log_event_v3
::
do_apply_event
(
Relay_log_info
const
*
rli
)
{
DBUG_ENTER
(
"Start_log_event_v3::do_apply_event"
);
int
error
=
0
;
switch
(
binlog_version
)
{
case
3
:
...
...
@@ -3731,7 +3732,7 @@ int Start_log_event_v3::do_apply_event(Relay_log_info const *rli)
*/
if
(
created
)
{
close_temporary_tables
(
thd
);
error
=
close_temporary_tables
(
thd
);
cleanup_load_tmpdir
();
}
else
...
...
@@ -3759,7 +3760,7 @@ int Start_log_event_v3::do_apply_event(Relay_log_info const *rli)
Can distinguish, based on the value of 'created': this event was
generated at master startup.
*/
close_temporary_tables
(
thd
);
error
=
close_temporary_tables
(
thd
);
}
/*
Otherwise, can't distinguish a Start_log_event generated at
...
...
@@ -3771,7 +3772,7 @@ int Start_log_event_v3::do_apply_event(Relay_log_info const *rli)
/* this case is impossible */
DBUG_RETURN
(
1
);
}
DBUG_RETURN
(
0
);
DBUG_RETURN
(
error
);
}
#endif
/* defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */
...
...
sql/sql_base.cc
View file @
7cf6bf62
...
...
@@ -1634,7 +1634,7 @@ static inline uint tmpkeyval(THD *thd, TABLE *table)
creates one DROP TEMPORARY TABLE binlog event for each pseudo-thread
*/
void
close_temporary_tables
(
THD
*
thd
)
bool
close_temporary_tables
(
THD
*
thd
)
{
DBUG_ENTER
(
"close_temporary_tables"
);
TABLE
*
table
;
...
...
@@ -1642,9 +1642,10 @@ void close_temporary_tables(THD *thd)
TABLE
*
prev_table
;
/* Assume thd->variables.option_bits has OPTION_QUOTE_SHOW_CREATE */
bool
was_quote_show
=
TRUE
;
bool
error
=
0
;
if
(
!
thd
->
temporary_tables
)
DBUG_
VOID_RETURN
;
DBUG_
RETURN
(
FALSE
)
;
if
(
!
mysql_bin_log
.
is_open
())
{
...
...
@@ -1655,7 +1656,7 @@ void close_temporary_tables(THD *thd)
close_temporary
(
table
,
1
,
1
);
}
thd
->
temporary_tables
=
0
;
DBUG_
VOID_RETURN
;
DBUG_
RETURN
(
FALSE
)
;
}
/* Better add "if exists", in case a RESET MASTER has been done */
...
...
@@ -1754,11 +1755,27 @@ void close_temporary_tables(THD *thd)
qinfo
.
db
=
db
.
ptr
();
qinfo
.
db_len
=
db
.
length
();
thd
->
variables
.
character_set_client
=
cs_save
;
if
(
mysql_bin_log
.
write
(
&
qinfo
))
thd
->
stmt_da
->
can_overwrite_status
=
TRUE
;
if
((
error
=
(
mysql_bin_log
.
write
(
&
qinfo
)
||
error
)))
{
push_warning
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_ERROR
,
MYF
(
0
),
"Failed to write the DROP statement for temporary tables to binary log"
);
/*
If we're here following THD::cleanup, thence the connection
has been closed already. So lets print a message to the
error log instead of pushing yet another error into the
stmt_da.
Also, we keep the error flag so that we propagate the error
up in the stack. This way, if we're the SQL thread we notice
that close_temporary_tables failed. (Actually, the SQL
thread only calls close_temporary_tables while applying old
Start_log_event_v3 events.)
*/
sql_print_error
(
"Failed to write the DROP statement for "
"temporary tables to binary log"
);
}
thd
->
stmt_da
->
can_overwrite_status
=
FALSE
;
thd
->
variables
.
pseudo_thread_id
=
save_pseudo_thread_id
;
thd
->
thread_specific_used
=
save_thread_specific_used
;
}
...
...
@@ -1771,7 +1788,8 @@ void close_temporary_tables(THD *thd)
if
(
!
was_quote_show
)
thd
->
variables
.
option_bits
&=
~
OPTION_QUOTE_SHOW_CREATE
;
/* restore option */
thd
->
temporary_tables
=
0
;
DBUG_VOID_RETURN
;
DBUG_RETURN
(
error
);
}
/*
...
...
sql/sql_base.h
View file @
7cf6bf62
...
...
@@ -222,7 +222,7 @@ int decide_logging_format(THD *thd, TABLE_LIST *tables);
void
free_io_cache
(
TABLE
*
entry
);
void
intern_close_table
(
TABLE
*
entry
);
bool
close_thread_table
(
THD
*
thd
,
TABLE
**
table_ptr
);
void
close_temporary_tables
(
THD
*
thd
);
bool
close_temporary_tables
(
THD
*
thd
);
TABLE_LIST
*
unique_table
(
THD
*
thd
,
TABLE_LIST
*
table
,
TABLE_LIST
*
table_list
,
bool
check_alias
);
int
drop_temporary_table
(
THD
*
thd
,
TABLE_LIST
*
table_list
);
...
...
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