summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2006-05-04 06:28:24 +0300
committerunknown <monty@mysql.com>2006-05-04 06:28:24 +0300
commit79d87430db7aac8e9b763d63a2e51cc9946bdc8d (patch)
treef9bdf22894017186b47db65bd16339e2f5b9646a /mysys
parent26fe4bf90b1a5ad3056a095e7950e0965af3eb5c (diff)
downloadmariadb-git-79d87430db7aac8e9b763d63a2e51cc9946bdc8d.tar.gz
After merge fixes
Remove compiler warnings Fix some broken tests Workaround for syncronization bug in NDB (Bug #16445) client/mysqltest.c: Added more information to output from abort_not_supported_test() Removed compiler warnings include/my_sys.h: Added function to print names of open files include/mysys_err.h: Print names of open files mysql-test/include/have_ndb.inc: Added comment mysql-test/lib/mtr_report.pl: Only print warning once mysql-test/r/mysqldump.result: After merge fix mysql-test/r/ndb_basic.result: Workaround for syncronization bug in NDB mysql-test/r/ndb_config.result: Remove not portable test mysql-test/t/ndb_basic.test: Workaround for syncronization bug in NDB mysql-test/t/ndb_config.test: Remove not portable test mysys/errors.c: Print names of open files mysys/my_file.c: Ensure that structs are cleared and copyied properly so that my_print_open_files() works. mysys/my_init.c: In case of EXTRA_DEBUG, print names of open files mysys/my_open.c: Added function to print names of open files sql/sql_table.cc: Fixed file-not-closed error
Diffstat (limited to 'mysys')
-rw-r--r--mysys/errors.c2
-rw-r--r--mysys/my_file.c9
-rw-r--r--mysys/my_init.c1
-rw-r--r--mysys/my_open.c21
4 files changed, 32 insertions, 1 deletions
diff --git a/mysys/errors.c b/mysys/errors.c
index 630e4511124..5fe9eadb522 100644
--- a/mysys/errors.c
+++ b/mysys/errors.c
@@ -50,6 +50,7 @@ const char * NEAR globerrs[GLOBERRS]=
"Can't sync file '%s' to disk (Errcode: %d)",
"Collation '%s' is not a compiled collation and is not specified in the '%s' file",
"File '%s' not found (Errcode: %d)",
+ "File '%s' (fileno: %d) was not closed"
};
void init_glob_errs(void)
@@ -89,5 +90,6 @@ void init_glob_errs()
EE(EE_SYNC)= "Can't sync file '%s' to disk (Errcode: %d)";
EE(EE_UNKNOWN_COLLATION)= "Collation '%s' is not a compiled collation and is not specified in the %s file";
EE(EE_FILENOTFOUND) = "File '%s' not found (Errcode: %d)";
+ EE(EE_FILE_NOT_CLOSED) = "File '%s' (fileno: %d) was not closed";
}
#endif
diff --git a/mysys/my_file.c b/mysys/my_file.c
index 4c333c7d7db..0abc031a195 100644
--- a/mysys/my_file.c
+++ b/mysys/my_file.c
@@ -107,7 +107,10 @@ uint my_set_max_open_files(uint files)
DBUG_RETURN(MY_NFILE);
/* Copy any initialized files */
- memcpy((char*) tmp, (char*) my_file_info, sizeof(*tmp) * my_file_limit);
+ memcpy((char*) tmp, (char*) my_file_info,
+ sizeof(*tmp) * min(my_file_limit, files));
+ bzero((char*) (tmp + my_file_limit),
+ max((int) (files- my_file_limit), 0)*sizeof(*tmp));
my_free_open_file_info(); /* Free if already allocated */
my_file_info= tmp;
my_file_limit= files;
@@ -121,8 +124,12 @@ void my_free_open_file_info()
DBUG_ENTER("my_free_file_info");
if (my_file_info != my_file_info_default)
{
+ /* Copy data back for my_print_open_files */
+ memcpy((char*) my_file_info_default, my_file_info,
+ sizeof(*my_file_info_default)* MY_NFILE);
my_free((char*) my_file_info, MYF(0));
my_file_info= my_file_info_default;
+ my_file_limit= MY_NFILE;
}
DBUG_VOID_RETURN;
}
diff --git a/mysys/my_init.c b/mysys/my_init.c
index 88b8e457bd6..4d7299c7cb1 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -150,6 +150,7 @@ void my_end(int infoflag)
sprintf(errbuff[0],EE(EE_OPEN_WARNING),my_file_opened,my_stream_opened);
(void) my_message_no_curses(EE_OPEN_WARNING,errbuff[0],ME_BELL);
DBUG_PRINT("error",("%s",errbuff[0]));
+ my_print_open_files();
}
}
free_charsets();
diff --git a/mysys/my_open.c b/mysys/my_open.c
index 098d410d8ce..ed323b3b1ad 100644
--- a/mysys/my_open.c
+++ b/mysys/my_open.c
@@ -351,3 +351,24 @@ File my_sopen(const char *path, int oflag, int shflag, int pmode)
return fh; /* return handle */
}
#endif /* __WIN__ */
+
+
+#ifdef EXTRA_DEBUG
+
+void my_print_open_files(void)
+{
+ if (my_file_opened | my_stream_opened)
+ {
+ uint i;
+ for (i= 0 ; i < my_file_limit ; i++)
+ {
+ if (my_file_info[i].type != UNOPEN)
+ {
+ fprintf(stderr, EE(EE_FILE_NOT_CLOSED), my_file_info[i].name, i);
+ fputc('\n', stderr);
+ }
+ }
+ }
+}
+
+#endif