logo       

bk commit into 4.0 tree (1.1477): msg#00382

db.mysql.devel

Subject: bk commit into 4.0 tree (1.1477)

Below is the list of changes that have just been committed into a local
4.0 repository of guilhem. When guilhem does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html

ChangeSet
1.1477 03/04/27 22:29:24 guilhem@xxxxxxxxx +3 -0
User-friendly CHANGE MASTER TO MASTER_LOG_POS=0
and SHOW BINLOG EVENTS FROM 0

sql/unireg.h
1.18 03/04/27 22:29:23 guilhem@xxxxxxxxx +6 -2
warning comment

sql/sql_yacc.yy
1.206 03/04/27 22:29:23 guilhem@xxxxxxxxx +12 -0
User-friendly CHANGE MASTER TO:
presently when one does CHANGE MASTER TO MASTER_LOG_POS=0 he gets
030425 10:12:41 Slave I/O thread: connected to master
'root@localhost:3306', r
eplication started in log 'gbichot-bin.013' at position 151
030425 10:12:41 Error reading packet from server: Client requested master
to st
art replication from impossible position (server_errno=1236)
030425 10:12:41 Got fatal error 1236: 'Client requested master to start
replica
tion from impossible position' from master when reading data from binary log
030425 10:12:41 Slave I/O thread exiting, read up to log
'gbichot-bin.013', pos
ition 151

while she/he probably just wanted to start at the beginning of the
binlog, which is 4. So we silently convert <4 to 4 in sql_yacc.yy
(i.e. in the slave code; fortunately all versions have the same
BIN_LOG_HEADER_SIZE=4 and we should not change this). See comments
for an explaination of why we have to do this in sql_yacc.yy,
not in sql_repl.cc.

RELAY_LOG_POS does not have the problem (so no change).

sql/sql_repl.cc
1.94 03/04/27 22:29:22 guilhem@xxxxxxxxx +1 -7
SHOW BINLOG EVENTS FROM 0: currently one gets
MASTER> show binlog events from 0;
ERROR 1220: Error when executing command SHOW BINLOG EVENTS: Invalid log
position

# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: guilhem
# Host: gbichot.local
# Root: /home/mysql_src/mysql-4.0

--- 1.205/sql/sql_yacc.yy Sun Apr 27 21:12:05 2003
+++ 1.206/sql/sql_yacc.yy Sun Apr 27 22:29:23 2003
@@ -706,6 +706,18 @@
MASTER_LOG_POS_SYM EQ ulonglong_num
{
Lex->mi.pos = $3;
+ /*
+ If the user specified a value < BIN_LOG_HEADER_SIZE, adjust it
+ instead of causing subsequent errors.
+ We need to do it in this file, because only there we know that
+ MASTER_LOG_POS has been explicitely specified. On the contrary
+ in change_master() (sql_repl.cc) we cannot distinguish between 0
+ (MASTER_LOG_POS explicitely specified as 0) and 0 (unspecified),
+ whereas we want to distinguish (specified 0 means "read the binlog
+ from 0" (4 in fact), unspecified means "don't change the position
+ (keep the preceding value)").
+ */
+ Lex->mi.pos = max(BIN_LOG_HEADER_SIZE, Lex->mi.pos);
}
|
MASTER_CONNECT_RETRY_SYM EQ ULONG_NUM

--- 1.17/sql/unireg.h Wed Mar 5 18:43:53 2003
+++ 1.18/sql/unireg.h Sun Apr 27 22:29:23 2003
@@ -129,9 +129,13 @@
*/
#define MIN_TURBOBM_PATTERN_LEN 3

-/* Defines for binary logging */
+/*
+ Defines for binary logging.
+ Do not decrease the value of BIN_LOG_HEADER_SIZE.
+ Do not even increase it before checking code.
+*/

-#define BIN_LOG_HEADER_SIZE 4
+#define BIN_LOG_HEADER_SIZE 4

/* Include prototypes for unireg */


--- 1.93/sql/sql_repl.cc Sun Apr 27 21:12:05 2003
+++ 1.94/sql/sql_repl.cc Sun Apr 27 22:29:22 2003
@@ -961,7 +961,7 @@
{
LEX_MASTER_INFO *lex_mi = &thd->lex.mi;
ha_rows event_count, limit_start, limit_end;
- my_off_t pos = lex_mi->pos;
+ my_off_t pos = max(BIN_LOG_HEADER_SIZE, lex_mi->pos); // user-friendly
char search_file_name[FN_REFLEN], *name;
const char *log_file_name = lex_mi->log_file_name;
pthread_mutex_t *log_lock = mysql_bin_log.get_log_lock();
@@ -988,12 +988,6 @@

if ((file=open_binlog(&log, linfo.log_file_name, &errmsg)) < 0)
goto err;
-
- if (pos < 4)
- {
- errmsg = "Invalid log position";
- goto err;
- }

pthread_mutex_lock(log_lock);
my_b_seek(&log, pos);

--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe:
http://lists.mysql.com/internals?unsub=gcdmd-internals@xxxxxxxxxxx




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise