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 | |
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')
-rw-r--r-- | client/mysql.cc | 6 | ||||
-rw-r--r-- | client/mysqladmin.c | 13 | ||||
-rw-r--r-- | client/mysqlbinlog.cc | 9 | ||||
-rw-r--r-- | client/mysqldump.c | 9 | ||||
-rw-r--r-- | client/mysqltest.c | 61 |
5 files changed, 64 insertions, 34 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index 82925400c44..31f563d4116 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -3183,6 +3183,8 @@ static const char* construct_prompt() processed_prompt.append(' '); break; case 'R': + if (t->tm_hour < 10) + processed_prompt.append('0'); add_int_to_prompt(t->tm_hour); break; case 'r': @@ -3190,6 +3192,8 @@ static const char* construct_prompt() getHour = t->tm_hour % 12; if (getHour == 0) getHour=12; + if (getHour < 10) + processed_prompt.append('0'); add_int_to_prompt(getHour); break; case 'm': @@ -3215,6 +3219,8 @@ static const char* construct_prompt() processed_prompt.append(strtok(dateTime,"\n")); break; case 's': + if (t->tm_sec < 10) + processed_prompt.append('0'); add_int_to_prompt(t->tm_sec); break; case 'w': diff --git a/client/mysqladmin.c b/client/mysqladmin.c index 46bdb896c59..a2cce3782d6 100644 --- a/client/mysqladmin.c +++ b/client/mysqladmin.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (C) 2000-2004 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -140,7 +140,7 @@ static struct my_option my_long_options[] = NO_ARG, 0, 0, 0, 0, 0, 0}, #endif {"port", 'P', "Port number to use for connection.", (gptr*) &tcp_port, - (gptr*) &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + (gptr*) &tcp_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0, 0}, {"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"relative", 'r', @@ -440,6 +440,7 @@ static my_bool sql_connect(MYSQL *mysql, uint wait) } } + /* Execute a command. Return 0 on ok @@ -450,6 +451,14 @@ static my_bool sql_connect(MYSQL *mysql, uint wait) static int execute_commands(MYSQL *mysql,int argc, char **argv) { const char *status; + /* + MySQL documentation relies on the fact that mysqladmin will + execute commands in the order specified, e.g. + mysqladmin -u root flush-privileges password "newpassword" + to reset a lost root password. + If this behaviour is ever changed, Docs should be notified. + */ + struct rand_struct rand_st; for (; argc > 0 ; argv++,argc--) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 50c6e8ca6dc..d44b6188f0a 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -443,9 +443,9 @@ static struct my_option my_long_options[] = {"user", 'u', "Connect to the remote server as username.", (gptr*) &user, (gptr*) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"local-load", 'l', "Prepare files for local load in directory.", + {"local-load", 'l', "Prepare local temporary files for LOAD DATA INFILE in the specified directory.", (gptr*) &dirname_for_local_load, (gptr*) &dirname_for_local_load, 0, - GET_STR_ALLOC, OPT_ARG, 0, 0, 0, 0, 0, 0}, + GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"version", 'V', "Print version and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} @@ -579,6 +579,7 @@ static int parse_args(int *argc, char*** argv) static MYSQL* safe_connect() { MYSQL *local_mysql = mysql_init(NULL); + if (!local_mysql) die("Failed on mysql_init"); @@ -893,7 +894,7 @@ int main(int argc, char** argv) { if (init_tmpdir(&tmpdir, 0)) exit(1); - dirname_for_local_load= my_tmpdir(&tmpdir); + dirname_for_local_load= my_strdup(my_tmpdir(&tmpdir), MY_WME); } if (load_processor.init()) @@ -904,6 +905,8 @@ int main(int argc, char** argv) load_processor.init_by_cur_dir(); exit_value= 0; + fprintf(result_file, + "/*!40019 SET @@session.max_insert_delayed_threads=0*/;\n"); while (--argc >= 0) { if (dump_log_entries(*(argv++))) diff --git a/client/mysqldump.c b/client/mysqldump.c index bd8af680df8..8a5e70649a1 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -79,10 +79,11 @@ static my_bool verbose=0,tFlag=0,cFlag=0,dFlag=0,quick= 1, extended_insert= 1, ignore=0,opt_drop=1,opt_keywords=0,opt_lock=1,opt_compress=0, opt_delayed=0,create_options=1,opt_quoted=0,opt_databases=0, opt_alldbs=0,opt_create_db=0,opt_first_slave=0,opt_set_names=0, - opt_autocommit=0,opt_master_data,opt_disable_keys=1,opt_xml=0, - opt_delete_master_logs=0, tty_password=0, + opt_autocommit=0,opt_master_data,opt_disable_keys=1,opt_xml=0, + opt_delete_master_logs=0, tty_password=0, opt_single_transaction=0, opt_comments= 0, opt_compact= 0; -static MYSQL mysql_connection,*sock=0; + +static MYSQL mysql_connection,*sock=0; static char insert_pat[12 * 1024],*opt_password=0,*current_user=0, *current_host=0,*path=0,*fields_terminated=0, *lines_terminated=0, *enclosed=0, *opt_enclosed=0, *escaped=0, @@ -508,7 +509,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), } #if !defined(DBUG_OFF) { - int size_for_sql_mode= 0; + uint size_for_sql_mode= 0; const char **ptr; for (ptr= compatible_mode_names; *ptr; ptr++) size_for_sql_mode+= strlen(*ptr); 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); } |