diff options
author | unknown <monty@donna.mysql.fi> | 2001-03-25 01:02:26 +0200 |
---|---|---|
committer | unknown <monty@donna.mysql.fi> | 2001-03-25 01:02:26 +0200 |
commit | 4a3f651d6dcd050b5a213ed141fc5c70ce5500e8 (patch) | |
tree | 6191242036b4e9061dfd34fc46bf82677415e532 /client/mysqltest.c | |
parent | a032242b883ab2697ea3a69b2b3650247dfea1b2 (diff) | |
download | mariadb-git-4a3f651d6dcd050b5a213ed141fc5c70ce5500e8.tar.gz |
Fixed bug in send in mysqltest
Removed usage of @r/result as this made life hard when testing different
table handlers.
Allow concurrent inserts if no update/binary log.
Don't remove key_cache at flush tables.
Fixed bug in SELECT DISTINCT SUM()...
BitKeeper/deleted/.del-rpl000012.status.result~bbbd650b5beea32f:
Delete: mysql-test/r/rpl000012.status.result
BitKeeper/deleted/.del-rpl000013.status.result~6bee190c298cc9fd:
Delete: mysql-test/r/rpl000013.status.result
Docs/manual.texi:
Changelog
client/mysqltest.c:
Fixed bug in 'send' that Sasha had introduced.
Make database, port and socket optional parameters to connect()
mysql-test/r/rpl000005.result:
Removed usage of @r/result as this made life hard when doing
test for multiple table handlers.
mysql-test/r/rpl000006.result:
Removed usage of @r/result as this made life hard when doing
test for multiple table handlers.
mysql-test/r/rpl000012.result:
Removed usage of @r/result as this made life hard when doing
test for multiple table handlers.
mysql-test/r/rpl000013.result:
Removed usage of @r/result as this made life hard when doing
test for multiple table handlers.
mysql-test/r/sel000033.result:
Removed usage of @r/result as this made life hard when doing
test for multiple table handlers.
mysql-test/t/backup.test:
Use default port and socket.
mysql-test/t/dirty-close.test:
Use default port and socket.
mysql-test/t/flush.test:
Use default port and socket.
mysql-test/t/kill.test:
Use default port and socket.
mysql-test/t/overflow.test:
Use default port and socket.
mysql-test/t/rpl000003.test:
Removed usage of @r/result as this made life hard when doing
test for multiple table handlers.
mysql-test/t/rpl000005.test:
Removed usage of @r/result as this made life hard when doing
test for multiple table handlers.
mysql-test/t/rpl000006.test:
Removed usage of @r/result as this made life hard when doing
test for multiple table handlers.
mysql-test/t/rpl000007.test:
Removed usage of @r/result as this made life hard when doing
test for multiple table handlers.
mysql-test/t/rpl000008.test:
Removed usage of @r/result as this made life hard when doing
test for multiple table handlers.
mysql-test/t/rpl000009.test:
Removed usage of @r/result as this made life hard when doing
test for multiple table handlers.
mysql-test/t/rpl000010.test:
Removed usage of @r/result as this made life hard when doing
test for multiple table handlers.
mysql-test/t/rpl000011.test:
Removed usage of @r/result as this made life hard when doing
test for multiple table handlers.
mysql-test/t/rpl000012.test:
Removed usage of @r/result as this made life hard when doing
test for multiple table handlers.
mysql-test/t/rpl000013.test:
Removed usage of @r/result as this made life hard when doing
test for multiple table handlers.
mysql-test/t/sel000001.test:
Removed usage of @r/result as this made life hard when doing
test for multiple table handlers.
mysql-test/t/sel000002.test:
Removed usage of @r/result as this made life hard when doing
test for multiple table handlers.
mysql-test/t/sel000003.test:
Removed usage of @r/result as this made life hard when doing
test for multiple table handlers.
mysql-test/t/sel000031.test:
Removed usage of @r/result as this made life hard when doing
test for multiple table handlers.
mysql-test/t/sel000032.test:
Removed usage of @r/result as this made life hard when doing
test for multiple table handlers.
mysql-test/t/sel000033.test:
Removed usage of @r/result as this made life hard when doing
test for multiple table handlers.
mysql-test/t/sel000100.test:
Removed usage of @r/result as this made life hard when doing
test for multiple table handlers.
mysql-test/t/shw000001.test:
Removed usage of @r/result as this made life hard when doing
test for multiple table handlers.
mysql-test/t/status.test:
Use default port and socket.
sql/gen_lex_hash.cc:
Smaller hash table
sql/mysql_priv.h:
Allow concurrent inserts if no update/binary log
sql/mysqld.cc:
Allow concurrent inserts if no update/binary log
Don't remove key_cache at flush tables
sql/sql_base.cc:
Don't remove key_cache at flush tables
sql/sql_select.cc:
Fix bug in SELECT DISTINCT SUM().
sql/sql_yacc.yy:
Allow concurrent inserts if no update/binary log
tests/export.pl:
C
Diffstat (limited to 'client/mysqltest.c')
-rw-r--r-- | client/mysqltest.c | 52 |
1 files changed, 37 insertions, 15 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c index 85ebc050571..928f429ac12 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -43,7 +43,7 @@ **********************************************************************/ -#define MTEST_VERSION "1.7" +#define MTEST_VERSION "1.8" #include <global.h> #include <my_sys.h> @@ -269,6 +269,7 @@ static void die(const char* fmt, ...) fprintf(stderr, "%s: ", my_progname); vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); + fflush(stderr); } va_end(args); free_used_memory(); @@ -864,13 +865,12 @@ int close_connection(struct st_query* q) char* safe_get_param(char* str, char** arg, const char* msg) { DBUG_ENTER("safe_get_param"); - while(*str && isspace(*str)) str++; + while (*str && isspace(*str)) str++; *arg = str; - while(*str && *str != ',' && *str != ')') - { - if (isspace(*str)) *str = 0; - str++; - } + for (; *str && *str != ',' && *str != ')' ; str++) + { + if (isspace(*str)) *str = 0; + } if (!*str) die(msg); @@ -885,6 +885,7 @@ int do_connect(struct st_query* q) *con_db, *con_sock; char* p=q->first_argument; char buff[FN_REFLEN]; + int con_port; DBUG_ENTER("do_connect"); DBUG_PRINT("enter",("connect: %s",p)); @@ -896,16 +897,27 @@ int do_connect(struct st_query* q) p = safe_get_param(p, &con_user, "missing connection user"); p = safe_get_param(p, &con_pass, "missing connection password"); p = safe_get_param(p, &con_db, "missing connection db"); - p = safe_get_param(p, &con_port_str, "missing connection port"); - p = safe_get_param(p, &con_sock, "missing connection socket"); + if (!*p || *p == ';') /* Default port and sock */ + { + con_port=port; + con_sock=(char*) unix_sock; + } + else + { + p = safe_get_param(p, &con_port_str, "missing connection port"); + con_port=atoi(con_port_str); + p = safe_get_param(p, &con_sock, "missing connection socket"); + } if (next_con == cons_end) die("Connection limit exhausted - increase MAX_CONS in mysqltest.c"); if (!mysql_init(&next_con->mysql)) die("Failed on mysql_init()"); - con_sock=fn_format(buff, con_sock, TMPDIR,"",0); + con_sock=fn_format(buff, con_sock, TMPDIR, "",0); + if (!con_db[0]) + con_db=db; if (!mysql_real_connect(&next_con->mysql, con_host, con_user, con_pass, - con_db, atoi(con_port_str), con_sock, 0)) + con_db, con_port, con_sock, 0)) die("Could not open connection '%s': %s", con_name, mysql_error(&next_con->mysql)); @@ -1572,7 +1584,7 @@ int main(int argc, char** argv) { int error = 0; struct st_query* q; - my_bool require_file=0; + my_bool require_file=0, q_send_flag=0; char save_file[FN_REFLEN]; MY_INIT(argv[0]); @@ -1639,6 +1651,11 @@ int main(int argc, char** argv) * read-result only ( reap) */ if (q->type == Q_QUERY) /* for a full query, enable the send stage */ flags |= QUERY_SEND; + if (q_send_flag) + { + flags= QUERY_SEND; + q_send_flag=0; + } if (save_file[0]) { strmov(q->record_file,save_file); @@ -1649,9 +1666,14 @@ int main(int argc, char** argv) break; } case Q_SEND: - if(q->query == q->query_buf) /* fix up query pointer if this is - * first iteration for this line - */ + if (!q->query[q->first_word_len]) + { + /* This happens when we use 'send' on it's own line */ + q_send_flag=1; + break; + } + /* fix up query pointer if this is * first iteration for this line */ + if (q->query == q->query_buf) q->query += q->first_word_len; error |= run_query(&cur_con->mysql, q, QUERY_SEND); /* run query can execute a query partially, depending on the flags |