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
0058593c
Commit
0058593c
authored
Jun 05, 2003
by
guilhem@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test for bug 578. And a comment in slave.cc.
parent
e6cdc816
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
0 deletions
+47
-0
mysql-test/r/lock_tables_lost_commit.result
mysql-test/r/lock_tables_lost_commit.result
+8
-0
mysql-test/t/lock_tables_lost_commit-master.opt
mysql-test/t/lock_tables_lost_commit-master.opt
+1
-0
mysql-test/t/lock_tables_lost_commit.test
mysql-test/t/lock_tables_lost_commit.test
+18
-0
sql/slave.cc
sql/slave.cc
+20
-0
No files found.
mysql-test/r/lock_tables_lost_commit.result
0 → 100644
View file @
0058593c
drop table if exists t1;
create table t1(a int) type=innodb;
lock tables t1 write;
insert into t1 values(10);
select * from t1;
a
10
drop table t1;
mysql-test/t/lock_tables_lost_commit-master.opt
0 → 100644
View file @
0058593c
--binlog-ignore-db=test innodb
\ No newline at end of file
mysql-test/t/lock_tables_lost_commit.test
0 → 100644
View file @
0058593c
# This is a test for bug 578
connect
(
con1
,
localhost
,
root
,,);
connect
(
con2
,
localhost
,
root
,,);
connection
con1
;
drop
table
if
exists
t1
;
create
table
t1
(
a
int
)
type
=
innodb
;
lock
tables
t1
write
;
insert
into
t1
values
(
10
);
disconnect
con1
;
connection
con2
;
# The bug was that, because of the LOCK TABLES, the handler "forgot" to commit,
# and the other commit when we write to the binlog was not done because of
# binlog-ignore-db
select
*
from
t1
;
drop
table
t1
;
sql/slave.cc
View file @
0058593c
...
...
@@ -1186,6 +1186,26 @@ int init_relay_log_info(RELAY_LOG_INFO* rli, const char* info_fname)
strmov
(
strcend
(
tmp
,
'.'
),
"-relay-bin"
);
opt_relay_logname
=
my_strdup
(
tmp
,
MYF
(
MY_WME
));
}
/*
The relay log will now be opened, as a SEQ_READ_APPEND IO_CACHE. It is
notable that the last kilobytes of it (8 kB for example) may live in memory,
not on disk (depending on what the thread using it does). While this is
efficient, it has a side-effect one must know:
the size of the relay log on disk (displayed by 'ls -l' on Unix) can be a
few kilobytes less than one would expect by doing SHOW SLAVE STATUS; this
happens when only the IO thread is started (not the SQL thread). The
"missing" kilobytes are in memory, are preserved during 'STOP SLAVE; START
SLAVE IO_THREAD', and are flushed to disk when the slave's mysqld stops. So
this does not cause any bug. Example of how disk size grows by leaps:
Read_Master_Log_Pos: 7811 -rw-rw---- 1 guilhem qq 4 Jun 5 16:19 gbichot2-relay-bin.002
...later...
Read_Master_Log_Pos: 9744 -rw-rw---- 1 guilhem qq 8192 Jun 5 16:27 gbichot2-relay-bin.002
See how 4 is less than 7811 and 8192 is less than 9744.
*/
if
(
open_log
(
&
rli
->
relay_log
,
glob_hostname
,
opt_relay_logname
,
"-relay-bin"
,
opt_relaylog_index_name
,
LOG_BIN
,
1
/* read_append cache */
,
...
...
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