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
11c9a13a
Commit
11c9a13a
authored
Sep 16, 2007
by
aelkin@dl145j.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge: bug#27417,23333 manual work for fixing tests and a source code.
parent
e9b287f2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
41 deletions
+71
-41
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
...l-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
+53
-24
mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test
mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test
+8
-8
sql/sql_insert.cc
sql/sql_insert.cc
+10
-9
No files found.
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
View file @
11c9a13a
...
...
@@ -426,11 +426,18 @@ insert into ti values (2) /* to make the dup error in the following */;
insert into tt select * from ti /* one affected and error */;
ERROR 23000: Duplicate entry '2' for key 'a'
rollback;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001
106
master-bin.000001
589
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Query # # use `test`; insert into ti values (1)
master-bin.000001 # Query # # use `test`; insert into ti values (2) /* to make the dup error in the following */
master-bin.000001 # Query # # use `test`; insert into tt select * from ti /* one affected and error */
master-bin.000001 # Query # # use `test`; ROLLBACK
select count(*) from ti /* zero */;
count(*)
0
...
...
@@ -456,10 +463,11 @@ insert into t2 select bug27417(2);
reset master;
insert into t2 values (bug27417(2));
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 222
/* only (!) with fixes for #23333 will show there is the query */;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
select count(*) from t1 /* must be 3 */;
count(*)
3
...
...
@@ -471,10 +479,11 @@ delete from t2 where a=bug27417(3);
select count(*) from t2 /* nothing got deleted */;
count(*)
2
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 227
/* the query must be in regardless of #23333 */;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
select count(*) from t1 /* must be 5 */;
count(*)
5
...
...
@@ -491,9 +500,12 @@ insert into t2 values (1);
reset master;
insert into t2 values (bug27417(1));
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
show master status /* the offset must denote there is the query */;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 293
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; ROLLBACK
select count(*) from t1 /* must be 1 */;
count(*)
1
...
...
@@ -503,9 +515,13 @@ insert into t2 values (2);
reset master;
insert into t2 select bug27417(1) union select bug27417(2);
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
show master status /* the offset must denote there is the query */;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 332
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; ROLLBACK
select count(*) from t1 /* must be 2 */;
count(*)
2
...
...
@@ -514,9 +530,13 @@ insert into t3 values (1,1),(2,3),(3,4);
reset master;
update t3 set b=b+bug27417(1);
ERROR 23000: Duplicate entry '4' for key 'b'
show master status /* the offset must denote there is the query */;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 305
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Table_map # # table_id: # (test.t3)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Update_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
select count(*) from t1 /* must be 2 */;
count(*)
2
...
...
@@ -530,9 +550,13 @@ insert into t3 values (bug27417(1), 2);
reset master;
delete from t2;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
show master status /* the offset must denote there is the query */;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 335
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Table_map # # table_id: # (test.t3)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; ROLLBACK
select count(*) from t1 /* must be 1 */;
count(*)
1
...
...
@@ -548,9 +572,14 @@ a b
select count(*) from t1 /* must be 2 */;
count(*)
2
show master status /* the offset must denote there is the query */;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 362
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Table_map # # table_id: # (test.t4)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; ROLLBACK
drop trigger trg_del;
drop table t1,t2,t3,t4;
drop function bug27417;
...
...
mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test
View file @
11c9a13a
...
...
@@ -120,15 +120,15 @@ insert into t2 select bug27417(2);
reset
master
;
--
error
ER_DUP_ENTRY
insert
into
t2
values
(
bug27417
(
2
));
s
how
master
status
;
/* only (!) with fixes for #23333 will show there is the query */
;
insert
into
t2
values
(
bug27417
(
2
));
s
ource
include
/
show_binlog_events
.
inc
;
#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 */
;
s
how
master
status
;
/* the query must be in regardless of #23333 */
;
s
ource
include
/
show_binlog_events
.
inc
;
# the query must be in regardless of #23333
select
count
(
*
)
from
t1
/* must be 5 */
;
--
enable_info
...
...
@@ -166,7 +166,7 @@ CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique);
# check
s
how
master
status
/* the offset must denote there is the query */
;
s
ource
include
/
show_binlog_events
.
inc
;
# must be event of the query
select
count
(
*
)
from
t1
/* must be 1 */
;
#
...
...
@@ -186,7 +186,7 @@ CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique);
# check
s
how
master
status
/* the offset must denote there is the query */
;
s
ource
include
/
show_binlog_events
.
inc
;
# must be events of the query
select
count
(
*
)
from
t1
/* must be 2 */
;
#
...
...
@@ -203,7 +203,7 @@ CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique);
update
t3
set
b
=
b
+
bug27417
(
1
);
# check
s
how
master
status
/* the offset must denote there is the query */
;
s
ource
include
/
show_binlog_events
.
inc
;
# must be events of the query
select
count
(
*
)
from
t1
/* must be 2 */
;
...
...
@@ -225,7 +225,7 @@ CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique);
--
error
ER_DUP_ENTRY
delete
from
t2
;
# check
s
how
master
status
/* the offset must denote there is the query */
;
s
ource
include
/
show_binlog_events
.
inc
;
# must be events of the query
select
count
(
*
)
from
t1
/* must be 1 */
;
...
...
@@ -245,7 +245,7 @@ CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique);
# check
select
*
from
t4
;
select
count
(
*
)
from
t1
/* must be 2 */
;
s
how
master
status
/* the offset must denote there is the query */
;
s
ource
include
/
show_binlog_events
.
inc
;
# must be events of the query
#
# bug#23333 cleanup
...
...
sql/sql_insert.cc
View file @
11c9a13a
...
...
@@ -3163,6 +3163,7 @@ void select_insert::abort() {
*/
if
(
table
)
{
bool
changed
,
transactional_table
;
/*
If we are not in prelocked mode, we end the bulk insert started
before.
...
...
@@ -3184,20 +3185,20 @@ void select_insert::abort() {
If table creation failed, the number of rows modified will also be
zero, so no check for that is made.
*/
if
(
info
.
copied
||
info
.
deleted
||
info
.
updated
)
changed
=
(
info
.
copied
||
info
.
deleted
||
info
.
updated
);
transactional_table
=
table
->
file
->
has_transactions
();
if
(
thd
->
transaction
.
stmt
.
modified_non_trans_table
)
{
DBUG_ASSERT
(
table
!=
NULL
);
if
(
!
table
->
file
->
has_transactions
())
{
if
(
mysql_bin_log
.
is_open
())
thd
->
binlog_query
(
THD
::
ROW_QUERY_TYPE
,
thd
->
query
,
thd
->
query_length
,
table
->
file
->
has_transactions
(),
FALSE
);
if
(
!
thd
->
current_stmt_binlog_row_based
&&
!
table
->
s
->
tmp_table
&&
!
can_rollback_data
())
transactional_table
,
FALSE
);
if
(
!
thd
->
current_stmt_binlog_row_based
&&
!
can_rollback_data
())
thd
->
transaction
.
all
.
modified_non_trans_table
=
TRUE
;
query_cache_invalidate3
(
thd
,
table
,
1
);
}
if
(
changed
)
query_cache_invalidate3
(
thd
,
table
,
1
);
}
DBUG_ASSERT
(
transactional_table
||
!
changed
||
thd
->
transaction
.
stmt
.
modified_non_trans_table
);
table
->
file
->
ha_release_auto_increment
();
}
...
...
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