mariadb/mysys
Michael Widenius d8986fd6c3 Speed up connection time:
-Change my_rnd() slightly to make it safer if two threads use it at the same time.
-Avoid some sprintf and strmov in vio.
-Changed thread_count to be automaticly incremented (instead of under LOCK_thread_count).
-Thread cache now uses LOCK_thread_cache instead of LOCK_thread_count.
-Moved delete thd out from LOCK_thread_count.
-Save some mysql_cond_broadcast(&COND_thread_count) calls.
-Removed call to getsockname() during connect.
-Initialize random generator without locks.

Other things:
-Fixed test cases that depends on changes for LOCK_grant
-Added thread_safe_decrement32() and thread_safe_increment32()
-Removed sql_rnd_with_mutex() and get_thread_running()
-In check_table_access() don't lock LOCK_grant if we can resolve the grant with user or db level grants (the normal case).
-Don't use a lock for setting THD->query_id.
-Fixed bug where thd->set_query_id() could be set to same value by multiple threads.

Thanks to Yoshinori Matsunobu for the benchmark of connection speed and to
Domas Mituzas for the inspiration for many of the fixes.


include/violite.h:
  Change desc to a string pointer
mysql-test/suite/perfschema/r/all_instances.result:
  Added new mutex
mysql-test/suite/perfschema/t/func_mutex.test:
  Test for LOCK_system_variables_hash instead of LOCK_grant, as LOCK_grant is not anymore always taken for SELECT's.
mysys/my_gethwaddr.c:
  More DBUG
mysys/my_rnd.c:
  Change my_rnd() slightly to make it safer if two threads use it at the same time.
sql/event_scheduler.cc:
  Changed thread_count to be automically incremented
  Moved some safe things out from LOCK_thread_count.
  Simplify deleting of THD for running thread.
sql/mysqld.cc:
  Changed thread_count to be automically incremented
  Thread cache now uses LOCK_thread_cache instead of LOCK_thread_count
  Added delete_running_thd()
  Moved delete thd out from LOCK_thread_count
  More DBUG
  Only call  mysql_cond_broadcast(&COND_thread_count) if thread_count is 0
  Removed call to getsockname() (old not anymore needed check)
sql/mysqld.h:
  Removed sql_rnd_with_mutex() (not needed anymore)
  Removed not used function get_thread_running()
  Added thread_safe_decrement32() and thread_safe_increment32()
  Simplified dec_thread_running() and inc_thread_running()
  next_query_id() should return the original value for global_query_id, not the next one.
  (Bug introduced with MySQL 5.5 merge).
sql/sql_acl.cc:
  In check_table_access() don't lock LOCK_grant if we can resolve the grant with user or db level grants (the normal case).
sql/sql_class.cc:
  Removed thd_lock_thread_count() and thd_unlock_thread_count()
  Initialize random generator without locks
  Don't use a lock for setting THD->query_id.
  (This is only accessed by thread owning the THD)
sql/sql_class.h:
  Don't use a lock for setting THD->query_id.
sql/sql_insert.cc:
  Changed thread_count to be automically incremented
sql/sql_parse.cc:
  Changed thread_count to be automically incremented
  Fixed bug where thd->set_query_id() could be set to same value by multiple threads.
vio/vio.c:
  Don't generate 'desc' with sprintf/strmov. Assign a pointer instead.
  (Good enough as this is just for debugging)
2013-03-25 11:13:42 +02:00
..
array.c cleanup: remove unused init_dynamic_array and init_dynamic_array2 symbols, 2013-01-23 16:18:53 +01:00
base64.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
ChangeLog
charset-def.c MDEV-419 ensure that all HAVE_XXX constants can be set by cmake 2012-07-31 19:29:07 +02:00
charset.c 5.3 merge 2012-01-13 15:50:02 +01:00
checksum.c mysql-5.5.18 merge 2011-11-03 19:17:05 +01:00
CMakeLists.txt Fix FreeBSD test errors. Also link with libexecinfo on FreeBSD for stacktrace functionality. 2012-05-04 14:02:35 +02:00
default.c cleanup: use MYF() for mysys flags 2013-01-23 16:18:09 +01:00
errors.c Added text for errno in error messages by: 2012-05-30 00:37:55 +03:00
hash.c MDEV-4011 Added per thread memory counting and usage 2013-01-23 16:16:14 +01:00
lf_alloc-pin.c 1. fix an old typo. A purgatory must be cleaned on every LF_PURGATORY_SIZE freeing, 2012-09-04 12:12:28 +02:00
lf_dynarray.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
lf_hash.c MDEV-481 Assertion `pins->pin[i] == 0' failed in _lf_pinbox_put_pins on concurrent OPTIMIZE TABLE and DML with Aria tables 2012-09-04 19:11:06 +02:00
list.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
ma_dyncol.c cleanup: 2013-01-23 16:19:37 +01:00
md5.c rename debug variable to debug_dbug, to make test pass in release builds 2011-12-15 22:07:58 +01:00
mf_arr_appstr.c
mf_cache.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
mf_dirname.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
mf_fn_ext.c Made max_relay_log_size depending on master connection. 2012-10-01 02:30:44 +03:00
mf_format.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
mf_getdate.c Merge with 5.2. 2011-12-11 11:34:44 +02:00
mf_iocache.c mysql-5.5.28 2012-10-16 13:04:42 +02:00
mf_iocache2.c Fixed compiler warning on Mac 2012-09-10 13:53:19 +03:00
mf_keycache.c Merge 5.3 -> 5.5 2012-06-20 15:01:28 +04:00
mf_keycaches.c mysql-5.5.18 merge 2011-11-03 19:17:05 +01:00
mf_loadpath.c 5.3 merge 2012-01-13 15:50:02 +01:00
mf_pack.c 5.3->5.5 merge 2012-11-22 10:19:31 +01:00
mf_path.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
mf_qsort.c
mf_qsort2.c
mf_radix.c MDEV-415: Back-port of the WL task #1393 from the mysql-5.6 code line. 2012-09-01 14:21:59 -07:00
mf_same.c
mf_sort.c MDEV-415: Back-port of the WL task #1393 from the mysql-5.6 code line. 2012-09-01 14:21:59 -07:00
mf_soundex.c Added extra argument to longlong2str() to make it have same prototype is int2str() 2010-08-07 15:27:23 +03:00
mf_tempdir.c cleanup: use MYF() for mysys flags 2013-01-23 16:18:09 +01:00
mf_tempfile.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
mf_unixpath.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
mf_wcomp.c
mulalloc.c
my_access.c Bug #13889741: HANDLE_FATAL_SIGNAL IN _DB_ENTER_ | 2012-07-05 13:41:16 +03:00
my_addr_resolve.c mysql-5.5.22 merge 2012-03-28 01:04:46 +02:00
my_aes.c
my_alarm.c
my_alloc.c MDEV-4011 Added per thread memory counting and usage 2013-01-23 16:16:14 +01:00
my_atomic.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_basename.c - Fix rpl_checksum test. Use basename of file in error messages, not the o 2012-01-20 01:57:58 +01:00
my_bit.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_bitmap.c 5.3 merge 2012-01-13 15:50:02 +01:00
my_chmod.c MDEV-4011 Added per thread memory counting and usage 2013-01-23 16:16:14 +01:00
my_chsize.c MDEV-4011 Added per thread memory counting and usage 2013-01-23 16:16:14 +01:00
my_compare.c Updated/added copyright headers 2012-02-15 17:13:47 +01:00
my_compress.c mysql-5.5.18 merge 2011-11-03 19:17:05 +01:00
my_conio.c
my_context.c MDEV-3830 - fix compilation for Intel compiler, 2012-11-04 22:20:04 +01:00
my_copy.c MDEV-4011 Added per thread memory counting and usage 2013-01-23 16:16:14 +01:00
my_crc32.c
my_create.c MDEV-4011 Added per thread memory counting and usage 2013-01-23 16:16:14 +01:00
my_delete.c MDEV-4011 Added per thread memory counting and usage 2013-01-23 16:16:14 +01:00
my_div.c
my_error.c MDEV-4011 Added per thread memory counting and usage 2013-01-23 16:16:14 +01:00
my_file.c 5.3 merge 2012-01-13 15:50:02 +01:00
my_fopen.c MDEV-4011 Added per thread memory counting and usage 2013-01-23 16:16:14 +01:00
my_fstream.c MDEV-4011 Added per thread memory counting and usage 2013-01-23 16:16:14 +01:00
my_gethwaddr.c Speed up connection time: 2013-03-25 11:13:42 +02:00
my_getncpus.c 5.3 merge 2012-01-13 15:50:02 +01:00
my_getopt.c mysql-5.5.28 2012-10-16 13:04:42 +02:00
my_getpagesize.c
my_getsystime.c Merge of compatibility fixes 2012-04-02 13:33:16 +03:00
my_getwd.c MDEV-4011 Added per thread memory counting and usage 2013-01-23 16:16:14 +01:00
my_init.c fix compile error on unixes 2012-04-15 01:54:28 +02:00
my_largepage.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_lib.c cleanup: use MYF() for mysys flags 2013-01-23 16:18:09 +01:00
my_libwrap.c
my_lock.c MDEV-4011 Added per thread memory counting and usage 2013-01-23 16:16:14 +01:00
my_lockmem.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_malloc.c missing cast added 2013-02-04 11:47:57 +01:00
my_memmem.c
my_mess.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_mkdir.c
my_mmap.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_new.cc 1. support for testing statically built oqgraph 2012-03-30 22:15:44 +02:00
my_once.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_open.c MDEV-4011 Added per thread memory counting and usage 2013-01-23 16:16:14 +01:00
my_port.c Merge with MySQL 5.1.57/58 2011-05-02 20:58:45 +03:00
my_pread.c MDEV-4011 Added per thread memory counting and usage 2013-01-23 16:16:14 +01:00
my_pthread.c MDEV-419 ensure that all HAVE_XXX constants can be set by cmake 2012-07-31 19:29:07 +02:00
my_quick.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_rdtsc.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_read.c MDEV-4011 Added per thread memory counting and usage 2013-01-23 16:16:14 +01:00
my_redel.c 5.5 merge 2013-01-29 15:10:47 +01:00
my_rename.c MDEV-4011 Added per thread memory counting and usage 2013-01-23 16:16:14 +01:00
my_rnd.c Speed up connection time: 2013-03-25 11:13:42 +02:00
my_safehash.c use PSI wrappers in aria and other non-MySQL code 2011-07-13 21:10:18 +02:00
my_safehash.h use PSI wrappers in aria and other non-MySQL code 2011-07-13 21:10:18 +02:00
my_seek.c MDEV-4011 Added per thread memory counting and usage 2013-01-23 16:16:14 +01:00
my_sleep.c mysql-5.5.18 merge 2011-11-03 19:17:05 +01:00
my_static.c debug_sync is now a service, available to dynamically loaded plugins. 2012-03-28 19:26:00 +02:00
my_static.h mysql-5.5.18 merge 2011-11-03 19:17:05 +01:00
my_symlink.c mysql-5.1.62 merge 2012-04-05 10:49:38 +02:00
my_symlink2.c Fix for: LP #634955: Assert in _ma_update_at_original_place() 2010-11-02 17:22:57 +02:00
my_sync.c MDEV-4011 Added per thread memory counting and usage 2013-01-23 16:16:14 +01:00
my_thr_init.c MDEV-4011 Added per thread memory counting and usage 2013-01-23 16:16:14 +01:00
my_timer_cycles.il Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_uuid.c merge with 5.3 2011-10-19 21:45:18 +02:00
my_wincond.c Merge with 5.2. 2011-12-11 11:34:44 +02:00
my_windac.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_winerr.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_winfile.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_winthread.c monty's cleanup of my_thr_init.c 2012-03-13 13:29:44 +01:00
my_write.c MDEV-4011 Added per thread memory counting and usage 2013-01-23 16:16:14 +01:00
mysys_priv.h cleanup: 2013-01-23 16:20:39 +01:00
ptr_cmp.c Small Windows specific performance fixes: 2012-03-25 19:27:24 +02:00
queues.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
rijndael.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
safemalloc.c cleanup: 2013-01-23 16:20:39 +01:00
sha1.c Bug #56427 : Replace copyright notice removed from SHA1 code 2010-10-05 17:03:04 +03:00
stacktrace.c do not print return address when callstack is output on Windows, it does not provide any useful info 2012-10-18 11:30:29 +02:00
string.c backport to 5.5 dyncol changes and names support 2012-12-23 20:57:54 +02:00
test_charset.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
test_dir.c
test_thr_mutex.c
test_xml.c
testhash.c Updated/added copyright headers 2011-06-30 17:46:53 +02:00
thr_alarm.c Update copyright notices 2012-02-28 18:53:05 +01:00
thr_lock.c 5.3 merge 2012-03-28 20:25:31 +02:00
thr_mutex.c MDEV-419 ensure that all HAVE_XXX constants can be set by cmake 2012-07-31 19:29:07 +02:00
thr_rwlock.c mysql-5.5.18 merge 2011-11-03 19:17:05 +01:00
tree.c cleanup: use MYF() for mysys flags 2013-01-23 16:18:09 +01:00
typelib.c MDEV-69 SET optimizer_switch = REPLACE(...) causes ER_WRONG_VALUE_FOR_VAR 2012-01-17 10:55:27 +01:00
waiting_threads.c cleanup: use MYF() for mysys flags 2013-01-23 16:18:09 +01:00
wqueue.c fix the include guards and add missing gplv2 headers 2012-02-17 12:19:38 +01:00