summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <kent@mysql.com>2004-09-25 10:30:36 +0200
committerunknown <kent@mysql.com>2004-09-25 10:30:36 +0200
commitcb77c4d267cfbf6272028be6791571dcdb90dfd9 (patch)
treec5d83d1c262e57ccb81f2e2740d25f33842dc5df /client
parentcd5bd57b72c04abb5db973eac393d5cb80b9173e (diff)
downloadmariadb-git-cb77c4d267cfbf6272028be6791571dcdb90dfd9.tar.gz
client_test.c:
Return exit(1) instead of exit(0) on failure. Allow longer path names using MAXPATHLEN. Added option --testcase that skips some failing tests. Replaced 'return' with exit(1) in test_frm_bug(). mysqltest.c: Let --exec fail if command fails client/mysqltest.c: Let --exec fail if command fails tests/client_test.c: Return exit(1) instead of exit(0) on failure. Allow longer path names using MAXPATHLEN. Added option --testcase that skips some failing tests. Replaced 'return' with exit(1) in test_frm_bug().
Diffstat (limited to 'client')
-rw-r--r--client/mysqltest.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 3287c9738d3..55f2bd44947 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -844,10 +844,10 @@ int do_source(struct st_query* q)
1 error
*/
-int do_exec(struct st_query* q)
+static void do_exec(struct st_query* q)
{
- int error= 0;
- DYNAMIC_STRING *ds;
+ int error;
+ DYNAMIC_STRING *ds = NULL; /* Assign just to avoid warning */
DYNAMIC_STRING ds_tmp;
char buf[1024];
FILE *res_file;
@@ -884,7 +884,15 @@ int do_exec(struct st_query* q)
while (fgets(buf, sizeof(buf), res_file))
replace_dynstr_append_mem(ds, buf, strlen(buf));
+ }
+
+ error= pclose(res_file);
+
+ if (error != 0)
+ die("command \"%s\" failed: %s", cmd, errno);
+ if (!disable_result_log)
+ {
if (glob_replace)
free_replace();
@@ -902,9 +910,6 @@ int do_exec(struct st_query* q)
if (ds == &ds_tmp)
dynstr_free(&ds_tmp);
}
- pclose(res_file);
-
- DBUG_RETURN(error);
}
@@ -2811,7 +2816,7 @@ int main(int argc, char **argv)
(void) mysql_ping(&cur_con->mysql);
break;
case Q_EXEC:
- (void) do_exec(q);
+ do_exec(q);
break;
default: processed = 0; break;
}