diff options
author | unknown <monty@mashka.mysql.fi> | 2004-02-19 19:33:09 +0200 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2004-02-19 19:33:09 +0200 |
commit | ddbb78809dcce02d649eae436c77799d7a76983e (patch) | |
tree | 86d1d367349c537e9cbd45f6bf0ba3c2315f1a59 /client | |
parent | 62cc89aad50b00c0ab1ef3e94c5a3467eb78eb70 (diff) | |
download | mariadb-git-ddbb78809dcce02d649eae436c77799d7a76983e.tar.gz |
Max open files handling moved to my_set_max_open_files()
This ensures that my_file_info takes this the max number of files into account and one can now use --open-files-limit on windows to increase number of used files up to 2048
client/client_priv.h:
Added --open-files-limit to mysqlbinlog
client/mysqlbinlog.cc:
Added --open-files-limit to mysqlbinlog
include/config-win.h:
Define that you can have up to 2048 files open on windows
include/my_global.h:
Allow override of OS_FILE_LIMIT
include/my_sys.h:
Cleanup
Added prototypes for my_set_max_open_files() and my_free_open_files()
libmysql/Makefile.shared:
Added my_file.c
myisam/myisamlog.c:
Use my_set_max_open_files()
mysys/Makefile.am:
Use my_file.c (for mysqlbinlog)
mysys/my_alloc.c:
Remove compiler warning
mysys/my_div.c:
MY_NFILE -> my_file_limit
mysys/my_dup.c:
MY_NFILE -> my_file_limit
mysys/my_fopen.c:
MY_NFILE -> my_file_limit
mysys/my_open.c:
MY_NFILE -> my_file_limit
mysys/my_static.c:
Allow changing of open files limit
mysys/my_static.h:
Allow changing of open files limit
sql/mysqld.cc:
Max open files handling moved to my_set_max_open_files()
Diffstat (limited to 'client')
-rw-r--r-- | client/client_priv.h | 1 | ||||
-rw-r--r-- | client/mysqlbinlog.cc | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/client/client_priv.h b/client/client_priv.h index 910de1f03e9..0c71d72c0b4 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -43,4 +43,5 @@ enum options_client OPT_PROMPT, OPT_IGN_LINES,OPT_TRANSACTION,OPT_MYSQL_PROTOCOL, OPT_SHARED_MEMORY_BASE_NAME, OPT_FRM, OPT_SKIP_OPTIMIZATION, OPT_COMPATIBLE, OPT_RECONNECT, OPT_DELIMITER, OPT_SECURE_AUTH, + OPT_OPEN_FILES_LIMIT }; diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 82a57961c11..50c6e8ca6dc 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -33,6 +33,7 @@ ulong server_id = 0; // needed by net_serv.c ulong bytes_sent = 0L, bytes_received = 0L; ulong mysqld_net_retry_count = 10L; +ulong open_files_limit; uint test_flags = 0; static uint opt_protocol= 0; static FILE *result_file; @@ -68,7 +69,7 @@ static MYSQL* safe_connect(); class Load_log_processor { - char target_dir_name[MY_NFILE]; + char target_dir_name[FN_REFLEN]; int target_dir_name_len; DYNAMIC_ARRAY file_names; @@ -429,6 +430,10 @@ static struct my_option my_long_options[] = {"read-from-remote-server", 'R', "Read binary logs from a MySQL server", (gptr*) &remote_opt, (gptr*) &remote_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"open_files_limit", OPT_OPEN_FILES_LIMIT, + "Used to reserve file descriptors for usage by this program", + (gptr*) &open_files_limit, (gptr*) &open_files_limit, 0, GET_ULONG, + REQUIRED_ARG, MY_NFILE, 8, OS_FILE_LIMIT, 0, 1, 0}, {"short-form", 's', "Just show the queries, no extra info.", (gptr*) &short_form, (gptr*) &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -878,6 +883,7 @@ int main(int argc, char** argv) exit(1); } + my_set_max_open_files(open_files_limit); if (remote_opt) mysql = safe_connect(); @@ -915,6 +921,7 @@ int main(int argc, char** argv) mysql_close(mysql); cleanup(); free_defaults(defaults_argv); + my_free_open_file_info(); my_end(0); exit(exit_value); DBUG_RETURN(exit_value); // Keep compilers happy |