Commit 2f67759e authored by unknown's avatar unknown

Clean up printout of line numbers


client/mysqltest.c:
  Only print line no if start_lineno > 0
  Remove lineno in calls to verbose_msg and die, this is handled by the function.
parent f4d5b46e
......@@ -610,7 +610,9 @@ static void verbose_msg(const char *fmt, ...)
va_start(args, fmt);
fprintf(stderr, "mysqltest: At line %u: ", start_lineno);
fprintf(stderr, "mysqltest: ");
if (start_lineno > 0)
fprintf(stderr, "At line %u: ", start_lineno);
vfprintf(stderr, fmt, args);
fprintf(stderr, "\n");
va_end(args);
......@@ -1345,9 +1347,7 @@ int do_sync_with_master2(long offset)
int rpl_parse;
if (!master_pos.file[0])
{
die("Line %u: Calling 'sync_with_master' without calling 'save_master_pos'", start_lineno);
}
die("Calling 'sync_with_master' without calling 'save_master_pos'");
rpl_parse= mysql_rpl_parse_enabled(mysql);
mysql_disable_rpl_parse(mysql);
......@@ -1357,14 +1357,13 @@ int do_sync_with_master2(long offset)
wait_for_position:
if (mysql_query(mysql, query_buf))
die("line %u: failed in %s: %d: %s", start_lineno, query_buf,
mysql_errno(mysql), mysql_error(mysql));
die("failed in %s: %d: %s", query_buf, mysql_errno(mysql),
mysql_error(mysql));
if (!(last_result= res= mysql_store_result(mysql)))
die("line %u: mysql_store_result() returned NULL for '%s'", start_lineno,
query_buf);
die("mysql_store_result() returned NULL for '%s'", query_buf);
if (!(row= mysql_fetch_row(res)))
die("line %u: empty result in %s", start_lineno, query_buf);
die("empty result in %s", query_buf);
if (!row[0])
{
/*
......@@ -1372,10 +1371,7 @@ int do_sync_with_master2(long offset)
SLAVE has been issued ?
*/
if (tries++ == 3)
{
die("line %u: could not sync with master ('%s' returned NULL)",
start_lineno, query_buf);
}
die("could not sync with master ('%s' returned NULL)", query_buf);
sleep(1); /* So at most we will wait 3 seconds and make 4 tries */
mysql_free_result(res);
goto wait_for_position;
......@@ -1421,10 +1417,9 @@ int do_save_master_pos()
mysql_errno(mysql), mysql_error(mysql));
if (!(last_result =res = mysql_store_result(mysql)))
die("line %u: mysql_store_result() retuned NULL for '%s'", start_lineno,
query);
die("mysql_store_result() retuned NULL for '%s'", query);
if (!(row = mysql_fetch_row(res)))
die("line %u: empty result in show master status", start_lineno);
die("empty result in show master status");
strnmov(master_pos.file, row[0], sizeof(master_pos.file)-1);
master_pos.pos = strtoul(row[1], (char**) 0, 10);
mysql_free_result(res); last_result=0;
......
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