summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <msvensson@shellback.(none)>2007-08-08 16:44:01 +0200
committerunknown <msvensson@shellback.(none)>2007-08-08 16:44:01 +0200
commit5501f528f5a6f41f8e38cabbbd2d52fcb29993a6 (patch)
tree0204741190c400174f18b75b9191e9f2a32a00c8 /client
parentc35318cee16459c96be5803e80e2a2d9857615b3 (diff)
downloadmariadb-git-5501f528f5a6f41f8e38cabbbd2d52fcb29993a6.tar.gz
Remove extra newline added to files created by write_file and append_file
client/mysqltest.c: - Remove the extra newline first in the file produced by write_file and append_file - Add check for too many arguments passed to 'check_command_args' mysql-test/r/mysqltest.result: Update test result mysql-test/t/mysqltest.test: Add test to check that no extra newline is created
Diffstat (limited to 'client')
-rw-r--r--client/mysqltest.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 1d481f33f47..541c0cb4394 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -753,6 +753,15 @@ void check_command_args(struct st_command *command,
command->first_word_len, command->query);
}
+ /* Check for too many arguments passed */
+ ptr= command->last_argument;
+ while(ptr <= command->end)
+ {
+ if (*ptr && *ptr != ' ')
+ die("Extra argument '%s' passed to '%.*s'",
+ ptr, command->first_word_len, command->query);
+ ptr++;
+ }
DBUG_VOID_RETURN;
}
@@ -2691,8 +2700,22 @@ void read_until_delimiter(DYNAMIC_STRING *ds,
c= my_getc(cur_file->file);
if (c == '\n')
+ {
cur_file->lineno++;
+ /* Skip newline from the same line as the command */
+ if (start_lineno == (cur_file->lineno - 1))
+ continue;
+ }
+ else if (start_lineno == cur_file->lineno)
+ {
+ /*
+ No characters except \n are allowed on
+ the same line as the command
+ */
+ die("Trailing characters found after command");
+ }
+
if (feof(cur_file->file))
die("End of file encountered before '%s' delimiter was found",
ds_delimiter->str);