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
09bd2894
Commit
09bd2894
authored
Apr 01, 2011
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge MWL#136 after-review fixes into mariadb-5.2-rpl
parents
92dfbd42
6c8a23c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
6 deletions
+20
-6
sql/log.cc
sql/log.cc
+20
-6
No files found.
sql/log.cc
View file @
09bd2894
...
...
@@ -155,7 +155,7 @@ public:
using_xa
(
FALSE
),
xa_xid
(
0
)
{
trans_log
.
end_of_file
=
max_binlog_cache_size
;
strcpy
(
last_commit_pos_file
,
""
)
;
last_commit_pos_file
[
0
]
=
0
;
}
~
binlog_trx_data
()
...
...
@@ -213,7 +213,7 @@ public:
incident
=
FALSE
;
trans_log
.
end_of_file
=
max_binlog_cache_size
;
using_xa
=
FALSE
;
strcpy
(
last_commit_pos_file
,
""
)
;
last_commit_pos_file
[
0
]
=
0
;
last_commit_pos_offset
=
0
;
DBUG_ASSERT
(
empty
());
}
...
...
@@ -4388,6 +4388,10 @@ MYSQL_BIN_LOG::flush_and_set_pending_rows_event(THD *thd,
rotate_and_purge
(
RP_LOCK_LOG_IS_ALREADY_LOCKED
);
}
/*
Take mutex to protect against a reader seeing partial writes of 64-bit
offset on 32-bit CPUs.
*/
pthread_mutex_lock
(
&
LOCK_commit_ordered
);
last_commit_pos_offset
=
my_b_tell
(
&
log_file
);
pthread_mutex_unlock
(
&
LOCK_commit_ordered
);
...
...
@@ -4607,8 +4611,13 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info, my_bool *with_annotate)
err_unlock:
if
(
file
==
&
log_file
)
{
my_off_t
offset
=
my_b_tell
(
&
log_file
);
/*
Take mutex to protect against a reader seeing partial writes of 64-bit
offset on 32-bit CPUs.
*/
pthread_mutex_lock
(
&
LOCK_commit_ordered
);
last_commit_pos_offset
=
my_b_tell
(
&
log_file
)
;
last_commit_pos_offset
=
offset
;
pthread_mutex_unlock
(
&
LOCK_commit_ordered
);
pthread_mutex_unlock
(
&
LOCK_log
);
}
...
...
@@ -4906,6 +4915,7 @@ int query_error_code(THD *thd, bool not_killed)
bool
MYSQL_BIN_LOG
::
write_incident
(
THD
*
thd
)
{
uint
error
=
0
;
my_off_t
offset
;
DBUG_ENTER
(
"MYSQL_BIN_LOG::write_incident"
);
Incident
incident
=
INCIDENT_LOST_EVENTS
;
Incident_log_event
ev
(
thd
,
incident
,
write_error_msg
);
...
...
@@ -4921,8 +4931,13 @@ bool MYSQL_BIN_LOG::write_incident(THD *thd)
rotate_and_purge
(
RP_LOCK_LOG_IS_ALREADY_LOCKED
);
}
}
offset
=
my_b_tell
(
&
log_file
);
/*
Take mutex to protect against a reader seeing partial writes of 64-bit
offset on 32-bit CPUs.
*/
pthread_mutex_lock
(
&
LOCK_commit_ordered
);
last_commit_pos_offset
=
my_b_tell
(
&
log_file
)
;
last_commit_pos_offset
=
offset
;
pthread_mutex_unlock
(
&
LOCK_commit_ordered
);
pthread_mutex_unlock
(
&
LOCK_log
);
...
...
@@ -6734,8 +6749,7 @@ TC_LOG_BINLOG::set_status_variables(THD *thd)
else
trx_data
=
NULL
;
bool
have_snapshot
=
(
trx_data
&&
0
!=
strcmp
(
trx_data
->
last_commit_pos_file
,
""
));
bool
have_snapshot
=
(
trx_data
&&
trx_data
->
last_commit_pos_file
[
0
]
!=
0
);
pthread_mutex_lock
(
&
LOCK_commit_ordered
);
binlog_status_var_num_commits
=
this
->
num_commits
;
binlog_status_var_num_group_commits
=
this
->
num_group_commits
;
...
...
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