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
992698ce
Commit
992698ce
authored
Jul 31, 2007
by
gkodinov/kgeorge@magare.gmz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge of the fix for bug 17417 5.0-opt->5.1-opt
parent
24aa214a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
135 additions
and
133 deletions
+135
-133
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test
+0
-118
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
...l-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
+12
-12
mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test
mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test
+120
-0
sql/sql_class.cc
sql/sql_class.cc
+1
-1
sql/sql_insert.cc
sql/sql_insert.cc
+1
-1
sql/sql_parse.cc
sql/sql_parse.cc
+1
-1
No files found.
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test
View file @
992698ce
...
@@ -316,121 +316,3 @@ disconnect con3;
...
@@ -316,121 +316,3 @@ disconnect con3;
connection
con4
;
connection
con4
;
select
get_lock
(
"a"
,
10
);
# wait for rollback to finish
select
get_lock
(
"a"
,
10
);
# wait for rollback to finish
#
# Bug #27417 thd->no_trans_update.stmt lost value inside of SF-exec-stack
# bug #28960 non-trans temp table changes with insert .. select
# not binlogged after rollback
#
# testing appearence of insert into temp_table in binlog.
# There are two branches of execution that require different setup.
## send_eof() branch
# prepare
create
temporary
table
tt
(
a
int
unique
);
create
table
ti
(
a
int
)
engine
=
innodb
;
reset
master
;
show
master
status
;
# action
begin
;
insert
into
ti
values
(
1
);
insert
into
ti
values
(
2
)
;
insert
into
tt
select
*
from
ti
;
rollback
;
# check
select
count
(
*
)
from
tt
/* 2 */
;
show
master
status
;
--
replace_column
2
# 5 #
show
binlog
events
from
98
;
select
count
(
*
)
from
ti
/* zero */
;
insert
into
ti
select
*
from
tt
;
select
*
from
ti
/* that is what slave would miss - a bug */
;
## send_error() branch
delete
from
ti
;
delete
from
tt
where
a
=
1
;
reset
master
;
show
master
status
;
# action
begin
;
insert
into
ti
values
(
1
);
insert
into
ti
values
(
2
)
/* to make the dup error in the following */
;
--
error
ER_DUP_ENTRY
insert
into
tt
select
*
from
ti
/* one affected and error */
;
rollback
;
# check
show
master
status
;
--
replace_column
2
# 5 #
show
binlog
events
from
98
;
select
count
(
*
)
from
ti
/* zero */
;
insert
into
ti
select
*
from
tt
;
select
*
from
tt
/* that is what otherwise slave missed - the bug */
;
drop
table
ti
;
#
# Bug #27417 thd->no_trans_update.stmt lost value inside of SF-exec-stack
#
# Testing asserts: if there is a side effect of modifying non-transactional
# table thd->no_trans_update.stmt must be TRUE;
# the assert is active with debug build
#
--
disable_warnings
drop
function
if
exists
bug27417
;
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
# side effect table
CREATE
TABLE
t1
(
a
int
NOT
NULL
auto_increment
primary
key
)
ENGINE
=
MyISAM
;
# target tables
CREATE
TABLE
t2
(
a
int
NOT
NULL
auto_increment
,
PRIMARY
KEY
(
a
));
delimiter
|
;
create
function
bug27417
(
n
int
)
RETURNS
int
(
11
)
begin
insert
into
t1
values
(
null
);
return
n
;
end
|
delimiter
;
|
reset
master
;
# execute
insert
into
t2
values
(
bug27417
(
1
));
insert
into
t2
select
bug27417
(
2
);
reset
master
;
--
error
ER_DUP_ENTRY
insert
into
t2
values
(
bug27417
(
2
));
show
master
status
;
/* only (!) with fixes for #23333 will show there is the query */
;
select
count
(
*
)
from
t1
/* must be 3 */
;
reset
master
;
select
count
(
*
)
from
t2
;
delete
from
t2
where
a
=
bug27417
(
3
);
select
count
(
*
)
from
t2
/* nothing got deleted */
;
show
master
status
;
/* the query must be in regardless of #23333 */
;
select
count
(
*
)
from
t1
/* must be 5 */
;
--
enable_info
delete
t2
from
t2
where
t2
.
a
=
bug27417
(
100
)
/* must not affect t2 */
;
--
disable_info
select
count
(
*
)
from
t1
/* must be 7 */
;
drop
function
bug27417
;
drop
table
t1
,
t2
;
--
echo
end
of
tests
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
View file @
992698ce
...
@@ -380,12 +380,12 @@ select
...
@@ -380,12 +380,12 @@ select
@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%"
@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%"
1 1
1 1
drop table t1, t2;
drop table t1, t2;
create t
emporary t
able tt (a int unique);
create table tt (a int unique);
create table ti (a int) engine=innodb;
create table ti (a int) engine=innodb;
reset master;
reset master;
show master status;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001
98
master-bin.000001
106
begin;
begin;
insert into ti values (1);
insert into ti values (1);
insert into ti values (2) ;
insert into ti values (2) ;
...
@@ -398,8 +398,8 @@ count(*)
...
@@ -398,8 +398,8 @@ count(*)
2
2
show master status;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 5
07
master-bin.000001 5
15
show binlog events from
98
;
show binlog events from
106
;
Log_name Pos Event_type Server_id End_log_pos Info
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; BEGIN
master-bin.000001 # Query 1 # use `test`; BEGIN
master-bin.000001 # Query 1 # use `test`; insert into ti values (1)
master-bin.000001 # Query 1 # use `test`; insert into ti values (1)
...
@@ -419,19 +419,19 @@ delete from tt where a=1;
...
@@ -419,19 +419,19 @@ delete from tt where a=1;
reset master;
reset master;
show master status;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001
98
master-bin.000001
106
begin;
begin;
insert into ti values (1);
insert into ti values (1);
insert into ti values (2) /* to make the dup error in the following */;
insert into ti values (2) /* to make the dup error in the following */;
insert into tt select * from ti /* one affected and error */;
insert into tt select * from ti /* one affected and error */;
ERROR 23000: Duplicate entry '2' for key
1
ERROR 23000: Duplicate entry '2' for key
'a'
rollback;
rollback;
Warnings:
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
Warning 1196 Some non-transactional changed tables couldn't be rolled back
show master status;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 58
1
master-bin.000001 58
9
show binlog events from
98
;
show binlog events from
106
;
Log_name Pos Event_type Server_id End_log_pos Info
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; BEGIN
master-bin.000001 # Query 1 # use `test`; BEGIN
master-bin.000001 # Query 1 # use `test`; insert into ti values (1)
master-bin.000001 # Query 1 # use `test`; insert into ti values (1)
...
@@ -446,7 +446,7 @@ select * from tt /* that is what otherwise slave missed - the bug */;
...
@@ -446,7 +446,7 @@ select * from tt /* that is what otherwise slave missed - the bug */;
a
a
1
1
2
2
drop table ti;
drop table ti
,tt
;
drop function if exists bug27417;
drop function if exists bug27417;
drop table if exists t1,t2;
drop table if exists t1,t2;
CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM;
CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM;
...
@@ -462,10 +462,10 @@ insert into t2 values (bug27417(1));
...
@@ -462,10 +462,10 @@ insert into t2 values (bug27417(1));
insert into t2 select bug27417(2);
insert into t2 select bug27417(2);
reset master;
reset master;
insert into t2 values (bug27417(2));
insert into t2 values (bug27417(2));
ERROR 23000: Duplicate entry '2' for key
1
ERROR 23000: Duplicate entry '2' for key
'PRIMARY'
show master status;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001
9
8
master-bin.000001
21
8
/* only (!) with fixes for #23333 will show there is the query */;
/* only (!) with fixes for #23333 will show there is the query */;
select count(*) from t1 /* must be 3 */;
select count(*) from t1 /* must be 3 */;
count(*)
count(*)
...
@@ -480,7 +480,7 @@ count(*)
...
@@ -480,7 +480,7 @@ count(*)
2
2
show master status;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001
195
master-bin.000001
223
/* the query must be in regardless of #23333 */;
/* the query must be in regardless of #23333 */;
select count(*) from t1 /* must be 5 */;
select count(*) from t1 /* must be 5 */;
count(*)
count(*)
...
...
mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test
View file @
992698ce
...
@@ -21,4 +21,124 @@ is not null;
...
@@ -21,4 +21,124 @@ is not null;
eval
select
eval
select
@
a
like
"%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%"
,
@
a
like
"%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%"
,
@
a
not
like
"%#%error_code=%error_code=%"
;
@
a
not
like
"%#%error_code=%error_code=%"
;
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
#
# Bug #27417 thd->no_trans_update.stmt lost value inside of SF-exec-stack
# bug #28960 non-trans temp table changes with insert .. select
# not binlogged after rollback
#
# testing appearence of insert into temp_table in binlog.
# There are two branches of execution that require different setup.
## send_eof() branch
# prepare
create
table
tt
(
a
int
unique
);
create
table
ti
(
a
int
)
engine
=
innodb
;
reset
master
;
show
master
status
;
# action
begin
;
insert
into
ti
values
(
1
);
insert
into
ti
values
(
2
)
;
insert
into
tt
select
*
from
ti
;
rollback
;
# check
select
count
(
*
)
from
tt
/* 2 */
;
show
master
status
;
--
replace_column
2
# 5 #
show
binlog
events
from
106
;
select
count
(
*
)
from
ti
/* zero */
;
insert
into
ti
select
*
from
tt
;
select
*
from
ti
/* that is what slave would miss - a bug */
;
## send_error() branch
delete
from
ti
;
delete
from
tt
where
a
=
1
;
reset
master
;
show
master
status
;
# action
begin
;
insert
into
ti
values
(
1
);
insert
into
ti
values
(
2
)
/* to make the dup error in the following */
;
--
error
ER_DUP_ENTRY
insert
into
tt
select
*
from
ti
/* one affected and error */
;
rollback
;
# check
show
master
status
;
--
replace_column
2
# 5 #
show
binlog
events
from
106
;
select
count
(
*
)
from
ti
/* zero */
;
insert
into
ti
select
*
from
tt
;
select
*
from
tt
/* that is what otherwise slave missed - the bug */
;
drop
table
ti
,
tt
;
#
# Bug #27417 thd->no_trans_update.stmt lost value inside of SF-exec-stack
#
# Testing asserts: if there is a side effect of modifying non-transactional
# table thd->no_trans_update.stmt must be TRUE;
# the assert is active with debug build
#
--
disable_warnings
drop
function
if
exists
bug27417
;
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
# side effect table
CREATE
TABLE
t1
(
a
int
NOT
NULL
auto_increment
primary
key
)
ENGINE
=
MyISAM
;
# target tables
CREATE
TABLE
t2
(
a
int
NOT
NULL
auto_increment
,
PRIMARY
KEY
(
a
));
delimiter
|
;
create
function
bug27417
(
n
int
)
RETURNS
int
(
11
)
begin
insert
into
t1
values
(
null
);
return
n
;
end
|
delimiter
;
|
reset
master
;
# execute
insert
into
t2
values
(
bug27417
(
1
));
insert
into
t2
select
bug27417
(
2
);
reset
master
;
--
error
ER_DUP_ENTRY
insert
into
t2
values
(
bug27417
(
2
));
show
master
status
;
/* only (!) with fixes for #23333 will show there is the query */
;
select
count
(
*
)
from
t1
/* must be 3 */
;
reset
master
;
select
count
(
*
)
from
t2
;
delete
from
t2
where
a
=
bug27417
(
3
);
select
count
(
*
)
from
t2
/* nothing got deleted */
;
show
master
status
;
/* the query must be in regardless of #23333 */
;
select
count
(
*
)
from
t1
/* must be 5 */
;
--
enable_info
delete
t2
from
t2
where
t2
.
a
=
bug27417
(
100
)
/* must not affect t2 */
;
--
disable_info
select
count
(
*
)
from
t1
/* must be 7 */
;
drop
function
bug27417
;
drop
table
t1
,
t2
;
--
echo
end
of
tests
sql/sql_class.cc
View file @
992698ce
...
@@ -2573,7 +2573,7 @@ extern "C" int thd_slave_thread(const MYSQL_THD thd)
...
@@ -2573,7 +2573,7 @@ extern "C" int thd_slave_thread(const MYSQL_THD thd)
extern
"C"
int
thd_non_transactional_update
(
const
MYSQL_THD
thd
)
extern
"C"
int
thd_non_transactional_update
(
const
MYSQL_THD
thd
)
{
{
return
(
thd
->
no_trans_update
.
all
);
return
(
thd
->
transaction
.
all
.
modified_non_trans_table
);
}
}
extern
"C"
int
thd_binlog_format
(
const
MYSQL_THD
thd
)
extern
"C"
int
thd_binlog_format
(
const
MYSQL_THD
thd
)
...
...
sql/sql_insert.cc
View file @
992698ce
...
@@ -3188,7 +3188,7 @@ void select_insert::abort() {
...
@@ -3188,7 +3188,7 @@ void select_insert::abort() {
table
->
file
->
has_transactions
(),
FALSE
);
table
->
file
->
has_transactions
(),
FALSE
);
if
(
!
thd
->
current_stmt_binlog_row_based
&&
!
table
->
s
->
tmp_table
&&
if
(
!
thd
->
current_stmt_binlog_row_based
&&
!
table
->
s
->
tmp_table
&&
!
can_rollback_data
())
!
can_rollback_data
())
thd
->
no_trans_update
.
all
=
TRUE
;
thd
->
transaction
.
all
.
modified_non_trans_table
=
TRUE
;
query_cache_invalidate3
(
thd
,
table
,
1
);
query_cache_invalidate3
(
thd
,
table
,
1
);
}
}
}
}
...
...
sql/sql_parse.cc
View file @
992698ce
...
@@ -5176,7 +5176,7 @@ void mysql_reset_thd_for_next_command(THD *thd)
...
@@ -5176,7 +5176,7 @@ void mysql_reset_thd_for_next_command(THD *thd)
if
(
!
(
thd
->
options
&
(
OPTION_NOT_AUTOCOMMIT
|
OPTION_BEGIN
)))
if
(
!
(
thd
->
options
&
(
OPTION_NOT_AUTOCOMMIT
|
OPTION_BEGIN
)))
{
{
thd
->
options
&=
~
OPTION_KEEP_LOG
;
thd
->
options
&=
~
OPTION_KEEP_LOG
;
thd
->
no_trans_update
.
all
=
FALSE
;
thd
->
transaction
.
all
.
modified_non_trans_table
=
FALSE
;
}
}
DBUG_ASSERT
(
thd
->
security_ctx
==
&
thd
->
main_security_ctx
);
DBUG_ASSERT
(
thd
->
security_ctx
==
&
thd
->
main_security_ctx
);
thd
->
tmp_table_used
=
0
;
thd
->
tmp_table_used
=
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