summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <msvensson@shellback.(none)>2006-10-14 17:02:43 +0200
committerunknown <msvensson@shellback.(none)>2006-10-14 17:02:43 +0200
commitb0a4ec859faaf985d9e28fa443af9316729843be (patch)
treeaa30463122dc87d1996a222b9fa0b1b8c5715bcb /client
parent0d9e6366a82b5e9a8606ac332aeacc5cb9c54923 (diff)
downloadmariadb-git-b0a4ec859faaf985d9e28fa443af9316729843be.tar.gz
Improving debugging support in 'read_line' function
Diffstat (limited to 'client')
-rw-r--r--client/mysqltest.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c
index e46f22de4df..7029e0af3e1 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -3346,7 +3346,7 @@ int read_line(char *buf, int size)
LINT_INIT(last_quote);
start_lineno= cur_file->lineno;
- DBUG_PRINT("info", ("start_lineno: %d", start_lineno));
+ DBUG_PRINT("info", ("Starting to read at lineno: %d", start_lineno));
for (; p < buf_end ;)
{
skip_char= 0;
@@ -3370,7 +3370,7 @@ int read_line(char *buf, int size)
die("Missing end of block");
*p= 0;
- DBUG_PRINT("info", ("end of file"));
+ DBUG_PRINT("info", ("end of file at line %d", cur_file->lineno));
DBUG_RETURN(1);
}
cur_file--;
@@ -3393,7 +3393,8 @@ int read_line(char *buf, int size)
if (end_of_query(c))
{
*p= 0;
- DBUG_PRINT("exit", ("Found delimiter '%s'", delimiter));
+ DBUG_PRINT("exit", ("Found delimiter '%s' at line %d",
+ delimiter, cur_file->lineno));
DBUG_RETURN(0);
}
else if ((c == '{' &&
@@ -3405,7 +3406,8 @@ int read_line(char *buf, int size)
/* Only if and while commands can be terminated by { */
*p++= c;
*p= 0;
- DBUG_PRINT("exit", ("Found '{' indicating begining of block"));
+ DBUG_PRINT("exit", ("Found '{' indicating start of block at line %d",
+ cur_file->lineno));
DBUG_RETURN(0);
}
else if (c == '\'' || c == '"' || c == '`')
@@ -3420,7 +3422,8 @@ int read_line(char *buf, int size)
{
/* Comments are terminated by newline */
*p= 0;
- DBUG_PRINT("exit", ("Found newline in comment"));
+ DBUG_PRINT("exit", ("Found newline in comment at line: %d",
+ cur_file->lineno));
DBUG_RETURN(0);
}
break;
@@ -3435,13 +3438,19 @@ int read_line(char *buf, int size)
{
/* Skip all space at begining of line */
if (c == '\n')
- start_lineno= cur_file->lineno; /* Query hasn't started yet */
+ {
+ /* Query hasn't started yet */
+ start_lineno= cur_file->lineno;
+ DBUG_PRINT("info", ("Query hasn't started yet, start_lineno: %d",
+ start_lineno));
+ }
skip_char= 1;
}
else if (end_of_query(c))
{
*p= 0;
- DBUG_PRINT("exit", ("Found delimiter '%s'", delimiter));
+ DBUG_PRINT("exit", ("Found delimiter '%s' at line: %d",
+ delimiter, cur_file->lineno));
DBUG_RETURN(0);
}
else if (c == '}')
@@ -3449,7 +3458,8 @@ int read_line(char *buf, int size)
/* A "}" need to be by itself in the begining of a line to terminate */
*p++= c;
*p= 0;
- DBUG_PRINT("exit", ("Found '}' in begining of a line"));
+ DBUG_PRINT("exit", ("Found '}' in begining of a line at line: %d",
+ cur_file->lineno));
DBUG_RETURN(0);
}
else if (c == '\'' || c == '"' || c == '`')