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
f972ba14
Commit
f972ba14
authored
Jan 29, 2009
by
Satya B
Browse files
Options
Browse Files
Download
Plain Diff
merge to the latest 5.1-bugteam branch
parents
4a657eee
ba4a5e8c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
116 additions
and
0 deletions
+116
-0
mysql-test/suite/binlog/r/binlog_tmp_table.result
mysql-test/suite/binlog/r/binlog_tmp_table.result
+30
-0
mysql-test/suite/binlog/t/binlog_tmp_table.test
mysql-test/suite/binlog/t/binlog_tmp_table.test
+82
-0
sql/sql_delete.cc
sql/sql_delete.cc
+3
-0
sql/sql_table.cc
sql/sql_table.cc
+1
-0
No files found.
mysql-test/suite/binlog/r/binlog_tmp_table.result
0 → 100644
View file @
f972ba14
create table foo (a int);
flush logs;
create temporary table tmp1_foo like foo;
create temporary table tmp2_foo (a int);
insert into tmp1_foo values (1), (2), (3), (4);
replace into tmp2_foo values (1), (2), (3), (4);
update tmp1_foo set a=2*a-1;
update tmp2_foo set a=2*a;
delete from tmp1_foo where a < 5;
delete from tmp2_foo where a < 5;
insert into foo select * from tmp1_foo;
insert into foo select * from tmp2_foo;
truncate table tmp1_foo;
truncate table tmp2_foo;
flush logs;
select * from foo;
a
5
7
6
8
drop table foo;
create table foo (a int);
select * from foo;
a
5
7
6
8
drop table foo;
mysql-test/suite/binlog/t/binlog_tmp_table.test
0 → 100644
View file @
f972ba14
# ==== Purpose ====
#
# Test if statements used temporary tables are binlogged correctly
#
# ==== Method ====
#
# Use two connections, use temporary tables on both of them, and by
# switching connections between statements, the test can check if the
# statements are logged with the correct thread id.
#
# The statements current tested include:
# CREATE TEMPORARY TABLE
# CREATE TEMPORARY TABLE LIKE
# INSERT
# REPLACE
# UPDATE
# INSERT SELECT
# TRUNCATE
#
# Note: When adding new query statements, please add them between the
# two 'flush logs'. And aslo please make sure the connection is
# switched between each statement.
#
# ==== Related bugs ====
#
# BUG#35583 mysqlbinlog replay fails with ERROR 1146 when temp tables are used
#
source
include
/
have_log_bin
.
inc
;
source
include
/
have_binlog_format_mixed_or_statement
.
inc
;
connect
(
master
,
127.0
.
0.1
,
root
,,
test
,
$MASTER_MYPORT
,);
connect
(
master1
,
127.0
.
0.1
,
root
,,
test
,
$MASTER_MYPORT
,);
create
table
foo
(
a
int
);
flush
logs
;
connection
master
;
create
temporary
table
tmp1_foo
like
foo
;
connection
master1
;
create
temporary
table
tmp2_foo
(
a
int
);
connection
master
;
insert
into
tmp1_foo
values
(
1
),
(
2
),
(
3
),
(
4
);
connection
master1
;
replace
into
tmp2_foo
values
(
1
),
(
2
),
(
3
),
(
4
);
connection
master
;
update
tmp1_foo
set
a
=
2
*
a
-
1
;
connection
master1
;
update
tmp2_foo
set
a
=
2
*
a
;
connection
master
;
delete
from
tmp1_foo
where
a
<
5
;
connection
master1
;
delete
from
tmp2_foo
where
a
<
5
;
connection
master
;
insert
into
foo
select
*
from
tmp1_foo
;
connection
master1
;
insert
into
foo
select
*
from
tmp2_foo
;
connection
master
;
truncate
table
tmp1_foo
;
connection
master1
;
truncate
table
tmp2_foo
;
flush
logs
;
connection
default
;
select
*
from
foo
;
# prepare for the replay
drop
table
foo
;
create
table
foo
(
a
int
);
# replay from binary log
exec
$MYSQL_BINLOG
$MYSQLTEST_VARDIR
/
log
/
master
-
bin
.
000002
|
$MYSQL
;
select
*
from
foo
;
# clean up
drop
table
foo
;
sql/sql_delete.cc
View file @
f972ba14
...
@@ -1010,6 +1010,9 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
...
@@ -1010,6 +1010,9 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
share
->
db
.
str
,
share
->
db
.
str
,
share
->
table_name
.
str
,
1
))))
share
->
table_name
.
str
,
1
))))
(
void
)
rm_temporary_table
(
table_type
,
path
);
(
void
)
rm_temporary_table
(
table_type
,
path
);
else
thd
->
thread_specific_used
=
TRUE
;
free_table_share
(
share
);
free_table_share
(
share
);
my_free
((
char
*
)
table
,
MYF
(
0
));
my_free
((
char
*
)
table
,
MYF
(
0
));
/*
/*
...
...
sql/sql_table.cc
View file @
f972ba14
...
@@ -4983,6 +4983,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table,
...
@@ -4983,6 +4983,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table,
dst_path
);
/* purecov: inspected */
dst_path
);
/* purecov: inspected */
goto
err
;
/* purecov: inspected */
goto
err
;
/* purecov: inspected */
}
}
thd
->
thread_specific_used
=
TRUE
;
}
}
else
if
(
err
)
else
if
(
err
)
{
{
...
...
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