summaryrefslogtreecommitdiff
path: root/include/my_pthread.h
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-20279 Increase Aria index length limitMonty2019-08-231-0/+2
| | | | | | | | | | | | | | Limit increased from 1000 to 2000. Avoiding stack overflow by only storing keys and pages on the stack in recursive functions if there is plenty of space on it. Other things: - Use less stack space for b-tree operations as we now only allocate as much space as needed instead of always allocating HA_MAX_KEY_LENGTH. - Replaced most usage of my_safe_alloca() in Aria with the stack_alloc interface. - Moved my_setstacksize() to mysys/my_pthread.c
* MDEV-19773 : simplify implementation of Windows rwlockVladislav Vaintroub2019-06-181-28/+5
| | | | | No need to do dynamic loading and fallbacks anymore. We can safely assume Windows 7, and availability of all SRWLock functions.
* Merge 10.4 into 10.5Marko Mäkelä2019-05-231-1/+23
|\
| * Merge branch '10.3' into 10.4Oleksandr Byelkin2019-05-191-1/+23
| |\
| | * Merge 10.2 into 10.3Marko Mäkelä2019-05-141-1/+1
| | |\
| | | * Merge 10.1 into 10.2Marko Mäkelä2019-05-131-1/+1
| | | |\
| | | | * Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-111-1/+1
| | | | |\
| | | | | * Update FSF AddressVicențiu Ciorbaru2019-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * Update wrong zip-code
| | | | | * MDEV-9024 Build fails with VS2015Sergei Golubchik2016-02-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cherry-pick f1daf9ce from 10.0 branch ------------------------------------- Fix build failures caused by new C runtime library - isnan, snprintf, struct timespec are now defined, attempt to redefine them leads - P_tmpdir, tzname are no more defined - lfind() and lsearch() in lf_hash.c had to be renamed, declaration conflicts with some C runtime functions with the same name declared in a header included by stdlib.h Also fix couple of annoying warnings : - remove #define NOMINMAX from config.h to avoid "redefined" compiler warnings(NOMINMAX is already in compile flags) - disable incremental linker in Debug as well (feature not used much and compiler crashes often) Also simplify package building with Wix, require Wix 3.9 or later (VS2015 is not compatible with old Wix 3.5/3.6)
| | * | | | MDEV-17845 Extreme high open file limit usedSergei Golubchik2019-05-071-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SHOW STATUS LIKE 'Open_files' was showing 18446744073709551615 my_file_opened used statistic_increment/statistic_decrement, so one-off errors were normal and expected. But they confused monitoring tools, so let's move my_file_opened to use atomics.
* | | | | | MDEV-17841 S3 storage engineMonty2019-05-231-5/+17
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A read-only storage engine that stores it's data in (aws) S3 To store data in S3 one could use ALTER TABLE: ALTER TABLE table_name ENGINE=S3 libmarias3 integration done by Sergei Golubchik libmarias3 created by Andrew Hutchings
* | | | | Merge 10.3 into 10.4Marko Mäkelä2019-03-081-2/+6
|\ \ \ \ \ | |/ / / /
| * | | | Give ASAN some more stackMarko Mäkelä2019-03-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When compiling CMAKE_BUILD_TYPE=Debug WITH_ASAN using clang-7 -O2 the following tests could fail due to insufficient stack size: main.signal_demo3 sys_vars.max_sp_recursion_depth_func
| * | | | Merge 10.2 into 10.3Marko Mäkelä2019-03-081-0/+4
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.1 into 10.2Marko Mäkelä2019-03-071-0/+4
| | |\ \ \ | | | |/ / | | | | | | | | | | | | | | | | | | | | Rewrite the MDEV-13818 fix to prevent heap-use-after-free. Add a test case for MDEV-18272.
| | | * | ASAN loves stack, give it someSergei Golubchik2019-03-061-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fixes these test failures in ASAN builds (in 10.1 and 10.4): * main.signal_demo3 * main.sp * sys_vars.max_sp_recursion_depth_func * mroonga/storage.foreign_key_delete_existent * mroonga/storage.foreign_key_delete_nonexistent * mroonga/storage.foreign_key_insert_existent * mroonga/storage.foreign_key_update_existent * mroonga/storage.foreign_key_update_nonexistent * mroonga/storage.function_command_auto-escape * mroonga/storage.function_command_select * mroonga/storage.variable_enable_operations_recording_insert
* | | | | mysqld: ignore SIGHUP sent by the kernelSergei Golubchik2018-12-121-1/+13
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SIGHUP causes debug info in the error log and reload of logs/privileges/tables/etc. The server should only do it when a user intentionally sends SUGHUP, not when a parent terminal gets disconnected or something. In particular, not ignoring kernel SIGHUP causes FLUSH PRIVILEGES at some random point during non-systemd Debian upgrades (Debian restarts mysqld, debian-start script runs mysql_upgrade in the background, postinit script ends and kernel sends SIGHUP to all background processes it has started). And during mysql_upgrade privilege tables aren't necessarily ready to be reloaded.
* | | | Merge 10.2 into 10.3Marko Mäkelä2018-10-111-1/+1
|\ \ \ \ | |/ / /
| * | | Merge 10.1 into 10.2Marko Mäkelä2018-10-111-1/+1
| |\ \ \ | | |/ /
| | * | MDEV-17200 - pthread_detach called for already detached threadsSergey Vojtovich2018-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pthread_detach_this_thread() was intended to be defined to something meaningful only on some ancient unixes, which don't have pthread_attr_setdetachstate() defined. Otherwise, on normal unixes, threads are created detached in the first place. This was broken in 0f01bf267680244ec488adaf65a42838756ed48e so that we started calling pthread_detach() for already detached threads. Intention was to detach aria checkpoint thread. However in 87007dc2f71634cc460271eb277ad851ec69c04b aria service threads were made joinable with appropriate handling, which makes breaking revision unneccessary. Revert remnants of 0f01bf267680244ec488adaf65a42838756ed48e, so that pthread_detach_this_thread() is meaningful only on some ancient unixes again.
* | | | Misc. typosluz.paz2018-04-051-2/+2
| | | | | | | | | | | | | | | | Found via `codespell -i 3 -w --skip="./debian/po" -I ../mariadb-server-word-whitelist.txt ./cmake/ ./debian/ ./Docs/ ./include/ ./man/ ./plugin/ ./strings/`
* | | | MDEV-15694 Windows : use GetSystemTimePreciseAsFileTime if available for ↵Vladislav Vaintroub2018-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | high resolution time Use high accuracy timer on Windows 8.1+ for system versioning,it needs accurate high resoution start query time. Continue to use the inaccurate (but much faster timer function) GetSystemTimeAsFileTime() where accuracy does not matter, e.g in set_timespec_time_nsec(),or my_time()
* | | | MDEV-15091 : Windows, 64bit: reenable and fix warning C4267 (conversion from ↵Vladislav Vaintroub2018-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'size_t' to 'type', possible loss of data) Handle string length as size_t, consistently (almost always:)) Change function prototypes to accept size_t, where in the past ulong or uint were used. change local/member variables to size_t when appropriate. This fix excludes rocksdb, spider,spider, sphinx and connect for now.
* | | | Minor spelling fixes in code comments, docs and outputOtto Kekäläinen2018-01-121-2/+2
| | | | | | | | | | | | | | | | | | | | This commit does not touch any variable names or any other actual code, and thus should not in any way affect how the code works.
* | | | Enusure that my_global.h is included firstMichael Widenius2017-08-241-2/+0
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added sql/mariadb.h file that should be included first by files in sql directory, if sql_plugin.h is not used (sql_plugin.h adds SHOW variables that must be done before my_global.h is included) - Removed a lot of include my_global.h from include files - Removed include's of some files that my_global.h automatically includes - Removed duplicated include's of my_sys.h - Replaced include my_config.h with my_global.h
* | | Merge 10.1 into 10.2Marko Mäkelä2017-05-061-0/+20
|\ \ \ | |/ / | | | | | | | | | | | | Also, include fixes by Vladislav Vaintroub to the aws_key_management plugin. The AWS C++ SDK specifically depends on OPENSSL_LIBRARIES, not generic SSL_LIBRARIES (such as YaSSL).
| * | bugfix: federated/replication did not increment bytes_received status variableSergei Golubchik2017-04-271-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | because mysql->net.thd was reset to NULL in mysql_real_connect() and thd_increment_bytes_received() didn't do anything. Fix: * set mysql->net.thd to current_thd instread. * remove the test for non-null THD from a very often used function thd_increment_bytes_received().
* | | MDEV-11720 main.signal_demo3 fails in buildbot on labradorSergei Golubchik2017-03-291-1/+1
| | | | | | | | | | | | increase stack size for labrador
* | | Fix many -Wconversion warnings.Marko Mäkelä2017-03-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define my_thread_id as an unsigned type, to avoid mismatch with ulonglong. Change some parameters to this type. Use size_t in a few more places. Declare many flag constants as unsigned to avoid sign mismatch when shifting bits or applying the unary ~ operator. When applying the unary ~ operator to enum constants, explictly cast the result to an unsigned type, because enum constants can be treated as signed. In InnoDB, change the source code line number parameters from ulint to unsigned type. Also, make some InnoDB functions return a narrower type (unsigned or uint32_t instead of ulint; bool instead of ibool).
* | | compiler warningSergei Golubchik2016-09-121-1/+1
| | |
* | | increase stack size for labradorSergei Golubchik2016-07-011-1/+1
| | |
* | | Reuse THD for new user connectionsMonty2016-06-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - To ensure that mallocs are marked for the correct THD, even if it's allocated in another thread, I added the thread_id to the THD constructor - Added st_my_thread_var to thr_lock_info_init() to avoid a call to my_thread_var - Moved things from THD::THD() to THD::init() - Moved some things to THD::cleanup() - Added THD::free_connection() and THD::reset_for_reuse() - Added THD to CONNECT::create_thd() - Added THD::thread_dbug_id and st_my_thread_var->dbug_id. These are needed to ensure that we have a constant thread_id used for debugging with a THD, even if it changes thread_id (=connection_id) - Set variables.pseudo_thread_id in constructor. Removed not needed sets.
* | | MDEV-9154 : Remove workarounds (mainly dynamic function loading)Vladislav Vaintroub2016-06-011-24/+3
| | | | | | | | | | | | for running obsolete versions of Windows
* | | Make step bigger to reflect modern needs.Oleksandr Byelkin2016-03-231-1/+1
| | |
* | | Changed my_thread_id to int64 to fix compilation problem withMonty2016-02-081-1/+1
| | | | | | | | | | | | | | | | | | my_atomic_add32_explicit on windows Fixed that server_audit.c also works if one compiles with safemalloc Fixed compiler warnings
* | | Merge branch '10.1' into 10.2Monty2016-02-061-1/+1
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: VERSION cmake/plugin.cmake config.h.cmake configure.cmake plugin/server_audit/server_audit.c sql/sql_yacc.yy
| * | stack too small on labrador (again!)Sergei Golubchik2016-01-251-1/+1
| | | | | | | | | | | | | | | increase the thread stack a bit for main.signal_demo3 and sys_vars.max_sp_recursion_depth_func to stop failing
* | | MDEV-8111 - remove "fast mutexes"Sergey Vojtovich2015-11-261-20/+0
|/ / | | | | | | | | They aren't faster than normal mutexes. They're disabled by default for years, so de facto it's dead code, never used.
* | Merge branch '10.0' into 10.1Sergei Golubchik2015-11-191-0/+2
|\ \
| * | MDEV-9024 Build fails with VS2015Vladislav Vaintroub2015-11-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix build failures caused by new C runtime library - isnan, snprintf, struct timespec are now defined, attempt to redefine them leads - P_tmpdir, tzname are no more defined - lfind() and lsearch() in lf_hash.c had to be renamed, declaration conflicts with some C runtime functions with the same name declared in a header included by stdlib.h Also fix couple of annoying warnings : - remove #define NOMINMAX from config.h to avoid "redefined" compiler warnings(NOMINMAX is already in compile flags) - disable incremental linker in Debug as well (feature not used much and compiler crashes often) Also simplify package building with Wix, require Wix 3.9 or later (VS2015 is not compatible with old Wix 3.5/3.6)
* | | Merge branch '10.0' into 10.1Sergei Golubchik2015-10-121-4/+4
|\ \ \ | |/ /
| * | MDEV-8379 - SUSE mariadb patchesSergey Vojtovich2015-10-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed unclean prototype declaration. According to ISO/IEC 9899:TC2: ... 10. The special case of an unnamed parameter of type void as the only item in the list specifies that the function has no parameters. ... 14. An identifier list declares only the identifiers of the parameters of the function. An empty list in a function declarator that is part of a definition of that function specifies that the function has no parameters. The empty list in a function declarator that is not part of a definition of that function specifies that no information about the number or types of the parameters is supplied. 124) ... 6.11.6 Function declarators The use of function declarators with empty parentheses (not prototype-format parameter type declarators) is an obsolescent feature. ... Patch contributed by Michal Hrusecky.
* | | MDEV-8241: Debug build on Windows is broken: error LNK2019: unresolved ↵Oleksandr Byelkin2015-05-291-1/+1
|/ / | | | | | | | | | | | | | | external symbol pthread_detach referenced in function ma_checkpoint_init pthread_detach() replaced with pthread_detach_this_thread() pthread_detach_this_thread() definition fixed
* | 5.5 mergeSergei Golubchik2015-01-211-4/+14
|\ \ | |/
| * mysql-5.5.41 mergeSergei Golubchik2014-12-191-4/+14
| |\
| | * Bug #18808072 MYSQLBINLOG USES LOCALTIME() TO PRINT EVENTS, CAUSES KERNEL ↵Venkatesh Duggirala2014-10-081-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MUTEX CONTENTION Problem: For every event read, mysqlbinlog calls localtime() which in turn calls stat(/etc/localtime) which is causing kernel mutex contention. Analysis and Fix: localtime() calls stat(/etc/localtime) for every instance of the call where as localtime_r() the reentrant version was optimized to store the read only tz internal structure. Hence it will not call stat(/etc/localtime). It will call only once at the beginning. The mysql server is calling localtime_r() and mysqlbinlog tool is one place where we are still using localtime(). Once the process (mysqlbinlog) is started if timezone is changed it will be not picked up the the process and it will continue with the same values as the beginning of the process. This behavior is in-lined with mysql server. Also adding localtime_r() and gmtime_r() support for windows.
* | | rename st_my_thread_var::opt_info -> st_my_thread_var::keycache_linkSergei Golubchik2015-01-191-1/+1
| | |
* | | remove unused st_my_thread_var::cmp_lengthSergei Golubchik2015-01-191-1/+0
| | |
* | | 10.0-base mergeSergei Golubchik2014-02-261-3/+3
|\ \ \ | |/ /
| * | MySQL-5.5.36 mergeSergei Golubchik2014-02-171-3/+3
| |\ \ | | |/ | | | | | | (without few incorrect bugfixes and with 1250 files where only a copyright year was changed)