1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

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()
This commit is contained in:
unknown
2004-02-19 19:33:09 +02:00
parent 62cc89aad5
commit ddbb78809d
17 changed files with 224 additions and 179 deletions

View File

@@ -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