mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 23:04:20 +01:00
e76b873f24
------------------------------------------------------------------------ r4670 | vasil | 2009-04-07 09:35:23 +0300 (Tue, 07 Apr 2009) | 11 lines branches/zip: Fix Bug#43660 SHOW INDEXES/ANALYZE does NOT update cardinality for indexes of InnoDB table by replacing the pseudo random number generator with a better one (LCG). This also fixes Mantis Issue#212. Approved by: Heikki (rb://110) ------------------------------------------------------------------------ r4671 | vasil | 2009-04-07 09:37:31 +0300 (Tue, 07 Apr 2009) | 4 lines branches/zip: Add ChangeLog entry for r4670. ------------------------------------------------------------------------ r4673 | marko | 2009-04-07 15:45:28 +0300 (Tue, 07 Apr 2009) | 4 lines branches/zip: Allow in-place updates of UTF-8 CHAR columns from or to NULL in ROW_FORMAT=REDUNDANT. (Bug #44032) rb://107 approved by Heikki Tuuri. ------------------------------------------------------------------------ r4677 | marko | 2009-04-07 16:19:31 +0300 (Tue, 07 Apr 2009) | 1 line branches/zip: Adjust r4673 as in the merge to branches/6.0 -r4676. ------------------------------------------------------------------------ r4678 | inaam | 2009-04-07 18:45:37 +0300 (Tue, 07 Apr 2009) | 12 lines branches/zip Enable atomics on solaris (using the libc functions as defined in atomic.h) if GCC atomic builtins are not present. There still remains some work to be done (by Vasil?). This patch makes changes to plug.in to check pthread_t size and presence of atomic functions when running on solaris. The same has to become a part of the generated Makefile.in when we bake our source. Reviewed by: Heikki rb://106 ------------------------------------------------------------------------ r4687 | vasil | 2009-04-08 13:08:59 +0300 (Wed, 08 Apr 2009) | 4 lines branches/zip: Whitespace fixup in the ChangeLog ------------------------------------------------------------------------ r4688 | vasil | 2009-04-08 13:11:15 +0300 (Wed, 08 Apr 2009) | 4 lines branches/zip: Add ChangeLog entry for r4678. ------------------------------------------------------------------------ r4689 | marko | 2009-04-08 14:24:49 +0300 (Wed, 08 Apr 2009) | 5 lines branches/zip: Hide unnecessarily visible globals. dict_ind_redundant, dict_ind_compact: Declare these UNIV_INTERN. innodb_hton_ptr: Declare static. We do not attempt to access the built-in InnoDB any more. trx_roll_savepoints_free(): Declare UNIV_INTERN. ------------------------------------------------------------------------ r4700 | calvin | 2009-04-11 00:37:10 +0300 (Sat, 11 Apr 2009) | 9 lines branches/zip: Rewrite CMakeLists.txt CMakeLists.txt is completely rewritten: - To replace the one written by mysql - Print out some useful information, such as system name, directory, generator used, win64, Microsoft compiler, etc. - Remove one workaround for mysqld.lib location. User does not need to specify a build type ------------------------------------------------------------------------ r4702 | calvin | 2009-04-13 18:16:44 +0300 (Mon, 13 Apr 2009) | 3 lines branches/zip: delete the original CMakeLists.txt A new version will be committed, suggested by Ken. ------------------------------------------------------------------------ r4703 | calvin | 2009-04-13 18:20:45 +0300 (Mon, 13 Apr 2009) | 9 lines branches/zip: new CMakeLists.txt CMakeLists.txt is completely rewritten with enhancements: - Print out useful information, such as system name, directory, generator used, win64, Microsoft compiler, etc. - Remove one workaround for mysqld.lib location. User does not need to specify a build type when invoking MSVC generator. ------------------------------------------------------------------------ r4706 | vasil | 2009-04-14 14:32:11 +0300 (Tue, 14 Apr 2009) | 5 lines branches/zip: When using the random function, first take the modulus by the number of pages and then typecast to ulint. ------------------------------------------------------------------------ r4707 | calvin | 2009-04-14 17:47:31 +0300 (Tue, 14 Apr 2009) | 13 lines branches/zip: remove statically linked libraries from mysql To make zlib and strings dynamically linked; mysqld will export additional functions required by InnoDB. Since the symbols will be resolved dynamically during runtime, wdl_load_mapfile() is no longer able to make any function calls to ones in mysqld. As the result, strtoull() (from strings.lib) is replaced with _strtoui64(). rb://111 Approved by: Marko ------------------------------------------------------------------------ r4712 | vasil | 2009-04-15 12:26:32 +0300 (Wed, 15 Apr 2009) | 157 lines branches/zip: Merge revisions 4481:4710 from branches/5.1: (resolving conflict in r4574, r4575 and skipping r4699 and r4705 because analogous changes to r4699 and r4705 were already made to branches/zip) ------------------------------------------------------------------------ r4573 | vasil | 2009-03-30 14:17:13 +0300 (Mon, 30 Mar 2009) | 4 lines Changed paths: M /branches/5.1/mysql-test/innodb.test branches/5.1: Fix email address from dev@innodb.com to innodb_dev_ww@oracle.com ------------------------------------------------------------------------ r4574 | vasil | 2009-03-30 14:27:08 +0300 (Mon, 30 Mar 2009) | 38 lines Changed paths: M /branches/5.1/Makefile.am M /branches/5.1/mysql-test/innodb.test branches/5.1: Restore the state of INNODB_THREAD_CONCURRENCY to silence this warning: TEST RESULT TIME (ms) ------------------------------------------------------------ worker[1] Using MTR_BUILD_THREAD 250, with reserved ports 12500..12509 main.innodb [ pass ] 8803 MTR's internal check of the test case 'main.innodb' failed. This means that the test case does not preserve the state that existed before the test case was executed. Most likely the test case did not do a proper clean-up. This is the diff of the states of the servers before and after the test case was executed: mysqltest: Logging to '/tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.log'. mysqltest: Results saved in '/tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.result'. mysqltest: Connecting to server localhost:12500 (socket /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/mysqld.1.sock) as 'root', connection 'default', attempt 0 ... mysqltest: ... Connected. mysqltest: Start processing test commands from './include/check-testcase.test' ... mysqltest: ... Done processing test commands. --- /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.result 2009-03-30 14:12:31.000000000 +0300 +++ /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.reject 2009-03-30 14:12:41.000000000 +0300 @@ -99,7 +99,7 @@ INNODB_SUPPORT_XA ON INNODB_SYNC_SPIN_LOOPS 20 INNODB_TABLE_LOCKS ON -INNODB_THREAD_CONCURRENCY 8 +INNODB_THREAD_CONCURRENCY 16 INNODB_THREAD_SLEEP_DELAY 10000 INSERT_ID 0 INTERACTIVE_TIMEOUT 28800 mysqltest: Result content mismatch not ok ------------------------------------------------------------------------ r4575 | vasil | 2009-03-30 15:55:31 +0300 (Mon, 30 Mar 2009) | 8 lines Changed paths: M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Fix Bug#43309 Test main.innodb can't be run twice Make the innodb mysql-test more flexible by inspecting how much a variable of interest has changed since the start of the test. Do not assume the variables have zero values at the start of the test. ------------------------------------------------------------------------ r4576 | vasil | 2009-03-30 16:25:10 +0300 (Mon, 30 Mar 2009) | 4 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Revert a change to Makefile.am that I committed accidentally in c4574. ------------------------------------------------------------------------ r4659 | vasil | 2009-04-06 15:34:51 +0300 (Mon, 06 Apr 2009) | 6 lines Changed paths: M /branches/5.1/mysql-test/innodb.test branches/5.1: Followup to r4575 and the fix of Bug#43309 Test main.innodb can't be run twice: Add an explanatory comment, as suggested by Patrick Crews in the bug report. ------------------------------------------------------------------------ r4699 | vasil | 2009-04-09 14:01:52 +0300 (Thu, 09 Apr 2009) | 15 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/srv0srv.h M /branches/5.1/page/page0cur.c M /branches/5.1/srv/srv0srv.c branches/5.1: Fix Bug#43660 SHOW INDEXES/ANALYZE does NOT update cardinality for indexes of InnoDB table by replacing the PRNG that is used to pick random pages with a better one. This is based on r4670 but also adds a new configuration option and enables the fix only if this option is changed. Please skip the present revision when merging. Approved by: Heikki (via email) ------------------------------------------------------------------------ r4705 | vasil | 2009-04-14 14:30:13 +0300 (Tue, 14 Apr 2009) | 5 lines Changed paths: M /branches/5.1/page/page0cur.c branches/5.1: When using the random function, first take the modulus by the number of pages and then typecast to ulint. ------------------------------------------------------------------------ r4710 | vasil | 2009-04-15 11:55:18 +0300 (Wed, 15 Apr 2009) | 25 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Merge a change from MySQL (looks like this is against 5.0 but they later merged it to 5.1): ------------------------------------------------------------ revno: 1810.3846.1 committer: Alexey Botchkov <holyfoot@mysql.com> branch nick: 31435 timestamp: Tue 2008-11-11 14:42:32 +0400 message: Bug#31435 ha_innodb.cc:3983: ulint convert_search_mode_to_innobase(ha_rkey_function): Asse I think we don't need to issue an error statement in the convert_search_mode_to_innobase(). Returning the PAGE_CUR_UNSUPP value is enough as allows to handle this case depending on the requirements. per-file comments: sql/ha_innodb.cc Bug#31435 ha_innodb.cc:3983: ulint convert_search_mode_to_innobase(ha_rkey_function): Asse no error issued in convert_search_mode_to_innobase. ha_innobase::records_in_range() returns HA_POS_ERROR if search mode isn't supported. modified: sql/ha_innodb.cc ------------------------------------------------------------------------ ------------------------------------------------------------------------ r4713 | vasil | 2009-04-15 12:36:16 +0300 (Wed, 15 Apr 2009) | 4 lines branches/zip: Add missing ChangeLog entries ------------------------------------------------------------------------ r4714 | vasil | 2009-04-15 12:36:57 +0300 (Wed, 15 Apr 2009) | 4 lines branches/zip: Fix typo in the ChangeLog ------------------------------------------------------------------------ r4715 | vasil | 2009-04-15 12:39:04 +0300 (Wed, 15 Apr 2009) | 4 lines branches/zip: Whitespace cleanup in ChangeLog ------------------------------------------------------------------------ r4716 | vasil | 2009-04-15 21:36:06 +0300 (Wed, 15 Apr 2009) | 4 lines branches/zip: Add ChangeLog entry for r4543. ------------------------------------------------------------------------ r4717 | calvin | 2009-04-16 01:22:35 +0300 (Thu, 16 Apr 2009) | 18 lines branches/zip: Use the Windows Interlocked functions for atomic memory access Mapping the atomic operations to Windows Interlocked functions: os_compare_and_swap_* to InterlockedCompareExchange(64) os_atomic_increment_* to InterlockedExchangeAdd(64) os_atomic_test_and_set_byte to InterlockedExchange In this patch, the legacy code under UNIV_CAN_USE_X86_ASSEMBLER is removed all together, and add HAVE_WINDOWS_ATOMICS and INNODB_RW_LOCKS_USE_ATOMICS to CMakeLists.txt This is to address mantis issue#194. rb://113 Approved by: Marko ------------------------------------------------------------------------ r4720 | vasil | 2009-04-16 09:44:48 +0300 (Thu, 16 Apr 2009) | 4 lines branches/zip: Add ChangeLog entry for r4717. ------------------------------------------------------------------------ r4721 | marko | 2009-04-16 10:32:09 +0300 (Thu, 16 Apr 2009) | 2 lines branches/zip: row_scan_and_check_index(): Initialize prebuilt->index_usable. This should have been done in r4631. Spotted by Michael. ------------------------------------------------------------------------ r4728 | marko | 2009-04-16 16:02:27 +0300 (Thu, 16 Apr 2009) | 3 lines branches/zip: univ.i: Define REFMAN as the base URL of the MySQL Reference Manual and use it in every string. This fixes Issue #221. ------------------------------------------------------------------------ r4733 | calvin | 2009-04-17 08:13:20 +0300 (Fri, 17 Apr 2009) | 6 lines branches/zip: minor changes to CMakeLists.txt All are non-functional changes: - should check for long (not int), spotted by Sunny - comment out the project definition, avoiding to generate another .sln file. ------------------------------------------------------------------------ r4748 | vasil | 2009-04-18 00:50:09 +0300 (Sat, 18 Apr 2009) | 118 lines branches/zip: Merge revisions 4710:4746 from branches/5.1: ------------------------------------------------------------------------ r4746 | vasil | 2009-04-18 00:32:08 +0300 (Sat, 18 Apr 2009) | 110 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/pars0pars.h branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2728.10.2 committer: Ignacio Galarza <iggy@mysql.com> branch nick: mysql-5.1-bugteam-bug29125 timestamp: Fri 2009-02-13 11:41:47 -0500 message: Bug#29125 Windows Server X64: so many compiler warnings - Remove bothersome warning messages. This change focuses on the warnings that are covered by the ignore file: support-files/compiler_warnings.supp. - Strings are guaranteed to be max uint in length modified: client/mysql_upgrade.c client/mysqladmin.cc client/mysqlbinlog.cc client/mysqlcheck.c client/mysqldump.c client/mysqlslap.c client/mysqltest.cc client/sql_string.cc extra/comp_err.c extra/yassl/src/buffer.cpp extra/yassl/taocrypt/include/block.hpp extra/yassl/taocrypt/src/algebra.cpp extra/yassl/taocrypt/src/asn.cpp include/config-win.h libmysql/libmysql.c mysys/array.c mysys/base64.c mysys/charset.c mysys/checksum.c mysys/default.c mysys/default_modify.c mysys/hash.c mysys/mf_keycache.c mysys/mf_tempdir.c mysys/my_append.c mysys/my_compress.c mysys/my_conio.c mysys/my_copy.c mysys/my_getwd.c mysys/my_pread.c mysys/my_quick.c mysys/my_read.c mysys/safemalloc.c mysys/string.c server-tools/instance-manager/buffer.cc server-tools/instance-manager/instance.cc server-tools/instance-manager/options.cc server-tools/instance-manager/parse.h sql-common/client.c sql-common/my_user.c sql/event_data_objects.cc sql/event_parse_data.cc sql/events.cc sql/gen_lex_hash.cc sql/item.h sql/item_func.cc sql/item_strfunc.cc sql/item_timefunc.cc sql/lock.cc sql/log_event.cc sql/log_event.h sql/log_event_old.cc sql/net_serv.cc sql/sp_head.h sql/spatial.h sql/sql_class.h sql/sql_connect.cc sql/sql_crypt.cc sql/sql_error.cc sql/sql_insert.cc sql/sql_lex.cc sql/sql_lex.h sql/sql_load.cc sql/sql_prepare.cc sql/sql_profile.cc sql/sql_repl.cc sql/sql_servers.cc sql/sql_string.cc sql/sql_table.cc sql/sql_trigger.cc sql/sql_udf.cc sql/sql_view.cc sql/udf_example.c sql/uniques.cc storage/archive/azio.c storage/archive/azlib.h storage/csv/ha_tina.cc storage/csv/ha_tina.h storage/csv/transparent_file.h storage/federated/ha_federated.cc storage/federated/ha_federated.h storage/heap/hp_write.c storage/innobase/handler/ha_innodb.cc storage/innobase/include/pars0pars.h storage/myisam/ha_myisam.cc storage/myisam/mi_check.c storage/myisam/mi_packrec.c storage/myisam/mi_search.c storage/myisam/rt_index.c storage/myisammrg/ha_myisammrg.cc strings/ctype.c strings/my_vsnprintf.c tests/bug25714.c tests/mysql_client_test.c ------------------------------------------------------------------------ r4749 | vasil | 2009-04-18 00:58:08 +0300 (Sat, 18 Apr 2009) | 4 lines branches/zip: Add ChangeLog entry for t4748. ------------------------------------------------------------------------ r4751 | vasil | 2009-04-18 01:29:16 +0300 (Sat, 18 Apr 2009) | 4 lines branches/zip: Silence warning about unused variables. ------------------------------------------------------------------------ r4752 | vasil | 2009-04-18 01:30:37 +0300 (Sat, 18 Apr 2009) | 4 lines branches/zip: Include the needed header for memset(). ------------------------------------------------------------------------ r4753 | vasil | 2009-04-18 01:31:34 +0300 (Sat, 18 Apr 2009) | 4 lines branches/zip: Silence a compiler warning. ------------------------------------------------------------------------ r4756 | vasil | 2009-04-18 02:19:03 +0300 (Sat, 18 Apr 2009) | 5 lines branches/zip: Rename the aux config program and give it a more specific name because more are coming. ------------------------------------------------------------------------ r4757 | vasil | 2009-04-18 02:22:33 +0300 (Sat, 18 Apr 2009) | 4 lines branches/zip: Add comment and copyright notice to the aux config program. ------------------------------------------------------------------------ r4758 | vasil | 2009-04-18 02:40:47 +0300 (Sat, 18 Apr 2009) | 5 lines branches/zip: Add aux config programs to emulate the newly added checks in plug.in (from r4678). ------------------------------------------------------------------------ r4830 | marko | 2009-04-20 16:11:38 +0300 (Mon, 20 Apr 2009) | 6 lines branches/zip: Cosmetic fixes. row_unlock_for_mysql(): Add a const qualifier to read-only rec_t*. Use dict_index_is_clust(). CMakeLists.txt: svn propset svn:eol-style native. ------------------------------------------------------------------------ r4893 | marko | 2009-04-23 09:32:36 +0300 (Thu, 23 Apr 2009) | 11 lines branches/zip: Introduce the logical type names trx_id_t, roll_ptr_t, and undo_no_t. Each type is still defined as dulint. This is an initial step towards replacing dulint with a 64-bit data type. Because modern compilers have no trouble supporting 64-bit arithmetics even on 32-bit targets, the dulint struct is a relic that should go. The last remaining major use of dulint is dictionary IDs (table, index, and row ids). rb://114 approved by Sunny Bains ------------------------------------------------------------------------ r4894 | marko | 2009-04-23 10:21:07 +0300 (Thu, 23 Apr 2009) | 1 line branches/zip: ChangeLog: Document r4893. ------------------------------------------------------------------------ r4895 | marko | 2009-04-23 10:22:06 +0300 (Thu, 23 Apr 2009) | 1 line branches/zip: ChangeLog: Add the missing include/ to two files. ------------------------------------------------------------------------ r4896 | marko | 2009-04-23 10:37:40 +0300 (Thu, 23 Apr 2009) | 4 lines branches/zip: row_scan_and_check_index(): Improve the diagnostics, by reporting errors from row_search_for_mysql() in the error log. The errors will still be ignored by CHECK TABLE. This is somewhat related to Issue #211. ------------------------------------------------------------------------ r4897 | marko | 2009-04-23 10:40:34 +0300 (Thu, 23 Apr 2009) | 2 lines branches/zip: row_scan_and_check_index(): Check row_merge_is_index_usable() earlier, to make the logic clearer. ------------------------------------------------------------------------ r4898 | marko | 2009-04-23 15:15:07 +0300 (Thu, 23 Apr 2009) | 4 lines branches/zip: Correct a misleading comment. PAGE_MAX_TRX_ID will be updated in ibuf_insert_low() and updated from the insert buffer tree page to the secondary index tree page during the insert buffer merge. ------------------------------------------------------------------------ r4915 | marko | 2009-04-27 13:40:20 +0300 (Mon, 27 Apr 2009) | 2 lines branches/zip: row_scan_and_check_index(): Add some comments on prebuilt->index_usable, as suggested by Michael. ------------------------------------------------------------------------ r4921 | marko | 2009-04-29 11:51:25 +0300 (Wed, 29 Apr 2009) | 2 lines branches/zip: btr_cur_optimistic_insert(): Remove a redundant condition. The insert buffer tree is a clustered index. ------------------------------------------------------------------------ r4922 | marko | 2009-04-29 23:23:27 +0300 (Wed, 29 Apr 2009) | 22 lines branches/zip: Distinguish temporary tables in MLOG_FILE_CREATE. This addresses Mantis Issue #23 in InnoDB Hot Backup and some of MySQL Bug #41609. In MLOG_FILE_CREATE, we need to distinguish temporary tables, so that InnoDB Hot Backup can work correctly. It turns out that we can do this easily, by using a bit of the previously unused parameter for page number. (The page number parameter of MLOG_FILE_CREATE has been written as 0 ever since MySQL 4.1, which introduced MLOG_FILE_CREATE.) MLOG_FILE_FLAG_TEMP: A flag for indicating a temporary table in the page number parameter of MLOG_FILE_ operations. fil_op_write_log(): Add the parameter log_flags. fil_op_log_parse_or_replay(): Add the parameter log_flags. Do not replay MLOG_FILE_CREATE when MLOG_FILE_FLAG_TEMP is set in log_flags. This only affects ibbackup --apply-log. InnoDB itself never replays file operations. rb://117 approved by Heikki Tuuri ------------------------------------------------------------------------ r4977 | marko | 2009-05-13 15:49:38 +0300 (Wed, 13 May 2009) | 12 lines branches/zip: Merge revisions 4746:4976 from branches/5.1: ------------------------------------------------------------------------ r4976 | marko | 2009-05-13 15:44:54 +0300 (Wed, 13 May 2009) | 6 lines branches/5.1: Display DB_ROLL_PTR in the COLUMNS section of the innodb_table_monitor output. It was accidentally omitted due to an off-by-one loop condition. (Bug #44320) rb://116 approved by Heikki Tuuri ------------------------------------------------------------------------ ------------------------------------------------------------------------ r4978 | vasil | 2009-05-13 16:21:55 +0300 (Wed, 13 May 2009) | 4 lines branches/zip: Add ChangeLog entry for r4977. ------------------------------------------------------------------------ r4995 | marko | 2009-05-14 15:31:43 +0300 (Thu, 14 May 2009) | 24 lines branches/zip: Merge revisions 4976:4994 from branches/5.1: ------------------------------------------------------------------------ r4994 | marko | 2009-05-14 15:04:55 +0300 (Thu, 14 May 2009) | 18 lines branches/5.1: Prevent a race condition in innobase_commit() by ensuring that innodb_commit_concurrency>0 remains constant at run time. (Bug #42101) srv_commit_concurrency: Make this a static variable in ha_innodb.cc. innobase_commit_concurrency_validate(): Check that innodb_commit_concurrency is not changed from or to 0 at run time. This is needed, because innobase_commit() assumes that innodb_commit_concurrency>0 remains constant. Without this limitation, the checks for innodb_commit_concurrency>0 in innobase_commit() should be removed and that function would have to acquire and release commit_cond_m at least twice per invocation. Normally, innodb_commit_concurrency=0, and introducing the mutex operations would mean significant overhead. innodb_bug42101.test, innodb_bug42101-nonzero.test: Test cases. rb://123 approved by Heikki Tuuri ------------------------------------------------------------------------ ------------------------------------------------------------------------ r5000 | vasil | 2009-05-14 20:13:41 +0300 (Thu, 14 May 2009) | 4 lines branches/zip: Add ChangeLog entry for r4994. ------------------------------------------------------------------------ r5026 | marko | 2009-05-18 16:29:51 +0300 (Mon, 18 May 2009) | 1 line branches/zip: buf_validate(): Add missing out: comment. ------------------------------------------------------------------------ r5027 | marko | 2009-05-18 16:36:10 +0300 (Mon, 18 May 2009) | 1 line branches/zip: Add some missing out: comments to buf0buf.h, buf0buf.c. ------------------------------------------------------------------------ r5028 | marko | 2009-05-18 16:40:07 +0300 (Mon, 18 May 2009) | 11 lines branches/zip: When executing an optimistic update by delete-and-insert, correctly estimate the free space on the compressed page by page_zip_available(..., create=TRUE). This was reported as Issue #231. btr_cur_update_alloc_zip(): Add the parameter ibool create and pass it to page_zip_available(). The parameter was previously passed as 0. btr_cur_optimistic_update(): Pass create=TRUE to btr_cur_update_alloc_zip(). rb://120 approved by Heikki Tuuri ------------------------------------------------------------------------ r5030 | marko | 2009-05-19 10:04:04 +0300 (Tue, 19 May 2009) | 2 lines branches/zip: os_thread_get_curr_id(), os_thread_get_curr(): Add missing out: comments. ------------------------------------------------------------------------ r5031 | marko | 2009-05-19 10:30:02 +0300 (Tue, 19 May 2009) | 1 line branches/zip: Add missing out: comments to nullary functions. ------------------------------------------------------------------------ r5033 | marko | 2009-05-19 11:00:51 +0300 (Tue, 19 May 2009) | 1 line branches/zip: Remove bogus out: comments of functions returning void. ------------------------------------------------------------------------ r5034 | marko | 2009-05-19 12:41:32 +0300 (Tue, 19 May 2009) | 1 line branches/zip: row_update_prebuilt_trx(): Correct bogus comment. ------------------------------------------------------------------------ r5035 | marko | 2009-05-19 13:04:58 +0300 (Tue, 19 May 2009) | 3 lines branches/zip: ut0auxconf_have_solaris_atomics.c: Get the function declarations from <atomic.h>. Call the functions with proper arguments. ------------------------------------------------------------------------ r5036 | marko | 2009-05-19 13:05:50 +0300 (Tue, 19 May 2009) | 1 line branches/zip: Add proper comments to some file page accessors. ------------------------------------------------------------------------ r5037 | marko | 2009-05-19 13:08:16 +0300 (Tue, 19 May 2009) | 1 line branches/zip: Fix a typo that was introduced in r5036. ------------------------------------------------------------------------ r5038 | marko | 2009-05-19 22:59:07 +0300 (Tue, 19 May 2009) | 30 lines branches/zip: Write PAGE_MAX_TRX_ID to the redo log. Otherwise, transactions that are started before the rollback of incomplete transactions has finished may have an inconsistent view of the secondary indexes. dict_index_is_sec_or_ibuf(): Auxiliary function for controlling updates and checks of PAGE_MAX_TRX_ID: check whether an index is a secondary index or the insert buffer tree. page_set_max_trx_id(), page_update_max_trx_id(), lock_rec_insert_check_and_lock(), lock_sec_rec_modify_check_and_lock(), btr_cur_ins_lock_and_undo(), btr_cur_upd_lock_and_undo(): Add the parameter mtr. page_set_max_trx_id(): Allow mtr to be NULL. When mtr==NULL, do not attempt to write to the redo log. This only occurs when creating a page or reorganizing a compressed page. In these cases, the PAGE_MAX_TRX_ID will be set correctly during the application of redo log records, even though there is no explicit log record about it. btr_discard_only_page_on_level(): Preserve PAGE_MAX_TRX_ID. This function should be unreachable, though. btr_cur_pessimistic_update(): Update PAGE_MAX_TRX_ID. Add some assertions for checking that PAGE_MAX_TRX_ID is set on all secondary index leaf pages. rb://115 tested by Michael, fixes Issue #211 ------------------------------------------------------------------------ r5039 | marko | 2009-05-19 23:13:12 +0300 (Tue, 19 May 2009) | 1 line branches/zip: ib_wqueue_wait(): Add decorative comment. ------------------------------------------------------------------------ r5041 | marko | 2009-05-20 08:42:12 +0300 (Wed, 20 May 2009) | 1 line branches/zip: Add missing function comments. ------------------------------------------------------------------------ r5042 | marko | 2009-05-20 08:46:01 +0300 (Wed, 20 May 2009) | 1 line branches/zip: sync0rw.ic: Remove an extra ; that was added in r5041. ------------------------------------------------------------------------ r5044 | marko | 2009-05-20 11:11:58 +0300 (Wed, 20 May 2009) | 2 lines branches/zip: mlog_parse_index(): Correct a parameter comment and add a const qualifier that was missing. ------------------------------------------------------------------------ r5045 | marko | 2009-05-20 11:37:08 +0300 (Wed, 20 May 2009) | 1 line branches/zip: fil0fil.c: Correct some comments. ------------------------------------------------------------------------ r5046 | marko | 2009-05-20 12:19:40 +0300 (Wed, 20 May 2009) | 1 line branches/zip: Fix some function comments. ------------------------------------------------------------------------ r5047 | marko | 2009-05-20 12:26:49 +0300 (Wed, 20 May 2009) | 1 line branches/zip: ut_snprintf(): Fix the function comments. ------------------------------------------------------------------------ r5048 | marko | 2009-05-20 12:28:44 +0300 (Wed, 20 May 2009) | 3 lines branches/zip: inno_bcmp(): Remove this memcmp replacement. srv0start.c does not (any longer) call memcmp. srv_parse_megabytes(): Add a function comment. ------------------------------------------------------------------------ r5052 | marko | 2009-05-20 12:32:37 +0300 (Wed, 20 May 2009) | 1 line branches/zip: ib_vector_is_empty(): Fix the function comment. ------------------------------------------------------------------------ r5054 | marko | 2009-05-20 12:35:33 +0300 (Wed, 20 May 2009) | 1 line branches/zip: page_cur_lcg_prng(): Add missing parameter list. ------------------------------------------------------------------------ r5057 | marko | 2009-05-20 12:45:17 +0300 (Wed, 20 May 2009) | 1 line branches/zip: Remove bogus in: comments from struct members. ------------------------------------------------------------------------ r5058 | marko | 2009-05-20 13:06:03 +0300 (Wed, 20 May 2009) | 1 line branches/zip: Clean up some function comments. ------------------------------------------------------------------------ r5060 | marko | 2009-05-20 14:06:59 +0300 (Wed, 20 May 2009) | 1 line branches/zip: Clean up some comments. ------------------------------------------------------------------------ r5061 | marko | 2009-05-20 14:07:49 +0300 (Wed, 20 May 2009) | 2 lines branches/zip: innodb_export_status(): Remove the return(0), now that the function was declared void in r5060. ------------------------------------------------------------------------ r5062 | marko | 2009-05-20 14:45:03 +0300 (Wed, 20 May 2009) | 1 line branches/zip: ha_innodb.cc: Clean up some comments. ------------------------------------------------------------------------ r5063 | marko | 2009-05-20 16:10:17 +0300 (Wed, 20 May 2009) | 1 line branches/zip: ut_dulint_sort(): Write proper comments. ------------------------------------------------------------------------ r5064 | marko | 2009-05-20 16:17:26 +0300 (Wed, 20 May 2009) | 2 lines branches/zip: innobase_end(), innobase_flush_logs(): Document the function parameters. ------------------------------------------------------------------------ r5065 | marko | 2009-05-20 23:17:43 +0300 (Wed, 20 May 2009) | 1 line branches/zip: ha_innodb.cc: Add some missing function comments. ------------------------------------------------------------------------ r5066 | marko | 2009-05-21 00:51:23 +0300 (Thu, 21 May 2009) | 2 lines branches/zip: Fix some function comments. ------------------------------------------------------------------------ r5070 | vasil | 2009-05-21 08:27:00 +0300 (Thu, 21 May 2009) | 4 lines branches/zip: Whitespace fixup. ------------------------------------------------------------------------
576 lines
19 KiB
C
576 lines
19 KiB
C
/*****************************************************************************
|
|
|
|
Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved.
|
|
Copyright (c) 2008, Google Inc.
|
|
|
|
Portions of this file contain modifications contributed and copyrighted by
|
|
Google, Inc. Those modifications are gratefully acknowledged and are described
|
|
briefly in the InnoDB documentation. The contributions by Google are
|
|
incorporated with their permission, and subject to the conditions contained in
|
|
the file COPYING.Google.
|
|
|
|
This program is free software; you can redistribute it and/or modify it under
|
|
the terms of the GNU General Public License as published by the Free Software
|
|
Foundation; version 2 of the License.
|
|
|
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License along with
|
|
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
|
Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*****************************************************************************/
|
|
|
|
/******************************************************
|
|
Mutex, the basic synchronization primitive
|
|
|
|
Created 9/5/1995 Heikki Tuuri
|
|
*******************************************************/
|
|
|
|
#ifndef sync0sync_h
|
|
#define sync0sync_h
|
|
|
|
#include "univ.i"
|
|
#include "sync0types.h"
|
|
#include "ut0lst.h"
|
|
#include "ut0mem.h"
|
|
#include "os0thread.h"
|
|
#include "os0sync.h"
|
|
#include "sync0arr.h"
|
|
|
|
extern my_bool timed_mutexes;
|
|
|
|
#ifdef HAVE_WINDOWS_ATOMICS
|
|
typedef LONG lock_word_t; /* On Windows, InterlockedExchange operates
|
|
on LONG variable */
|
|
#else
|
|
typedef byte lock_word_t;
|
|
#endif
|
|
|
|
/**********************************************************************
|
|
Initializes the synchronization data structures. */
|
|
UNIV_INTERN
|
|
void
|
|
sync_init(void);
|
|
/*===========*/
|
|
/**********************************************************************
|
|
Frees the resources in synchronization data structures. */
|
|
UNIV_INTERN
|
|
void
|
|
sync_close(void);
|
|
/*===========*/
|
|
/**********************************************************************
|
|
Creates, or rather, initializes a mutex object to a specified memory
|
|
location (which must be appropriately aligned). The mutex is initialized
|
|
in the reset state. Explicit freeing of the mutex with mutex_free is
|
|
necessary only if the memory block containing it is freed. */
|
|
|
|
#ifdef UNIV_DEBUG
|
|
# ifdef UNIV_SYNC_DEBUG
|
|
# define mutex_create(M, level) \
|
|
mutex_create_func((M), #M, (level), __FILE__, __LINE__)
|
|
# else
|
|
# define mutex_create(M, level) \
|
|
mutex_create_func((M), #M, __FILE__, __LINE__)
|
|
# endif
|
|
#else
|
|
# define mutex_create(M, level) \
|
|
mutex_create_func((M), __FILE__, __LINE__)
|
|
#endif
|
|
|
|
/**********************************************************************
|
|
Creates, or rather, initializes a mutex object in a specified memory
|
|
location (which must be appropriately aligned). The mutex is initialized
|
|
in the reset state. Explicit freeing of the mutex with mutex_free is
|
|
necessary only if the memory block containing it is freed. */
|
|
UNIV_INTERN
|
|
void
|
|
mutex_create_func(
|
|
/*==============*/
|
|
mutex_t* mutex, /* in: pointer to memory */
|
|
#ifdef UNIV_DEBUG
|
|
const char* cmutex_name, /* in: mutex name */
|
|
# ifdef UNIV_SYNC_DEBUG
|
|
ulint level, /* in: level */
|
|
# endif /* UNIV_SYNC_DEBUG */
|
|
#endif /* UNIV_DEBUG */
|
|
const char* cfile_name, /* in: file name where created */
|
|
ulint cline); /* in: file line where created */
|
|
|
|
#undef mutex_free /* Fix for MacOS X */
|
|
|
|
/**********************************************************************
|
|
Calling this function is obligatory only if the memory buffer containing
|
|
the mutex is freed. Removes a mutex object from the mutex list. The mutex
|
|
is checked to be in the reset state. */
|
|
UNIV_INTERN
|
|
void
|
|
mutex_free(
|
|
/*=======*/
|
|
mutex_t* mutex); /* in: mutex */
|
|
/******************************************************************
|
|
NOTE! The following macro should be used in mutex locking, not the
|
|
corresponding function. */
|
|
|
|
#define mutex_enter(M) mutex_enter_func((M), __FILE__, __LINE__)
|
|
/******************************************************************
|
|
NOTE! The following macro should be used in mutex locking, not the
|
|
corresponding function. */
|
|
|
|
/* NOTE! currently same as mutex_enter! */
|
|
|
|
#define mutex_enter_fast(M) mutex_enter_func((M), __FILE__, __LINE__)
|
|
/**********************************************************************
|
|
NOTE! Use the corresponding macro in the header file, not this function
|
|
directly. Locks a mutex for the current thread. If the mutex is reserved
|
|
the function spins a preset time (controlled by SYNC_SPIN_ROUNDS) waiting
|
|
for the mutex before suspending the thread. */
|
|
UNIV_INLINE
|
|
void
|
|
mutex_enter_func(
|
|
/*=============*/
|
|
mutex_t* mutex, /* in: pointer to mutex */
|
|
const char* file_name, /* in: file name where locked */
|
|
ulint line); /* in: line where locked */
|
|
/******************************************************************
|
|
NOTE! The following macro should be used in mutex locking, not the
|
|
corresponding function. */
|
|
|
|
#define mutex_enter_nowait(M) \
|
|
mutex_enter_nowait_func((M), __FILE__, __LINE__)
|
|
/************************************************************************
|
|
NOTE! Use the corresponding macro in the header file, not this function
|
|
directly. Tries to lock the mutex for the current thread. If the lock is not
|
|
acquired immediately, returns with return value 1. */
|
|
UNIV_INTERN
|
|
ulint
|
|
mutex_enter_nowait_func(
|
|
/*====================*/
|
|
/* out: 0 if succeed, 1 if not */
|
|
mutex_t* mutex, /* in: pointer to mutex */
|
|
const char* file_name, /* in: file name where mutex
|
|
requested */
|
|
ulint line); /* in: line where requested */
|
|
/**********************************************************************
|
|
Unlocks a mutex owned by the current thread. */
|
|
UNIV_INLINE
|
|
void
|
|
mutex_exit(
|
|
/*=======*/
|
|
mutex_t* mutex); /* in: pointer to mutex */
|
|
#ifdef UNIV_SYNC_DEBUG
|
|
/**********************************************************************
|
|
Returns TRUE if no mutex or rw-lock is currently locked.
|
|
Works only in the debug version. */
|
|
UNIV_INTERN
|
|
ibool
|
|
sync_all_freed(void);
|
|
/*================*/
|
|
/* out: TRUE if no mutexes and rw-locks reserved */
|
|
#endif /* UNIV_SYNC_DEBUG */
|
|
/*#####################################################################
|
|
FUNCTION PROTOTYPES FOR DEBUGGING */
|
|
/***********************************************************************
|
|
Prints wait info of the sync system. */
|
|
UNIV_INTERN
|
|
void
|
|
sync_print_wait_info(
|
|
/*=================*/
|
|
FILE* file); /* in: file where to print */
|
|
/***********************************************************************
|
|
Prints info of the sync system. */
|
|
UNIV_INTERN
|
|
void
|
|
sync_print(
|
|
/*=======*/
|
|
FILE* file); /* in: file where to print */
|
|
#ifdef UNIV_DEBUG
|
|
/**********************************************************************
|
|
Checks that the mutex has been initialized. */
|
|
UNIV_INTERN
|
|
ibool
|
|
mutex_validate(
|
|
/*===========*/
|
|
/* out: TRUE */
|
|
const mutex_t* mutex); /* in: mutex */
|
|
/**********************************************************************
|
|
Checks that the current thread owns the mutex. Works only
|
|
in the debug version. */
|
|
UNIV_INTERN
|
|
ibool
|
|
mutex_own(
|
|
/*======*/
|
|
/* out: TRUE if owns */
|
|
const mutex_t* mutex); /* in: mutex */
|
|
#endif /* UNIV_DEBUG */
|
|
#ifdef UNIV_SYNC_DEBUG
|
|
/**********************************************************************
|
|
Adds a latch and its level in the thread level array. Allocates the memory
|
|
for the array if called first time for this OS thread. Makes the checks
|
|
against other latch levels stored in the array for this thread. */
|
|
UNIV_INTERN
|
|
void
|
|
sync_thread_add_level(
|
|
/*==================*/
|
|
void* latch, /* in: pointer to a mutex or an rw-lock */
|
|
ulint level); /* in: level in the latching order; if
|
|
SYNC_LEVEL_VARYING, nothing is done */
|
|
/**********************************************************************
|
|
Removes a latch from the thread level array if it is found there. */
|
|
UNIV_INTERN
|
|
ibool
|
|
sync_thread_reset_level(
|
|
/*====================*/
|
|
/* out: TRUE if found from the array; it is no error
|
|
if the latch is not found, as we presently are not
|
|
able to determine the level for every latch
|
|
reservation the program does */
|
|
void* latch); /* in: pointer to a mutex or an rw-lock */
|
|
/**********************************************************************
|
|
Checks that the level array for the current thread is empty. */
|
|
UNIV_INTERN
|
|
ibool
|
|
sync_thread_levels_empty(void);
|
|
/*==========================*/
|
|
/* out: TRUE if empty */
|
|
/**********************************************************************
|
|
Checks that the level array for the current thread is empty. */
|
|
UNIV_INTERN
|
|
ibool
|
|
sync_thread_levels_empty_gen(
|
|
/*=========================*/
|
|
/* out: TRUE if empty except the
|
|
exceptions specified below */
|
|
ibool dict_mutex_allowed); /* in: TRUE if dictionary mutex is
|
|
allowed to be owned by the thread,
|
|
also purge_is_running mutex is
|
|
allowed */
|
|
/**********************************************************************
|
|
Gets the debug information for a reserved mutex. */
|
|
UNIV_INTERN
|
|
void
|
|
mutex_get_debug_info(
|
|
/*=================*/
|
|
mutex_t* mutex, /* in: mutex */
|
|
const char** file_name, /* out: file where requested */
|
|
ulint* line, /* out: line where requested */
|
|
os_thread_id_t* thread_id); /* out: id of the thread which owns
|
|
the mutex */
|
|
/**********************************************************************
|
|
Counts currently reserved mutexes. Works only in the debug version. */
|
|
UNIV_INTERN
|
|
ulint
|
|
mutex_n_reserved(void);
|
|
/*==================*/
|
|
/* out: number of reserved mutexes */
|
|
#endif /* UNIV_SYNC_DEBUG */
|
|
/**********************************************************************
|
|
NOT to be used outside this module except in debugging! Gets the value
|
|
of the lock word. */
|
|
UNIV_INLINE
|
|
lock_word_t
|
|
mutex_get_lock_word(
|
|
/*================*/
|
|
const mutex_t* mutex); /* in: mutex */
|
|
#ifdef UNIV_SYNC_DEBUG
|
|
/**********************************************************************
|
|
NOT to be used outside this module except in debugging! Gets the waiters
|
|
field in a mutex. */
|
|
UNIV_INLINE
|
|
ulint
|
|
mutex_get_waiters(
|
|
/*==============*/
|
|
/* out: value to set */
|
|
const mutex_t* mutex); /* in: mutex */
|
|
#endif /* UNIV_SYNC_DEBUG */
|
|
|
|
/*
|
|
LATCHING ORDER WITHIN THE DATABASE
|
|
==================================
|
|
|
|
The mutex or latch in the central memory object, for instance, a rollback
|
|
segment object, must be acquired before acquiring the latch or latches to
|
|
the corresponding file data structure. In the latching order below, these
|
|
file page object latches are placed immediately below the corresponding
|
|
central memory object latch or mutex.
|
|
|
|
Synchronization object Notes
|
|
---------------------- -----
|
|
|
|
Dictionary mutex If we have a pointer to a dictionary
|
|
| object, e.g., a table, it can be
|
|
| accessed without reserving the
|
|
| dictionary mutex. We must have a
|
|
| reservation, a memoryfix, to the
|
|
| appropriate table object in this case,
|
|
| and the table must be explicitly
|
|
| released later.
|
|
V
|
|
Dictionary header
|
|
|
|
|
V
|
|
Secondary index tree latch The tree latch protects also all
|
|
| the B-tree non-leaf pages. These
|
|
V can be read with the page only
|
|
Secondary index non-leaf bufferfixed to save CPU time,
|
|
| no s-latch is needed on the page.
|
|
| Modification of a page requires an
|
|
| x-latch on the page, however. If a
|
|
| thread owns an x-latch to the tree,
|
|
| it is allowed to latch non-leaf pages
|
|
| even after it has acquired the fsp
|
|
| latch.
|
|
V
|
|
Secondary index leaf The latch on the secondary index leaf
|
|
| can be kept while accessing the
|
|
| clustered index, to save CPU time.
|
|
V
|
|
Clustered index tree latch To increase concurrency, the tree
|
|
| latch is usually released when the
|
|
| leaf page latch has been acquired.
|
|
V
|
|
Clustered index non-leaf
|
|
|
|
|
V
|
|
Clustered index leaf
|
|
|
|
|
V
|
|
Transaction system header
|
|
|
|
|
V
|
|
Transaction undo mutex The undo log entry must be written
|
|
| before any index page is modified.
|
|
| Transaction undo mutex is for the undo
|
|
| logs the analogue of the tree latch
|
|
| for a B-tree. If a thread has the
|
|
| trx undo mutex reserved, it is allowed
|
|
| to latch the undo log pages in any
|
|
| order, and also after it has acquired
|
|
| the fsp latch.
|
|
V
|
|
Rollback segment mutex The rollback segment mutex must be
|
|
| reserved, if, e.g., a new page must
|
|
| be added to an undo log. The rollback
|
|
| segment and the undo logs in its
|
|
| history list can be seen as an
|
|
| analogue of a B-tree, and the latches
|
|
| reserved similarly, using a version of
|
|
| lock-coupling. If an undo log must be
|
|
| extended by a page when inserting an
|
|
| undo log record, this corresponds to
|
|
| a pessimistic insert in a B-tree.
|
|
V
|
|
Rollback segment header
|
|
|
|
|
V
|
|
Purge system latch
|
|
|
|
|
V
|
|
Undo log pages If a thread owns the trx undo mutex,
|
|
| or for a log in the history list, the
|
|
| rseg mutex, it is allowed to latch
|
|
| undo log pages in any order, and even
|
|
| after it has acquired the fsp latch.
|
|
| If a thread does not have the
|
|
| appropriate mutex, it is allowed to
|
|
| latch only a single undo log page in
|
|
| a mini-transaction.
|
|
V
|
|
File space management latch If a mini-transaction must allocate
|
|
| several file pages, it can do that,
|
|
| because it keeps the x-latch to the
|
|
| file space management in its memo.
|
|
V
|
|
File system pages
|
|
|
|
|
V
|
|
Kernel mutex If a kernel operation needs a file
|
|
| page allocation, it must reserve the
|
|
| fsp x-latch before acquiring the kernel
|
|
| mutex.
|
|
V
|
|
Search system mutex
|
|
|
|
|
V
|
|
Buffer pool mutex
|
|
|
|
|
V
|
|
Log mutex
|
|
|
|
|
Any other latch
|
|
|
|
|
V
|
|
Memory pool mutex */
|
|
|
|
/* Latching order levels */
|
|
|
|
/* User transaction locks are higher than any of the latch levels below:
|
|
no latches are allowed when a thread goes to wait for a normal table
|
|
or row lock! */
|
|
#define SYNC_USER_TRX_LOCK 9999
|
|
#define SYNC_NO_ORDER_CHECK 3000 /* this can be used to suppress
|
|
latching order checking */
|
|
#define SYNC_LEVEL_VARYING 2000 /* Level is varying. Only used with
|
|
buffer pool page locks, which do not
|
|
have a fixed level, but instead have
|
|
their level set after the page is
|
|
locked; see e.g.
|
|
ibuf_bitmap_get_map_page(). */
|
|
#define SYNC_TRX_I_S_RWLOCK 1910 /* Used for
|
|
trx_i_s_cache_t::rw_lock */
|
|
#define SYNC_TRX_I_S_LAST_READ 1900 /* Used for
|
|
trx_i_s_cache_t::last_read_mutex */
|
|
#define SYNC_FILE_FORMAT_TAG 1200 /* Used to serialize access to the
|
|
file format tag */
|
|
#define SYNC_DICT_OPERATION 1001 /* table create, drop, etc. reserve
|
|
this in X-mode, implicit or backround
|
|
operations purge, rollback, foreign
|
|
key checks reserve this in S-mode */
|
|
#define SYNC_DICT 1000
|
|
#define SYNC_DICT_AUTOINC_MUTEX 999
|
|
#define SYNC_DICT_HEADER 995
|
|
#define SYNC_IBUF_HEADER 914
|
|
#define SYNC_IBUF_PESS_INSERT_MUTEX 912
|
|
#define SYNC_IBUF_MUTEX 910 /* ibuf mutex is really below
|
|
SYNC_FSP_PAGE: we assign a value this
|
|
high only to make the program to pass
|
|
the debug checks */
|
|
/*-------------------------------*/
|
|
#define SYNC_INDEX_TREE 900
|
|
#define SYNC_TREE_NODE_NEW 892
|
|
#define SYNC_TREE_NODE_FROM_HASH 891
|
|
#define SYNC_TREE_NODE 890
|
|
#define SYNC_PURGE_SYS 810
|
|
#define SYNC_PURGE_LATCH 800
|
|
#define SYNC_TRX_UNDO 700
|
|
#define SYNC_RSEG 600
|
|
#define SYNC_RSEG_HEADER_NEW 591
|
|
#define SYNC_RSEG_HEADER 590
|
|
#define SYNC_TRX_UNDO_PAGE 570
|
|
#define SYNC_EXTERN_STORAGE 500
|
|
#define SYNC_FSP 400
|
|
#define SYNC_FSP_PAGE 395
|
|
/*------------------------------------- Insert buffer headers */
|
|
/*------------------------------------- ibuf_mutex */
|
|
/*------------------------------------- Insert buffer tree */
|
|
#define SYNC_IBUF_BITMAP_MUTEX 351
|
|
#define SYNC_IBUF_BITMAP 350
|
|
/*------------------------------------- MySQL query cache mutex */
|
|
/*------------------------------------- MySQL binlog mutex */
|
|
/*-------------------------------*/
|
|
#define SYNC_KERNEL 300
|
|
#define SYNC_REC_LOCK 299
|
|
#define SYNC_TRX_LOCK_HEAP 298
|
|
#define SYNC_TRX_SYS_HEADER 290
|
|
#define SYNC_LOG 170
|
|
#define SYNC_RECV 168
|
|
#define SYNC_WORK_QUEUE 162
|
|
#define SYNC_SEARCH_SYS_CONF 161 /* for assigning btr_search_enabled */
|
|
#define SYNC_SEARCH_SYS 160 /* NOTE that if we have a memory
|
|
heap that can be extended to the
|
|
buffer pool, its logical level is
|
|
SYNC_SEARCH_SYS, as memory allocation
|
|
can call routines there! Otherwise
|
|
the level is SYNC_MEM_HASH. */
|
|
#define SYNC_BUF_POOL 150
|
|
#define SYNC_BUF_BLOCK 149
|
|
#define SYNC_DOUBLEWRITE 140
|
|
#define SYNC_ANY_LATCH 135
|
|
#define SYNC_THR_LOCAL 133
|
|
#define SYNC_MEM_HASH 131
|
|
#define SYNC_MEM_POOL 130
|
|
|
|
/* Codes used to designate lock operations */
|
|
#define RW_LOCK_NOT_LOCKED 350
|
|
#define RW_LOCK_EX 351
|
|
#define RW_LOCK_EXCLUSIVE 351
|
|
#define RW_LOCK_SHARED 352
|
|
#define RW_LOCK_WAIT_EX 353
|
|
#define SYNC_MUTEX 354
|
|
|
|
/* NOTE! The structure appears here only for the compiler to know its size.
|
|
Do not use its fields directly! The structure used in the spin lock
|
|
implementation of a mutual exclusion semaphore. */
|
|
|
|
struct mutex_struct {
|
|
os_event_t event; /* Used by sync0arr.c for the wait queue */
|
|
volatile lock_word_t lock_word; /* lock_word is the target
|
|
of the atomic test-and-set instruction when
|
|
atomic operations are enabled. */
|
|
|
|
#if !defined(HAVE_ATOMIC_BUILTINS)
|
|
os_fast_mutex_t
|
|
os_fast_mutex; /* We use this OS mutex in place of lock_word
|
|
when atomic operations are not enabled */
|
|
#endif
|
|
ulint waiters; /* This ulint is set to 1 if there are (or
|
|
may be) threads waiting in the global wait
|
|
array for this mutex to be released.
|
|
Otherwise, this is 0. */
|
|
UT_LIST_NODE_T(mutex_t) list; /* All allocated mutexes are put into
|
|
a list. Pointers to the next and prev. */
|
|
#ifdef UNIV_SYNC_DEBUG
|
|
const char* file_name; /* File where the mutex was locked */
|
|
ulint line; /* Line where the mutex was locked */
|
|
ulint level; /* Level in the global latching order */
|
|
#endif /* UNIV_SYNC_DEBUG */
|
|
const char* cfile_name;/* File name where mutex created */
|
|
ulint cline; /* Line where created */
|
|
#ifdef UNIV_DEBUG
|
|
os_thread_id_t thread_id; /* The thread id of the thread
|
|
which locked the mutex. */
|
|
ulint magic_n;
|
|
# define MUTEX_MAGIC_N (ulint)979585
|
|
#endif /* UNIV_DEBUG */
|
|
ulong count_os_wait; /* count of os_wait */
|
|
#ifdef UNIV_DEBUG
|
|
ulong count_using; /* count of times mutex used */
|
|
ulong count_spin_loop; /* count of spin loops */
|
|
ulong count_spin_rounds; /* count of spin rounds */
|
|
ulong count_os_yield; /* count of os_wait */
|
|
ulonglong lspent_time; /* mutex os_wait timer msec */
|
|
ulonglong lmax_spent_time; /* mutex os_wait timer msec */
|
|
const char* cmutex_name;/* mutex name */
|
|
ulint mutex_type;/* 0 - usual mutex 1 - rw_lock mutex */
|
|
#endif /* UNIV_DEBUG */
|
|
};
|
|
|
|
/* The global array of wait cells for implementation of the databases own
|
|
mutexes and read-write locks. Appears here for debugging purposes only! */
|
|
|
|
extern sync_array_t* sync_primary_wait_array;
|
|
|
|
/* Constant determining how long spin wait is continued before suspending
|
|
the thread. A value 600 rounds on a 1995 100 MHz Pentium seems to correspond
|
|
to 20 microseconds. */
|
|
|
|
#define SYNC_SPIN_ROUNDS srv_n_spin_wait_rounds
|
|
|
|
/* The number of system calls made in this module. Intended for performance
|
|
monitoring. */
|
|
|
|
extern ib_int64_t mutex_exit_count;
|
|
|
|
#ifdef UNIV_SYNC_DEBUG
|
|
/* Latching order checks start when this is set TRUE */
|
|
extern ibool sync_order_checks_on;
|
|
#endif /* UNIV_SYNC_DEBUG */
|
|
|
|
/* This variable is set to TRUE when sync_init is called */
|
|
extern ibool sync_initialized;
|
|
|
|
/* Global list of database mutexes (not OS mutexes) created. */
|
|
typedef UT_LIST_BASE_NODE_T(mutex_t) ut_list_base_node_t;
|
|
extern ut_list_base_node_t mutex_list;
|
|
|
|
/* Mutex protecting the mutex_list variable */
|
|
extern mutex_t mutex_list_mutex;
|
|
|
|
|
|
#ifndef UNIV_NONINL
|
|
#include "sync0sync.ic"
|
|
#endif
|
|
|
|
#endif
|