summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc29
-rw-r--r--client/mysqlbinlog.cc4
-rw-r--r--client/mysqldump.c2
3 files changed, 20 insertions, 15 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 2623660033b..155d8b03231 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1091,7 +1091,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
{ // Add found char to buffer
if (inchar == *in_string)
*in_string=0;
- else if (!*in_string && (inchar == '\'' || inchar == '"'))
+ else if (!*in_string && (inchar == '\'' || inchar == '"' || inchar == '`'))
*in_string=(char) inchar;
if (!(*ml_comment))
*out++ = (char) inchar;
@@ -2709,31 +2709,32 @@ select_limit, max_join_size);
static int
put_info(const char *str,INFO_TYPE info_type,uint error)
{
+ FILE *file= (info_type == INFO_ERROR ? stderr : stdout);
static int inited=0;
if (status.batch)
{
if (info_type == INFO_ERROR)
{
- (void) fflush(stdout);
- fprintf(stderr,"ERROR");
+ (void) fflush(file);
+ fprintf(file,"ERROR");
if (error)
- (void) fprintf(stderr," %d",error);
+ (void) fprintf(file," %d",error);
if (status.query_start_line && line_numbers)
{
- (void) fprintf(stderr," at line %lu",status.query_start_line);
+ (void) fprintf(file," at line %lu",status.query_start_line);
if (status.file_name)
- (void) fprintf(stderr," in file: '%s'", status.file_name);
+ (void) fprintf(file," in file: '%s'", status.file_name);
}
- (void) fprintf(stderr,": %s\n",str);
- (void) fflush(stderr);
+ (void) fprintf(file,": %s\n",str);
+ (void) fflush(file);
if (!ignore_errors)
return 1;
}
else if (info_type == INFO_RESULT && verbose > 1)
- tee_puts(str, stdout);
+ tee_puts(str, file);
if (unbuffered)
- fflush(stdout);
+ fflush(file);
return info_type == INFO_ERROR ? -1 : 0;
}
if (!opt_silent || info_type == INFO_ERROR)
@@ -2751,17 +2752,17 @@ put_info(const char *str,INFO_TYPE info_type,uint error)
putchar('\007'); /* This should make a bell */
vidattr(A_STANDOUT);
if (error)
- (void) tee_fprintf(stderr, "ERROR %d: ", error);
+ (void) tee_fprintf(file, "ERROR %d: ", error);
else
- tee_puts("ERROR: ", stdout);
+ tee_puts("ERROR: ", file);
}
else
vidattr(A_BOLD);
- (void) tee_puts(str, stdout);
+ (void) tee_puts(str, file);
vidattr(A_NORMAL);
}
if (unbuffered)
- fflush(stdout);
+ fflush(file);
return info_type == INFO_ERROR ? -1 : 0;
}
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 3f85f0be008..36508cdf5f4 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -44,6 +44,7 @@ static const char* default_dbug_option = "d:t:o,/tmp/mysqlbinlog.trace";
void sql_print_error(const char *format, ...);
static bool one_database = 0;
+static bool force_opt= 0;
static const char* database;
static bool short_form = 0;
static ulonglong offset = 0;
@@ -199,6 +200,9 @@ static struct my_option my_long_options[] =
{"database", 'd', "List entries for just this database (local log only)",
(gptr*) &database, (gptr*) &database, 0, GET_STR_ALLOC, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
+ {"force-read", 'f', "Force reading unknown binlog events",
+ (gptr*) &force_opt, (gptr*) &force_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+ 0, 0},
{"help", '?', "Display this help and exit",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"host", 'h', "Get the binlog from server", (gptr*) &host, (gptr*) &host,
diff --git a/client/mysqldump.c b/client/mysqldump.c
index b5e596ba072..17780458a2a 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -1613,7 +1613,7 @@ int main(int argc, char **argv)
else
{
row = mysql_fetch_row(master);
- if (row[0] && row[1])
+ if (row && row[0] && row[1])
{
fprintf(md_result_file,
"\n--\n-- Position to start replication from\n--\n\n");