summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2005-09-05 17:01:15 +0200
committerunknown <msvensson@neptunus.(none)>2005-09-05 17:01:15 +0200
commite54b1fd87f1e17804a1e2aae4cfbd52e82438d93 (patch)
tree2a602b11c531c2447a05708629ab0f9802378891 /client
parente93e346a244d06b0bdb91d8c83b4da46a2406ac9 (diff)
parente10b50e6f13206ec8fc320518d4460ca39a12ed2 (diff)
downloadmariadb-git-e54b1fd87f1e17804a1e2aae4cfbd52e82438d93.tar.gz
Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1
into neptunus.(none):/home/msvensson/mysql/bug12959/my41-bug12959 client/mysqltest.c: Auto merged
Diffstat (limited to 'client')
-rw-r--r--client/mysqltest.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 92735c97fea..24e05ab084b 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -2169,8 +2169,10 @@ int read_line(char *buf, int size)
if (feof(cur_file->file))
{
found_eof:
- if (cur_file->file != stdin)
+ if (cur_file->file != stdin){
my_fclose(cur_file->file, MYF(0));
+ cur_file->file= 0;
+ }
my_free((gptr)cur_file->file_name, MYF(MY_ALLOW_ZERO_PTR));
cur_file->file_name= 0;
lineno--;
@@ -2556,10 +2558,11 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
argument= buff;
}
fn_format(buff, argument, "", "", 4);
- DBUG_ASSERT(cur_file->file == 0);
+ DBUG_ASSERT(cur_file == file_stack && cur_file->file == 0);
if (!(cur_file->file=
my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(MY_WME))))
- die("Could not open %s: errno = %d", argument, errno);
+ die("Could not open %s: errno = %d", buff, errno);
+ cur_file->file_name= my_strdup(buff, MYF(MY_FAE));
break;
}
case 'm':
@@ -3746,9 +3749,8 @@ int main(int argc, char **argv)
embedded_server_args,
(char**) embedded_server_groups))
die("Can't initialize MySQL server");
- if (cur_file == file_stack)
+ if (cur_file == file_stack && cur_file->file == 0)
{
- DBUG_ASSERT(cur_file->file == 0);
cur_file->file= stdin;
cur_file->file_name= my_strdup("<stdin>", MYF(MY_WME));
}