summaryrefslogtreecommitdiff
path: root/mysys/my_open.c
Commit message (Collapse)AuthorAgeFilesLines
* This is the downport ofVladislav Vaintroub2009-09-111-212/+11
| | | | | | | | | | | | | | | | | | | | | | | Bug#24509 - 2048 file descriptor limit on windows needs increasing, also WL#3049 - improved Windows I/O The patch replaces the use of the POSIX I/O interfaces in mysys on Windows with the Win32 API calls (CreateFile, WriteFile, etc). The Windows HANDLE for the open file is stored in the my_file_info struct, along with a flag for append mode because the Windows API does not support opening files in append mode in all cases) The default max open files has been increased to 16384 and can be increased further by setting --max-open-files=<value> during the server start. Another major change in this patch that almost all Windows specific file IO code has been moved to a new file my_winfile.c, greatly reducing the amount of code in #ifdef blocks within mysys, thus improving readability. Minor enhancements: - my_(f)stat() is changed to use __stati64 structure with 64 file size and timestamps. It will return correct file size now (C runtime implementation used to report outdated information) - my_lock on Windows is prepared to handle additional timeout parameter - after review : changed __WIN__ to _WIN32 in the new and changed code.
* Moved a lot of old bug fixes and safe cleanups from Maria 5.1 tree to 5.1monty@mysql.com/narttu.mysql.fi2007-10-111-34/+40
| | | | | | | | | | | | | | | | | | | | - Reserver namespace and place in frm for TABLE_CHECKSUM and PAGE_CHECKSUM create options - Added syncing of directory when creating .frm files - Portability fixes - Added missing cast that could cause bugs - Code cleanups - Made some bit functions inline - Moved things out of myisam.h to my_handler.h to make them more accessable - Renamed some myisam variables and defines to make them more globaly usable (as they are used outside of MyISAM) - Fixed bugs in error conditions - Use compiler time asserts instead of run time - Fixed indentation HA_EXTRA_PREPARE_FOR_DELETE -> HA_EXTRA_PREPARE_FOR_DROP as the old name was wrong (Added a define for old value to ensure we don't break any old code) Added HA_EXTRA_PREPARE_FOR_RENAME as a signal for rename (before we used a DROP signal which is wrong) - Initialize error messages early to get better errors when mysqld or an engine fails to start - Fix windows bug that query_performance_frequency was not initialized if registry code failed - thread_stack -> my_thread_stack_size
* Fixed a lot of compiler warnings and errors detected by Forte C++ on Solarismonty@mysql.com/nosik.monty.fi2007-08-131-0/+1
| | | | | | | | | | | | Faster thr_alarm() Added 'Opened_files' status variable to track calls to my_open() Don't give warnings when running mysql_install_db Added option --source-install to mysql_install_db I had to do the following renames() as used polymorphism didn't work with Forte compiler on 64 bit systems index_read() -> index_read_map() index_read_idx() -> index_read_idx_map() index_read_last() -> index_read_last_map()
* WL#3817: Simplify string / memory area types and make things more consistent ↵monty@mysql.com/narttu.mysql.fi2007-05-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (first part) The following type conversions was done: - Changed byte to uchar - Changed gptr to uchar* - Change my_string to char * - Change my_size_t to size_t - Change size_s to size_t Removed declaration of byte, gptr, my_string, my_size_t and size_s. Following function parameter changes was done: - All string functions in mysys/strings was changed to use size_t instead of uint for string lengths. - All read()/write() functions changed to use size_t (including vio). - All protocoll functions changed to use size_t instead of uint - Functions that used a pointer to a string length was changed to use size_t* - Changed malloc(), free() and related functions from using gptr to use void * as this requires fewer casts in the code and is more in line with how the standard functions work. - Added extra length argument to dirname_part() to return the length of the created string. - Changed (at least) following functions to take uchar* as argument: - db_dump() - my_net_write() - net_write_command() - net_store_data() - DBUG_DUMP() - decimal2bin() & bin2decimal() - Changed my_compress() and my_uncompress() to use size_t. Changed one argument to my_uncompress() from a pointer to a value as we only return one value (makes function easier to use). - Changed type of 'pack_data' argument to packfrm() to avoid casts. - Changed in readfrm() and writefrom(), ha_discover and handler::discover() the type for argument 'frmdata' to uchar** to avoid casts. - Changed most Field functions to use uchar* instead of char* (reduced a lot of casts). - Changed field->val_xxx(xxx, new_ptr) to take const pointers. Other changes: - Removed a lot of not needed casts - Added a few new cast required by other changes - Added some cast to my_multi_malloc() arguments for safety (as string lengths needs to be uint, not size_t). - Fixed all calls to hash-get-key functions to use size_t*. (Needed to be done explicitely as this conflict was often hided by casting the function to hash_get_key). - Changed some buffers to memory regions to uchar* to avoid casts. - Changed some string lengths from uint to size_t. - Changed field->ptr to be uchar* instead of char*. This allowed us to get rid of a lot of casts. - Some changes from true -> TRUE, false -> FALSE, unsigned char -> uchar - Include zlib.h in some files as we needed declaration of crc32() - Changed MY_FILE_ERROR to be (size_t) -1. - Changed many variables to hold the result of my_read() / my_write() to be size_t. This was needed to properly detect errors (which are returned as (size_t) -1). - Removed some very old VMS code - Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix) - Removed windows specific code to restore cursor position as this causes slowdown on windows and we should not mix read() and pread() calls anyway as this is not thread safe. Updated function comment to reflect this. Changed function that depended on original behavior of my_pwrite() to itself restore the cursor position (one such case). - Added some missing checking of return value of malloc(). - Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid 'long' overflow. - Changed type of table_def::m_size from my_size_t to ulong to reflect that m_size is the number of elements in the array, not a string/memory length. - Moved THD::max_row_length() to table.cc (as it's not depending on THD). Inlined max_row_length_blob() into this function. - More function comments - Fixed some compiler warnings when compiled without partitions. - Removed setting of LEX_STRING() arguments in declaration (portability fix). - Some trivial indentation/variable name changes. - Some trivial code simplifications: - Replaced some calls to alloc_root + memcpy to use strmake_root()/strdup_root(). - Changed some calls from memdup() to strmake() (Safety fix) - Simpler loops in client-simple.c
* Merge recycle.(none):/src/bug25222/my50-bug25222iggy@recycle.(none)2007-03-071-1/+6
|\ | | | | | | into recycle.(none):/src/bug25222/my51-bug25222
| * Bug#25222 Win32 HANDLE leak in my_sopen()iggy@recycle.(none)2007-03-071-1/+6
| | | | | | | | | | | | | | - When attempting to associate a Windows File handle to a C run-time file handle there is an upper bound. Once reached, the newly created handles will cause a memory leak since they are not properly associated with a handle that can later be cleaned up.
* | Merge mysql.com:/home/kent/bk/main/mysql-5.0kent@kent-amd64.(none)2006-12-231-2/+1
|\ \ | |/ | | | | into mysql.com:/home/kent/bk/main/mysql-5.1
| * Many files:kent@mysql.com/kent-amd64.(none)2006-12-231-2/+1
| | | | | | | | Changed header to GPL version 2 only
* | ndb - fixed for BUG#15021, binlog_index table become inconsistent if errors ↵dli@dev3-76.dev.cn.tlan2006-10-131-2/+10
| | | | | | | | | | | | during purge of binlogs. if EMFILE error occured while purging binary logs, stop purging logs and report error message to user.
* | Merge moonlight.intranet:/home/tomash/src/mysql_ab/tmp_mergekroki/tomash@moonlight.intranet2006-08-101-2/+2
|\ \ | |/ | | | | into moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.1-merge
| * Bug #21396: Wrong error number generated for a missing tablegeorg@lmy002.wdf.sap.corp2006-08-021-2/+2
| |
* | Merge bk-internal:/home/bk/mysql-5.1msvensson@neptunus.(none)2006-06-101-1/+0
|\ \ | | | | | | | | | into neptunus.(none):/home/msvensson/mysql/mysql-5.1-new-maint
| * \ Merge neptunus.(none):/home/msvensson/mysql/my51-bug15936msvensson@neptunus.(none)2006-06-071-1/+0
| |\ \ | | | | | | | | | | | | into neptunus.(none):/home/msvensson/mysql/mysql-5.1-new-maint
| | * | Remove unused defined USES_TYPESmsvensson@shellback.2006-04-111-1/+0
| | |/
* | | Merge rburnett@bk-internal.mysql.com:/home/bk/mysql-5.1-newreggie@big_geek.2006-05-081-2/+2
|\ \ \ | |/ / |/| | | | | into big_geek.:C:/Work/mysql/mysql-5.1
| * | removing MSDOS defines and codereggie@big_geek.2006-05-081-2/+2
| | |
* | | After merge fixesmonty@mysql.com2006-05-041-0/+21
|/ / | | | | | | | | | | Remove compiler warnings Fix some broken tests Workaround for syncronization bug in NDB (Bug #16445)
* | Another long patch to remove the rest of the OS2 support. brian@zim.(none)2006-04-151-2/+2
|/
* Polishing: get rid of C++-style comments.anozdrin@mysql.com2005-11-241-3/+3
|
* Fixes bug #13377. my_open() & my_create() functions changed to use SergeyV@selena.2005-11-141-0/+184
| | | | | | my_sopen() on win32 which allows to use FILE_SHARE_DELETE flag to allow deleting opened files. my_sopen() implementation is added to support this functionality.
* Merge from 4.1msvensson@neptunus.(none)2005-05-261-5/+8
|\
| * Cleanup during code reviewmonty@mysql.com2005-05-251-5/+8
| | | | | | | | Faster detection of wrong table names (like PRN) on windows
* | Merge bk-internal.mysql.com:/data0/bk/mysql-4.1gbichot@bk-internal.mysql.com2005-05-241-0/+7
|\ \ | |/ | | | | into bk-internal.mysql.com:/data0/bk/mysql-5.0
| * BUG# 9148 Denial of servicereggie@mdk10.(none)2005-05-231-3/+4
| | | | | | | | fixups of test case and comment formatting
| * BUG# 9148: Denial of servicereggie@mdk10.(none)2005-05-211-0/+6
| | | | | | | | | | | | | | | | This is a second patch needing another review. The first patch didn't solve the entire problem. open and fopen on Windows will still open files like "com1.sym" when they shouldn't. This patch checks that the file exists before trying to open it.
* | my_close(), my_sync(): retry if EINTRserg@serg.mylan2005-01-111-2/+7
|/
* Max open files handling moved to my_set_max_open_files()monty@mashka.mysql.fi2004-02-191-2/+2
| | | | 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
* Rewrite function commentssalle@geopard.(none)2002-07-091-2/+31
|
* Update copyrightmonty@hundin.mysql.fi2001-12-061-15/+14
| | | | Fixed memory leak on shutdown (Affects the embedded version & MyODBC)
* Fixed bug in counting open files when using many filesmonty@hundin.mysql.fi2001-09-271-3/+2
| | | | Fixed bug in JOIN
* Fixes for OS2.monty@hundin.mysql.fi2001-08-221-2/+2
| | | | | Fix bug in isamlog Add argument types to function declarations.
* Added defines for fast mutex in glibc 2.2 (should be safe)monty@donna.mysql.fi2001-03-241-1/+1
| | | | | | Fixed crash in SELECT DISTINCT SUM(...) Fix return value of mysortncmp() for innobase Fix join_crash bug
* Lots of new benchmark runsmonty@donna.mysql.com2000-12-181-38/+46
| | | | | | Remember filename for temporary files created with mkstemp Fixed wrongly allocated BDB share structure Cleanups for SunPRO
* New error messagesmonty@donna.mysql.com2000-12-051-2/+5
| | | | | Fix for creating read-only files on windows Manual updates
* New thr_alarm struct for better integration with OS2monty@donna.mysql.com2000-11-281-2/+2
| | | | | Run bootstrap in separate thread Fix bug in FLUSH TABLES table_name
* BUILD/compile-pentium-debugsasha@mysql.sashanet.com2000-11-161-1/+1
| | | | | | | | | | make -j 2 mysys/my_open.c my_umask is better than 0 - we do not want 0000 files when my_open() is called with O_CREAT sql/log.cc fixed up IO_CACHE to make replication work, not fully yet sql/log_event.cc fixed up IO_CACHE
* RIGHT JOIN, part of automatic repair of MyISAM tables, backup on repair,monty@tramp.mysql.fi2000-09-261-0/+1
| | | | reading from FIFO, fixes for FULLTEXT, @@IDENTITY
* Update to new root alloc, OPTIMIZE TABLE and some other changesmonty@donna.mysql.com2000-09-121-2/+20
|
* Import changesetbk@work.mysql.com2000-07-311-0/+97