diff options
author | unknown <monty@mysql.com> | 2004-03-18 00:16:04 +0200 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-03-18 00:16:04 +0200 |
commit | 24148f04c736679a69fd305270617616906f3697 (patch) | |
tree | 2bd46f92f467b68e9b652a280b512a9cf0413ca2 /client/mysqltest.c | |
parent | 7395d54d5b59d9615773c1300953df3b225b0027 (diff) | |
parent | 022c5241a9ebcd6047b761ef437f51e62722f9e9 (diff) | |
download | mariadb-git-24148f04c736679a69fd305270617616906f3697.tar.gz |
merge fixes (use old code)
client/mysqladmin.c:
Auto merged
client/mysqltest.c:
Auto merged
innobase/dict/dict0dict.c:
Auto merged
innobase/include/os0file.h:
Auto merged
innobase/os/os0file.c:
Auto merged
myisam/mi_check.c:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/opt_range.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_cache.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_handler.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
Diffstat (limited to 'client/mysqltest.c')
-rw-r--r-- | client/mysqltest.c | 61 |
1 files changed, 36 insertions, 25 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c index f5cf677a02e..4e97863f97b 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -876,36 +876,46 @@ int do_exec(struct st_query* q) if (!*cmd) die("Missing argument in exec\n"); - if (q->record_file[0]) + if (disable_result_log) { - init_dynamic_string(&ds_tmp, "", 16384, 65536); - ds= &ds_tmp; + if (!(res_file= popen(cmd, "r")) && q->abort_on_error) + die("popen() failed\n"); + while (fgets(buf, sizeof(buf), res_file)); + pclose(res_file); } else - ds= &ds_res; + { + if (q->record_file[0]) + { + init_dynamic_string(&ds_tmp, "", 16384, 65536); + ds= &ds_tmp; + } + else + ds= &ds_res; - if (!(res_file= popen(cmd, "r")) && q->abort_on_error) - die("popen() failed\n"); - while (fgets(buf, sizeof(buf), res_file)) - replace_dynstr_append_mem(ds, buf, strlen(buf)); - pclose(res_file); + if (!(res_file= popen(cmd, "r")) && q->abort_on_error) + die("popen() failed\n"); + while (fgets(buf, sizeof(buf), res_file)) + replace_dynstr_append_mem(ds, buf, strlen(buf)); + pclose(res_file); - if (glob_replace) - free_replace(); + if (glob_replace) + free_replace(); - if (record) - { - if (!q->record_file[0] && !result_file) - die("At line %u: Missing result file", start_lineno); - if (!result_file) - str_to_file(q->record_file, ds->str, ds->length); - } - else if (q->record_file[0]) - { - error= check_result(ds, q->record_file, q->require_file); + if (record) + { + if (!q->record_file[0] && !result_file) + die("At line %u: Missing result file", start_lineno); + if (!result_file) + str_to_file(q->record_file, ds->str, ds->length); + } + else if (q->record_file[0]) + { + error= check_result(ds, q->record_file, q->require_file); + } + if (ds == &ds_tmp) + dynstr_free(&ds_tmp); } - if (ds == &ds_tmp) - dynstr_free(&ds_tmp); return error; } @@ -1902,7 +1912,7 @@ static struct my_option my_long_options[] = {"password", 'p', "Password to use when connecting to server.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"port", 'P', "Port number to use for connection.", (gptr*) &port, - (gptr*) &port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + (gptr*) &port, 0, GET_INT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0, 0}, {"quiet", 's', "Suppress all normal output.", (gptr*) &silent, (gptr*) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"record", 'r', "Record output of test_file into result file.", @@ -2305,7 +2315,8 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags) { if (i) dynstr_append_mem(ds, "\t", 1); - dynstr_append(ds, fields[i].name); + replace_dynstr_append_mem(ds, fields[i].name, + strlen(fields[i].name)); } dynstr_append_mem(ds, "\n", 1); } |