Commit 2a97416e authored by unknown's avatar unknown

MWL#136: Rename binlog_trx_{file,position} to the much better binlog_snapshot_{file,position}

parent 0bc31c3e
...@@ -1114,8 +1114,8 @@ static int fetch_db_collation(const char *db_name, ...@@ -1114,8 +1114,8 @@ static int fetch_db_collation(const char *db_name,
/* /*
Check if server supports non-blocking binlog position using the Check if server supports non-blocking binlog position using the
binlog_trx_file and binlog_trx_position status variables. If it does, binlog_snapshot_file and binlog_snapshot_position status variables. If it
also return the position obtained if output pointers are non-NULL. does, also return the position obtained if output pointers are non-NULL.
Returns 1 if position available, 0 if not. Returns 1 if position available, 0 if not.
*/ */
static int static int
...@@ -1126,19 +1126,19 @@ check_consistent_binlog_pos(char *binlog_pos_file, char *binlog_pos_offset) ...@@ -1126,19 +1126,19 @@ check_consistent_binlog_pos(char *binlog_pos_file, char *binlog_pos_offset)
int found; int found;
if (mysql_query_with_error_report(mysql, &res, if (mysql_query_with_error_report(mysql, &res,
"SHOW STATUS LIKE 'binlog_trx_%'")) "SHOW STATUS LIKE 'binlog_snapshot_%'"))
return 1; return 1;
found= 0; found= 0;
while ((row= mysql_fetch_row(res))) 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) if (binlog_pos_file)
strmake(binlog_pos_file, row[1], FN_REFLEN-1); strmake(binlog_pos_file, row[1], FN_REFLEN-1);
found++; found++;
} }
else if (0 == strcmp(row[0], "binlog_trx_position")) else if (0 == strcmp(row[0], "binlog_snapshot_position"))
{ {
if (binlog_pos_offset) if (binlog_pos_offset)
strmake(binlog_pos_offset, row[1], LONGLONG_LEN); strmake(binlog_pos_offset, row[1], LONGLONG_LEN);
......
...@@ -4,10 +4,10 @@ CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb; ...@@ -4,10 +4,10 @@ CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb;
SHOW MASTER STATUS; SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 241 master-bin.000001 241
SHOW STATUS LIKE 'binlog_trx_%'; SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name Value Variable_name Value
binlog_trx_file ./master-bin.000001 binlog_snapshot_file ./master-bin.000001
binlog_trx_position 241 binlog_snapshot_position 241
BEGIN; BEGIN;
INSERT INTO t1 VALUES (0, ""); INSERT INTO t1 VALUES (0, "");
# Connection con1 # Connection con1
...@@ -35,10 +35,10 @@ COMMIT; ...@@ -35,10 +35,10 @@ COMMIT;
SELECT * FROM t1 ORDER BY a,b; SELECT * FROM t1 ORDER BY a,b;
a b a b
0 0
SHOW STATUS LIKE 'binlog_trx_%'; SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name Value Variable_name Value
binlog_trx_file ./master-bin.000001 binlog_snapshot_file ./master-bin.000001
binlog_trx_position 540 binlog_snapshot_position 540
SHOW MASTER STATUS; SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 727 master-bin.000001 727
...@@ -57,18 +57,18 @@ FLUSH LOGS; ...@@ -57,18 +57,18 @@ FLUSH LOGS;
SELECT * FROM t1 ORDER BY a,b; SELECT * FROM t1 ORDER BY a,b;
a b a b
0 0
SHOW STATUS LIKE 'binlog_trx_%'; SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name Value Variable_name Value
binlog_trx_file ./master-bin.000001 binlog_snapshot_file ./master-bin.000001
binlog_trx_position 540 binlog_snapshot_position 540
SHOW MASTER STATUS; SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 106 master-bin.000002 106
COMMIT; COMMIT;
SHOW STATUS LIKE 'binlog_trx_%'; SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name Value Variable_name Value
binlog_trx_file ./master-bin.000002 binlog_snapshot_file ./master-bin.000002
binlog_trx_position 106 binlog_snapshot_position 106
SHOW MASTER STATUS; SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 106 master-bin.000002 106
......
...@@ -17,7 +17,7 @@ connection default; ...@@ -17,7 +17,7 @@ connection default;
CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb; CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb;
SHOW MASTER STATUS; SHOW MASTER STATUS;
SHOW STATUS LIKE 'binlog_trx_%'; SHOW STATUS LIKE 'binlog_snapshot_%';
BEGIN; BEGIN;
INSERT INTO t1 VALUES (0, ""); INSERT INTO t1 VALUES (0, "");
...@@ -56,7 +56,7 @@ COMMIT; ...@@ -56,7 +56,7 @@ COMMIT;
connection default; connection default;
--echo # Connection default --echo # Connection default
SELECT * FROM t1 ORDER BY a,b; SELECT * FROM t1 ORDER BY a,b;
SHOW STATUS LIKE 'binlog_trx_%'; SHOW STATUS LIKE 'binlog_snapshot_%';
SHOW MASTER STATUS; SHOW MASTER STATUS;
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
...@@ -76,10 +76,10 @@ FLUSH LOGS; ...@@ -76,10 +76,10 @@ FLUSH LOGS;
connection default; connection default;
--echo # Connection default --echo # Connection default
SELECT * FROM t1 ORDER BY a,b; SELECT * FROM t1 ORDER BY a,b;
SHOW STATUS LIKE 'binlog_trx_%'; SHOW STATUS LIKE 'binlog_snapshot_%';
SHOW MASTER STATUS; SHOW MASTER STATUS;
COMMIT; COMMIT;
SHOW STATUS LIKE 'binlog_trx_%'; SHOW STATUS LIKE 'binlog_snapshot_%';
SHOW MASTER STATUS; SHOW MASTER STATUS;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/ --replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
......
...@@ -6600,8 +6600,8 @@ mysql_bin_log_commit_pos(THD *thd, ulonglong *out_pos, const char **out_file) ...@@ -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_commits;
static ulonglong binlog_status_var_num_group_commits; static ulonglong binlog_status_var_num_group_commits;
static char binlog_trx_file[FN_REFLEN]; static char binlog_snapshot_file[FN_REFLEN];
static ulonglong binlog_trx_position; static ulonglong binlog_snapshot_position;
static SHOW_VAR binlog_status_vars_detail[]= static SHOW_VAR binlog_status_vars_detail[]=
{ {
...@@ -6609,10 +6609,10 @@ 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}, (char *)&binlog_status_var_num_commits, SHOW_LONGLONG},
{"group_commits", {"group_commits",
(char *)&binlog_status_var_num_group_commits, SHOW_LONGLONG}, (char *)&binlog_status_var_num_group_commits, SHOW_LONGLONG},
{"trx_file", {"snapshot_file",
(char *)&binlog_trx_file, SHOW_CHAR}, (char *)&binlog_snapshot_file, SHOW_CHAR},
{"trx_position", {"snapshot_position",
(char *)&binlog_trx_position, SHOW_LONGLONG}, (char *)&binlog_snapshot_position, SHOW_LONGLONG},
{NullS, NullS, SHOW_LONG} {NullS, NullS, SHOW_LONG}
}; };
...@@ -6671,16 +6671,17 @@ TC_LOG_BINLOG::set_status_variables(THD *thd) ...@@ -6671,16 +6671,17 @@ TC_LOG_BINLOG::set_status_variables(THD *thd)
binlog_status_var_num_group_commits= this->num_group_commits; binlog_status_var_num_group_commits= this->num_group_commits;
if (!trx_data || 0 == strcmp(trx_data->last_commit_pos_file, "")) if (!trx_data || 0 == strcmp(trx_data->last_commit_pos_file, ""))
{ {
strmake(binlog_trx_file, last_commit_pos_file, sizeof(binlog_trx_file)-1); strmake(binlog_snapshot_file, last_commit_pos_file,
binlog_trx_position= last_commit_pos_offset; sizeof(binlog_snapshot_file)-1);
binlog_snapshot_position= last_commit_pos_offset;
} }
pthread_mutex_unlock(&LOCK_commit_ordered); pthread_mutex_unlock(&LOCK_commit_ordered);
if (trx_data && 0 != strcmp(trx_data->last_commit_pos_file, "")) if (trx_data && 0 != strcmp(trx_data->last_commit_pos_file, ""))
{ {
strmake(binlog_trx_file, trx_data->last_commit_pos_file, strmake(binlog_snapshot_file, trx_data->last_commit_pos_file,
sizeof(binlog_trx_file)-1); sizeof(binlog_snapshot_file)-1);
binlog_trx_position= trx_data->last_commit_pos_offset; binlog_snapshot_position= trx_data->last_commit_pos_offset;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment