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
42ea72db
Commit
42ea72db
authored
Oct 15, 2009
by
Alexander Nozdrin
Browse files
Options
Browse Files
Download
Plain Diff
Merge from mysql-5.1.
parents
32e51de7
482503d2
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
1199 additions
and
16 deletions
+1199
-16
mysql-test/extra/binlog_tests/binlog_failure_mixing_engines.test
...est/extra/binlog_tests/binlog_failure_mixing_engines.test
+300
-0
mysql-test/extra/rpl_tests/rpl_failed_optimize.test
mysql-test/extra/rpl_tests/rpl_failed_optimize.test
+1
-0
mysql-test/suite/binlog/r/binlog_mixed_failure_mixing_engines.result
...suite/binlog/r/binlog_mixed_failure_mixing_engines.result
+406
-0
mysql-test/suite/binlog/r/binlog_row_failure_mixing_engines.result
...t/suite/binlog/r/binlog_row_failure_mixing_engines.result
+440
-0
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
...l-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
+15
-3
mysql-test/suite/binlog/t/binlog_mixed_failure_mixing_engines.test
...t/suite/binlog/t/binlog_mixed_failure_mixing_engines.test
+4
-0
mysql-test/suite/binlog/t/binlog_row_failure_mixing_engines.test
...est/suite/binlog/t/binlog_row_failure_mixing_engines.test
+4
-0
mysql-test/suite/rpl/r/rpl_row_create_table.result
mysql-test/suite/rpl/r/rpl_row_create_table.result
+2
-2
mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result
+1
-0
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test
+1
-0
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test
+4
-0
sql/log.cc
sql/log.cc
+21
-11
No files found.
mysql-test/extra/binlog_tests/binlog_failure_mixing_engines.test
0 → 100644
View file @
42ea72db
This diff is collapsed.
Click to expand it.
mysql-test/extra/rpl_tests/rpl_failed_optimize.test
View file @
42ea72db
...
...
@@ -22,3 +22,4 @@ connection master;
select
*
from
t1
;
commit
;
drop
table
t1
;
--
sync_slave_with_master
mysql-test/suite/binlog/r/binlog_mixed_failure_mixing_engines.result
0 → 100644
View file @
42ea72db
This diff is collapsed.
Click to expand it.
mysql-test/suite/binlog/r/binlog_row_failure_mixing_engines.result
0 → 100644
View file @
42ea72db
This diff is collapsed.
Click to expand it.
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
View file @
42ea72db
...
...
@@ -133,6 +133,10 @@ master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
insert into t1 values(11);
commit;
show binlog events from <binlog_start>;
...
...
@@ -144,6 +148,8 @@ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
...
...
@@ -272,6 +278,10 @@ master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; drop table t1,t2
master-bin.000001 # Query # # use `test`; create table t0 (n int)
master-bin.000001 # Query # # BEGIN
...
...
@@ -372,7 +382,7 @@ master-bin.000001 # Query # # use `test`; DROP TABLE if exists t2
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # #
ROLLBACK
master-bin.000001 # Query # #
COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t2
master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb
master-bin.000001 # Query # # BEGIN
...
...
@@ -390,9 +400,11 @@ master-bin.000001 # Query # # use `test`; DROP TABLE t2
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # #
ROLLBACK
master-bin.000001 # Query # #
COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
...
...
@@ -400,7 +412,7 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # #
ROLLBACK
master-bin.000001 # Query # #
COMMIT
master-bin.000001 # Query # # use `test`; TRUNCATE table t2
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
...
...
mysql-test/suite/binlog/t/binlog_mixed_failure_mixing_engines.test
0 → 100644
View file @
42ea72db
--
source
include
/
have_binlog_format_mixed
.
inc
--
source
include
/
have_innodb
.
inc
--
source
extra
/
binlog_tests
/
binlog_failure_mixing_engines
.
test
mysql-test/suite/binlog/t/binlog_row_failure_mixing_engines.test
0 → 100644
View file @
42ea72db
--
source
include
/
have_binlog_format_row
.
inc
--
source
include
/
have_innodb
.
inc
--
source
extra
/
binlog_tests
/
binlog_failure_mixing_engines
.
test
mysql-test/suite/rpl/r/rpl_row_create_table.result
View file @
42ea72db
...
...
@@ -176,7 +176,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
# 106 Query # 174 BEGIN
# 174 Table_map # 216 table_id: # (test.t7)
# 216 Write_rows # 272 table_id: # flags: STMT_END_F
# 272 Query # 34
3 ROLLBACK
# 272 Query # 34
1 COMMIT
SELECT * FROM t7 ORDER BY a,b;
a b
1 2
...
...
@@ -327,7 +327,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
# 1329 Query # 1397 BEGIN
# 1397 Table_map # 1438 table_id: # (test.t1)
# 1438 Write_rows # 1482 table_id: # flags: STMT_END_F
# 1482 Query # 155
3 ROLLBACK
# 1482 Query # 155
1 COMMIT
SHOW TABLES;
Tables_in_test
t1
...
...
mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result
View file @
42ea72db
...
...
@@ -102,3 +102,4 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
DROP TABLE t1;
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test
View file @
42ea72db
...
...
@@ -58,3 +58,4 @@ STOP SLAVE;
# cleanup
--
connection
master
DROP
TABLE
t1
;
--
sync_slave_with_master
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test
View file @
42ea72db
...
...
@@ -78,3 +78,7 @@ SELECT * FROM t1 ORDER BY a;
--
replace_result
$MASTER_MYPORT
MASTER_PORT
--
replace_column
1
# 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
query_vertical
SHOW
SLAVE
STATUS
;
--
connection
master
DROP
TABLE
t1
;
--
sync_slave_with_master
sql/log.cc
View file @
42ea72db
...
...
@@ -153,7 +153,7 @@ class Mutex_sentry
class
binlog_trx_data
{
public:
binlog_trx_data
()
:
at_least_one_stmt
(
0
),
incident
(
FALSE
),
m_pending
(
0
),
:
at_least_one_stmt
_committed
(
0
),
incident
(
FALSE
),
m_pending
(
0
),
before_stmt_pos
(
MY_OFF_T_UNDEF
)
{
trans_log
.
end_of_file
=
max_binlog_cache_size
;
...
...
@@ -182,7 +182,10 @@ class binlog_trx_data {
{
DBUG_PRINT
(
"info"
,
(
"truncating to position %lu"
,
(
ulong
)
pos
));
DBUG_PRINT
(
"info"
,
(
"before_stmt_pos=%lu"
,
(
ulong
)
pos
));
delete
pending
();
if
(
pending
())
{
delete
pending
();
}
set_pending
(
0
);
reinit_io_cache
(
&
trans_log
,
WRITE_CACHE
,
pos
,
0
,
0
);
trans_log
.
end_of_file
=
max_binlog_cache_size
;
...
...
@@ -192,12 +195,12 @@ class binlog_trx_data {
/*
The only valid positions that can be truncated to are at the
beginning of a statement. We are relying on this fact to be able
to set the at_least_one_stmt flag correctly. In other word, if
to set the at_least_one_stmt
_committed
flag correctly. In other word, if
we are truncating to the beginning of the transaction cache,
there will be no statements in the cache, otherwhise, we will
have at least one statement in the transaction cache.
*/
at_least_one_stmt
=
(
pos
>
0
);
at_least_one_stmt
_committed
=
(
pos
>
0
);
}
/*
...
...
@@ -239,7 +242,7 @@ class binlog_trx_data {
Boolean that is true if there is at least one statement in the
transaction cache.
*/
bool
at_least_one_stmt
;
bool
at_least_one_stmt
_committed
;
bool
incident
;
private:
...
...
@@ -1272,7 +1275,7 @@ static bool stmt_has_updated_trans_table(THD *thd)
{
Ha_trx_info
*
ha_info
;
for
(
ha_info
=
thd
->
transaction
.
stmt
.
ha_list
;
ha_info
;
ha_info
=
ha_info
->
next
())
for
(
ha_info
=
thd
->
transaction
.
stmt
.
ha_list
;
ha_info
&&
ha_info
->
is_started
()
;
ha_info
=
ha_info
->
next
())
{
if
(
ha_info
->
is_trx_read_write
()
&&
ha_info
->
ht
()
!=
binlog_hton
)
return
(
TRUE
);
...
...
@@ -1535,13 +1538,17 @@ static int binlog_commit(handlerton *hton, THD *thd, bool all)
YESNO
(
in_transaction
),
YESNO
(
thd
->
transaction
.
all
.
modified_non_trans_table
),
YESNO
(
thd
->
transaction
.
stmt
.
modified_non_trans_table
)));
if
(
!
in_transaction
||
all
)
if
(
!
in_transaction
||
all
||
(
!
all
&&
!
trx_data
->
at_least_one_stmt_committed
&&
!
stmt_has_updated_trans_table
(
thd
)
&&
thd
->
transaction
.
stmt
.
modified_non_trans_table
))
{
Query_log_event
qev
(
thd
,
STRING_WITH_LEN
(
"COMMIT"
),
TRUE
,
TRUE
,
0
);
error
=
binlog_end_trans
(
thd
,
trx_data
,
&
qev
,
all
);
goto
end
;
}
trx_data
->
at_least_one_stmt_committed
=
my_b_tell
(
&
trx_data
->
trans_log
)
>
0
;
end:
if
(
!
all
)
trx_data
->
before_stmt_pos
=
MY_OFF_T_UNDEF
;
// part of the stmt commit
...
...
@@ -1608,15 +1615,18 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all)
{
/*
We flush the cache with a rollback, wrapped in a beging/rollback if:
. aborting a trans
cation that modified a non-transactional table or
;
. aborting a trans
action that modified a non-transactional table
;
. aborting a statement that modified both transactional and
non-transctional tables but which is not in the boundaries of any
transaction;
non-trans
a
ctional tables but which is not in the boundaries of any
transaction
or there was no early change
;
. the OPTION_KEEP_LOG is activate.
*/
if
((
all
&&
thd
->
transaction
.
all
.
modified_non_trans_table
)
||
(
!
all
&&
thd
->
transaction
.
stmt
.
modified_non_trans_table
&&
!
(
thd
->
options
&
(
OPTION_BEGIN
|
OPTION_NOT_AUTOCOMMIT
)))
||
(
!
all
&&
thd
->
transaction
.
stmt
.
modified_non_trans_table
&&
!
trx_data
->
at_least_one_stmt_committed
&&
thd
->
current_stmt_binlog_row_based
)
||
((
thd
->
options
&
OPTION_KEEP_LOG
)))
{
Query_log_event
qev
(
thd
,
STRING_WITH_LEN
(
"ROLLBACK"
),
TRUE
,
TRUE
,
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