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
2a97416e
Commit
2a97416e
authored
Nov 08, 2010
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MWL#136: Rename binlog_trx_{file,position} to the much better binlog_snapshot_{file,position}
parent
0bc31c3e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
32 deletions
+33
-32
client/mysqldump.c
client/mysqldump.c
+5
-5
mysql-test/suite/binlog/r/binlog_consistent.result
mysql-test/suite/binlog/r/binlog_consistent.result
+12
-12
mysql-test/suite/binlog/t/binlog_consistent.test
mysql-test/suite/binlog/t/binlog_consistent.test
+4
-4
sql/log.cc
sql/log.cc
+12
-11
No files found.
client/mysqldump.c
View file @
2a97416e
...
...
@@ -1114,8 +1114,8 @@ static int fetch_db_collation(const char *db_name,
/*
Check if server supports non-blocking binlog position using the
binlog_
trx_file and binlog_trx_position status variables. If it does,
also return the position obtained if output pointers are non-NULL.
binlog_
snapshot_file and binlog_snapshot_position status variables. If it
does,
also return the position obtained if output pointers are non-NULL.
Returns 1 if position available, 0 if not.
*/
static
int
...
...
@@ -1126,19 +1126,19 @@ check_consistent_binlog_pos(char *binlog_pos_file, char *binlog_pos_offset)
int
found
;
if
(
mysql_query_with_error_report
(
mysql
,
&
res
,
"SHOW STATUS LIKE 'binlog_
trx
_%'"
))
"SHOW STATUS LIKE 'binlog_
snapshot
_%'"
))
return
1
;
found
=
0
;
while
((
row
=
mysql_fetch_row
(
res
)))
{
if
(
0
==
strcmp
(
row
[
0
],
"binlog_
trx
_file"
))
if
(
0
==
strcmp
(
row
[
0
],
"binlog_
snapshot
_file"
))
{
if
(
binlog_pos_file
)
strmake
(
binlog_pos_file
,
row
[
1
],
FN_REFLEN
-
1
);
found
++
;
}
else
if
(
0
==
strcmp
(
row
[
0
],
"binlog_
trx
_position"
))
else
if
(
0
==
strcmp
(
row
[
0
],
"binlog_
snapshot
_position"
))
{
if
(
binlog_pos_offset
)
strmake
(
binlog_pos_offset
,
row
[
1
],
LONGLONG_LEN
);
...
...
mysql-test/suite/binlog/r/binlog_consistent.result
View file @
2a97416e
...
...
@@ -4,10 +4,10 @@ CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb;
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 241
SHOW STATUS LIKE 'binlog_
trx
_%';
SHOW STATUS LIKE 'binlog_
snapshot
_%';
Variable_name Value
binlog_
trx
_file ./master-bin.000001
binlog_
trx
_position 241
binlog_
snapshot
_file ./master-bin.000001
binlog_
snapshot
_position 241
BEGIN;
INSERT INTO t1 VALUES (0, "");
# Connection con1
...
...
@@ -35,10 +35,10 @@ COMMIT;
SELECT * FROM t1 ORDER BY a,b;
a b
0
SHOW STATUS LIKE 'binlog_
trx
_%';
SHOW STATUS LIKE 'binlog_
snapshot
_%';
Variable_name Value
binlog_
trx
_file ./master-bin.000001
binlog_
trx
_position 540
binlog_
snapshot
_file ./master-bin.000001
binlog_
snapshot
_position 540
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 727
...
...
@@ -57,18 +57,18 @@ FLUSH LOGS;
SELECT * FROM t1 ORDER BY a,b;
a b
0
SHOW STATUS LIKE 'binlog_
trx
_%';
SHOW STATUS LIKE 'binlog_
snapshot
_%';
Variable_name Value
binlog_
trx
_file ./master-bin.000001
binlog_
trx
_position 540
binlog_
snapshot
_file ./master-bin.000001
binlog_
snapshot
_position 540
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 106
COMMIT;
SHOW STATUS LIKE 'binlog_
trx
_%';
SHOW STATUS LIKE 'binlog_
snapshot
_%';
Variable_name Value
binlog_
trx
_file ./master-bin.000002
binlog_
trx
_position 106
binlog_
snapshot
_file ./master-bin.000002
binlog_
snapshot
_position 106
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 106
...
...
mysql-test/suite/binlog/t/binlog_consistent.test
View file @
2a97416e
...
...
@@ -17,7 +17,7 @@ connection default;
CREATE
TABLE
t1
(
a
INT
,
b
VARCHAR
(
100
),
PRIMARY
KEY
(
a
,
b
))
ENGINE
=
innodb
;
SHOW
MASTER
STATUS
;
SHOW
STATUS
LIKE
'binlog_
trx
_%'
;
SHOW
STATUS
LIKE
'binlog_
snapshot
_%'
;
BEGIN
;
INSERT
INTO
t1
VALUES
(
0
,
""
);
...
...
@@ -56,7 +56,7 @@ COMMIT;
connection
default
;
--
echo
# Connection default
SELECT
*
FROM
t1
ORDER
BY
a
,
b
;
SHOW
STATUS
LIKE
'binlog_
trx
_%'
;
SHOW
STATUS
LIKE
'binlog_
snapshot
_%'
;
SHOW
MASTER
STATUS
;
SELECT
*
FROM
t2
ORDER
BY
a
;
...
...
@@ -76,10 +76,10 @@ FLUSH LOGS;
connection
default
;
--
echo
# Connection default
SELECT
*
FROM
t1
ORDER
BY
a
,
b
;
SHOW
STATUS
LIKE
'binlog_
trx
_%'
;
SHOW
STATUS
LIKE
'binlog_
snapshot
_%'
;
SHOW
MASTER
STATUS
;
COMMIT
;
SHOW
STATUS
LIKE
'binlog_
trx
_%'
;
SHOW
STATUS
LIKE
'binlog_
snapshot
_%'
;
SHOW
MASTER
STATUS
;
--
replace_regex
/
\
/
\
*
xid
=.*
\
*
\
//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
...
...
sql/log.cc
View file @
2a97416e
...
...
@@ -6600,8 +6600,8 @@ mysql_bin_log_commit_pos(THD *thd, ulonglong *out_pos, const char **out_file)
static
ulonglong
binlog_status_var_num_commits
;
static
ulonglong
binlog_status_var_num_group_commits
;
static
char
binlog_
trx
_file
[
FN_REFLEN
];
static
ulonglong
binlog_
trx
_position
;
static
char
binlog_
snapshot
_file
[
FN_REFLEN
];
static
ulonglong
binlog_
snapshot
_position
;
static
SHOW_VAR
binlog_status_vars_detail
[]
=
{
...
...
@@ -6609,10 +6609,10 @@ static SHOW_VAR binlog_status_vars_detail[]=
(
char
*
)
&
binlog_status_var_num_commits
,
SHOW_LONGLONG
},
{
"group_commits"
,
(
char
*
)
&
binlog_status_var_num_group_commits
,
SHOW_LONGLONG
},
{
"
trx
_file"
,
(
char
*
)
&
binlog_
trx
_file
,
SHOW_CHAR
},
{
"
trx
_position"
,
(
char
*
)
&
binlog_
trx
_position
,
SHOW_LONGLONG
},
{
"
snapshot
_file"
,
(
char
*
)
&
binlog_
snapshot
_file
,
SHOW_CHAR
},
{
"
snapshot
_position"
,
(
char
*
)
&
binlog_
snapshot
_position
,
SHOW_LONGLONG
},
{
NullS
,
NullS
,
SHOW_LONG
}
};
...
...
@@ -6671,16 +6671,17 @@ TC_LOG_BINLOG::set_status_variables(THD *thd)
binlog_status_var_num_group_commits
=
this
->
num_group_commits
;
if
(
!
trx_data
||
0
==
strcmp
(
trx_data
->
last_commit_pos_file
,
""
))
{
strmake
(
binlog_trx_file
,
last_commit_pos_file
,
sizeof
(
binlog_trx_file
)
-
1
);
binlog_trx_position
=
last_commit_pos_offset
;
strmake
(
binlog_snapshot_file
,
last_commit_pos_file
,
sizeof
(
binlog_snapshot_file
)
-
1
);
binlog_snapshot_position
=
last_commit_pos_offset
;
}
pthread_mutex_unlock
(
&
LOCK_commit_ordered
);
if
(
trx_data
&&
0
!=
strcmp
(
trx_data
->
last_commit_pos_file
,
""
))
{
strmake
(
binlog_
trx
_file
,
trx_data
->
last_commit_pos_file
,
sizeof
(
binlog_
trx
_file
)
-
1
);
binlog_
trx
_position
=
trx_data
->
last_commit_pos_offset
;
strmake
(
binlog_
snapshot
_file
,
trx_data
->
last_commit_pos_file
,
sizeof
(
binlog_
snapshot
_file
)
-
1
);
binlog_
snapshot
_position
=
trx_data
->
last_commit_pos_offset
;
}
}
...
...
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