1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-27 13:04:36 +03:00
Files
mariadb/mysql-test/suite/large_tests/t/lock_tables_big.test
Vladislav Vaintroub 4e92af9f43 This is the downport of
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.
2009-09-11 22:26:35 +02:00

33 lines
737 B
Plaintext

#
# Bug#24509 cannot use more than 2048 file descriptors on windows
#
--disable_query_log
create database many_tables;
use many_tables;
let $max_tables=3000;
let $i=$max_tables;
--disable_warnings
create table t (i int);
let $table_list=t READ;
while ($i)
{
eval create table t$i (i int);
let $table_list= $table_list ,t$i READ;
dec $i;
}
#lock all tables we just created (resembles mysqldump startup is doing with --all-databases operation)
#There will be 3 descriptors for each table (table.FRM, table.MYI and table.MYD files) means 9000 files
#descriptors altogether. For Microsoft C runtime, this is way too many.
eval LOCK TABLES $table_list;
unlock tables;
drop database many_tables;
--disable_query_log
--echo all done