diff options
Diffstat (limited to 'client/mysqltest.c')
-rw-r--r-- | client/mysqltest.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c index 7be65941f2d..6226189cbbb 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -359,8 +359,7 @@ DYNAMIC_STRING ds_res; static void die(const char *fmt, ...); static void init_var_hash(); static VAR* var_from_env(const char *, const char *); -static byte* get_var_key(const byte* rec, uint* len, - my_bool __attribute__((unused)) t); +static byte* get_var_key(const byte* rec, uint* len, my_bool t); static VAR* var_init(VAR* v, const char *name, int name_len, const char *val, int val_len); @@ -1785,6 +1784,10 @@ int read_line(char* buf, int size) continue; } + /* Line counting is independent of state */ + if (c == '\n') + (*lineno)++; + switch(state) { case R_NORMAL: /* Only accept '{' in the beginning of a line */ @@ -1800,14 +1803,12 @@ int read_line(char* buf, int size) else if (c == '\n') { state = R_LINE_START; - (*lineno)++; } break; case R_COMMENT: if (c == '\n') { *p= 0; - (*lineno)++; DBUG_RETURN(0); } break; @@ -1819,7 +1820,7 @@ int read_line(char* buf, int size) else if (my_isspace(charset_info, c)) { if (c == '\n') - start_lineno= ++*lineno; /* Query hasn't started yet */ + start_lineno= *lineno; /* Query hasn't started yet */ no_save= 1; } else if (c == '}') |