diff options
author | unknown <monty@tramp.mysql.fi> | 2000-10-03 14:18:03 +0300 |
---|---|---|
committer | unknown <monty@tramp.mysql.fi> | 2000-10-03 14:18:03 +0300 |
commit | 63b7b45ff7f79a08a673e8b759a69f5ee7e67902 (patch) | |
tree | c02cc6a9c6585038615c596332aae70354b44aac /mysys/my_fopen.c | |
parent | 27a17a6ef909533820b2137ab598fb7df220876d (diff) | |
download | mariadb-git-63b7b45ff7f79a08a673e8b759a69f5ee7e67902.tar.gz |
First part of automatic repair of MyISAM tables.
Error on full disk on repair.
SIGHUP signal handling.
Update with keys on timestamp
Portability fixes
Docs/manual.texi:
Added documentation about automatic repair of MyISAM tables
client/mysql.cc:
Remove usage of tempnam.
include/my_sys.h:
Added create_temp_file
include/myisam.h:
Fix for disk full on repair
myisam/mi_check.c:
Fix for disk full on repair
myisam/sort.c:
Fix for disk full on repair & removed usage of tempnam()
mysys/mf_cache.c:
Remove usage of tempnam()
mysys/mf_dirname.c:
Changed convert_dirname to return end 0
mysys/my_fopen.c:
Security fixes
mysys/my_tempnam.c:
remove blanks
readline/bind.c:
Portability fixes
readline/complete.c:
Portability fixes
readline/histexpand.c:
Portability fixes
readline/input.c:
Portability fixes
readline/search.c:
Portability fixes
readline/shell.c:
Portability fixes
readline/terminal.c:
Portability fixes
readline/tilde.c:
Portability fixes
readline/undo.c:
Portability fixes
regex/cname.h:
Portability fixes
regex/debug.c:
Portability fixes
regex/main.c:
Portability fixes
regex/regcomp.c:
Portability fixes
regex/regerror.c:
Portability fixes
sql/filesort.cc:
Remove dummy code
sql/ha_myisam.cc:
Automatic repair of MyISAM tables
sql/ha_myisam.h:
Automatic repair of MyISAM tables
sql/handler.cc:
Automatic repair of MyISAM tables
sql/handler.h:
Automatic repair of MyISAM tables
sql/key.cc:
Fix for UPDATE with key on timestamp column
sql/mysql_priv.h:
Automatic repair of MyISAM tables
sql/mysqld.cc:
Automatic repair of MyISAM tables & signal SIGHUP handling
sql/sql_base.cc:
Automatic repair of MyISAM tables
sql/sql_class.cc:
Automatic repair of MyISAM tables
sql/sql_class.h:
Fix for insert with reference to columns
sql/sql_insert.cc:
Fix for insert with reference to columns
sql/table.cc:
Automatic repair of MyISAM tables
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
Diffstat (limited to 'mysys/my_fopen.c')
-rw-r--r-- | mysys/my_fopen.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/mysys/my_fopen.c b/mysys/my_fopen.c index 30424874aa0..e1575b0af48 100644 --- a/mysys/my_fopen.c +++ b/mysys/my_fopen.c @@ -95,7 +95,7 @@ int my_fclose(FILE *fd, myf MyFlags) if ((uint) file < MY_NFILE && my_file_info[file].type != UNOPEN) { my_file_info[file].type = UNOPEN; - my_free(my_file_info[file].name, MYF(0)); + my_free(my_file_info[file].name, MYF(MY_ALLOW_ZERO_PTR)); } pthread_mutex_unlock(&THR_LOCK_open); DBUG_RETURN(err); @@ -103,11 +103,9 @@ int my_fclose(FILE *fd, myf MyFlags) /* Make a stream out of a file handle */ + /* Name may be 0 */ -FILE *my_fdopen(File Filedes, int Flags, myf MyFlags) - - /* Read | write .. */ - /* Special flags */ +FILE *my_fdopen(File Filedes, const char *name, int Flags, myf MyFlags) { FILE *fd; char type[5]; @@ -125,11 +123,18 @@ FILE *my_fdopen(File Filedes, int Flags, myf MyFlags) else { pthread_mutex_lock(&THR_LOCK_open); - if (my_file_info[Filedes].type != UNOPEN) + my_stream_opened++; + if (Filedes < MY_NFILE) { + if (my_file_info[Filedes].type != UNOPEN) + { + my_file_opened--; /* File is opened with my_open ! */ + } + else + { + my_file_info[Filedes].name= my_strdup(name,MyFlags); + } my_file_info[Filedes].type = STREAM_BY_FDOPEN; - my_file_opened--; /* File is opened with my_open ! */ - my_stream_opened++; } pthread_mutex_unlock(&THR_LOCK_open); } |