diff options
author | monty@donna.mysql.com <> | 2000-09-07 04:55:17 +0300 |
---|---|---|
committer | monty@donna.mysql.com <> | 2000-09-07 04:55:17 +0300 |
commit | be5e4e72b67c1ce6d25ec6d961ed0f6b4d13a106 (patch) | |
tree | cd775f59b4803ef23e407df9d47af3ae7b517a13 /client | |
parent | 0c07817b08812e18ecba76966cb84b562efb0d80 (diff) | |
download | mariadb-git-be5e4e72b67c1ce6d25ec6d961ed0f6b4d13a106.tar.gz |
Small bug fixes
Diffstat (limited to 'client')
-rw-r--r-- | client/mysql.cc | 5 | ||||
-rw-r--r-- | client/mysqldump.c | 12 |
2 files changed, 9 insertions, 8 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index 788b9f39899..71d9310785d 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -300,7 +300,7 @@ int main(int argc,char *argv[]) } } #endif - sprintf(buff, "Type 'help;' or '\\h' for help.\n"); + sprintf(buff, "Type 'help;' or '\\h' for help. Type '\\c' to clear the buffer\n"); put_info(buff,INFO_INFO); status.exit_status=read_lines(1); // read lines and execute them mysql_end(0); @@ -1680,8 +1680,9 @@ static int com_source(String *buffer, char *line) while (end > source_name && (isspace(end[-1]) || iscntrl(end[-1]))) end--; end[0]=0; + unpack_filename(source_name,source_name); /* open file name */ - if (!(sql_file = my_fopen(source_name, O_RDONLY,MYF(0)))) + if (!(sql_file = my_fopen(source_name, O_RDONLY | O_BINARY,MYF(0)))) { char buff[FN_REFLEN+60]; sprintf(buff,"Failed to open file '%s', error: %d", source_name,errno); diff --git a/client/mysqldump.c b/client/mysqldump.c index 78d64c76a75..163822d5d34 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1046,7 +1046,7 @@ static char *getTableName(int reset) } if ((row = mysql_fetch_row(res))) return((char*) row[0]); - + if (reset) mysql_data_seek(res,0); /* We want to read again */ else @@ -1134,14 +1134,14 @@ static int dump_all_tables_in_db(char *database) dynstr_append(&query, " READ /*!32311 LOCAL */,"); } if (numrows && mysql_real_query(sock, query.str, query.length-1)) - DBerror(sock, "when using LOCK TABLES"); + DBerror(sock, "when using LOCK TABLES"); /* We shall continue here, if --force was given */ dynstr_free(&query); } if (flush_logs) { if (mysql_refresh(sock, REFRESH_LOG)) - DBerror(sock, "when doing refresh"); + DBerror(sock, "when doing refresh"); /* We shall continue here, if --force was given */ } while ((table = getTableName(0))) @@ -1175,14 +1175,14 @@ static int dump_selected_tables(char *db, char **table_names, int tables) dynstr_append(&query, " READ /*!32311 LOCAL */,"); } if (mysql_real_query(sock, query.str, query.length-1)) - DBerror(sock, "when doing LOCK TABLES"); + DBerror(sock, "when doing LOCK TABLES"); /* We shall countinue here, if --force was given */ dynstr_free(&query); } if (flush_logs) { if (mysql_refresh(sock, REFRESH_LOG)) - DBerror(sock, "when doing refresh"); + DBerror(sock, "when doing refresh"); /* We shall countinue here, if --force was given */ } for (; tables > 0 ; tables-- , table_names++) @@ -1258,7 +1258,7 @@ int main(int argc, char **argv) else if (argc > 1 && !opt_databases) dump_selected_tables(*argv, (argv + 1), (argc - 1)); /* One or more databases, all tables */ - else + else dump_databases(argv); if (opt_first_slave) |