summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2005-09-19 12:24:59 +0200
committerunknown <msvensson@neptunus.(none)>2005-09-19 12:24:59 +0200
commit2f67759e5bf60104ea8456891275898f222aa9a9 (patch)
tree056a1548c1fce088ce515fce1c1da5862687ab72 /client
parentf4d5b46e28ca809005d365a9833da7dcad091703 (diff)
downloadmariadb-git-2f67759e5bf60104ea8456891275898f222aa9a9.tar.gz
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.
Diffstat (limited to 'client')
-rw-r--r--client/mysqltest.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 3e2cde92aa9..19c74629a55 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -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 @@ wait_for_position:
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;