summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsasha@mysql.sashanet.com <>2002-03-01 17:14:40 -0700
committersasha@mysql.sashanet.com <>2002-03-01 17:14:40 -0700
commitfdb0e646cd9c1267dc83871e50bdc03875ec3636 (patch)
tree12a254a23a8c84446134d5822c64b9599ec8fcff
parent863b5da02d8220ae03684c510af3436647755c87 (diff)
parent40be5306e15ca6383f269335072bb825c5b1b27f (diff)
downloadmariadb-git-fdb0e646cd9c1267dc83871e50bdc03875ec3636.tar.gz
Merge work:/home/bk/mysql-4.0
into mysql.sashanet.com:/reiser-data/mysql-4.0
-rw-r--r--mysys/my_vsnprintf.c13
-rw-r--r--sql/log.cc3
-rw-r--r--sql/slave.cc1
3 files changed, 9 insertions, 8 deletions
diff --git a/mysys/my_vsnprintf.c b/mysys/my_vsnprintf.c
index 0fe6eff24a6..ccd4fbb74fc 100644
--- a/mysys/my_vsnprintf.c
+++ b/mysys/my_vsnprintf.c
@@ -39,7 +39,7 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
*to++= *fmt; /* Copy ordinary char */
continue;
}
- /* Skipp if max size is used (to be compatible with printf) */
+ /* Skip if max size is used (to be compatible with printf) */
fmt++;
while (isdigit(*fmt) || *fmt == '.' || *fmt == '-')
fmt++;
@@ -48,14 +48,13 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
if (*fmt == 's') /* String parameter */
{
reg2 char *par = va_arg(ap, char *);
- uint plen;
+ uint plen,left_len = (uint)(end-to);
if (!par) par = (char*)"(null)";
plen = (uint) strlen(par);
- if ((uint) (end-to) > plen) /* Replace if possible */
- {
- to=strmov(to,par);
- continue;
- }
+ if (left_len <= plen)
+ plen = left_len - 1;
+ to=strmov(to,par);
+ continue;
}
else if (*fmt == 'd' || *fmt == 'u') /* Integer parameter */
{
diff --git a/sql/log.cc b/sql/log.cc
index 892780d3882..1052b3379b3 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -237,7 +237,8 @@ void MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
/*
Explanation of the boolean black magic:
if we are supposed to write magic number try write
- clean up if failed
+ clean
+up if failed
then if index_file has not been previously opened, try to open it
clean up if failed
*/
diff --git a/sql/slave.cc b/sql/slave.cc
index 100e305530f..c63af63978d 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -1762,6 +1762,7 @@ reconnect done to recover from failed read");
from master");
goto err;
}
+ flush_master_info(mi);
// TODO: check debugging abort code
#ifndef DBUG_OFF
if (abort_slave_event_count && !--events_till_abort)