You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9263 lines
259 KiB

branches/innodb+: Merge revisions 4150:4528 from branches/zip: ------------------------------------------------------------------------ r4152 | marko | 2009-02-10 12:52:27 +0200 (Tue, 10 Feb 2009) | 12 lines branches/zip: When innodb_use_sys_malloc is set, ignore innodb_additional_mem_pool_size, because nothing will be allocated from mem_comm_pool. mem_pool_create(): Remove the assertion about size. The function will work with any size. However, an assertion would fail in ut_malloc_low() when size==0. mem_init(): When srv_use_sys_malloc is set, pass size=1 to mem_pool_create(). mem0mem.c: Add #include "srv0srv.h" that is needed by mem0dbg.c. ------------------------------------------------------------------------ r4153 | vasil | 2009-02-10 22:58:17 +0200 (Tue, 10 Feb 2009) | 14 lines branches/zip: (followup to r4145) Non-functional change: Change the os_atomic_increment() and os_compare_and_swap() functions to macros to avoid artificial limitations on the types of those functions' arguments. As a consequence typecasts from the source code can be removed. Also remove Google's copyright from os0sync.ic because that file no longer contains code from Google. Approved by: Marko (rb://88), also ok from Inaam via IM ------------------------------------------------------------------------ r4163 | marko | 2009-02-12 00:14:19 +0200 (Thu, 12 Feb 2009) | 4 lines branches/zip: Make innodb_thread_concurrency=0 the default. The old default was 8. ------------------------------------------------------------------------ r4169 | calvin | 2009-02-12 10:37:10 +0200 (Thu, 12 Feb 2009) | 3 lines branches/zip: Adjust the result file of innodb_thread_concurrency_basic test. The default value of innodb_thread_concurrency is changed to 0 (from 8) via r4163. ------------------------------------------------------------------------ r4174 | vasil | 2009-02-12 17:38:27 +0200 (Thu, 12 Feb 2009) | 4 lines branches/zip: Fix pathname of the file to patch. ------------------------------------------------------------------------ r4176 | vasil | 2009-02-13 10:06:31 +0200 (Fri, 13 Feb 2009) | 7 lines branches/zip: Fix the failing mysql-test partition_innodb, which failed only if run after innodb_trx_weight (or other test that would leave LATEST DEADLOCK ERROR into the output of SHOW ENGINE INNODB STATUS). Find further explanation for the failure at the top of the added patch partition_innodb.diff. ------------------------------------------------------------------------ r4198 | vasil | 2009-02-17 09:06:07 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: Add the full text of the GPLv2 license into the root directory of the plugin. In previous releases this file was copied from an external source (https://svn.innodb.com/svn/plugin/trunk/support/COPYING) "manually" when creating the source and binary archives. It is less confusing to have this present in the root directory of the SVN branch. ------------------------------------------------------------------------ r4199 | vasil | 2009-02-17 09:11:58 +0200 (Tue, 17 Feb 2009) | 4 lines branches/zip: Add Google's license into COPYING.Google. ------------------------------------------------------------------------ r4200 | vasil | 2009-02-17 09:56:33 +0200 (Tue, 17 Feb 2009) | 11 lines branches/zip: To the files touched by the Google patch from c4144 (excluding include/os0sync.ic because later we removed Google code from that file): * Remove the Google license * Remove old Innobase copyright lines * Add a reference to the Google license and to the GPLv2 license at the top, as recommended by the lawyers at Oracle Legal. ------------------------------------------------------------------------ r4201 | vasil | 2009-02-17 10:12:02 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 1/28] ------------------------------------------------------------------------ r4202 | vasil | 2009-02-17 10:15:06 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 2/28] ------------------------------------------------------------------------ r4203 | vasil | 2009-02-17 10:25:45 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 3/28] ------------------------------------------------------------------------ r4204 | vasil | 2009-02-17 10:55:41 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 4/28] ------------------------------------------------------------------------ r4205 | vasil | 2009-02-17 10:59:22 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 5/28] ------------------------------------------------------------------------ r4206 | vasil | 2009-02-17 11:02:27 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 6/28] ------------------------------------------------------------------------ r4207 | vasil | 2009-02-17 11:04:28 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 7/28] ------------------------------------------------------------------------ r4208 | vasil | 2009-02-17 11:06:49 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 8/28] ------------------------------------------------------------------------ r4209 | vasil | 2009-02-17 11:10:18 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 9/28] ------------------------------------------------------------------------ r4210 | vasil | 2009-02-17 11:12:41 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 10/28] ------------------------------------------------------------------------ r4211 | vasil | 2009-02-17 11:14:40 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 11/28] ------------------------------------------------------------------------ r4212 | vasil | 2009-02-17 11:18:35 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 12/28] ------------------------------------------------------------------------ r4213 | vasil | 2009-02-17 11:24:40 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 13/28] ------------------------------------------------------------------------ r4214 | vasil | 2009-02-17 11:27:31 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 13/28] ------------------------------------------------------------------------ r4215 | vasil | 2009-02-17 11:29:55 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 15/28] ------------------------------------------------------------------------ r4216 | vasil | 2009-02-17 11:33:38 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 16/28] ------------------------------------------------------------------------ r4217 | vasil | 2009-02-17 11:36:44 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 17/28] ------------------------------------------------------------------------ r4218 | vasil | 2009-02-17 11:39:11 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 18/28] ------------------------------------------------------------------------ r4219 | vasil | 2009-02-17 11:41:24 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 19/28] ------------------------------------------------------------------------ r4220 | vasil | 2009-02-17 11:43:50 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 20/28] ------------------------------------------------------------------------ r4221 | vasil | 2009-02-17 11:46:52 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 21/28] ------------------------------------------------------------------------ r4222 | vasil | 2009-02-17 11:50:12 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 22/28] ------------------------------------------------------------------------ r4223 | vasil | 2009-02-17 11:53:58 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 23/28] ------------------------------------------------------------------------ r4224 | vasil | 2009-02-17 12:01:41 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 24/28] ------------------------------------------------------------------------ r4225 | vasil | 2009-02-17 12:05:45 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 25/28] ------------------------------------------------------------------------ r4226 | vasil | 2009-02-17 12:09:16 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 26/28] ------------------------------------------------------------------------ r4227 | vasil | 2009-02-17 12:12:56 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 27/28] ------------------------------------------------------------------------ r4228 | vasil | 2009-02-17 12:14:04 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 28/28] ------------------------------------------------------------------------ r4229 | vasil | 2009-02-17 12:30:55 +0200 (Tue, 17 Feb 2009) | 4 lines branches/zip: Add the copyright notice to the non C files. ------------------------------------------------------------------------ r4231 | marko | 2009-02-17 14:26:53 +0200 (Tue, 17 Feb 2009) | 12 lines Minor cleanup of the Google SMP patch. sync_array_object_signalled(): Add a (void) cast to eliminate a gcc warning about the return value of os_atomic_increment() being ignored. rw_lock_create_func(): Properly indent the preprocessor directives. rw_lock_x_lock_low(), rw_lock_x_lock_func_nowait(): Split lines correctly. rw_lock_set_writer_id_and_recursion_flag(): Silence a Valgrind warning. Do not mix statements and variable declarations. ------------------------------------------------------------------------ r4232 | marko | 2009-02-17 14:59:54 +0200 (Tue, 17 Feb 2009) | 3 lines branches/zip: When assigning lock->recursive = FALSE, also flag lock->writer_thread invalid, so that Valgrind will catch more errors. This is related to Issue #175. ------------------------------------------------------------------------ r4242 | marko | 2009-02-18 17:01:09 +0200 (Wed, 18 Feb 2009) | 2 lines branches/zip: UT_DBG_STOP: Use do{} while(0) to silence a g++-4.3.2 warning about a while(0); statement. This should fix (part of) Issue #176. ------------------------------------------------------------------------ r4243 | marko | 2009-02-18 17:04:03 +0200 (Wed, 18 Feb 2009) | 3 lines branches/zip: buf_buddy_get_slot(): Fix a gcc 4.3.2 warning about an empty body of a "for" statement. This fixes part of Issue #176. ------------------------------------------------------------------------ r4244 | marko | 2009-02-18 17:25:45 +0200 (Wed, 18 Feb 2009) | 11 lines branches/zip: Protect ut_total_allocated_memory with ut_list_mutex. Unprotected updates to ut_total_allocated_memory in os_mem_alloc_large() and os_mem_free_large(), called during fast index creation, may corrupt the variable and cause assertion failures. Also, add UNIV_MEM_ALLOC() and UNIV_MEM_FREE() instrumentation around os_mem_alloc_large() and os_mem_free_large(), so that Valgrind can detect more errors. rb://90 approved by Heikki Tuuri. This addresses Issue #177. ------------------------------------------------------------------------ r4248 | marko | 2009-02-19 11:52:39 +0200 (Thu, 19 Feb 2009) | 2 lines branches/zip: page_zip_set_size(): Fix a g++ 4.3.2 warning about an empty body in a "for" statement. This closes Issue #176. ------------------------------------------------------------------------ r4251 | inaam | 2009-02-19 15:46:27 +0200 (Thu, 19 Feb 2009) | 8 lines branches/zip: Issue #178 rb://91 Change plug.in to have same CXXFLAGS as CFLAGS. This is to ensure that both .c and .cc files get compiled with same flags. To fix the issue where UNIV_LINUX was defined only in .c files. Approved by: Marko ------------------------------------------------------------------------ r4258 | vasil | 2009-02-20 11:52:19 +0200 (Fri, 20 Feb 2009) | 7 lines branches/zip: Cleanup in ChangeLog: * Wrap lines at 78 characters * Changed files are listed alphabetically * White-space cleanup ------------------------------------------------------------------------ r4259 | vasil | 2009-02-20 11:59:42 +0200 (Fri, 20 Feb 2009) | 6 lines branches/zip: ChangeLog: Remove include/os0sync.ic from the entry about the google patch, this file was modified later to not include Google's code. ------------------------------------------------------------------------ r4262 | vasil | 2009-02-20 14:56:59 +0200 (Fri, 20 Feb 2009) | 373 lines branches/zip: Merge revisions 4035:4261 from branches/5.1: ------------------------------------------------------------------------ r4065 | sunny | 2009-01-29 16:01:36 +0200 (Thu, 29 Jan 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: In the last round of AUTOINC cleanup we assumed that AUTOINC is only defined for integer columns. This caused an assertion failure when we checked for the maximum value of a column type. We now calculate the max value for floating-point autoinc columns too. Fix Bug#42400 - InnoDB autoinc code can't handle floating-point columns rb://84 and Mantis issue://162 ------------------------------------------------------------------------ r4111 | sunny | 2009-02-03 22:06:52 +0200 (Tue, 03 Feb 2009) | 2 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Add the ULL suffix otherwise there is an overflow. ------------------------------------------------------------------------ r4128 | vasil | 2009-02-08 21:36:45 +0200 (Sun, 08 Feb 2009) | 18 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2709.20.31 committer: Timothy Smith <timothy.smith@sun.com> branch nick: 51 timestamp: Fri 2008-12-19 01:28:51 +0100 message: Disable part of innodb-autoinc.test, because the MySQL server asserts when compiled --with-debug, due to bug 39828, "autoinc wraps around when offset and increment > 1". This change should be reverted when that bug is fixed (and a a few other minor changes to the test as described in comments). modified: mysql-test/r/innodb-autoinc.result mysql-test/t/innodb-autoinc.test ------------------------------------------------------------------------ r4129 | vasil | 2009-02-08 21:54:25 +0200 (Sun, 08 Feb 2009) | 310 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Merge a change from MySQL: [looks like the changes to innodb-autoinc.test were made as part of the following huge merge, but we are merging only changes to that file] ------------------------------------------------------------ revno: 2546.47.1 committer: Luis Soares <luis.soares@sun.com> branch nick: 5.1-rpl timestamp: Fri 2009-01-23 13:22:05 +0100 message: merge: 5.1 -> 5.1-rpl conflicts: Text conflict in client/mysqltest.cc Text conflict in mysql-test/include/wait_until_connected_again.inc Text conflict in mysql-test/lib/mtr_report.pm Text conflict in mysql-test/mysql-test-run.pl Text conflict in mysql-test/r/events_bugs.result Text conflict in mysql-test/r/log_state.result Text conflict in mysql-test/r/myisam_data_pointer_size_func.result Text conflict in mysql-test/r/mysqlcheck.result Text conflict in mysql-test/r/query_cache.result Text conflict in mysql-test/r/status.result Text conflict in mysql-test/suite/binlog/r/binlog_index.result Text conflict in mysql-test/suite/binlog/r/binlog_innodb.result Text conflict in mysql-test/suite/rpl/r/rpl_packet.result Text conflict in mysql-test/suite/rpl/t/rpl_packet.test Text conflict in mysql-test/t/disabled.def Text conflict in mysql-test/t/events_bugs.test Text conflict in mysql-test/t/log_state.test Text conflict in mysql-test/t/myisam_data_pointer_size_func.test Text conflict in mysql-test/t/mysqlcheck.test Text conflict in mysql-test/t/query_cache.test Text conflict in mysql-test/t/rpl_init_slave_func.test Text conflict in mysql-test/t/status.test removed: mysql-test/suite/parts/r/partition_bit_ndb.result mysql-test/suite/parts/t/partition_bit_ndb.test mysql-test/suite/parts/t/partition_sessions.test mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test mysql-test/t/log_bin_trust_function_creators_func-master.opt mysql-test/t/rpl_init_slave_func-slave.opt added: mysql-test/include/check_events_off.inc mysql-test/include/cleanup_fake_relay_log.inc mysql-test/include/have_simple_parser.inc mysql-test/include/no_running_event_scheduler.inc mysql-test/include/no_running_events.inc mysql-test/include/running_event_scheduler.inc mysql-test/include/setup_fake_relay_log.inc mysql-test/include/wait_condition_sp.inc mysql-test/r/fulltext_plugin.result mysql-test/r/have_simple_parser.require mysql-test/r/innodb_bug38231.result mysql-test/r/innodb_bug39438.result mysql-test/r/innodb_mysql_rbk.result mysql-test/r/partition_innodb_semi_consistent.result mysql-test/r/query_cache_28249.result mysql-test/r/status2.result mysql-test/std_data/bug40482-bin.000001 mysql-test/suite/binlog/r/binlog_innodb_row.result mysql-test/suite/binlog/t/binlog_innodb_row.test mysql-test/suite/rpl/r/rpl_binlog_corruption.result mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt mysql-test/suite/rpl/t/rpl_binlog_corruption.test mysql-test/suite/sys_vars/r/tmp_table_size_basic.result mysql-test/suite/sys_vars/t/tmp_table_size_basic.test mysql-test/t/fulltext_plugin-master.opt mysql-test/t/fulltext_plugin.test mysql-test/t/innodb_bug38231.test mysql-test/t/innodb_bug39438-master.opt mysql-test/t/innodb_bug39438.test mysql-test/t/innodb_mysql_rbk-master.opt mysql-test/t/innodb_mysql_rbk.test mysql-test/t/partition_innodb_semi_consistent-master.opt mysql-test/t/partition_innodb_semi_consistent.test mysql-test/t/query_cache_28249.test mysql-test/t/status2.test renamed: mysql-test/suite/funcs_1/r/is_collation_character_set_applicability.result => mysql-test/suite/funcs_1/r/is_coll_char_set_appl.result mysql-test/suite/funcs_1/t/is_collation_character_set_applicability.test => mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test modified: .bzr-mysql/default.conf CMakeLists.txt client/mysql.cc client/mysql_upgrade.c client/mysqlcheck.c client/mysqltest.cc configure.in extra/resolve_stack_dump.c extra/yassl/include/openssl/ssl.h include/config-win.h include/m_ctype.h include/my_global.h mysql-test/extra/binlog_tests/database.test mysql-test/extra/rpl_tests/rpl_auto_increment.test mysql-test/include/commit.inc mysql-test/include/have_32bit.inc mysql-test/include/have_64bit.inc mysql-test/include/index_merge1.inc mysql-test/include/linux_sys_vars.inc mysql-test/include/windows_sys_vars.inc mysql-test/lib/mtr_report.pm mysql-test/mysql-test-run.pl mysql-test/r/alter_table.result mysql-test/r/commit_1innodb.result mysql-test/r/create.result mysql-test/r/csv.result mysql-test/r/ctype_ucs.result mysql-test/r/date_formats.result mysql-test/r/events_bugs.result mysql-test/r/events_scheduling.result mysql-test/r/fulltext.result mysql-test/r/func_if.result mysql-test/r/func_in.result mysql-test/r/func_str.result mysql-test/r/func_time.result mysql-test/r/grant.result mysql-test/r/index_merge_myisam.result mysql-test/r/information_schema.result mysql-test/r/innodb-autoinc.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/log_bin_trust_function_creators_func.result mysql-test/r/log_state.result mysql-test/r/myisampack.result mysql-test/r/mysql.result mysql-test/r/mysqlcheck.result mysql-test/r/partition_datatype.result mysql-test/r/partition_mgm.result mysql-test/r/partition_pruning.result mysql-test/r/query_cache.result mysql-test/r/read_buffer_size_basic.result mysql-test/r/read_rnd_buffer_size_basic.result mysql-test/r/rpl_init_slave_func.result mysql-test/r/select.result mysql-test/r/status.result mysql-test/r/strict.result mysql-test/r/temp_table.result mysql-test/r/type_bit.result mysql-test/r/type_date.result mysql-test/r/type_float.result mysql-test/r/warnings_engine_disabled.result mysql-test/r/xml.result mysql-test/suite/binlog/r/binlog_database.result mysql-test/suite/binlog/r/binlog_index.result mysql-test/suite/binlog/r/binlog_innodb.result mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result mysql-test/suite/binlog/t/binlog_innodb.test mysql-test/suite/funcs_1/r/is_columns_is.result mysql-test/suite/funcs_1/r/is_engines.result mysql-test/suite/funcs_1/r/storedproc.result mysql-test/suite/funcs_1/storedproc/param_check.inc mysql-test/suite/funcs_2/t/disabled.def mysql-test/suite/ndb/t/disabled.def mysql-test/suite/parts/r/partition_bit_innodb.result mysql-test/suite/parts/r/partition_bit_myisam.result mysql-test/suite/parts/r/partition_special_innodb.result mysql-test/suite/parts/t/disabled.def mysql-test/suite/parts/t/partition_special_innodb.test mysql-test/suite/parts/t/partition_value_innodb.test mysql-test/suite/parts/t/partition_value_myisam.test mysql-test/suite/parts/t/partition_value_ndb.test mysql-test/suite/rpl/r/rpl_auto_increment.result mysql-test/suite/rpl/r/rpl_packet.result mysql-test/suite/rpl/r/rpl_row_create_table.result mysql-test/suite/rpl/r/rpl_slave_skip.result mysql-test/suite/rpl/r/rpl_trigger.result mysql-test/suite/rpl/t/disabled.def mysql-test/suite/rpl/t/rpl_packet.test mysql-test/suite/rpl/t/rpl_row_create_table.test mysql-test/suite/rpl/t/rpl_slave_skip.test mysql-test/suite/rpl/t/rpl_trigger.test mysql-test/suite/rpl_ndb/t/disabled.def mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result mysql-test/t/alter_table.test mysql-test/t/create.test mysql-test/t/csv.test mysql-test/t/ctype_ucs.test mysql-test/t/date_formats.test mysql-test/t/disabled.def mysql-test/t/events_bugs.test mysql-test/t/events_scheduling.test mysql-test/t/fulltext.test mysql-test/t/func_if.test mysql-test/t/func_in.test mysql-test/t/func_str.test mysql-test/t/func_time.test mysql-test/t/grant.test mysql-test/t/information_schema.test mysql-test/t/innodb-autoinc.test mysql-test/t/innodb.test mysql-test/t/innodb_mysql.test mysql-test/t/log_bin_trust_function_creators_func.test mysql-test/t/log_state.test mysql-test/t/myisam_data_pointer_size_func.test mysql-test/t/myisampack.test mysql-test/t/mysql.test mysql-test/t/mysqlcheck.test mysql-test/t/partition_innodb_stmt.test mysql-test/t/partition_mgm.test mysql-test/t/partition_pruning.test mysql-test/t/query_cache.test mysql-test/t/rpl_init_slave_func.test mysql-test/t/select.test mysql-test/t/status.test mysql-test/t/strict.test mysql-test/t/temp_table.test mysql-test/t/type_bit.test mysql-test/t/type_date.test mysql-test/t/type_float.test mysql-test/t/warnings_engine_disabled.test mysql-test/t/xml.test mysys/my_getopt.c mysys/my_init.c scripts/mysql_install_db.sh sql-common/my_time.c sql/field.cc sql/field.h sql/filesort.cc sql/ha_partition.cc sql/ha_partition.h sql/item.cc sql/item_cmpfunc.cc sql/item_func.h sql/item_strfunc.cc sql/item_sum.cc sql/item_timefunc.cc sql/item_timefunc.h sql/log.cc sql/log.h sql/log_event.cc sql/log_event.h sql/mysql_priv.h sql/mysqld.cc sql/opt_range.cc sql/partition_info.cc sql/repl_failsafe.cc sql/rpl_constants.h sql/set_var.cc sql/slave.cc sql/spatial.h sql/sql_acl.cc sql/sql_base.cc sql/sql_binlog.cc sql/sql_class.h sql/sql_cursor.cc sql/sql_delete.cc sql/sql_lex.cc sql/sql_lex.h sql/sql_locale.cc sql/sql_parse.cc sql/sql_partition.cc sql/sql_plugin.cc sql/sql_plugin.h sql/sql_profile.cc sql/sql_repl.cc sql/sql_select.cc sql/sql_select.h sql/sql_show.cc sql/sql_table.cc sql/sql_trigger.cc sql/sql_trigger.h sql/table.cc sql/table.h sql/unireg.cc storage/csv/ha_tina.cc storage/federated/ha_federated.cc storage/heap/ha_heap.cc storage/innobase/Makefile.am storage/innobase/btr/btr0sea.c storage/innobase/buf/buf0lru.c storage/innobase/dict/dict0dict.c storage/innobase/dict/dict0mem.c storage/innobase/handler/ha_innodb.cc storage/innobase/handler/ha_innodb.h storage/innobase/include/btr0sea.h storage/innobase/include/dict0dict.h storage/innobase/include/dict0mem.h storage/innobase/include/ha_prototypes.h storage/innobase/include/lock0lock.h storage/innobase/include/row0mysql.h storage/innobase/include/sync0sync.ic storage/innobase/include/ut0ut.h storage/innobase/lock/lock0lock.c storage/innobase/os/os0file.c storage/innobase/plug.in storage/innobase/row/row0mysql.c storage/innobase/row/row0sel.c storage/innobase/srv/srv0srv.c storage/innobase/srv/srv0start.c storage/innobase/ut/ut0ut.c storage/myisam/ft_boolean_search.c strings/ctype.c strings/xml.c tests/mysql_client_test.c win/configure.js mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test ------------------------------------------------------------------------ r4165 | calvin | 2009-02-12 01:34:27 +0200 (Thu, 12 Feb 2009) | 1 line Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: minor non-functional changes. ------------------------------------------------------------------------ ------------------------------------------------------------------------ r4263 | vasil | 2009-02-20 15:00:46 +0200 (Fri, 20 Feb 2009) | 4 lines branches/zip: Add a ChangeLog entry for a change in r4262. ------------------------------------------------------------------------ r4265 | marko | 2009-02-20 22:31:03 +0200 (Fri, 20 Feb 2009) | 5 lines branches/zip: Make innodb_use_sys_malloc=ON the default. Replace srv_use_sys_malloc with UNIV_LIKELY(srv_use_sys_malloc) to improve branch prediction in the default case. Approved by Ken over the IM. ------------------------------------------------------------------------ r4266 | vasil | 2009-02-20 23:29:32 +0200 (Fri, 20 Feb 2009) | 7 lines branches/zip: Add a sentence at the top of COPYING.Google to clarify that this license does not apply to the whole InnoDB. Suggested by: Ken ------------------------------------------------------------------------ r4268 | marko | 2009-02-23 12:43:51 +0200 (Mon, 23 Feb 2009) | 9 lines branches/zip: Initialize ut_list_mutex at startup. Without this fix, ut_list_mutex would be used uninitialized when innodb_use_sys_malloc=1. This fix addresses Issue #181. ut_mem_block_list_init(): Rename to ut_mem_init() and make public. ut_malloc_low(), ut_free_all_mem(): Add ut_a(ut_mem_block_list_inited). mem_init(): Call ut_mem_init(). ------------------------------------------------------------------------ r4269 | marko | 2009-02-23 15:09:49 +0200 (Mon, 23 Feb 2009) | 7 lines branches/zip: When freeing an uncompressed BLOB page, tolerate garbage in FIL_PAGE_TYPE. (Bug #43043, Issue #182) btr_check_blob_fil_page_type(): New function. btr_free_externally_stored_field(), btr_copy_blob_prefix(): Call btr_check_blob_fil_page_type() to check FIL_PAGE_TYPE. ------------------------------------------------------------------------ r4272 | marko | 2009-02-23 23:10:18 +0200 (Mon, 23 Feb 2009) | 8 lines branches/zip: Adjust the fix of Issue #182 in r4269 per Inaam's suggestion. btr_check_blob_fil_page_type(): Replace the parameter const char* op with ibool read. Do not print anything about page type mismatch when reading a BLOB page in Antelope format. Print space id before page number. ------------------------------------------------------------------------ r4273 | marko | 2009-02-24 00:11:11 +0200 (Tue, 24 Feb 2009) | 1 line branches/zip: ut_mem_init(): Add the assertion !ut_mem_block_list_inited. ------------------------------------------------------------------------ r4274 | marko | 2009-02-24 00:14:38 +0200 (Tue, 24 Feb 2009) | 12 lines branches/zip: Fix bugs in the fix of Issue #181. Tested inside and outside Valgrind, with innodb_use_sys_malloc set to 0 and 1. mem_init(): Invoke ut_mem_init() before mem_pool_create(), because the latter one will invoke ut_malloc(). srv_general_init(): Do not initialize the memory subsystem (mem_init()). innobase_init(): Initialize the memory subsystem (mem_init()) before calling srv_parse_data_file_paths_and_sizes(), which needs ut_malloc(). Call ut_free_all_mem() in error handling to clean up after the mem_init(). ------------------------------------------------------------------------ r4280 | marko | 2009-02-24 15:14:59 +0200 (Tue, 24 Feb 2009) | 1 line branches/zip: Remove unused function os_mem_alloc_nocache(). ------------------------------------------------------------------------ r4281 | marko | 2009-02-24 16:02:48 +0200 (Tue, 24 Feb 2009) | 1 line branches/zip: Remove the unused function dict_index_get_type(). ------------------------------------------------------------------------ r4283 | marko | 2009-02-24 23:06:56 +0200 (Tue, 24 Feb 2009) | 1 line branches/zip: srv0start.c: Remove unnecessary #include "mem0pool.h". ------------------------------------------------------------------------ r4284 | marko | 2009-02-24 23:26:38 +0200 (Tue, 24 Feb 2009) | 1 line branches/zip: mem0mem.c: Remove unnecessary #include "mach0data.h". ------------------------------------------------------------------------ r4288 | vasil | 2009-02-25 10:48:07 +0200 (Wed, 25 Feb 2009) | 21 lines branches/zip: Merge revisions 4261:4287 from branches/5.1: ------------------------------------------------------------------------ r4287 | sunny | 2009-02-25 05:32:01 +0200 (Wed, 25 Feb 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Fix Bug#42714 AUTO_INCREMENT errors in 5.1.31. There are two changes to the autoinc handling. 1. To fix the immediate problem from the bug report, we must ensure that the value written to the table is always less than the max value stored in dict_table_t. 2. The second related change is that according to MySQL documentation when the offset is greater than the increment, we should ignore the offset. ------------------------------------------------------------------------ ------------------------------------------------------------------------ r4289 | vasil | 2009-02-25 10:53:51 +0200 (Wed, 25 Feb 2009) | 4 lines branches/zip: Add ChangeLog entry for the fix in r4288. ------------------------------------------------------------------------ r4290 | vasil | 2009-02-25 11:05:44 +0200 (Wed, 25 Feb 2009) | 11 lines branches/zip: Make ChangeLog entries for bugs in bugs.mysql.com in the form: Fix Bug#12345 bug title (for bugs after 1.0.2 was released and the ChangeLog published) There is no need to bloat the ChangeLog with information that is available via bugs.mysql.com. Discussed with: Marko ------------------------------------------------------------------------ r4291 | vasil | 2009-02-25 11:08:32 +0200 (Wed, 25 Feb 2009) | 4 lines branches/zip: Fix Bug synopsis and remove explanation ------------------------------------------------------------------------ r4292 | marko | 2009-02-25 12:09:15 +0200 (Wed, 25 Feb 2009) | 25 lines branches/zip: Correct the initialization of the memory subsystem once again, to finally put Issue #181 to rest. Revert some parts of r4274. It is best not to call ut_malloc() before srv_general_init(). mem_init(): Do not call ut_mem_init(). srv_general_init(): Initialize the memory subsystem in two phases: first ut_mem_init(), then mem_init(). This is because os_sync_init() and sync_init() depend on ut_mem_init() and mem_init() depends on os_sync_init() or sync_init(). srv_parse_data_file_paths_and_sizes(), srv_parse_log_group_home_dirs(): Remove the output parameters. Assign to the global variables directly. Allocate memory with malloc() instead of ut_malloc(), because these functions will be called before srv_general_init(). srv_free_paths_and_sizes(): New function, for cleaning up after srv_parse_data_file_paths_and_sizes() and srv_parse_log_group_home_dirs(). rb://92 approved by Sunny Bains ------------------------------------------------------------------------ r4297 | vasil | 2009-02-25 17:19:19 +0200 (Wed, 25 Feb 2009) | 4 lines branches/zip: White-space cleanup in the ChangeLog ------------------------------------------------------------------------ r4301 | vasil | 2009-02-25 21:33:32 +0200 (Wed, 25 Feb 2009) | 5 lines branches/zip: Do not output the commands that restore the environment because they depend on the state of the environment before the test starts executing. ------------------------------------------------------------------------ r4315 | vasil | 2009-02-26 09:21:20 +0200 (Thu, 26 Feb 2009) | 5 lines branches/zip: Apply any necessary patches to the mysql tree at the end of setup.sh This step was previously done manually (and sometimes forgotten). ------------------------------------------------------------------------ r4319 | marko | 2009-02-26 23:27:51 +0200 (Thu, 26 Feb 2009) | 6 lines branches/zip: btr_check_blob_fil_page_type(): Do not report FIL_PAGE_TYPE mismatch even when purging a BLOB. Heavy users may have large data files created with MySQL 5.0 or earlier, and they don not want to have the error log flooded with such messages. This fixes Issue #182. ------------------------------------------------------------------------ r4320 | inaam | 2009-02-27 02:13:19 +0200 (Fri, 27 Feb 2009) | 8 lines branches/zip This is to revert the changes made to the plug.in (r4251) as a fix for issue# 178. Changes to plug.in will not propogate to a plugin installation unless autotools are rerun which is unacceptable. A fix for issue# 178 will be committed in a separate commit. ------------------------------------------------------------------------ r4321 | inaam | 2009-02-27 02:16:46 +0200 (Fri, 27 Feb 2009) | 6 lines branches/zip This is a fix for issue#178. Instead of using UNIV_LINUX which is defined through CFLAGS we use compiler generated define __linux__ that is effective for both .c and .cc files. ------------------------------------------------------------------------ r4324 | vasil | 2009-02-27 13:27:18 +0200 (Fri, 27 Feb 2009) | 39 lines branches/zip: Add FreeBSD to the list of the operating systems that have sizeof(pthread_t) == sizeof(void*) (i.e. word size). On FreeBSD pthread_t is defined like: /usr/include/sys/_pthreadtypes.h: typedef struct pthread *pthread_t; I did the following tests (per Inaam's recommendation): a) appropriate version of GCC is available on that platform (4.1.2 or higher for atomics to be available) On FreeBSD 6.x the default compiler is 3.4.6, on FreeBSD 7.x the default one is 4.2.1. One can always install the version of choice from the ports collection. If gcc 3.x is used then HAVE_GCC_ATOMIC_BUILTINS will not be defined and thus the change I am committing will make no difference. b) find out if sizeof(pthread_t) == sizeof(long) On 32 bit both are 4 bytes, on 64 bit both are 8 bytes. c) find out the compiler generated platform define (e.g.: __aix, __sunos__ etc.) The macro is __FreeBSD__. d) patch univ.i with the appropriate platform define e) build the mysql f) ensure it is using atomic builtins (look at the err.log message at system startup. It should say we are using atomics for both mutexes and rw-locks) g) do sanity testing (keeping in view the smp changes) I ran the mysql-test suite. All tests pass. ------------------------------------------------------------------------ r4353 | vasil | 2009-03-05 09:27:29 +0200 (Thu, 05 Mar 2009) | 6 lines branches/zip: As suggested by Ken, print a message that says that the Google SMP patch (GCC atomics) is disabled if it is. Also extend the message when the patch is partially enabled to make it clear that it is partially enabled. ------------------------------------------------------------------------ r4356 | vasil | 2009-03-05 13:49:51 +0200 (Thu, 05 Mar 2009) | 4 lines branches/zip: Fix typo made in r4353. ------------------------------------------------------------------------ r4357 | vasil | 2009-03-05 16:38:59 +0200 (Thu, 05 Mar 2009) | 23 lines branches/zip: Implement a check whether pthread_t objects can be used by GCC atomic builtin functions. This check is implemented in plug.in and defines the macro HAVE_ATOMIC_PTHREAD_T. This macro is checked in univ.i and the relevant part of the code enabled (the one that uses GCC atomics against pthread_t objects). In addition to this, the same program that is compiled as part of the plug.in check is added in ut/ut0auxconf.c. In the InnoDB Plugin source archives that are shipped to the users, a generated Makefile.in is added. That Makefile.in will be modified to compile ut/ut0auxconf.c and define the macro HAVE_ATOMIC_PTHREAD_T if the compilation succeeds. I.e. Makefile.in will emulate the work that is done by plug.in. This is done in order to make the check happen and HAVE_ATOMIC_PTHREAD_T eventually defined without regenerating MySQL's ./configure from ./storage/innobase/plug.in. The point is not to ask users to install the autotools and regenerate ./configure. rb://95 Approved by: Marko ------------------------------------------------------------------------ r4360 | vasil | 2009-03-05 22:23:17 +0200 (Thu, 05 Mar 2009) | 21 lines branches/zip: Merge revisions 4287:4357 from branches/5.1: ------------------------------------------------------------------------ r4325 | sunny | 2009-03-02 02:28:52 +0200 (Mon, 02 Mar 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Bug#43203: Overflow from auto incrementing causes server segv It was not a SIGSEGV but an assertion failure. The assertion was checking the invariant that *first_value passed in by MySQL doesn't contain a value that is greater than the max value for that type. The assertion has been changed to a check and if the value is greater than the max we report a generic AUTOINC failure. rb://93 Approved by Heikki ------------------------------------------------------------------------ ------------------------------------------------------------------------ r4361 | vasil | 2009-03-05 22:27:54 +0200 (Thu, 05 Mar 2009) | 30 lines branches/zip: Merge revision 4358 from branches/5.1 (resolving a conflict): ------------------------------------------------------------------------ r4358 | vasil | 2009-03-05 21:21:10 +0200 (Thu, 05 Mar 2009) | 21 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2728.19.1 committer: Alfranio Correia <alfranio.correia@sun.com> branch nick: mysql-5.1-bugteam timestamp: Tue 2009-02-03 11:36:46 +0000 message: BUG#42445 Warning messages in innobase/handler/ha_innodb.cc There was a type casting problem in the storage/innobase/handler/ha_innodb.cc, (int ha_innobase::write_row(...)). Innobase uses has an internal error variable of type 'ulint' while mysql uses an 'int'. To fix the problem the function manipulates an error variable of type 'ulint' and only casts it into 'int' when needs to return the value. modified: storage/innobase/handler/ha_innodb.cc ------------------------------------------------------------------------ ------------------------------------------------------------------------ r4362 | vasil | 2009-03-05 22:29:07 +0200 (Thu, 05 Mar 2009) | 23 lines branches/zip: Merge revision 4359 from branches/5.1: ------------------------------------------------------------------------ r4359 | vasil | 2009-03-05 21:42:01 +0200 (Thu, 05 Mar 2009) | 14 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2747 committer: Timothy Smith <timothy.smith@sun.com> branch nick: 51 timestamp: Fri 2009-01-16 17:49:07 +0100 message: Add another cast to ignore int/ulong difference in error types, silence warning on Win64 modified: storage/innobase/handler/ha_innodb.cc ------------------------------------------------------------------------ ------------------------------------------------------------------------ r4363 | vasil | 2009-03-05 22:31:37 +0200 (Thu, 05 Mar 2009) | 4 lines branches/zip: Add ChangeLog entry for the bugfix in c4360. ------------------------------------------------------------------------ r4378 | calvin | 2009-03-09 10:10:17 +0200 (Mon, 09 Mar 2009) | 7 lines branches/zip: remove compile flag MYSQL_SERVER for dynamic plugin The dynamic plugin on Windows used to be built with MYSQL_SERVER compile flag, while it is not the case for other platforms. r3797 assumed MYSQL_SERVER was not defined for dynamic plugin, which introduced the engine crash during dropping a database. ------------------------------------------------------------------------ r4396 | marko | 2009-03-12 09:22:27 +0200 (Thu, 12 Mar 2009) | 3 lines branches/zip: btr_store_big_rec_extern_fields(): Initialize FIL_PAGE_TYPE in a separate redo log entry. This will make ibbackup --apply-log debugging easier. ------------------------------------------------------------------------ r4397 | marko | 2009-03-12 09:26:11 +0200 (Thu, 12 Mar 2009) | 3 lines branches/zip: trx_sys_create_doublewrite_buf(): As the dummy change, initialize FIL_PAGE_TYPE. This will make it easier to write the debug assertions for ibbackup --apply-log. ------------------------------------------------------------------------ r4401 | marko | 2009-03-12 10:26:40 +0200 (Thu, 12 Mar 2009) | 19 lines branches/zip: Merge revisions 4359:4400 from branches/5.1: ------------------------------------------------------------------------ r4399 | marko | 2009-03-12 09:38:05 +0200 (Thu, 12 Mar 2009) | 2 lines branches/5.1: row_sel_get_clust_rec_for_mysql(): Store the cursor position also for unlock_row(). (Bug #39320) ------------------------------------------------------------------------ r4400 | marko | 2009-03-12 10:06:44 +0200 (Thu, 12 Mar 2009) | 5 lines branches/5.1: Fix a bug in multi-table semi-consistent reads. Remember the acquired record locks per table handle (row_prebuilt_t) rather than per transaction (trx_t), so that unlock_row should successfully unlock all non-matching rows in multi-table operations. This deficiency was found while investigating Bug #39320. ------------------------------------------------------------------------ These were submitted as rb://94 and rb://96 and approved by Heikki Tuuri. ------------------------------------------------------------------------ r4455 | marko | 2009-03-16 11:43:34 +0200 (Mon, 16 Mar 2009) | 2 lines branches/zip: UT_LIST_VALIDATE(): Add the parameter ASSERTION and adjust all callers. ------------------------------------------------------------------------ r4456 | marko | 2009-03-16 12:59:25 +0200 (Mon, 16 Mar 2009) | 6 lines branches/zip: UT_LIST_VALIDATE(): Assert that the link is non-NULL before dereferencing it. In this way, ut_list_node_313 will be pointing to the last non-NULL list item at the time of the assertion failure. (gcc-4.3.2 -O3 seems to optimize the common subexpressions and make the variable NULL, though.) ------------------------------------------------------------------------ r4457 | marko | 2009-03-16 14:12:02 +0200 (Mon, 16 Mar 2009) | 2 lines branches/zip: sync_thread_add_level(): Make the assertions about level == SYNC_BUF_BLOCK more readable. ------------------------------------------------------------------------ r4461 | vasil | 2009-03-17 09:38:19 +0200 (Tue, 17 Mar 2009) | 6 lines branches/zip: Remove mysql-test/patches/bug32625.diff because that bug was fixed in the mysql repository (1 year and 4 months after sending them the simple patch!). See http://bugs.mysql.com/32625 ------------------------------------------------------------------------ r4465 | marko | 2009-03-17 12:34:19 +0200 (Tue, 17 Mar 2009) | 1 line branches/zip: buf0buddy.c: Add and adjust some debug assertions. ------------------------------------------------------------------------ r4473 | vasil | 2009-03-17 15:50:30 +0200 (Tue, 17 Mar 2009) | 5 lines branches/zip: Increment the InnoDB Plugin version from 1.0.3 to 1.0.4 now that 1.0.3 has been released. ------------------------------------------------------------------------ r4478 | vasil | 2009-03-18 11:53:53 +0200 (Wed, 18 Mar 2009) | 5 lines branches/zip: Remove mysql-test/patches/bug41893.diff because that bug has been fixed in the MySQL repository, see http://bugs.mysql.com/41893. ------------------------------------------------------------------------ r4479 | marko | 2009-03-18 12:43:54 +0200 (Wed, 18 Mar 2009) | 2 lines branches/zip: buf_LRU_block_remove_hashed_page(): Add some debug assertions. ------------------------------------------------------------------------ r4480 | marko | 2009-03-18 14:32:13 +0200 (Wed, 18 Mar 2009) | 1 line branches/zip: buf_buddy_free_low(): Correct the function comment. ------------------------------------------------------------------------ r4482 | marko | 2009-03-19 15:23:32 +0200 (Thu, 19 Mar 2009) | 12 lines branches/zip: Merge revisions 4400:4481 from branches/5.1: ------------------------------------------------------------------------ r4481 | marko | 2009-03-19 15:01:48 +0200 (Thu, 19 Mar 2009) | 6 lines branches/5.1: row_unlock_for_mysql(): Do not unlock records that were modified by the current transaction. This bug was introduced or unmasked in r4400. rb://97 approved by Heikki Tuuri ------------------------------------------------------------------------ ------------------------------------------------------------------------ r4490 | marko | 2009-03-20 12:33:33 +0200 (Fri, 20 Mar 2009) | 4 lines branches/zip: Non-functional change for reducing dependencies in InnoDB Hot Backup: Replace srv_sys->dummy_ind1 and srv_sys->dummy_ind2 with dict_ind_redundant and dict_ind_compact, initialized in dict_init(). ------------------------------------------------------------------------ r4491 | marko | 2009-03-20 12:45:18 +0200 (Fri, 20 Mar 2009) | 2 lines branches/zip: Add const qualifiers or in/out comments to some function parameters in log0log. ------------------------------------------------------------------------ r4492 | marko | 2009-03-20 12:52:14 +0200 (Fri, 20 Mar 2009) | 5 lines branches/zip: page_validate(): Always report the space id and the name of the index. In Hot Backup, do not invoke comparison functions, as MySQL collations will be unavailable. ------------------------------------------------------------------------ r4493 | marko | 2009-03-20 13:24:06 +0200 (Fri, 20 Mar 2009) | 1 line branches/zip: Replace fil_get_space_for_id_low() with fil_space_get_by_id(). ------------------------------------------------------------------------ r4494 | marko | 2009-03-20 13:51:35 +0200 (Fri, 20 Mar 2009) | 3 lines branches/zip: fil0fil.c: Refer to fil_system directly, not via local vars. This eliminates some "unused variable" warnings when building InnoDB Hot Backup in such a way that all mutex operations are no-ops. ------------------------------------------------------------------------ r4495 | marko | 2009-03-20 14:15:52 +0200 (Fri, 20 Mar 2009) | 1 line branches/zip: innobase_get_at_most_n_mbchars(): Declare in ha_prototypes.h. ------------------------------------------------------------------------ r4496 | marko | 2009-03-20 14:48:26 +0200 (Fri, 20 Mar 2009) | 1 line branches/zip: recv_recover_page(): Remove compile-time constant parameters. ------------------------------------------------------------------------ r4497 | marko | 2009-03-20 14:56:19 +0200 (Fri, 20 Mar 2009) | 1 line branches/zip: recv_sys_init(): Remove a compile-time constant parameter. ------------------------------------------------------------------------ r4498 | marko | 2009-03-20 15:08:05 +0200 (Fri, 20 Mar 2009) | 4 lines branches/zip: Non-functional change: Add const qualifiers. log_block_checksum_is_ok_or_old_format(), recv_sys_add_to_parsing_buf(): The log block is read-only. Make it const. ------------------------------------------------------------------------ r4499 | marko | 2009-03-20 15:10:25 +0200 (Fri, 20 Mar 2009) | 1 line branches/zip: recv_scan_log_recs(): Remove a compile-time constant parameter. ------------------------------------------------------------------------ r4500 | marko | 2009-03-20 15:47:17 +0200 (Fri, 20 Mar 2009) | 1 line branches/zip: fil_init(): Add the parameter hash_size. ------------------------------------------------------------------------ r4501 | vasil | 2009-03-20 16:50:41 +0200 (Fri, 20 Mar 2009) | 4 lines branches/zip: Add any entry about the release of 1.0.3 in the ChangeLog. ------------------------------------------------------------------------ r4515 | marko | 2009-03-23 10:49:53 +0200 (Mon, 23 Mar 2009) | 1 line branches/zip: hash_table_t: adaptive: Remove from UNIV_HOTBACKUP builds. ------------------------------------------------------------------------ r4516 | marko | 2009-03-23 10:57:16 +0200 (Mon, 23 Mar 2009) | 2 lines branches/zip: Define and use ASSERT_HASH_MUTEX_OWN. Make it a no-op in UNIV_HOTBACKUP builds. ------------------------------------------------------------------------ r4517 | marko | 2009-03-23 11:07:20 +0200 (Mon, 23 Mar 2009) | 2 lines branches/zip: Define and use PAGE_ZIP_MATCH. In UNIV_HOTBACKUP builds, assume fixed allocation. ------------------------------------------------------------------------ r4521 | marko | 2009-03-23 12:05:47 +0200 (Mon, 23 Mar 2009) | 1 line branches/zip: buf_page_print(): Clean up the code #ifdef UNIV_HOTBACKUP. ------------------------------------------------------------------------ r4522 | marko | 2009-03-23 12:20:50 +0200 (Mon, 23 Mar 2009) | 2 lines branches/zip: Exclude some operating system interface code from UNIV_HOTBACKUP builds. ------------------------------------------------------------------------ r4523 | marko | 2009-03-23 13:00:43 +0200 (Mon, 23 Mar 2009) | 2 lines branches/zip: Remove the remaining references to hash_table_t::adapive from UNIV_HOTBACKUP builds. This should have been done in r4515. ------------------------------------------------------------------------ r4524 | marko | 2009-03-23 14:05:18 +0200 (Mon, 23 Mar 2009) | 2 lines branches/zip: Enclose recv_recovery_from_backup_on and recv_recovery_from_backup_is_on() in #ifdef UNIV_LOG_ARCHIVE. ------------------------------------------------------------------------ r4525 | marko | 2009-03-23 14:57:45 +0200 (Mon, 23 Mar 2009) | 2 lines branches/zip: recv_parse_or_apply_log_rec_body(): Add debug assertions ensuring that FIL_PAGE_TYPE makes sense when applying log records. ------------------------------------------------------------------------ r4526 | marko | 2009-03-23 16:21:34 +0200 (Mon, 23 Mar 2009) | 2 lines branches/zip: Remove unneeded definitions and dependencies from UNIV_HOTBACKUP builds. ------------------------------------------------------------------------ r4527 | calvin | 2009-03-23 23:15:33 +0200 (Mon, 23 Mar 2009) | 5 lines branches/zip: adjust build files on Windows Adjust the patch positions based on the latest MySQL source. Also add the patches to the .bat files for vs9. ------------------------------------------------------------------------
17 years ago
9 years ago
branches/innodb+: Merge revisions 4150:4528 from branches/zip: ------------------------------------------------------------------------ r4152 | marko | 2009-02-10 12:52:27 +0200 (Tue, 10 Feb 2009) | 12 lines branches/zip: When innodb_use_sys_malloc is set, ignore innodb_additional_mem_pool_size, because nothing will be allocated from mem_comm_pool. mem_pool_create(): Remove the assertion about size. The function will work with any size. However, an assertion would fail in ut_malloc_low() when size==0. mem_init(): When srv_use_sys_malloc is set, pass size=1 to mem_pool_create(). mem0mem.c: Add #include "srv0srv.h" that is needed by mem0dbg.c. ------------------------------------------------------------------------ r4153 | vasil | 2009-02-10 22:58:17 +0200 (Tue, 10 Feb 2009) | 14 lines branches/zip: (followup to r4145) Non-functional change: Change the os_atomic_increment() and os_compare_and_swap() functions to macros to avoid artificial limitations on the types of those functions' arguments. As a consequence typecasts from the source code can be removed. Also remove Google's copyright from os0sync.ic because that file no longer contains code from Google. Approved by: Marko (rb://88), also ok from Inaam via IM ------------------------------------------------------------------------ r4163 | marko | 2009-02-12 00:14:19 +0200 (Thu, 12 Feb 2009) | 4 lines branches/zip: Make innodb_thread_concurrency=0 the default. The old default was 8. ------------------------------------------------------------------------ r4169 | calvin | 2009-02-12 10:37:10 +0200 (Thu, 12 Feb 2009) | 3 lines branches/zip: Adjust the result file of innodb_thread_concurrency_basic test. The default value of innodb_thread_concurrency is changed to 0 (from 8) via r4163. ------------------------------------------------------------------------ r4174 | vasil | 2009-02-12 17:38:27 +0200 (Thu, 12 Feb 2009) | 4 lines branches/zip: Fix pathname of the file to patch. ------------------------------------------------------------------------ r4176 | vasil | 2009-02-13 10:06:31 +0200 (Fri, 13 Feb 2009) | 7 lines branches/zip: Fix the failing mysql-test partition_innodb, which failed only if run after innodb_trx_weight (or other test that would leave LATEST DEADLOCK ERROR into the output of SHOW ENGINE INNODB STATUS). Find further explanation for the failure at the top of the added patch partition_innodb.diff. ------------------------------------------------------------------------ r4198 | vasil | 2009-02-17 09:06:07 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: Add the full text of the GPLv2 license into the root directory of the plugin. In previous releases this file was copied from an external source (https://svn.innodb.com/svn/plugin/trunk/support/COPYING) "manually" when creating the source and binary archives. It is less confusing to have this present in the root directory of the SVN branch. ------------------------------------------------------------------------ r4199 | vasil | 2009-02-17 09:11:58 +0200 (Tue, 17 Feb 2009) | 4 lines branches/zip: Add Google's license into COPYING.Google. ------------------------------------------------------------------------ r4200 | vasil | 2009-02-17 09:56:33 +0200 (Tue, 17 Feb 2009) | 11 lines branches/zip: To the files touched by the Google patch from c4144 (excluding include/os0sync.ic because later we removed Google code from that file): * Remove the Google license * Remove old Innobase copyright lines * Add a reference to the Google license and to the GPLv2 license at the top, as recommended by the lawyers at Oracle Legal. ------------------------------------------------------------------------ r4201 | vasil | 2009-02-17 10:12:02 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 1/28] ------------------------------------------------------------------------ r4202 | vasil | 2009-02-17 10:15:06 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 2/28] ------------------------------------------------------------------------ r4203 | vasil | 2009-02-17 10:25:45 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 3/28] ------------------------------------------------------------------------ r4204 | vasil | 2009-02-17 10:55:41 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 4/28] ------------------------------------------------------------------------ r4205 | vasil | 2009-02-17 10:59:22 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 5/28] ------------------------------------------------------------------------ r4206 | vasil | 2009-02-17 11:02:27 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 6/28] ------------------------------------------------------------------------ r4207 | vasil | 2009-02-17 11:04:28 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 7/28] ------------------------------------------------------------------------ r4208 | vasil | 2009-02-17 11:06:49 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 8/28] ------------------------------------------------------------------------ r4209 | vasil | 2009-02-17 11:10:18 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 9/28] ------------------------------------------------------------------------ r4210 | vasil | 2009-02-17 11:12:41 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 10/28] ------------------------------------------------------------------------ r4211 | vasil | 2009-02-17 11:14:40 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 11/28] ------------------------------------------------------------------------ r4212 | vasil | 2009-02-17 11:18:35 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 12/28] ------------------------------------------------------------------------ r4213 | vasil | 2009-02-17 11:24:40 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 13/28] ------------------------------------------------------------------------ r4214 | vasil | 2009-02-17 11:27:31 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 13/28] ------------------------------------------------------------------------ r4215 | vasil | 2009-02-17 11:29:55 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 15/28] ------------------------------------------------------------------------ r4216 | vasil | 2009-02-17 11:33:38 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 16/28] ------------------------------------------------------------------------ r4217 | vasil | 2009-02-17 11:36:44 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 17/28] ------------------------------------------------------------------------ r4218 | vasil | 2009-02-17 11:39:11 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 18/28] ------------------------------------------------------------------------ r4219 | vasil | 2009-02-17 11:41:24 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 19/28] ------------------------------------------------------------------------ r4220 | vasil | 2009-02-17 11:43:50 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 20/28] ------------------------------------------------------------------------ r4221 | vasil | 2009-02-17 11:46:52 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 21/28] ------------------------------------------------------------------------ r4222 | vasil | 2009-02-17 11:50:12 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 22/28] ------------------------------------------------------------------------ r4223 | vasil | 2009-02-17 11:53:58 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 23/28] ------------------------------------------------------------------------ r4224 | vasil | 2009-02-17 12:01:41 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 24/28] ------------------------------------------------------------------------ r4225 | vasil | 2009-02-17 12:05:45 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 25/28] ------------------------------------------------------------------------ r4226 | vasil | 2009-02-17 12:09:16 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 26/28] ------------------------------------------------------------------------ r4227 | vasil | 2009-02-17 12:12:56 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 27/28] ------------------------------------------------------------------------ r4228 | vasil | 2009-02-17 12:14:04 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 28/28] ------------------------------------------------------------------------ r4229 | vasil | 2009-02-17 12:30:55 +0200 (Tue, 17 Feb 2009) | 4 lines branches/zip: Add the copyright notice to the non C files. ------------------------------------------------------------------------ r4231 | marko | 2009-02-17 14:26:53 +0200 (Tue, 17 Feb 2009) | 12 lines Minor cleanup of the Google SMP patch. sync_array_object_signalled(): Add a (void) cast to eliminate a gcc warning about the return value of os_atomic_increment() being ignored. rw_lock_create_func(): Properly indent the preprocessor directives. rw_lock_x_lock_low(), rw_lock_x_lock_func_nowait(): Split lines correctly. rw_lock_set_writer_id_and_recursion_flag(): Silence a Valgrind warning. Do not mix statements and variable declarations. ------------------------------------------------------------------------ r4232 | marko | 2009-02-17 14:59:54 +0200 (Tue, 17 Feb 2009) | 3 lines branches/zip: When assigning lock->recursive = FALSE, also flag lock->writer_thread invalid, so that Valgrind will catch more errors. This is related to Issue #175. ------------------------------------------------------------------------ r4242 | marko | 2009-02-18 17:01:09 +0200 (Wed, 18 Feb 2009) | 2 lines branches/zip: UT_DBG_STOP: Use do{} while(0) to silence a g++-4.3.2 warning about a while(0); statement. This should fix (part of) Issue #176. ------------------------------------------------------------------------ r4243 | marko | 2009-02-18 17:04:03 +0200 (Wed, 18 Feb 2009) | 3 lines branches/zip: buf_buddy_get_slot(): Fix a gcc 4.3.2 warning about an empty body of a "for" statement. This fixes part of Issue #176. ------------------------------------------------------------------------ r4244 | marko | 2009-02-18 17:25:45 +0200 (Wed, 18 Feb 2009) | 11 lines branches/zip: Protect ut_total_allocated_memory with ut_list_mutex. Unprotected updates to ut_total_allocated_memory in os_mem_alloc_large() and os_mem_free_large(), called during fast index creation, may corrupt the variable and cause assertion failures. Also, add UNIV_MEM_ALLOC() and UNIV_MEM_FREE() instrumentation around os_mem_alloc_large() and os_mem_free_large(), so that Valgrind can detect more errors. rb://90 approved by Heikki Tuuri. This addresses Issue #177. ------------------------------------------------------------------------ r4248 | marko | 2009-02-19 11:52:39 +0200 (Thu, 19 Feb 2009) | 2 lines branches/zip: page_zip_set_size(): Fix a g++ 4.3.2 warning about an empty body in a "for" statement. This closes Issue #176. ------------------------------------------------------------------------ r4251 | inaam | 2009-02-19 15:46:27 +0200 (Thu, 19 Feb 2009) | 8 lines branches/zip: Issue #178 rb://91 Change plug.in to have same CXXFLAGS as CFLAGS. This is to ensure that both .c and .cc files get compiled with same flags. To fix the issue where UNIV_LINUX was defined only in .c files. Approved by: Marko ------------------------------------------------------------------------ r4258 | vasil | 2009-02-20 11:52:19 +0200 (Fri, 20 Feb 2009) | 7 lines branches/zip: Cleanup in ChangeLog: * Wrap lines at 78 characters * Changed files are listed alphabetically * White-space cleanup ------------------------------------------------------------------------ r4259 | vasil | 2009-02-20 11:59:42 +0200 (Fri, 20 Feb 2009) | 6 lines branches/zip: ChangeLog: Remove include/os0sync.ic from the entry about the google patch, this file was modified later to not include Google's code. ------------------------------------------------------------------------ r4262 | vasil | 2009-02-20 14:56:59 +0200 (Fri, 20 Feb 2009) | 373 lines branches/zip: Merge revisions 4035:4261 from branches/5.1: ------------------------------------------------------------------------ r4065 | sunny | 2009-01-29 16:01:36 +0200 (Thu, 29 Jan 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: In the last round of AUTOINC cleanup we assumed that AUTOINC is only defined for integer columns. This caused an assertion failure when we checked for the maximum value of a column type. We now calculate the max value for floating-point autoinc columns too. Fix Bug#42400 - InnoDB autoinc code can't handle floating-point columns rb://84 and Mantis issue://162 ------------------------------------------------------------------------ r4111 | sunny | 2009-02-03 22:06:52 +0200 (Tue, 03 Feb 2009) | 2 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Add the ULL suffix otherwise there is an overflow. ------------------------------------------------------------------------ r4128 | vasil | 2009-02-08 21:36:45 +0200 (Sun, 08 Feb 2009) | 18 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2709.20.31 committer: Timothy Smith <timothy.smith@sun.com> branch nick: 51 timestamp: Fri 2008-12-19 01:28:51 +0100 message: Disable part of innodb-autoinc.test, because the MySQL server asserts when compiled --with-debug, due to bug 39828, "autoinc wraps around when offset and increment > 1". This change should be reverted when that bug is fixed (and a a few other minor changes to the test as described in comments). modified: mysql-test/r/innodb-autoinc.result mysql-test/t/innodb-autoinc.test ------------------------------------------------------------------------ r4129 | vasil | 2009-02-08 21:54:25 +0200 (Sun, 08 Feb 2009) | 310 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Merge a change from MySQL: [looks like the changes to innodb-autoinc.test were made as part of the following huge merge, but we are merging only changes to that file] ------------------------------------------------------------ revno: 2546.47.1 committer: Luis Soares <luis.soares@sun.com> branch nick: 5.1-rpl timestamp: Fri 2009-01-23 13:22:05 +0100 message: merge: 5.1 -> 5.1-rpl conflicts: Text conflict in client/mysqltest.cc Text conflict in mysql-test/include/wait_until_connected_again.inc Text conflict in mysql-test/lib/mtr_report.pm Text conflict in mysql-test/mysql-test-run.pl Text conflict in mysql-test/r/events_bugs.result Text conflict in mysql-test/r/log_state.result Text conflict in mysql-test/r/myisam_data_pointer_size_func.result Text conflict in mysql-test/r/mysqlcheck.result Text conflict in mysql-test/r/query_cache.result Text conflict in mysql-test/r/status.result Text conflict in mysql-test/suite/binlog/r/binlog_index.result Text conflict in mysql-test/suite/binlog/r/binlog_innodb.result Text conflict in mysql-test/suite/rpl/r/rpl_packet.result Text conflict in mysql-test/suite/rpl/t/rpl_packet.test Text conflict in mysql-test/t/disabled.def Text conflict in mysql-test/t/events_bugs.test Text conflict in mysql-test/t/log_state.test Text conflict in mysql-test/t/myisam_data_pointer_size_func.test Text conflict in mysql-test/t/mysqlcheck.test Text conflict in mysql-test/t/query_cache.test Text conflict in mysql-test/t/rpl_init_slave_func.test Text conflict in mysql-test/t/status.test removed: mysql-test/suite/parts/r/partition_bit_ndb.result mysql-test/suite/parts/t/partition_bit_ndb.test mysql-test/suite/parts/t/partition_sessions.test mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test mysql-test/t/log_bin_trust_function_creators_func-master.opt mysql-test/t/rpl_init_slave_func-slave.opt added: mysql-test/include/check_events_off.inc mysql-test/include/cleanup_fake_relay_log.inc mysql-test/include/have_simple_parser.inc mysql-test/include/no_running_event_scheduler.inc mysql-test/include/no_running_events.inc mysql-test/include/running_event_scheduler.inc mysql-test/include/setup_fake_relay_log.inc mysql-test/include/wait_condition_sp.inc mysql-test/r/fulltext_plugin.result mysql-test/r/have_simple_parser.require mysql-test/r/innodb_bug38231.result mysql-test/r/innodb_bug39438.result mysql-test/r/innodb_mysql_rbk.result mysql-test/r/partition_innodb_semi_consistent.result mysql-test/r/query_cache_28249.result mysql-test/r/status2.result mysql-test/std_data/bug40482-bin.000001 mysql-test/suite/binlog/r/binlog_innodb_row.result mysql-test/suite/binlog/t/binlog_innodb_row.test mysql-test/suite/rpl/r/rpl_binlog_corruption.result mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt mysql-test/suite/rpl/t/rpl_binlog_corruption.test mysql-test/suite/sys_vars/r/tmp_table_size_basic.result mysql-test/suite/sys_vars/t/tmp_table_size_basic.test mysql-test/t/fulltext_plugin-master.opt mysql-test/t/fulltext_plugin.test mysql-test/t/innodb_bug38231.test mysql-test/t/innodb_bug39438-master.opt mysql-test/t/innodb_bug39438.test mysql-test/t/innodb_mysql_rbk-master.opt mysql-test/t/innodb_mysql_rbk.test mysql-test/t/partition_innodb_semi_consistent-master.opt mysql-test/t/partition_innodb_semi_consistent.test mysql-test/t/query_cache_28249.test mysql-test/t/status2.test renamed: mysql-test/suite/funcs_1/r/is_collation_character_set_applicability.result => mysql-test/suite/funcs_1/r/is_coll_char_set_appl.result mysql-test/suite/funcs_1/t/is_collation_character_set_applicability.test => mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test modified: .bzr-mysql/default.conf CMakeLists.txt client/mysql.cc client/mysql_upgrade.c client/mysqlcheck.c client/mysqltest.cc configure.in extra/resolve_stack_dump.c extra/yassl/include/openssl/ssl.h include/config-win.h include/m_ctype.h include/my_global.h mysql-test/extra/binlog_tests/database.test mysql-test/extra/rpl_tests/rpl_auto_increment.test mysql-test/include/commit.inc mysql-test/include/have_32bit.inc mysql-test/include/have_64bit.inc mysql-test/include/index_merge1.inc mysql-test/include/linux_sys_vars.inc mysql-test/include/windows_sys_vars.inc mysql-test/lib/mtr_report.pm mysql-test/mysql-test-run.pl mysql-test/r/alter_table.result mysql-test/r/commit_1innodb.result mysql-test/r/create.result mysql-test/r/csv.result mysql-test/r/ctype_ucs.result mysql-test/r/date_formats.result mysql-test/r/events_bugs.result mysql-test/r/events_scheduling.result mysql-test/r/fulltext.result mysql-test/r/func_if.result mysql-test/r/func_in.result mysql-test/r/func_str.result mysql-test/r/func_time.result mysql-test/r/grant.result mysql-test/r/index_merge_myisam.result mysql-test/r/information_schema.result mysql-test/r/innodb-autoinc.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/log_bin_trust_function_creators_func.result mysql-test/r/log_state.result mysql-test/r/myisampack.result mysql-test/r/mysql.result mysql-test/r/mysqlcheck.result mysql-test/r/partition_datatype.result mysql-test/r/partition_mgm.result mysql-test/r/partition_pruning.result mysql-test/r/query_cache.result mysql-test/r/read_buffer_size_basic.result mysql-test/r/read_rnd_buffer_size_basic.result mysql-test/r/rpl_init_slave_func.result mysql-test/r/select.result mysql-test/r/status.result mysql-test/r/strict.result mysql-test/r/temp_table.result mysql-test/r/type_bit.result mysql-test/r/type_date.result mysql-test/r/type_float.result mysql-test/r/warnings_engine_disabled.result mysql-test/r/xml.result mysql-test/suite/binlog/r/binlog_database.result mysql-test/suite/binlog/r/binlog_index.result mysql-test/suite/binlog/r/binlog_innodb.result mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result mysql-test/suite/binlog/t/binlog_innodb.test mysql-test/suite/funcs_1/r/is_columns_is.result mysql-test/suite/funcs_1/r/is_engines.result mysql-test/suite/funcs_1/r/storedproc.result mysql-test/suite/funcs_1/storedproc/param_check.inc mysql-test/suite/funcs_2/t/disabled.def mysql-test/suite/ndb/t/disabled.def mysql-test/suite/parts/r/partition_bit_innodb.result mysql-test/suite/parts/r/partition_bit_myisam.result mysql-test/suite/parts/r/partition_special_innodb.result mysql-test/suite/parts/t/disabled.def mysql-test/suite/parts/t/partition_special_innodb.test mysql-test/suite/parts/t/partition_value_innodb.test mysql-test/suite/parts/t/partition_value_myisam.test mysql-test/suite/parts/t/partition_value_ndb.test mysql-test/suite/rpl/r/rpl_auto_increment.result mysql-test/suite/rpl/r/rpl_packet.result mysql-test/suite/rpl/r/rpl_row_create_table.result mysql-test/suite/rpl/r/rpl_slave_skip.result mysql-test/suite/rpl/r/rpl_trigger.result mysql-test/suite/rpl/t/disabled.def mysql-test/suite/rpl/t/rpl_packet.test mysql-test/suite/rpl/t/rpl_row_create_table.test mysql-test/suite/rpl/t/rpl_slave_skip.test mysql-test/suite/rpl/t/rpl_trigger.test mysql-test/suite/rpl_ndb/t/disabled.def mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result mysql-test/t/alter_table.test mysql-test/t/create.test mysql-test/t/csv.test mysql-test/t/ctype_ucs.test mysql-test/t/date_formats.test mysql-test/t/disabled.def mysql-test/t/events_bugs.test mysql-test/t/events_scheduling.test mysql-test/t/fulltext.test mysql-test/t/func_if.test mysql-test/t/func_in.test mysql-test/t/func_str.test mysql-test/t/func_time.test mysql-test/t/grant.test mysql-test/t/information_schema.test mysql-test/t/innodb-autoinc.test mysql-test/t/innodb.test mysql-test/t/innodb_mysql.test mysql-test/t/log_bin_trust_function_creators_func.test mysql-test/t/log_state.test mysql-test/t/myisam_data_pointer_size_func.test mysql-test/t/myisampack.test mysql-test/t/mysql.test mysql-test/t/mysqlcheck.test mysql-test/t/partition_innodb_stmt.test mysql-test/t/partition_mgm.test mysql-test/t/partition_pruning.test mysql-test/t/query_cache.test mysql-test/t/rpl_init_slave_func.test mysql-test/t/select.test mysql-test/t/status.test mysql-test/t/strict.test mysql-test/t/temp_table.test mysql-test/t/type_bit.test mysql-test/t/type_date.test mysql-test/t/type_float.test mysql-test/t/warnings_engine_disabled.test mysql-test/t/xml.test mysys/my_getopt.c mysys/my_init.c scripts/mysql_install_db.sh sql-common/my_time.c sql/field.cc sql/field.h sql/filesort.cc sql/ha_partition.cc sql/ha_partition.h sql/item.cc sql/item_cmpfunc.cc sql/item_func.h sql/item_strfunc.cc sql/item_sum.cc sql/item_timefunc.cc sql/item_timefunc.h sql/log.cc sql/log.h sql/log_event.cc sql/log_event.h sql/mysql_priv.h sql/mysqld.cc sql/opt_range.cc sql/partition_info.cc sql/repl_failsafe.cc sql/rpl_constants.h sql/set_var.cc sql/slave.cc sql/spatial.h sql/sql_acl.cc sql/sql_base.cc sql/sql_binlog.cc sql/sql_class.h sql/sql_cursor.cc sql/sql_delete.cc sql/sql_lex.cc sql/sql_lex.h sql/sql_locale.cc sql/sql_parse.cc sql/sql_partition.cc sql/sql_plugin.cc sql/sql_plugin.h sql/sql_profile.cc sql/sql_repl.cc sql/sql_select.cc sql/sql_select.h sql/sql_show.cc sql/sql_table.cc sql/sql_trigger.cc sql/sql_trigger.h sql/table.cc sql/table.h sql/unireg.cc storage/csv/ha_tina.cc storage/federated/ha_federated.cc storage/heap/ha_heap.cc storage/innobase/Makefile.am storage/innobase/btr/btr0sea.c storage/innobase/buf/buf0lru.c storage/innobase/dict/dict0dict.c storage/innobase/dict/dict0mem.c storage/innobase/handler/ha_innodb.cc storage/innobase/handler/ha_innodb.h storage/innobase/include/btr0sea.h storage/innobase/include/dict0dict.h storage/innobase/include/dict0mem.h storage/innobase/include/ha_prototypes.h storage/innobase/include/lock0lock.h storage/innobase/include/row0mysql.h storage/innobase/include/sync0sync.ic storage/innobase/include/ut0ut.h storage/innobase/lock/lock0lock.c storage/innobase/os/os0file.c storage/innobase/plug.in storage/innobase/row/row0mysql.c storage/innobase/row/row0sel.c storage/innobase/srv/srv0srv.c storage/innobase/srv/srv0start.c storage/innobase/ut/ut0ut.c storage/myisam/ft_boolean_search.c strings/ctype.c strings/xml.c tests/mysql_client_test.c win/configure.js mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test ------------------------------------------------------------------------ r4165 | calvin | 2009-02-12 01:34:27 +0200 (Thu, 12 Feb 2009) | 1 line Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: minor non-functional changes. ------------------------------------------------------------------------ ------------------------------------------------------------------------ r4263 | vasil | 2009-02-20 15:00:46 +0200 (Fri, 20 Feb 2009) | 4 lines branches/zip: Add a ChangeLog entry for a change in r4262. ------------------------------------------------------------------------ r4265 | marko | 2009-02-20 22:31:03 +0200 (Fri, 20 Feb 2009) | 5 lines branches/zip: Make innodb_use_sys_malloc=ON the default. Replace srv_use_sys_malloc with UNIV_LIKELY(srv_use_sys_malloc) to improve branch prediction in the default case. Approved by Ken over the IM. ------------------------------------------------------------------------ r4266 | vasil | 2009-02-20 23:29:32 +0200 (Fri, 20 Feb 2009) | 7 lines branches/zip: Add a sentence at the top of COPYING.Google to clarify that this license does not apply to the whole InnoDB. Suggested by: Ken ------------------------------------------------------------------------ r4268 | marko | 2009-02-23 12:43:51 +0200 (Mon, 23 Feb 2009) | 9 lines branches/zip: Initialize ut_list_mutex at startup. Without this fix, ut_list_mutex would be used uninitialized when innodb_use_sys_malloc=1. This fix addresses Issue #181. ut_mem_block_list_init(): Rename to ut_mem_init() and make public. ut_malloc_low(), ut_free_all_mem(): Add ut_a(ut_mem_block_list_inited). mem_init(): Call ut_mem_init(). ------------------------------------------------------------------------ r4269 | marko | 2009-02-23 15:09:49 +0200 (Mon, 23 Feb 2009) | 7 lines branches/zip: When freeing an uncompressed BLOB page, tolerate garbage in FIL_PAGE_TYPE. (Bug #43043, Issue #182) btr_check_blob_fil_page_type(): New function. btr_free_externally_stored_field(), btr_copy_blob_prefix(): Call btr_check_blob_fil_page_type() to check FIL_PAGE_TYPE. ------------------------------------------------------------------------ r4272 | marko | 2009-02-23 23:10:18 +0200 (Mon, 23 Feb 2009) | 8 lines branches/zip: Adjust the fix of Issue #182 in r4269 per Inaam's suggestion. btr_check_blob_fil_page_type(): Replace the parameter const char* op with ibool read. Do not print anything about page type mismatch when reading a BLOB page in Antelope format. Print space id before page number. ------------------------------------------------------------------------ r4273 | marko | 2009-02-24 00:11:11 +0200 (Tue, 24 Feb 2009) | 1 line branches/zip: ut_mem_init(): Add the assertion !ut_mem_block_list_inited. ------------------------------------------------------------------------ r4274 | marko | 2009-02-24 00:14:38 +0200 (Tue, 24 Feb 2009) | 12 lines branches/zip: Fix bugs in the fix of Issue #181. Tested inside and outside Valgrind, with innodb_use_sys_malloc set to 0 and 1. mem_init(): Invoke ut_mem_init() before mem_pool_create(), because the latter one will invoke ut_malloc(). srv_general_init(): Do not initialize the memory subsystem (mem_init()). innobase_init(): Initialize the memory subsystem (mem_init()) before calling srv_parse_data_file_paths_and_sizes(), which needs ut_malloc(). Call ut_free_all_mem() in error handling to clean up after the mem_init(). ------------------------------------------------------------------------ r4280 | marko | 2009-02-24 15:14:59 +0200 (Tue, 24 Feb 2009) | 1 line branches/zip: Remove unused function os_mem_alloc_nocache(). ------------------------------------------------------------------------ r4281 | marko | 2009-02-24 16:02:48 +0200 (Tue, 24 Feb 2009) | 1 line branches/zip: Remove the unused function dict_index_get_type(). ------------------------------------------------------------------------ r4283 | marko | 2009-02-24 23:06:56 +0200 (Tue, 24 Feb 2009) | 1 line branches/zip: srv0start.c: Remove unnecessary #include "mem0pool.h". ------------------------------------------------------------------------ r4284 | marko | 2009-02-24 23:26:38 +0200 (Tue, 24 Feb 2009) | 1 line branches/zip: mem0mem.c: Remove unnecessary #include "mach0data.h". ------------------------------------------------------------------------ r4288 | vasil | 2009-02-25 10:48:07 +0200 (Wed, 25 Feb 2009) | 21 lines branches/zip: Merge revisions 4261:4287 from branches/5.1: ------------------------------------------------------------------------ r4287 | sunny | 2009-02-25 05:32:01 +0200 (Wed, 25 Feb 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Fix Bug#42714 AUTO_INCREMENT errors in 5.1.31. There are two changes to the autoinc handling. 1. To fix the immediate problem from the bug report, we must ensure that the value written to the table is always less than the max value stored in dict_table_t. 2. The second related change is that according to MySQL documentation when the offset is greater than the increment, we should ignore the offset. ------------------------------------------------------------------------ ------------------------------------------------------------------------ r4289 | vasil | 2009-02-25 10:53:51 +0200 (Wed, 25 Feb 2009) | 4 lines branches/zip: Add ChangeLog entry for the fix in r4288. ------------------------------------------------------------------------ r4290 | vasil | 2009-02-25 11:05:44 +0200 (Wed, 25 Feb 2009) | 11 lines branches/zip: Make ChangeLog entries for bugs in bugs.mysql.com in the form: Fix Bug#12345 bug title (for bugs after 1.0.2 was released and the ChangeLog published) There is no need to bloat the ChangeLog with information that is available via bugs.mysql.com. Discussed with: Marko ------------------------------------------------------------------------ r4291 | vasil | 2009-02-25 11:08:32 +0200 (Wed, 25 Feb 2009) | 4 lines branches/zip: Fix Bug synopsis and remove explanation ------------------------------------------------------------------------ r4292 | marko | 2009-02-25 12:09:15 +0200 (Wed, 25 Feb 2009) | 25 lines branches/zip: Correct the initialization of the memory subsystem once again, to finally put Issue #181 to rest. Revert some parts of r4274. It is best not to call ut_malloc() before srv_general_init(). mem_init(): Do not call ut_mem_init(). srv_general_init(): Initialize the memory subsystem in two phases: first ut_mem_init(), then mem_init(). This is because os_sync_init() and sync_init() depend on ut_mem_init() and mem_init() depends on os_sync_init() or sync_init(). srv_parse_data_file_paths_and_sizes(), srv_parse_log_group_home_dirs(): Remove the output parameters. Assign to the global variables directly. Allocate memory with malloc() instead of ut_malloc(), because these functions will be called before srv_general_init(). srv_free_paths_and_sizes(): New function, for cleaning up after srv_parse_data_file_paths_and_sizes() and srv_parse_log_group_home_dirs(). rb://92 approved by Sunny Bains ------------------------------------------------------------------------ r4297 | vasil | 2009-02-25 17:19:19 +0200 (Wed, 25 Feb 2009) | 4 lines branches/zip: White-space cleanup in the ChangeLog ------------------------------------------------------------------------ r4301 | vasil | 2009-02-25 21:33:32 +0200 (Wed, 25 Feb 2009) | 5 lines branches/zip: Do not output the commands that restore the environment because they depend on the state of the environment before the test starts executing. ------------------------------------------------------------------------ r4315 | vasil | 2009-02-26 09:21:20 +0200 (Thu, 26 Feb 2009) | 5 lines branches/zip: Apply any necessary patches to the mysql tree at the end of setup.sh This step was previously done manually (and sometimes forgotten). ------------------------------------------------------------------------ r4319 | marko | 2009-02-26 23:27:51 +0200 (Thu, 26 Feb 2009) | 6 lines branches/zip: btr_check_blob_fil_page_type(): Do not report FIL_PAGE_TYPE mismatch even when purging a BLOB. Heavy users may have large data files created with MySQL 5.0 or earlier, and they don not want to have the error log flooded with such messages. This fixes Issue #182. ------------------------------------------------------------------------ r4320 | inaam | 2009-02-27 02:13:19 +0200 (Fri, 27 Feb 2009) | 8 lines branches/zip This is to revert the changes made to the plug.in (r4251) as a fix for issue# 178. Changes to plug.in will not propogate to a plugin installation unless autotools are rerun which is unacceptable. A fix for issue# 178 will be committed in a separate commit. ------------------------------------------------------------------------ r4321 | inaam | 2009-02-27 02:16:46 +0200 (Fri, 27 Feb 2009) | 6 lines branches/zip This is a fix for issue#178. Instead of using UNIV_LINUX which is defined through CFLAGS we use compiler generated define __linux__ that is effective for both .c and .cc files. ------------------------------------------------------------------------ r4324 | vasil | 2009-02-27 13:27:18 +0200 (Fri, 27 Feb 2009) | 39 lines branches/zip: Add FreeBSD to the list of the operating systems that have sizeof(pthread_t) == sizeof(void*) (i.e. word size). On FreeBSD pthread_t is defined like: /usr/include/sys/_pthreadtypes.h: typedef struct pthread *pthread_t; I did the following tests (per Inaam's recommendation): a) appropriate version of GCC is available on that platform (4.1.2 or higher for atomics to be available) On FreeBSD 6.x the default compiler is 3.4.6, on FreeBSD 7.x the default one is 4.2.1. One can always install the version of choice from the ports collection. If gcc 3.x is used then HAVE_GCC_ATOMIC_BUILTINS will not be defined and thus the change I am committing will make no difference. b) find out if sizeof(pthread_t) == sizeof(long) On 32 bit both are 4 bytes, on 64 bit both are 8 bytes. c) find out the compiler generated platform define (e.g.: __aix, __sunos__ etc.) The macro is __FreeBSD__. d) patch univ.i with the appropriate platform define e) build the mysql f) ensure it is using atomic builtins (look at the err.log message at system startup. It should say we are using atomics for both mutexes and rw-locks) g) do sanity testing (keeping in view the smp changes) I ran the mysql-test suite. All tests pass. ------------------------------------------------------------------------ r4353 | vasil | 2009-03-05 09:27:29 +0200 (Thu, 05 Mar 2009) | 6 lines branches/zip: As suggested by Ken, print a message that says that the Google SMP patch (GCC atomics) is disabled if it is. Also extend the message when the patch is partially enabled to make it clear that it is partially enabled. ------------------------------------------------------------------------ r4356 | vasil | 2009-03-05 13:49:51 +0200 (Thu, 05 Mar 2009) | 4 lines branches/zip: Fix typo made in r4353. ------------------------------------------------------------------------ r4357 | vasil | 2009-03-05 16:38:59 +0200 (Thu, 05 Mar 2009) | 23 lines branches/zip: Implement a check whether pthread_t objects can be used by GCC atomic builtin functions. This check is implemented in plug.in and defines the macro HAVE_ATOMIC_PTHREAD_T. This macro is checked in univ.i and the relevant part of the code enabled (the one that uses GCC atomics against pthread_t objects). In addition to this, the same program that is compiled as part of the plug.in check is added in ut/ut0auxconf.c. In the InnoDB Plugin source archives that are shipped to the users, a generated Makefile.in is added. That Makefile.in will be modified to compile ut/ut0auxconf.c and define the macro HAVE_ATOMIC_PTHREAD_T if the compilation succeeds. I.e. Makefile.in will emulate the work that is done by plug.in. This is done in order to make the check happen and HAVE_ATOMIC_PTHREAD_T eventually defined without regenerating MySQL's ./configure from ./storage/innobase/plug.in. The point is not to ask users to install the autotools and regenerate ./configure. rb://95 Approved by: Marko ------------------------------------------------------------------------ r4360 | vasil | 2009-03-05 22:23:17 +0200 (Thu, 05 Mar 2009) | 21 lines branches/zip: Merge revisions 4287:4357 from branches/5.1: ------------------------------------------------------------------------ r4325 | sunny | 2009-03-02 02:28:52 +0200 (Mon, 02 Mar 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Bug#43203: Overflow from auto incrementing causes server segv It was not a SIGSEGV but an assertion failure. The assertion was checking the invariant that *first_value passed in by MySQL doesn't contain a value that is greater than the max value for that type. The assertion has been changed to a check and if the value is greater than the max we report a generic AUTOINC failure. rb://93 Approved by Heikki ------------------------------------------------------------------------ ------------------------------------------------------------------------ r4361 | vasil | 2009-03-05 22:27:54 +0200 (Thu, 05 Mar 2009) | 30 lines branches/zip: Merge revision 4358 from branches/5.1 (resolving a conflict): ------------------------------------------------------------------------ r4358 | vasil | 2009-03-05 21:21:10 +0200 (Thu, 05 Mar 2009) | 21 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2728.19.1 committer: Alfranio Correia <alfranio.correia@sun.com> branch nick: mysql-5.1-bugteam timestamp: Tue 2009-02-03 11:36:46 +0000 message: BUG#42445 Warning messages in innobase/handler/ha_innodb.cc There was a type casting problem in the storage/innobase/handler/ha_innodb.cc, (int ha_innobase::write_row(...)). Innobase uses has an internal error variable of type 'ulint' while mysql uses an 'int'. To fix the problem the function manipulates an error variable of type 'ulint' and only casts it into 'int' when needs to return the value. modified: storage/innobase/handler/ha_innodb.cc ------------------------------------------------------------------------ ------------------------------------------------------------------------ r4362 | vasil | 2009-03-05 22:29:07 +0200 (Thu, 05 Mar 2009) | 23 lines branches/zip: Merge revision 4359 from branches/5.1: ------------------------------------------------------------------------ r4359 | vasil | 2009-03-05 21:42:01 +0200 (Thu, 05 Mar 2009) | 14 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2747 committer: Timothy Smith <timothy.smith@sun.com> branch nick: 51 timestamp: Fri 2009-01-16 17:49:07 +0100 message: Add another cast to ignore int/ulong difference in error types, silence warning on Win64 modified: storage/innobase/handler/ha_innodb.cc ------------------------------------------------------------------------ ------------------------------------------------------------------------ r4363 | vasil | 2009-03-05 22:31:37 +0200 (Thu, 05 Mar 2009) | 4 lines branches/zip: Add ChangeLog entry for the bugfix in c4360. ------------------------------------------------------------------------ r4378 | calvin | 2009-03-09 10:10:17 +0200 (Mon, 09 Mar 2009) | 7 lines branches/zip: remove compile flag MYSQL_SERVER for dynamic plugin The dynamic plugin on Windows used to be built with MYSQL_SERVER compile flag, while it is not the case for other platforms. r3797 assumed MYSQL_SERVER was not defined for dynamic plugin, which introduced the engine crash during dropping a database. ------------------------------------------------------------------------ r4396 | marko | 2009-03-12 09:22:27 +0200 (Thu, 12 Mar 2009) | 3 lines branches/zip: btr_store_big_rec_extern_fields(): Initialize FIL_PAGE_TYPE in a separate redo log entry. This will make ibbackup --apply-log debugging easier. ------------------------------------------------------------------------ r4397 | marko | 2009-03-12 09:26:11 +0200 (Thu, 12 Mar 2009) | 3 lines branches/zip: trx_sys_create_doublewrite_buf(): As the dummy change, initialize FIL_PAGE_TYPE. This will make it easier to write the debug assertions for ibbackup --apply-log. ------------------------------------------------------------------------ r4401 | marko | 2009-03-12 10:26:40 +0200 (Thu, 12 Mar 2009) | 19 lines branches/zip: Merge revisions 4359:4400 from branches/5.1: ------------------------------------------------------------------------ r4399 | marko | 2009-03-12 09:38:05 +0200 (Thu, 12 Mar 2009) | 2 lines branches/5.1: row_sel_get_clust_rec_for_mysql(): Store the cursor position also for unlock_row(). (Bug #39320) ------------------------------------------------------------------------ r4400 | marko | 2009-03-12 10:06:44 +0200 (Thu, 12 Mar 2009) | 5 lines branches/5.1: Fix a bug in multi-table semi-consistent reads. Remember the acquired record locks per table handle (row_prebuilt_t) rather than per transaction (trx_t), so that unlock_row should successfully unlock all non-matching rows in multi-table operations. This deficiency was found while investigating Bug #39320. ------------------------------------------------------------------------ These were submitted as rb://94 and rb://96 and approved by Heikki Tuuri. ------------------------------------------------------------------------ r4455 | marko | 2009-03-16 11:43:34 +0200 (Mon, 16 Mar 2009) | 2 lines branches/zip: UT_LIST_VALIDATE(): Add the parameter ASSERTION and adjust all callers. ------------------------------------------------------------------------ r4456 | marko | 2009-03-16 12:59:25 +0200 (Mon, 16 Mar 2009) | 6 lines branches/zip: UT_LIST_VALIDATE(): Assert that the link is non-NULL before dereferencing it. In this way, ut_list_node_313 will be pointing to the last non-NULL list item at the time of the assertion failure. (gcc-4.3.2 -O3 seems to optimize the common subexpressions and make the variable NULL, though.) ------------------------------------------------------------------------ r4457 | marko | 2009-03-16 14:12:02 +0200 (Mon, 16 Mar 2009) | 2 lines branches/zip: sync_thread_add_level(): Make the assertions about level == SYNC_BUF_BLOCK more readable. ------------------------------------------------------------------------ r4461 | vasil | 2009-03-17 09:38:19 +0200 (Tue, 17 Mar 2009) | 6 lines branches/zip: Remove mysql-test/patches/bug32625.diff because that bug was fixed in the mysql repository (1 year and 4 months after sending them the simple patch!). See http://bugs.mysql.com/32625 ------------------------------------------------------------------------ r4465 | marko | 2009-03-17 12:34:19 +0200 (Tue, 17 Mar 2009) | 1 line branches/zip: buf0buddy.c: Add and adjust some debug assertions. ------------------------------------------------------------------------ r4473 | vasil | 2009-03-17 15:50:30 +0200 (Tue, 17 Mar 2009) | 5 lines branches/zip: Increment the InnoDB Plugin version from 1.0.3 to 1.0.4 now that 1.0.3 has been released. ------------------------------------------------------------------------ r4478 | vasil | 2009-03-18 11:53:53 +0200 (Wed, 18 Mar 2009) | 5 lines branches/zip: Remove mysql-test/patches/bug41893.diff because that bug has been fixed in the MySQL repository, see http://bugs.mysql.com/41893. ------------------------------------------------------------------------ r4479 | marko | 2009-03-18 12:43:54 +0200 (Wed, 18 Mar 2009) | 2 lines branches/zip: buf_LRU_block_remove_hashed_page(): Add some debug assertions. ------------------------------------------------------------------------ r4480 | marko | 2009-03-18 14:32:13 +0200 (Wed, 18 Mar 2009) | 1 line branches/zip: buf_buddy_free_low(): Correct the function comment. ------------------------------------------------------------------------ r4482 | marko | 2009-03-19 15:23:32 +0200 (Thu, 19 Mar 2009) | 12 lines branches/zip: Merge revisions 4400:4481 from branches/5.1: ------------------------------------------------------------------------ r4481 | marko | 2009-03-19 15:01:48 +0200 (Thu, 19 Mar 2009) | 6 lines branches/5.1: row_unlock_for_mysql(): Do not unlock records that were modified by the current transaction. This bug was introduced or unmasked in r4400. rb://97 approved by Heikki Tuuri ------------------------------------------------------------------------ ------------------------------------------------------------------------ r4490 | marko | 2009-03-20 12:33:33 +0200 (Fri, 20 Mar 2009) | 4 lines branches/zip: Non-functional change for reducing dependencies in InnoDB Hot Backup: Replace srv_sys->dummy_ind1 and srv_sys->dummy_ind2 with dict_ind_redundant and dict_ind_compact, initialized in dict_init(). ------------------------------------------------------------------------ r4491 | marko | 2009-03-20 12:45:18 +0200 (Fri, 20 Mar 2009) | 2 lines branches/zip: Add const qualifiers or in/out comments to some function parameters in log0log. ------------------------------------------------------------------------ r4492 | marko | 2009-03-20 12:52:14 +0200 (Fri, 20 Mar 2009) | 5 lines branches/zip: page_validate(): Always report the space id and the name of the index. In Hot Backup, do not invoke comparison functions, as MySQL collations will be unavailable. ------------------------------------------------------------------------ r4493 | marko | 2009-03-20 13:24:06 +0200 (Fri, 20 Mar 2009) | 1 line branches/zip: Replace fil_get_space_for_id_low() with fil_space_get_by_id(). ------------------------------------------------------------------------ r4494 | marko | 2009-03-20 13:51:35 +0200 (Fri, 20 Mar 2009) | 3 lines branches/zip: fil0fil.c: Refer to fil_system directly, not via local vars. This eliminates some "unused variable" warnings when building InnoDB Hot Backup in such a way that all mutex operations are no-ops. ------------------------------------------------------------------------ r4495 | marko | 2009-03-20 14:15:52 +0200 (Fri, 20 Mar 2009) | 1 line branches/zip: innobase_get_at_most_n_mbchars(): Declare in ha_prototypes.h. ------------------------------------------------------------------------ r4496 | marko | 2009-03-20 14:48:26 +0200 (Fri, 20 Mar 2009) | 1 line branches/zip: recv_recover_page(): Remove compile-time constant parameters. ------------------------------------------------------------------------ r4497 | marko | 2009-03-20 14:56:19 +0200 (Fri, 20 Mar 2009) | 1 line branches/zip: recv_sys_init(): Remove a compile-time constant parameter. ------------------------------------------------------------------------ r4498 | marko | 2009-03-20 15:08:05 +0200 (Fri, 20 Mar 2009) | 4 lines branches/zip: Non-functional change: Add const qualifiers. log_block_checksum_is_ok_or_old_format(), recv_sys_add_to_parsing_buf(): The log block is read-only. Make it const. ------------------------------------------------------------------------ r4499 | marko | 2009-03-20 15:10:25 +0200 (Fri, 20 Mar 2009) | 1 line branches/zip: recv_scan_log_recs(): Remove a compile-time constant parameter. ------------------------------------------------------------------------ r4500 | marko | 2009-03-20 15:47:17 +0200 (Fri, 20 Mar 2009) | 1 line branches/zip: fil_init(): Add the parameter hash_size. ------------------------------------------------------------------------ r4501 | vasil | 2009-03-20 16:50:41 +0200 (Fri, 20 Mar 2009) | 4 lines branches/zip: Add any entry about the release of 1.0.3 in the ChangeLog. ------------------------------------------------------------------------ r4515 | marko | 2009-03-23 10:49:53 +0200 (Mon, 23 Mar 2009) | 1 line branches/zip: hash_table_t: adaptive: Remove from UNIV_HOTBACKUP builds. ------------------------------------------------------------------------ r4516 | marko | 2009-03-23 10:57:16 +0200 (Mon, 23 Mar 2009) | 2 lines branches/zip: Define and use ASSERT_HASH_MUTEX_OWN. Make it a no-op in UNIV_HOTBACKUP builds. ------------------------------------------------------------------------ r4517 | marko | 2009-03-23 11:07:20 +0200 (Mon, 23 Mar 2009) | 2 lines branches/zip: Define and use PAGE_ZIP_MATCH. In UNIV_HOTBACKUP builds, assume fixed allocation. ------------------------------------------------------------------------ r4521 | marko | 2009-03-23 12:05:47 +0200 (Mon, 23 Mar 2009) | 1 line branches/zip: buf_page_print(): Clean up the code #ifdef UNIV_HOTBACKUP. ------------------------------------------------------------------------ r4522 | marko | 2009-03-23 12:20:50 +0200 (Mon, 23 Mar 2009) | 2 lines branches/zip: Exclude some operating system interface code from UNIV_HOTBACKUP builds. ------------------------------------------------------------------------ r4523 | marko | 2009-03-23 13:00:43 +0200 (Mon, 23 Mar 2009) | 2 lines branches/zip: Remove the remaining references to hash_table_t::adapive from UNIV_HOTBACKUP builds. This should have been done in r4515. ------------------------------------------------------------------------ r4524 | marko | 2009-03-23 14:05:18 +0200 (Mon, 23 Mar 2009) | 2 lines branches/zip: Enclose recv_recovery_from_backup_on and recv_recovery_from_backup_is_on() in #ifdef UNIV_LOG_ARCHIVE. ------------------------------------------------------------------------ r4525 | marko | 2009-03-23 14:57:45 +0200 (Mon, 23 Mar 2009) | 2 lines branches/zip: recv_parse_or_apply_log_rec_body(): Add debug assertions ensuring that FIL_PAGE_TYPE makes sense when applying log records. ------------------------------------------------------------------------ r4526 | marko | 2009-03-23 16:21:34 +0200 (Mon, 23 Mar 2009) | 2 lines branches/zip: Remove unneeded definitions and dependencies from UNIV_HOTBACKUP builds. ------------------------------------------------------------------------ r4527 | calvin | 2009-03-23 23:15:33 +0200 (Mon, 23 Mar 2009) | 5 lines branches/zip: adjust build files on Windows Adjust the patch positions based on the latest MySQL source. Also add the patches to the .bat files for vs9. ------------------------------------------------------------------------
17 years ago
branches/innodb+: Merge revisions 4150:4528 from branches/zip: ------------------------------------------------------------------------ r4152 | marko | 2009-02-10 12:52:27 +0200 (Tue, 10 Feb 2009) | 12 lines branches/zip: When innodb_use_sys_malloc is set, ignore innodb_additional_mem_pool_size, because nothing will be allocated from mem_comm_pool. mem_pool_create(): Remove the assertion about size. The function will work with any size. However, an assertion would fail in ut_malloc_low() when size==0. mem_init(): When srv_use_sys_malloc is set, pass size=1 to mem_pool_create(). mem0mem.c: Add #include "srv0srv.h" that is needed by mem0dbg.c. ------------------------------------------------------------------------ r4153 | vasil | 2009-02-10 22:58:17 +0200 (Tue, 10 Feb 2009) | 14 lines branches/zip: (followup to r4145) Non-functional change: Change the os_atomic_increment() and os_compare_and_swap() functions to macros to avoid artificial limitations on the types of those functions' arguments. As a consequence typecasts from the source code can be removed. Also remove Google's copyright from os0sync.ic because that file no longer contains code from Google. Approved by: Marko (rb://88), also ok from Inaam via IM ------------------------------------------------------------------------ r4163 | marko | 2009-02-12 00:14:19 +0200 (Thu, 12 Feb 2009) | 4 lines branches/zip: Make innodb_thread_concurrency=0 the default. The old default was 8. ------------------------------------------------------------------------ r4169 | calvin | 2009-02-12 10:37:10 +0200 (Thu, 12 Feb 2009) | 3 lines branches/zip: Adjust the result file of innodb_thread_concurrency_basic test. The default value of innodb_thread_concurrency is changed to 0 (from 8) via r4163. ------------------------------------------------------------------------ r4174 | vasil | 2009-02-12 17:38:27 +0200 (Thu, 12 Feb 2009) | 4 lines branches/zip: Fix pathname of the file to patch. ------------------------------------------------------------------------ r4176 | vasil | 2009-02-13 10:06:31 +0200 (Fri, 13 Feb 2009) | 7 lines branches/zip: Fix the failing mysql-test partition_innodb, which failed only if run after innodb_trx_weight (or other test that would leave LATEST DEADLOCK ERROR into the output of SHOW ENGINE INNODB STATUS). Find further explanation for the failure at the top of the added patch partition_innodb.diff. ------------------------------------------------------------------------ r4198 | vasil | 2009-02-17 09:06:07 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: Add the full text of the GPLv2 license into the root directory of the plugin. In previous releases this file was copied from an external source (https://svn.innodb.com/svn/plugin/trunk/support/COPYING) "manually" when creating the source and binary archives. It is less confusing to have this present in the root directory of the SVN branch. ------------------------------------------------------------------------ r4199 | vasil | 2009-02-17 09:11:58 +0200 (Tue, 17 Feb 2009) | 4 lines branches/zip: Add Google's license into COPYING.Google. ------------------------------------------------------------------------ r4200 | vasil | 2009-02-17 09:56:33 +0200 (Tue, 17 Feb 2009) | 11 lines branches/zip: To the files touched by the Google patch from c4144 (excluding include/os0sync.ic because later we removed Google code from that file): * Remove the Google license * Remove old Innobase copyright lines * Add a reference to the Google license and to the GPLv2 license at the top, as recommended by the lawyers at Oracle Legal. ------------------------------------------------------------------------ r4201 | vasil | 2009-02-17 10:12:02 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 1/28] ------------------------------------------------------------------------ r4202 | vasil | 2009-02-17 10:15:06 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 2/28] ------------------------------------------------------------------------ r4203 | vasil | 2009-02-17 10:25:45 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 3/28] ------------------------------------------------------------------------ r4204 | vasil | 2009-02-17 10:55:41 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 4/28] ------------------------------------------------------------------------ r4205 | vasil | 2009-02-17 10:59:22 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 5/28] ------------------------------------------------------------------------ r4206 | vasil | 2009-02-17 11:02:27 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 6/28] ------------------------------------------------------------------------ r4207 | vasil | 2009-02-17 11:04:28 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 7/28] ------------------------------------------------------------------------ r4208 | vasil | 2009-02-17 11:06:49 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 8/28] ------------------------------------------------------------------------ r4209 | vasil | 2009-02-17 11:10:18 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 9/28] ------------------------------------------------------------------------ r4210 | vasil | 2009-02-17 11:12:41 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 10/28] ------------------------------------------------------------------------ r4211 | vasil | 2009-02-17 11:14:40 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 11/28] ------------------------------------------------------------------------ r4212 | vasil | 2009-02-17 11:18:35 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 12/28] ------------------------------------------------------------------------ r4213 | vasil | 2009-02-17 11:24:40 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 13/28] ------------------------------------------------------------------------ r4214 | vasil | 2009-02-17 11:27:31 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 13/28] ------------------------------------------------------------------------ r4215 | vasil | 2009-02-17 11:29:55 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 15/28] ------------------------------------------------------------------------ r4216 | vasil | 2009-02-17 11:33:38 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 16/28] ------------------------------------------------------------------------ r4217 | vasil | 2009-02-17 11:36:44 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 17/28] ------------------------------------------------------------------------ r4218 | vasil | 2009-02-17 11:39:11 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 18/28] ------------------------------------------------------------------------ r4219 | vasil | 2009-02-17 11:41:24 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 19/28] ------------------------------------------------------------------------ r4220 | vasil | 2009-02-17 11:43:50 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 20/28] ------------------------------------------------------------------------ r4221 | vasil | 2009-02-17 11:46:52 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 21/28] ------------------------------------------------------------------------ r4222 | vasil | 2009-02-17 11:50:12 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 22/28] ------------------------------------------------------------------------ r4223 | vasil | 2009-02-17 11:53:58 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 23/28] ------------------------------------------------------------------------ r4224 | vasil | 2009-02-17 12:01:41 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 24/28] ------------------------------------------------------------------------ r4225 | vasil | 2009-02-17 12:05:45 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 25/28] ------------------------------------------------------------------------ r4226 | vasil | 2009-02-17 12:09:16 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 26/28] ------------------------------------------------------------------------ r4227 | vasil | 2009-02-17 12:12:56 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 27/28] ------------------------------------------------------------------------ r4228 | vasil | 2009-02-17 12:14:04 +0200 (Tue, 17 Feb 2009) | 8 lines branches/zip: * Remove old Innobase copyright lines from C source files * Add a reference to the GPLv2 license as recommended by the lawyers at Oracle Legal [Step 28/28] ------------------------------------------------------------------------ r4229 | vasil | 2009-02-17 12:30:55 +0200 (Tue, 17 Feb 2009) | 4 lines branches/zip: Add the copyright notice to the non C files. ------------------------------------------------------------------------ r4231 | marko | 2009-02-17 14:26:53 +0200 (Tue, 17 Feb 2009) | 12 lines Minor cleanup of the Google SMP patch. sync_array_object_signalled(): Add a (void) cast to eliminate a gcc warning about the return value of os_atomic_increment() being ignored. rw_lock_create_func(): Properly indent the preprocessor directives. rw_lock_x_lock_low(), rw_lock_x_lock_func_nowait(): Split lines correctly. rw_lock_set_writer_id_and_recursion_flag(): Silence a Valgrind warning. Do not mix statements and variable declarations. ------------------------------------------------------------------------ r4232 | marko | 2009-02-17 14:59:54 +0200 (Tue, 17 Feb 2009) | 3 lines branches/zip: When assigning lock->recursive = FALSE, also flag lock->writer_thread invalid, so that Valgrind will catch more errors. This is related to Issue #175. ------------------------------------------------------------------------ r4242 | marko | 2009-02-18 17:01:09 +0200 (Wed, 18 Feb 2009) | 2 lines branches/zip: UT_DBG_STOP: Use do{} while(0) to silence a g++-4.3.2 warning about a while(0); statement. This should fix (part of) Issue #176. ------------------------------------------------------------------------ r4243 | marko | 2009-02-18 17:04:03 +0200 (Wed, 18 Feb 2009) | 3 lines branches/zip: buf_buddy_get_slot(): Fix a gcc 4.3.2 warning about an empty body of a "for" statement. This fixes part of Issue #176. ------------------------------------------------------------------------ r4244 | marko | 2009-02-18 17:25:45 +0200 (Wed, 18 Feb 2009) | 11 lines branches/zip: Protect ut_total_allocated_memory with ut_list_mutex. Unprotected updates to ut_total_allocated_memory in os_mem_alloc_large() and os_mem_free_large(), called during fast index creation, may corrupt the variable and cause assertion failures. Also, add UNIV_MEM_ALLOC() and UNIV_MEM_FREE() instrumentation around os_mem_alloc_large() and os_mem_free_large(), so that Valgrind can detect more errors. rb://90 approved by Heikki Tuuri. This addresses Issue #177. ------------------------------------------------------------------------ r4248 | marko | 2009-02-19 11:52:39 +0200 (Thu, 19 Feb 2009) | 2 lines branches/zip: page_zip_set_size(): Fix a g++ 4.3.2 warning about an empty body in a "for" statement. This closes Issue #176. ------------------------------------------------------------------------ r4251 | inaam | 2009-02-19 15:46:27 +0200 (Thu, 19 Feb 2009) | 8 lines branches/zip: Issue #178 rb://91 Change plug.in to have same CXXFLAGS as CFLAGS. This is to ensure that both .c and .cc files get compiled with same flags. To fix the issue where UNIV_LINUX was defined only in .c files. Approved by: Marko ------------------------------------------------------------------------ r4258 | vasil | 2009-02-20 11:52:19 +0200 (Fri, 20 Feb 2009) | 7 lines branches/zip: Cleanup in ChangeLog: * Wrap lines at 78 characters * Changed files are listed alphabetically * White-space cleanup ------------------------------------------------------------------------ r4259 | vasil | 2009-02-20 11:59:42 +0200 (Fri, 20 Feb 2009) | 6 lines branches/zip: ChangeLog: Remove include/os0sync.ic from the entry about the google patch, this file was modified later to not include Google's code. ------------------------------------------------------------------------ r4262 | vasil | 2009-02-20 14:56:59 +0200 (Fri, 20 Feb 2009) | 373 lines branches/zip: Merge revisions 4035:4261 from branches/5.1: ------------------------------------------------------------------------ r4065 | sunny | 2009-01-29 16:01:36 +0200 (Thu, 29 Jan 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: In the last round of AUTOINC cleanup we assumed that AUTOINC is only defined for integer columns. This caused an assertion failure when we checked for the maximum value of a column type. We now calculate the max value for floating-point autoinc columns too. Fix Bug#42400 - InnoDB autoinc code can't handle floating-point columns rb://84 and Mantis issue://162 ------------------------------------------------------------------------ r4111 | sunny | 2009-02-03 22:06:52 +0200 (Tue, 03 Feb 2009) | 2 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Add the ULL suffix otherwise there is an overflow. ------------------------------------------------------------------------ r4128 | vasil | 2009-02-08 21:36:45 +0200 (Sun, 08 Feb 2009) | 18 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2709.20.31 committer: Timothy Smith <timothy.smith@sun.com> branch nick: 51 timestamp: Fri 2008-12-19 01:28:51 +0100 message: Disable part of innodb-autoinc.test, because the MySQL server asserts when compiled --with-debug, due to bug 39828, "autoinc wraps around when offset and increment > 1". This change should be reverted when that bug is fixed (and a a few other minor changes to the test as described in comments). modified: mysql-test/r/innodb-autoinc.result mysql-test/t/innodb-autoinc.test ------------------------------------------------------------------------ r4129 | vasil | 2009-02-08 21:54:25 +0200 (Sun, 08 Feb 2009) | 310 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Merge a change from MySQL: [looks like the changes to innodb-autoinc.test were made as part of the following huge merge, but we are merging only changes to that file] ------------------------------------------------------------ revno: 2546.47.1 committer: Luis Soares <luis.soares@sun.com> branch nick: 5.1-rpl timestamp: Fri 2009-01-23 13:22:05 +0100 message: merge: 5.1 -> 5.1-rpl conflicts: Text conflict in client/mysqltest.cc Text conflict in mysql-test/include/wait_until_connected_again.inc Text conflict in mysql-test/lib/mtr_report.pm Text conflict in mysql-test/mysql-test-run.pl Text conflict in mysql-test/r/events_bugs.result Text conflict in mysql-test/r/log_state.result Text conflict in mysql-test/r/myisam_data_pointer_size_func.result Text conflict in mysql-test/r/mysqlcheck.result Text conflict in mysql-test/r/query_cache.result Text conflict in mysql-test/r/status.result Text conflict in mysql-test/suite/binlog/r/binlog_index.result Text conflict in mysql-test/suite/binlog/r/binlog_innodb.result Text conflict in mysql-test/suite/rpl/r/rpl_packet.result Text conflict in mysql-test/suite/rpl/t/rpl_packet.test Text conflict in mysql-test/t/disabled.def Text conflict in mysql-test/t/events_bugs.test Text conflict in mysql-test/t/log_state.test Text conflict in mysql-test/t/myisam_data_pointer_size_func.test Text conflict in mysql-test/t/mysqlcheck.test Text conflict in mysql-test/t/query_cache.test Text conflict in mysql-test/t/rpl_init_slave_func.test Text conflict in mysql-test/t/status.test removed: mysql-test/suite/parts/r/partition_bit_ndb.result mysql-test/suite/parts/t/partition_bit_ndb.test mysql-test/suite/parts/t/partition_sessions.test mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test mysql-test/t/log_bin_trust_function_creators_func-master.opt mysql-test/t/rpl_init_slave_func-slave.opt added: mysql-test/include/check_events_off.inc mysql-test/include/cleanup_fake_relay_log.inc mysql-test/include/have_simple_parser.inc mysql-test/include/no_running_event_scheduler.inc mysql-test/include/no_running_events.inc mysql-test/include/running_event_scheduler.inc mysql-test/include/setup_fake_relay_log.inc mysql-test/include/wait_condition_sp.inc mysql-test/r/fulltext_plugin.result mysql-test/r/have_simple_parser.require mysql-test/r/innodb_bug38231.result mysql-test/r/innodb_bug39438.result mysql-test/r/innodb_mysql_rbk.result mysql-test/r/partition_innodb_semi_consistent.result mysql-test/r/query_cache_28249.result mysql-test/r/status2.result mysql-test/std_data/bug40482-bin.000001 mysql-test/suite/binlog/r/binlog_innodb_row.result mysql-test/suite/binlog/t/binlog_innodb_row.test mysql-test/suite/rpl/r/rpl_binlog_corruption.result mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt mysql-test/suite/rpl/t/rpl_binlog_corruption.test mysql-test/suite/sys_vars/r/tmp_table_size_basic.result mysql-test/suite/sys_vars/t/tmp_table_size_basic.test mysql-test/t/fulltext_plugin-master.opt mysql-test/t/fulltext_plugin.test mysql-test/t/innodb_bug38231.test mysql-test/t/innodb_bug39438-master.opt mysql-test/t/innodb_bug39438.test mysql-test/t/innodb_mysql_rbk-master.opt mysql-test/t/innodb_mysql_rbk.test mysql-test/t/partition_innodb_semi_consistent-master.opt mysql-test/t/partition_innodb_semi_consistent.test mysql-test/t/query_cache_28249.test mysql-test/t/status2.test renamed: mysql-test/suite/funcs_1/r/is_collation_character_set_applicability.result => mysql-test/suite/funcs_1/r/is_coll_char_set_appl.result mysql-test/suite/funcs_1/t/is_collation_character_set_applicability.test => mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test modified: .bzr-mysql/default.conf CMakeLists.txt client/mysql.cc client/mysql_upgrade.c client/mysqlcheck.c client/mysqltest.cc configure.in extra/resolve_stack_dump.c extra/yassl/include/openssl/ssl.h include/config-win.h include/m_ctype.h include/my_global.h mysql-test/extra/binlog_tests/database.test mysql-test/extra/rpl_tests/rpl_auto_increment.test mysql-test/include/commit.inc mysql-test/include/have_32bit.inc mysql-test/include/have_64bit.inc mysql-test/include/index_merge1.inc mysql-test/include/linux_sys_vars.inc mysql-test/include/windows_sys_vars.inc mysql-test/lib/mtr_report.pm mysql-test/mysql-test-run.pl mysql-test/r/alter_table.result mysql-test/r/commit_1innodb.result mysql-test/r/create.result mysql-test/r/csv.result mysql-test/r/ctype_ucs.result mysql-test/r/date_formats.result mysql-test/r/events_bugs.result mysql-test/r/events_scheduling.result mysql-test/r/fulltext.result mysql-test/r/func_if.result mysql-test/r/func_in.result mysql-test/r/func_str.result mysql-test/r/func_time.result mysql-test/r/grant.result mysql-test/r/index_merge_myisam.result mysql-test/r/information_schema.result mysql-test/r/innodb-autoinc.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/log_bin_trust_function_creators_func.result mysql-test/r/log_state.result mysql-test/r/myisampack.result mysql-test/r/mysql.result mysql-test/r/mysqlcheck.result mysql-test/r/partition_datatype.result mysql-test/r/partition_mgm.result mysql-test/r/partition_pruning.result mysql-test/r/query_cache.result mysql-test/r/read_buffer_size_basic.result mysql-test/r/read_rnd_buffer_size_basic.result mysql-test/r/rpl_init_slave_func.result mysql-test/r/select.result mysql-test/r/status.result mysql-test/r/strict.result mysql-test/r/temp_table.result mysql-test/r/type_bit.result mysql-test/r/type_date.result mysql-test/r/type_float.result mysql-test/r/warnings_engine_disabled.result mysql-test/r/xml.result mysql-test/suite/binlog/r/binlog_database.result mysql-test/suite/binlog/r/binlog_index.result mysql-test/suite/binlog/r/binlog_innodb.result mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result mysql-test/suite/binlog/t/binlog_innodb.test mysql-test/suite/funcs_1/r/is_columns_is.result mysql-test/suite/funcs_1/r/is_engines.result mysql-test/suite/funcs_1/r/storedproc.result mysql-test/suite/funcs_1/storedproc/param_check.inc mysql-test/suite/funcs_2/t/disabled.def mysql-test/suite/ndb/t/disabled.def mysql-test/suite/parts/r/partition_bit_innodb.result mysql-test/suite/parts/r/partition_bit_myisam.result mysql-test/suite/parts/r/partition_special_innodb.result mysql-test/suite/parts/t/disabled.def mysql-test/suite/parts/t/partition_special_innodb.test mysql-test/suite/parts/t/partition_value_innodb.test mysql-test/suite/parts/t/partition_value_myisam.test mysql-test/suite/parts/t/partition_value_ndb.test mysql-test/suite/rpl/r/rpl_auto_increment.result mysql-test/suite/rpl/r/rpl_packet.result mysql-test/suite/rpl/r/rpl_row_create_table.result mysql-test/suite/rpl/r/rpl_slave_skip.result mysql-test/suite/rpl/r/rpl_trigger.result mysql-test/suite/rpl/t/disabled.def mysql-test/suite/rpl/t/rpl_packet.test mysql-test/suite/rpl/t/rpl_row_create_table.test mysql-test/suite/rpl/t/rpl_slave_skip.test mysql-test/suite/rpl/t/rpl_trigger.test mysql-test/suite/rpl_ndb/t/disabled.def mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result mysql-test/t/alter_table.test mysql-test/t/create.test mysql-test/t/csv.test mysql-test/t/ctype_ucs.test mysql-test/t/date_formats.test mysql-test/t/disabled.def mysql-test/t/events_bugs.test mysql-test/t/events_scheduling.test mysql-test/t/fulltext.test mysql-test/t/func_if.test mysql-test/t/func_in.test mysql-test/t/func_str.test mysql-test/t/func_time.test mysql-test/t/grant.test mysql-test/t/information_schema.test mysql-test/t/innodb-autoinc.test mysql-test/t/innodb.test mysql-test/t/innodb_mysql.test mysql-test/t/log_bin_trust_function_creators_func.test mysql-test/t/log_state.test mysql-test/t/myisam_data_pointer_size_func.test mysql-test/t/myisampack.test mysql-test/t/mysql.test mysql-test/t/mysqlcheck.test mysql-test/t/partition_innodb_stmt.test mysql-test/t/partition_mgm.test mysql-test/t/partition_pruning.test mysql-test/t/query_cache.test mysql-test/t/rpl_init_slave_func.test mysql-test/t/select.test mysql-test/t/status.test mysql-test/t/strict.test mysql-test/t/temp_table.test mysql-test/t/type_bit.test mysql-test/t/type_date.test mysql-test/t/type_float.test mysql-test/t/warnings_engine_disabled.test mysql-test/t/xml.test mysys/my_getopt.c mysys/my_init.c scripts/mysql_install_db.sh sql-common/my_time.c sql/field.cc sql/field.h sql/filesort.cc sql/ha_partition.cc sql/ha_partition.h sql/item.cc sql/item_cmpfunc.cc sql/item_func.h sql/item_strfunc.cc sql/item_sum.cc sql/item_timefunc.cc sql/item_timefunc.h sql/log.cc sql/log.h sql/log_event.cc sql/log_event.h sql/mysql_priv.h sql/mysqld.cc sql/opt_range.cc sql/partition_info.cc sql/repl_failsafe.cc sql/rpl_constants.h sql/set_var.cc sql/slave.cc sql/spatial.h sql/sql_acl.cc sql/sql_base.cc sql/sql_binlog.cc sql/sql_class.h sql/sql_cursor.cc sql/sql_delete.cc sql/sql_lex.cc sql/sql_lex.h sql/sql_locale.cc sql/sql_parse.cc sql/sql_partition.cc sql/sql_plugin.cc sql/sql_plugin.h sql/sql_profile.cc sql/sql_repl.cc sql/sql_select.cc sql/sql_select.h sql/sql_show.cc sql/sql_table.cc sql/sql_trigger.cc sql/sql_trigger.h sql/table.cc sql/table.h sql/unireg.cc storage/csv/ha_tina.cc storage/federated/ha_federated.cc storage/heap/ha_heap.cc storage/innobase/Makefile.am storage/innobase/btr/btr0sea.c storage/innobase/buf/buf0lru.c storage/innobase/dict/dict0dict.c storage/innobase/dict/dict0mem.c storage/innobase/handler/ha_innodb.cc storage/innobase/handler/ha_innodb.h storage/innobase/include/btr0sea.h storage/innobase/include/dict0dict.h storage/innobase/include/dict0mem.h storage/innobase/include/ha_prototypes.h storage/innobase/include/lock0lock.h storage/innobase/include/row0mysql.h storage/innobase/include/sync0sync.ic storage/innobase/include/ut0ut.h storage/innobase/lock/lock0lock.c storage/innobase/os/os0file.c storage/innobase/plug.in storage/innobase/row/row0mysql.c storage/innobase/row/row0sel.c storage/innobase/srv/srv0srv.c storage/innobase/srv/srv0start.c storage/innobase/ut/ut0ut.c storage/myisam/ft_boolean_search.c strings/ctype.c strings/xml.c tests/mysql_client_test.c win/configure.js mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test ------------------------------------------------------------------------ r4165 | calvin | 2009-02-12 01:34:27 +0200 (Thu, 12 Feb 2009) | 1 line Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: minor non-functional changes. ------------------------------------------------------------------------ ------------------------------------------------------------------------ r4263 | vasil | 2009-02-20 15:00:46 +0200 (Fri, 20 Feb 2009) | 4 lines branches/zip: Add a ChangeLog entry for a change in r4262. ------------------------------------------------------------------------ r4265 | marko | 2009-02-20 22:31:03 +0200 (Fri, 20 Feb 2009) | 5 lines branches/zip: Make innodb_use_sys_malloc=ON the default. Replace srv_use_sys_malloc with UNIV_LIKELY(srv_use_sys_malloc) to improve branch prediction in the default case. Approved by Ken over the IM. ------------------------------------------------------------------------ r4266 | vasil | 2009-02-20 23:29:32 +0200 (Fri, 20 Feb 2009) | 7 lines branches/zip: Add a sentence at the top of COPYING.Google to clarify that this license does not apply to the whole InnoDB. Suggested by: Ken ------------------------------------------------------------------------ r4268 | marko | 2009-02-23 12:43:51 +0200 (Mon, 23 Feb 2009) | 9 lines branches/zip: Initialize ut_list_mutex at startup. Without this fix, ut_list_mutex would be used uninitialized when innodb_use_sys_malloc=1. This fix addresses Issue #181. ut_mem_block_list_init(): Rename to ut_mem_init() and make public. ut_malloc_low(), ut_free_all_mem(): Add ut_a(ut_mem_block_list_inited). mem_init(): Call ut_mem_init(). ------------------------------------------------------------------------ r4269 | marko | 2009-02-23 15:09:49 +0200 (Mon, 23 Feb 2009) | 7 lines branches/zip: When freeing an uncompressed BLOB page, tolerate garbage in FIL_PAGE_TYPE. (Bug #43043, Issue #182) btr_check_blob_fil_page_type(): New function. btr_free_externally_stored_field(), btr_copy_blob_prefix(): Call btr_check_blob_fil_page_type() to check FIL_PAGE_TYPE. ------------------------------------------------------------------------ r4272 | marko | 2009-02-23 23:10:18 +0200 (Mon, 23 Feb 2009) | 8 lines branches/zip: Adjust the fix of Issue #182 in r4269 per Inaam's suggestion. btr_check_blob_fil_page_type(): Replace the parameter const char* op with ibool read. Do not print anything about page type mismatch when reading a BLOB page in Antelope format. Print space id before page number. ------------------------------------------------------------------------ r4273 | marko | 2009-02-24 00:11:11 +0200 (Tue, 24 Feb 2009) | 1 line branches/zip: ut_mem_init(): Add the assertion !ut_mem_block_list_inited. ------------------------------------------------------------------------ r4274 | marko | 2009-02-24 00:14:38 +0200 (Tue, 24 Feb 2009) | 12 lines branches/zip: Fix bugs in the fix of Issue #181. Tested inside and outside Valgrind, with innodb_use_sys_malloc set to 0 and 1. mem_init(): Invoke ut_mem_init() before mem_pool_create(), because the latter one will invoke ut_malloc(). srv_general_init(): Do not initialize the memory subsystem (mem_init()). innobase_init(): Initialize the memory subsystem (mem_init()) before calling srv_parse_data_file_paths_and_sizes(), which needs ut_malloc(). Call ut_free_all_mem() in error handling to clean up after the mem_init(). ------------------------------------------------------------------------ r4280 | marko | 2009-02-24 15:14:59 +0200 (Tue, 24 Feb 2009) | 1 line branches/zip: Remove unused function os_mem_alloc_nocache(). ------------------------------------------------------------------------ r4281 | marko | 2009-02-24 16:02:48 +0200 (Tue, 24 Feb 2009) | 1 line branches/zip: Remove the unused function dict_index_get_type(). ------------------------------------------------------------------------ r4283 | marko | 2009-02-24 23:06:56 +0200 (Tue, 24 Feb 2009) | 1 line branches/zip: srv0start.c: Remove unnecessary #include "mem0pool.h". ------------------------------------------------------------------------ r4284 | marko | 2009-02-24 23:26:38 +0200 (Tue, 24 Feb 2009) | 1 line branches/zip: mem0mem.c: Remove unnecessary #include "mach0data.h". ------------------------------------------------------------------------ r4288 | vasil | 2009-02-25 10:48:07 +0200 (Wed, 25 Feb 2009) | 21 lines branches/zip: Merge revisions 4261:4287 from branches/5.1: ------------------------------------------------------------------------ r4287 | sunny | 2009-02-25 05:32:01 +0200 (Wed, 25 Feb 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Fix Bug#42714 AUTO_INCREMENT errors in 5.1.31. There are two changes to the autoinc handling. 1. To fix the immediate problem from the bug report, we must ensure that the value written to the table is always less than the max value stored in dict_table_t. 2. The second related change is that according to MySQL documentation when the offset is greater than the increment, we should ignore the offset. ------------------------------------------------------------------------ ------------------------------------------------------------------------ r4289 | vasil | 2009-02-25 10:53:51 +0200 (Wed, 25 Feb 2009) | 4 lines branches/zip: Add ChangeLog entry for the fix in r4288. ------------------------------------------------------------------------ r4290 | vasil | 2009-02-25 11:05:44 +0200 (Wed, 25 Feb 2009) | 11 lines branches/zip: Make ChangeLog entries for bugs in bugs.mysql.com in the form: Fix Bug#12345 bug title (for bugs after 1.0.2 was released and the ChangeLog published) There is no need to bloat the ChangeLog with information that is available via bugs.mysql.com. Discussed with: Marko ------------------------------------------------------------------------ r4291 | vasil | 2009-02-25 11:08:32 +0200 (Wed, 25 Feb 2009) | 4 lines branches/zip: Fix Bug synopsis and remove explanation ------------------------------------------------------------------------ r4292 | marko | 2009-02-25 12:09:15 +0200 (Wed, 25 Feb 2009) | 25 lines branches/zip: Correct the initialization of the memory subsystem once again, to finally put Issue #181 to rest. Revert some parts of r4274. It is best not to call ut_malloc() before srv_general_init(). mem_init(): Do not call ut_mem_init(). srv_general_init(): Initialize the memory subsystem in two phases: first ut_mem_init(), then mem_init(). This is because os_sync_init() and sync_init() depend on ut_mem_init() and mem_init() depends on os_sync_init() or sync_init(). srv_parse_data_file_paths_and_sizes(), srv_parse_log_group_home_dirs(): Remove the output parameters. Assign to the global variables directly. Allocate memory with malloc() instead of ut_malloc(), because these functions will be called before srv_general_init(). srv_free_paths_and_sizes(): New function, for cleaning up after srv_parse_data_file_paths_and_sizes() and srv_parse_log_group_home_dirs(). rb://92 approved by Sunny Bains ------------------------------------------------------------------------ r4297 | vasil | 2009-02-25 17:19:19 +0200 (Wed, 25 Feb 2009) | 4 lines branches/zip: White-space cleanup in the ChangeLog ------------------------------------------------------------------------ r4301 | vasil | 2009-02-25 21:33:32 +0200 (Wed, 25 Feb 2009) | 5 lines branches/zip: Do not output the commands that restore the environment because they depend on the state of the environment before the test starts executing. ------------------------------------------------------------------------ r4315 | vasil | 2009-02-26 09:21:20 +0200 (Thu, 26 Feb 2009) | 5 lines branches/zip: Apply any necessary patches to the mysql tree at the end of setup.sh This step was previously done manually (and sometimes forgotten). ------------------------------------------------------------------------ r4319 | marko | 2009-02-26 23:27:51 +0200 (Thu, 26 Feb 2009) | 6 lines branches/zip: btr_check_blob_fil_page_type(): Do not report FIL_PAGE_TYPE mismatch even when purging a BLOB. Heavy users may have large data files created with MySQL 5.0 or earlier, and they don not want to have the error log flooded with such messages. This fixes Issue #182. ------------------------------------------------------------------------ r4320 | inaam | 2009-02-27 02:13:19 +0200 (Fri, 27 Feb 2009) | 8 lines branches/zip This is to revert the changes made to the plug.in (r4251) as a fix for issue# 178. Changes to plug.in will not propogate to a plugin installation unless autotools are rerun which is unacceptable. A fix for issue# 178 will be committed in a separate commit. ------------------------------------------------------------------------ r4321 | inaam | 2009-02-27 02:16:46 +0200 (Fri, 27 Feb 2009) | 6 lines branches/zip This is a fix for issue#178. Instead of using UNIV_LINUX which is defined through CFLAGS we use compiler generated define __linux__ that is effective for both .c and .cc files. ------------------------------------------------------------------------ r4324 | vasil | 2009-02-27 13:27:18 +0200 (Fri, 27 Feb 2009) | 39 lines branches/zip: Add FreeBSD to the list of the operating systems that have sizeof(pthread_t) == sizeof(void*) (i.e. word size). On FreeBSD pthread_t is defined like: /usr/include/sys/_pthreadtypes.h: typedef struct pthread *pthread_t; I did the following tests (per Inaam's recommendation): a) appropriate version of GCC is available on that platform (4.1.2 or higher for atomics to be available) On FreeBSD 6.x the default compiler is 3.4.6, on FreeBSD 7.x the default one is 4.2.1. One can always install the version of choice from the ports collection. If gcc 3.x is used then HAVE_GCC_ATOMIC_BUILTINS will not be defined and thus the change I am committing will make no difference. b) find out if sizeof(pthread_t) == sizeof(long) On 32 bit both are 4 bytes, on 64 bit both are 8 bytes. c) find out the compiler generated platform define (e.g.: __aix, __sunos__ etc.) The macro is __FreeBSD__. d) patch univ.i with the appropriate platform define e) build the mysql f) ensure it is using atomic builtins (look at the err.log message at system startup. It should say we are using atomics for both mutexes and rw-locks) g) do sanity testing (keeping in view the smp changes) I ran the mysql-test suite. All tests pass. ------------------------------------------------------------------------ r4353 | vasil | 2009-03-05 09:27:29 +0200 (Thu, 05 Mar 2009) | 6 lines branches/zip: As suggested by Ken, print a message that says that the Google SMP patch (GCC atomics) is disabled if it is. Also extend the message when the patch is partially enabled to make it clear that it is partially enabled. ------------------------------------------------------------------------ r4356 | vasil | 2009-03-05 13:49:51 +0200 (Thu, 05 Mar 2009) | 4 lines branches/zip: Fix typo made in r4353. ------------------------------------------------------------------------ r4357 | vasil | 2009-03-05 16:38:59 +0200 (Thu, 05 Mar 2009) | 23 lines branches/zip: Implement a check whether pthread_t objects can be used by GCC atomic builtin functions. This check is implemented in plug.in and defines the macro HAVE_ATOMIC_PTHREAD_T. This macro is checked in univ.i and the relevant part of the code enabled (the one that uses GCC atomics against pthread_t objects). In addition to this, the same program that is compiled as part of the plug.in check is added in ut/ut0auxconf.c. In the InnoDB Plugin source archives that are shipped to the users, a generated Makefile.in is added. That Makefile.in will be modified to compile ut/ut0auxconf.c and define the macro HAVE_ATOMIC_PTHREAD_T if the compilation succeeds. I.e. Makefile.in will emulate the work that is done by plug.in. This is done in order to make the check happen and HAVE_ATOMIC_PTHREAD_T eventually defined without regenerating MySQL's ./configure from ./storage/innobase/plug.in. The point is not to ask users to install the autotools and regenerate ./configure. rb://95 Approved by: Marko ------------------------------------------------------------------------ r4360 | vasil | 2009-03-05 22:23:17 +0200 (Thu, 05 Mar 2009) | 21 lines branches/zip: Merge revisions 4287:4357 from branches/5.1: ------------------------------------------------------------------------ r4325 | sunny | 2009-03-02 02:28:52 +0200 (Mon, 02 Mar 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Bug#43203: Overflow from auto incrementing causes server segv It was not a SIGSEGV but an assertion failure. The assertion was checking the invariant that *first_value passed in by MySQL doesn't contain a value that is greater than the max value for that type. The assertion has been changed to a check and if the value is greater than the max we report a generic AUTOINC failure. rb://93 Approved by Heikki ------------------------------------------------------------------------ ------------------------------------------------------------------------ r4361 | vasil | 2009-03-05 22:27:54 +0200 (Thu, 05 Mar 2009) | 30 lines branches/zip: Merge revision 4358 from branches/5.1 (resolving a conflict): ------------------------------------------------------------------------ r4358 | vasil | 2009-03-05 21:21:10 +0200 (Thu, 05 Mar 2009) | 21 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2728.19.1 committer: Alfranio Correia <alfranio.correia@sun.com> branch nick: mysql-5.1-bugteam timestamp: Tue 2009-02-03 11:36:46 +0000 message: BUG#42445 Warning messages in innobase/handler/ha_innodb.cc There was a type casting problem in the storage/innobase/handler/ha_innodb.cc, (int ha_innobase::write_row(...)). Innobase uses has an internal error variable of type 'ulint' while mysql uses an 'int'. To fix the problem the function manipulates an error variable of type 'ulint' and only casts it into 'int' when needs to return the value. modified: storage/innobase/handler/ha_innodb.cc ------------------------------------------------------------------------ ------------------------------------------------------------------------ r4362 | vasil | 2009-03-05 22:29:07 +0200 (Thu, 05 Mar 2009) | 23 lines branches/zip: Merge revision 4359 from branches/5.1: ------------------------------------------------------------------------ r4359 | vasil | 2009-03-05 21:42:01 +0200 (Thu, 05 Mar 2009) | 14 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2747 committer: Timothy Smith <timothy.smith@sun.com> branch nick: 51 timestamp: Fri 2009-01-16 17:49:07 +0100 message: Add another cast to ignore int/ulong difference in error types, silence warning on Win64 modified: storage/innobase/handler/ha_innodb.cc ------------------------------------------------------------------------ ------------------------------------------------------------------------ r4363 | vasil | 2009-03-05 22:31:37 +0200 (Thu, 05 Mar 2009) | 4 lines branches/zip: Add ChangeLog entry for the bugfix in c4360. ------------------------------------------------------------------------ r4378 | calvin | 2009-03-09 10:10:17 +0200 (Mon, 09 Mar 2009) | 7 lines branches/zip: remove compile flag MYSQL_SERVER for dynamic plugin The dynamic plugin on Windows used to be built with MYSQL_SERVER compile flag, while it is not the case for other platforms. r3797 assumed MYSQL_SERVER was not defined for dynamic plugin, which introduced the engine crash during dropping a database. ------------------------------------------------------------------------ r4396 | marko | 2009-03-12 09:22:27 +0200 (Thu, 12 Mar 2009) | 3 lines branches/zip: btr_store_big_rec_extern_fields(): Initialize FIL_PAGE_TYPE in a separate redo log entry. This will make ibbackup --apply-log debugging easier. ------------------------------------------------------------------------ r4397 | marko | 2009-03-12 09:26:11 +0200 (Thu, 12 Mar 2009) | 3 lines branches/zip: trx_sys_create_doublewrite_buf(): As the dummy change, initialize FIL_PAGE_TYPE. This will make it easier to write the debug assertions for ibbackup --apply-log. ------------------------------------------------------------------------ r4401 | marko | 2009-03-12 10:26:40 +0200 (Thu, 12 Mar 2009) | 19 lines branches/zip: Merge revisions 4359:4400 from branches/5.1: ------------------------------------------------------------------------ r4399 | marko | 2009-03-12 09:38:05 +0200 (Thu, 12 Mar 2009) | 2 lines branches/5.1: row_sel_get_clust_rec_for_mysql(): Store the cursor position also for unlock_row(). (Bug #39320) ------------------------------------------------------------------------ r4400 | marko | 2009-03-12 10:06:44 +0200 (Thu, 12 Mar 2009) | 5 lines branches/5.1: Fix a bug in multi-table semi-consistent reads. Remember the acquired record locks per table handle (row_prebuilt_t) rather than per transaction (trx_t), so that unlock_row should successfully unlock all non-matching rows in multi-table operations. This deficiency was found while investigating Bug #39320. ------------------------------------------------------------------------ These were submitted as rb://94 and rb://96 and approved by Heikki Tuuri. ------------------------------------------------------------------------ r4455 | marko | 2009-03-16 11:43:34 +0200 (Mon, 16 Mar 2009) | 2 lines branches/zip: UT_LIST_VALIDATE(): Add the parameter ASSERTION and adjust all callers. ------------------------------------------------------------------------ r4456 | marko | 2009-03-16 12:59:25 +0200 (Mon, 16 Mar 2009) | 6 lines branches/zip: UT_LIST_VALIDATE(): Assert that the link is non-NULL before dereferencing it. In this way, ut_list_node_313 will be pointing to the last non-NULL list item at the time of the assertion failure. (gcc-4.3.2 -O3 seems to optimize the common subexpressions and make the variable NULL, though.) ------------------------------------------------------------------------ r4457 | marko | 2009-03-16 14:12:02 +0200 (Mon, 16 Mar 2009) | 2 lines branches/zip: sync_thread_add_level(): Make the assertions about level == SYNC_BUF_BLOCK more readable. ------------------------------------------------------------------------ r4461 | vasil | 2009-03-17 09:38:19 +0200 (Tue, 17 Mar 2009) | 6 lines branches/zip: Remove mysql-test/patches/bug32625.diff because that bug was fixed in the mysql repository (1 year and 4 months after sending them the simple patch!). See http://bugs.mysql.com/32625 ------------------------------------------------------------------------ r4465 | marko | 2009-03-17 12:34:19 +0200 (Tue, 17 Mar 2009) | 1 line branches/zip: buf0buddy.c: Add and adjust some debug assertions. ------------------------------------------------------------------------ r4473 | vasil | 2009-03-17 15:50:30 +0200 (Tue, 17 Mar 2009) | 5 lines branches/zip: Increment the InnoDB Plugin version from 1.0.3 to 1.0.4 now that 1.0.3 has been released. ------------------------------------------------------------------------ r4478 | vasil | 2009-03-18 11:53:53 +0200 (Wed, 18 Mar 2009) | 5 lines branches/zip: Remove mysql-test/patches/bug41893.diff because that bug has been fixed in the MySQL repository, see http://bugs.mysql.com/41893. ------------------------------------------------------------------------ r4479 | marko | 2009-03-18 12:43:54 +0200 (Wed, 18 Mar 2009) | 2 lines branches/zip: buf_LRU_block_remove_hashed_page(): Add some debug assertions. ------------------------------------------------------------------------ r4480 | marko | 2009-03-18 14:32:13 +0200 (Wed, 18 Mar 2009) | 1 line branches/zip: buf_buddy_free_low(): Correct the function comment. ------------------------------------------------------------------------ r4482 | marko | 2009-03-19 15:23:32 +0200 (Thu, 19 Mar 2009) | 12 lines branches/zip: Merge revisions 4400:4481 from branches/5.1: ------------------------------------------------------------------------ r4481 | marko | 2009-03-19 15:01:48 +0200 (Thu, 19 Mar 2009) | 6 lines branches/5.1: row_unlock_for_mysql(): Do not unlock records that were modified by the current transaction. This bug was introduced or unmasked in r4400. rb://97 approved by Heikki Tuuri ------------------------------------------------------------------------ ------------------------------------------------------------------------ r4490 | marko | 2009-03-20 12:33:33 +0200 (Fri, 20 Mar 2009) | 4 lines branches/zip: Non-functional change for reducing dependencies in InnoDB Hot Backup: Replace srv_sys->dummy_ind1 and srv_sys->dummy_ind2 with dict_ind_redundant and dict_ind_compact, initialized in dict_init(). ------------------------------------------------------------------------ r4491 | marko | 2009-03-20 12:45:18 +0200 (Fri, 20 Mar 2009) | 2 lines branches/zip: Add const qualifiers or in/out comments to some function parameters in log0log. ------------------------------------------------------------------------ r4492 | marko | 2009-03-20 12:52:14 +0200 (Fri, 20 Mar 2009) | 5 lines branches/zip: page_validate(): Always report the space id and the name of the index. In Hot Backup, do not invoke comparison functions, as MySQL collations will be unavailable. ------------------------------------------------------------------------ r4493 | marko | 2009-03-20 13:24:06 +0200 (Fri, 20 Mar 2009) | 1 line branches/zip: Replace fil_get_space_for_id_low() with fil_space_get_by_id(). ------------------------------------------------------------------------ r4494 | marko | 2009-03-20 13:51:35 +0200 (Fri, 20 Mar 2009) | 3 lines branches/zip: fil0fil.c: Refer to fil_system directly, not via local vars. This eliminates some "unused variable" warnings when building InnoDB Hot Backup in such a way that all mutex operations are no-ops. ------------------------------------------------------------------------ r4495 | marko | 2009-03-20 14:15:52 +0200 (Fri, 20 Mar 2009) | 1 line branches/zip: innobase_get_at_most_n_mbchars(): Declare in ha_prototypes.h. ------------------------------------------------------------------------ r4496 | marko | 2009-03-20 14:48:26 +0200 (Fri, 20 Mar 2009) | 1 line branches/zip: recv_recover_page(): Remove compile-time constant parameters. ------------------------------------------------------------------------ r4497 | marko | 2009-03-20 14:56:19 +0200 (Fri, 20 Mar 2009) | 1 line branches/zip: recv_sys_init(): Remove a compile-time constant parameter. ------------------------------------------------------------------------ r4498 | marko | 2009-03-20 15:08:05 +0200 (Fri, 20 Mar 2009) | 4 lines branches/zip: Non-functional change: Add const qualifiers. log_block_checksum_is_ok_or_old_format(), recv_sys_add_to_parsing_buf(): The log block is read-only. Make it const. ------------------------------------------------------------------------ r4499 | marko | 2009-03-20 15:10:25 +0200 (Fri, 20 Mar 2009) | 1 line branches/zip: recv_scan_log_recs(): Remove a compile-time constant parameter. ------------------------------------------------------------------------ r4500 | marko | 2009-03-20 15:47:17 +0200 (Fri, 20 Mar 2009) | 1 line branches/zip: fil_init(): Add the parameter hash_size. ------------------------------------------------------------------------ r4501 | vasil | 2009-03-20 16:50:41 +0200 (Fri, 20 Mar 2009) | 4 lines branches/zip: Add any entry about the release of 1.0.3 in the ChangeLog. ------------------------------------------------------------------------ r4515 | marko | 2009-03-23 10:49:53 +0200 (Mon, 23 Mar 2009) | 1 line branches/zip: hash_table_t: adaptive: Remove from UNIV_HOTBACKUP builds. ------------------------------------------------------------------------ r4516 | marko | 2009-03-23 10:57:16 +0200 (Mon, 23 Mar 2009) | 2 lines branches/zip: Define and use ASSERT_HASH_MUTEX_OWN. Make it a no-op in UNIV_HOTBACKUP builds. ------------------------------------------------------------------------ r4517 | marko | 2009-03-23 11:07:20 +0200 (Mon, 23 Mar 2009) | 2 lines branches/zip: Define and use PAGE_ZIP_MATCH. In UNIV_HOTBACKUP builds, assume fixed allocation. ------------------------------------------------------------------------ r4521 | marko | 2009-03-23 12:05:47 +0200 (Mon, 23 Mar 2009) | 1 line branches/zip: buf_page_print(): Clean up the code #ifdef UNIV_HOTBACKUP. ------------------------------------------------------------------------ r4522 | marko | 2009-03-23 12:20:50 +0200 (Mon, 23 Mar 2009) | 2 lines branches/zip: Exclude some operating system interface code from UNIV_HOTBACKUP builds. ------------------------------------------------------------------------ r4523 | marko | 2009-03-23 13:00:43 +0200 (Mon, 23 Mar 2009) | 2 lines branches/zip: Remove the remaining references to hash_table_t::adapive from UNIV_HOTBACKUP builds. This should have been done in r4515. ------------------------------------------------------------------------ r4524 | marko | 2009-03-23 14:05:18 +0200 (Mon, 23 Mar 2009) | 2 lines branches/zip: Enclose recv_recovery_from_backup_on and recv_recovery_from_backup_is_on() in #ifdef UNIV_LOG_ARCHIVE. ------------------------------------------------------------------------ r4525 | marko | 2009-03-23 14:57:45 +0200 (Mon, 23 Mar 2009) | 2 lines branches/zip: recv_parse_or_apply_log_rec_body(): Add debug assertions ensuring that FIL_PAGE_TYPE makes sense when applying log records. ------------------------------------------------------------------------ r4526 | marko | 2009-03-23 16:21:34 +0200 (Mon, 23 Mar 2009) | 2 lines branches/zip: Remove unneeded definitions and dependencies from UNIV_HOTBACKUP builds. ------------------------------------------------------------------------ r4527 | calvin | 2009-03-23 23:15:33 +0200 (Mon, 23 Mar 2009) | 5 lines branches/zip: adjust build files on Windows Adjust the patch positions based on the latest MySQL source. Also add the patches to the .bat files for vs9. ------------------------------------------------------------------------
17 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
14 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
12 years ago
12 years ago
12 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
12 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
12 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
branches/innodb+ Merge r6915:6992 from branches/innodb+multipbp (i.e.: all the changes made since it's creation) This also reverts r6930 to branches/innodb+ because a different solution for that issue is already present in innodb+multibp which is being merged. After this commit branches/innodb+multibp should be discarded and this branch should become our main development tree. ------------------------------------------------------------------------ r6915 | sbains | 2010-03-31 07:33:43 +0300 (Wed, 31 Mar 2010) | 1 line Changed paths: A /branches/innodb+multibp (from /branches/innodb+:6914) Creating a branch for the multiple buffer pool ------------------------------------------------------------------------ r6916 | sbains | 2010-03-31 08:21:00 +0300 (Wed, 31 Mar 2010) | 3 lines Changed paths: M /branches/innodb+multibp/CMakeLists.txt M /branches/innodb+multibp/btr/btr0btr.c M /branches/innodb+multibp/btr/btr0cur.c M /branches/innodb+multibp/btr/btr0sea.c M /branches/innodb+multibp/buf/buf0buddy.c M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/buf/buf0lru.c M /branches/innodb+multibp/buf/buf0rea.c M /branches/innodb+multibp/handler/ha_innodb.cc M /branches/innodb+multibp/handler/i_s.cc M /branches/innodb+multibp/ibuf/ibuf0ibuf.c M /branches/innodb+multibp/include/buf0buddy.h M /branches/innodb+multibp/include/buf0buddy.ic M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.h M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/include/buf0lru.h M /branches/innodb+multibp/include/buf0rea.h M /branches/innodb+multibp/include/buf0types.h M /branches/innodb+multibp/include/ibuf0ibuf.ic M /branches/innodb+multibp/include/srv0srv.h M /branches/innodb+multibp/include/univ.i M /branches/innodb+multibp/log/log0log.c M /branches/innodb+multibp/log/log0recv.c M /branches/innodb+multibp/mem/mem0mem.c M /branches/innodb+multibp/page/page0zip.c M /branches/innodb+multibp/srv/srv0srv.c M /branches/innodb+multibp/srv/srv0start.c M /branches/innodb+multibp/trx/trx0trx.c M /branches/innodb+multibp/trx/trx0undo.c branches/innodb+multibp: Unable to crash it with UNIV_DEBUG and UNIV_SYNC_DEBUG with both ibtests and Sysbench. The patch now needs a workout from Michael. ------------------------------------------------------------------------ r6917 | sbains | 2010-03-31 08:56:18 +0300 (Wed, 31 Mar 2010) | 2 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp: Fix error introduced in r6916. ------------------------------------------------------------------------ r6923 | sbains | 2010-03-31 15:16:04 +0300 (Wed, 31 Mar 2010) | 3 lines Changed paths: M /branches/innodb+multibp/btr/btr0cur.c M /branches/innodb+multibp/buf/buf0buddy.c M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/buf/buf0lru.c M /branches/innodb+multibp/include/buf0buddy.ic M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/page/page0zip.c branches/innodb+multibp: Fix whitespace issues. Add function buf_pool_from_block(). Add some comments to parameters. ------------------------------------------------------------------------ r6932 | sbains | 2010-04-01 01:12:07 +0300 (Thu, 01 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/univ.i branches/innodb+multibp: Remove bogus assertion. It's possible for the space and offset of a page to be undefined during the lifecycle of a page. Remove the debug #defines from univ.i. ------------------------------------------------------------------------ r6933 | sbains | 2010-04-01 01:22:40 +0300 (Thu, 01 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/srv/srv0start.c branches/innodb+multibp: Fix whitespace issues. ------------------------------------------------------------------------ r6934 | sbains | 2010-04-01 01:53:18 +0300 (Thu, 01 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/CMakeLists.txt M /branches/innodb+multibp/ChangeLog M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/handler/ha_innodb.cc M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/include/srv0srv.h M /branches/innodb+multibp/include/sync0sync.h M /branches/innodb+multibp/include/trx0purge.h M /branches/innodb+multibp/include/ut0ut.h M /branches/innodb+multibp/include/ut0ut.ic M /branches/innodb+multibp/lock/lock0lock.c M /branches/innodb+multibp/log/log0recv.c M /branches/innodb+multibp/mtr/mtr0mtr.c M /branches/innodb+multibp/mysql-test/innodb_bug38231.test A /branches/innodb+multibp/mysql-test/innodb_bug51920.result (from /branches/innodb+/mysql-test/innodb_bug51920.result:6931) A /branches/innodb+multibp/mysql-test/innodb_bug51920.test (from /branches/innodb+/mysql-test/innodb_bug51920.test:6931) M /branches/innodb+multibp/row/row0sel.c M /branches/innodb+multibp/srv/srv0srv.c M /branches/innodb+multibp/srv/srv0start.c M /branches/innodb+multibp/sync/sync0sync.c M /branches/innodb+multibp/trx/trx0purge.c branches/innodb+multibp: Merge revisions r6914:6931 from branches/innodb+ ------------------------------------------------------------------------ r6935 | sbains | 2010-04-01 02:08:32 +0300 (Thu, 01 Apr 2010) | 3 lines Changed paths: M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/mtr/mtr0mtr.c branches/innodb+multibp: Fix the debug assertions for flush order mutex. These were missed in r6934. ------------------------------------------------------------------------ r6936 | sbains | 2010-04-01 02:46:52 +0300 (Thu, 01 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/sync/sync0sync.c branches/innodb+multibp: Because now we have multiple instances of a mutex at the same level and these mutexes can be acquired simultaneously we can't simply check for <= level. We need to check for <= level - 1. ------------------------------------------------------------------------ r6937 | sbains | 2010-04-01 04:40:17 +0300 (Thu, 01 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/trx/trx0purge.c branches/innodb+multibp: We need to check if the history list len is > than some threshold not that it is evenly divisible by the some batch size. While running tests on dscczz01 I've observed that the purge thread can't keep up with the generation of the UNDO log records because of the faster code. ------------------------------------------------------------------------ r6938 | irana | 2010-04-01 10:15:00 +0300 (Thu, 01 Apr 2010) | 7 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.h M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/include/log0log.h M /branches/innodb+multibp/include/sync0sync.h M /branches/innodb+multibp/log/log0log.c M /branches/innodb+multibp/log/log0recv.c M /branches/innodb+multibp/mtr/mtr0mtr.c M /branches/innodb+multibp/sync/sync0sync.c branches/innodb+multibp The buf_flush_order patch that was ported in from 1.1 won't work with multiple buffer pools. This patch moves the mutex protecting order of insertion in the flush list(s) to log_sys struct so that we can have one global mutex protecting insertions into all flush list(s) ------------------------------------------------------------------------ r6941 | sbains | 2010-04-02 00:51:28 +0300 (Fri, 02 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/lock/lock0lock.c branches/innodb+multibp: We should get the record heap no to check recursively only if we are checking a record lock. Prior to this fix we were doing it for table locks as well, this is a bug. ------------------------------------------------------------------------ r6942 | csun | 2010-04-02 02:39:10 +0300 (Fri, 02 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/ha/ha0ha.c branches/innodb+multibp: fix compiler errors on Windows. Move ut_ad() to after declarations for C file. ------------------------------------------------------------------------ r6943 | sbains | 2010-04-03 05:14:25 +0300 (Sat, 03 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: Remove the code that created the fake buffer pool. ------------------------------------------------------------------------ r6945 | irana | 2010-04-05 23:35:29 +0300 (Mon, 05 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/lock/lock0lock.c branches/innodb+multibp Revert r6941 as it does not resolve the issue and we have to take back the whole fix for bug#49047 ------------------------------------------------------------------------ r6946 | irana | 2010-04-05 23:50:42 +0300 (Mon, 05 Apr 2010) | 6 lines Changed paths: M /branches/innodb+multibp/include/ut0ut.h M /branches/innodb+multibp/include/ut0ut.ic M /branches/innodb+multibp/lock/lock0lock.c branches/innodb+multibp Merged revisions 6932:6944 from branches/innodb+ This solely includes the reversal of fix for bug#49047 ------------------------------------------------------------------------ r6947 | sbains | 2010-04-06 01:33:46 +0300 (Tue, 06 Apr 2010) | 3 lines Changed paths: M /branches/innodb+multibp/buf/buf0lru.c branches/innodb+multibp: Remove the log sys mutex acquisition when doing buffer pool stat aggregation. A dirty read here should suffice. ------------------------------------------------------------------------ r6951 | irana | 2010-04-06 17:25:29 +0300 (Tue, 06 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+mbp Initialize the buf_page_t::buf_pool pointer when the descriptor is allocated using buf_buddy_alloc(). ------------------------------------------------------------------------ r6954 | jyang | 2010-04-06 21:24:46 +0300 (Tue, 06 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp: Fix a possible null pointer of index_mapping in a race condition. ------------------------------------------------------------------------ r6958 | sbains | 2010-04-07 00:27:44 +0300 (Wed, 07 Apr 2010) | 3 lines Changed paths: M /branches/innodb+multibp/include/ut0mem.h M /branches/innodb+multibp/ut/ut0mem.c branches/innodb+multibp: Fix part of Bug#52546. We allow ut_free() to accept a NULL pointer and treat it as a nop. ------------------------------------------------------------------------ r6961 | jyang | 2010-04-07 10:50:03 +0300 (Wed, 07 Apr 2010) | 9 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp: Fix for bug #52580: Crash in ha_innobase::open on executing INSERT with concurrent ALTER TABLE. Change in MySQL bug #51557 releases the mutex LOCK_open before ha_innobase::open(), causing racing condition for index translation table creation. Fix it by adding dict_sys mutex for the operation. rb://283, approved by Marko. ------------------------------------------------------------------------ r6963 | irana | 2010-04-07 19:14:10 +0300 (Wed, 07 Apr 2010) | 15 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp Force setting of buf_pool->LRU_old_ratio by calling buf_LRU_old_ratio_update() with adjust set to TRUE. This will make sure that we grab the buf_pool mutex and actually adjust the buf_pool->LRU_old pointer instead of just updating the buf_pool->LRU_old_ratio. Note that after this change there is no call to buf_LRU_old_ratio_update() with adjust set to FALSE and therefore this parameter should be removed. I am keeping it for now to first make sure that the fix does work. Approved by: No one. Sunny agreed with my hypothesis of the problem. ------------------------------------------------------------------------ r6964 | irana | 2010-04-07 19:59:59 +0300 (Wed, 07 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp Remove a too strong assertion on behalf of Jimmy. ------------------------------------------------------------------------ r6971 | sbains | 2010-04-09 13:23:33 +0300 (Fri, 09 Apr 2010) | 6 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: When getting the oldest (minimum) LSN value from all the flush lists we need to acquire the flush list mutex. We were incorrectly acquiring the buffer pool mutex. This patch should fix a slew of bugs reported by Michael. ------------------------------------------------------------------------ r6972 | sbains | 2010-04-10 00:25:09 +0300 (Sat, 10 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: We should not reset the lsn to 0 when we encounter an empty flush list. Oldest LSN should be 0 only when all flush lists are empty. e.g., without this fix if even one flush list was empty we would end up breaking WAL. ------------------------------------------------------------------------ r6987 | sbains | 2010-04-14 00:14:13 +0300 (Wed, 14 Apr 2010) | 12 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: When calculating the oldest_lsn we can have a situation where we've iterated to say buffer pool 3 and another thread adds two new dirty pages, the first to buffer pool 1 and the second to buffer pool 4. Up to say buffer pool 3 the oldest_lsn was 0. Now, we will end up returning the lsn at buffer pool 4 as the oldest LSN. We prevent this by acquiring the flush order mutex. One other future option is to calculate the min_lsn when flushing pages from the list and maintaining a running total using atomics. That way we can get rid of this function altogether. The atomics will only really be required when we do parallel flushing. ------------------------------------------------------------------------ r6992 | sbains | 2010-04-14 02:45:59 +0300 (Wed, 14 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/include/ut0rbt.h M /branches/innodb+multibp/ut/ut0rbt.c branches/innodb+multibp: Fix copyright of the rbt code. ------------------------------------------------------------------------
16 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
branches/innodb+ Merge r6915:6992 from branches/innodb+multipbp (i.e.: all the changes made since it's creation) This also reverts r6930 to branches/innodb+ because a different solution for that issue is already present in innodb+multibp which is being merged. After this commit branches/innodb+multibp should be discarded and this branch should become our main development tree. ------------------------------------------------------------------------ r6915 | sbains | 2010-03-31 07:33:43 +0300 (Wed, 31 Mar 2010) | 1 line Changed paths: A /branches/innodb+multibp (from /branches/innodb+:6914) Creating a branch for the multiple buffer pool ------------------------------------------------------------------------ r6916 | sbains | 2010-03-31 08:21:00 +0300 (Wed, 31 Mar 2010) | 3 lines Changed paths: M /branches/innodb+multibp/CMakeLists.txt M /branches/innodb+multibp/btr/btr0btr.c M /branches/innodb+multibp/btr/btr0cur.c M /branches/innodb+multibp/btr/btr0sea.c M /branches/innodb+multibp/buf/buf0buddy.c M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/buf/buf0lru.c M /branches/innodb+multibp/buf/buf0rea.c M /branches/innodb+multibp/handler/ha_innodb.cc M /branches/innodb+multibp/handler/i_s.cc M /branches/innodb+multibp/ibuf/ibuf0ibuf.c M /branches/innodb+multibp/include/buf0buddy.h M /branches/innodb+multibp/include/buf0buddy.ic M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.h M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/include/buf0lru.h M /branches/innodb+multibp/include/buf0rea.h M /branches/innodb+multibp/include/buf0types.h M /branches/innodb+multibp/include/ibuf0ibuf.ic M /branches/innodb+multibp/include/srv0srv.h M /branches/innodb+multibp/include/univ.i M /branches/innodb+multibp/log/log0log.c M /branches/innodb+multibp/log/log0recv.c M /branches/innodb+multibp/mem/mem0mem.c M /branches/innodb+multibp/page/page0zip.c M /branches/innodb+multibp/srv/srv0srv.c M /branches/innodb+multibp/srv/srv0start.c M /branches/innodb+multibp/trx/trx0trx.c M /branches/innodb+multibp/trx/trx0undo.c branches/innodb+multibp: Unable to crash it with UNIV_DEBUG and UNIV_SYNC_DEBUG with both ibtests and Sysbench. The patch now needs a workout from Michael. ------------------------------------------------------------------------ r6917 | sbains | 2010-03-31 08:56:18 +0300 (Wed, 31 Mar 2010) | 2 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp: Fix error introduced in r6916. ------------------------------------------------------------------------ r6923 | sbains | 2010-03-31 15:16:04 +0300 (Wed, 31 Mar 2010) | 3 lines Changed paths: M /branches/innodb+multibp/btr/btr0cur.c M /branches/innodb+multibp/buf/buf0buddy.c M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/buf/buf0lru.c M /branches/innodb+multibp/include/buf0buddy.ic M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/page/page0zip.c branches/innodb+multibp: Fix whitespace issues. Add function buf_pool_from_block(). Add some comments to parameters. ------------------------------------------------------------------------ r6932 | sbains | 2010-04-01 01:12:07 +0300 (Thu, 01 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/univ.i branches/innodb+multibp: Remove bogus assertion. It's possible for the space and offset of a page to be undefined during the lifecycle of a page. Remove the debug #defines from univ.i. ------------------------------------------------------------------------ r6933 | sbains | 2010-04-01 01:22:40 +0300 (Thu, 01 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/srv/srv0start.c branches/innodb+multibp: Fix whitespace issues. ------------------------------------------------------------------------ r6934 | sbains | 2010-04-01 01:53:18 +0300 (Thu, 01 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/CMakeLists.txt M /branches/innodb+multibp/ChangeLog M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/handler/ha_innodb.cc M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/include/srv0srv.h M /branches/innodb+multibp/include/sync0sync.h M /branches/innodb+multibp/include/trx0purge.h M /branches/innodb+multibp/include/ut0ut.h M /branches/innodb+multibp/include/ut0ut.ic M /branches/innodb+multibp/lock/lock0lock.c M /branches/innodb+multibp/log/log0recv.c M /branches/innodb+multibp/mtr/mtr0mtr.c M /branches/innodb+multibp/mysql-test/innodb_bug38231.test A /branches/innodb+multibp/mysql-test/innodb_bug51920.result (from /branches/innodb+/mysql-test/innodb_bug51920.result:6931) A /branches/innodb+multibp/mysql-test/innodb_bug51920.test (from /branches/innodb+/mysql-test/innodb_bug51920.test:6931) M /branches/innodb+multibp/row/row0sel.c M /branches/innodb+multibp/srv/srv0srv.c M /branches/innodb+multibp/srv/srv0start.c M /branches/innodb+multibp/sync/sync0sync.c M /branches/innodb+multibp/trx/trx0purge.c branches/innodb+multibp: Merge revisions r6914:6931 from branches/innodb+ ------------------------------------------------------------------------ r6935 | sbains | 2010-04-01 02:08:32 +0300 (Thu, 01 Apr 2010) | 3 lines Changed paths: M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/mtr/mtr0mtr.c branches/innodb+multibp: Fix the debug assertions for flush order mutex. These were missed in r6934. ------------------------------------------------------------------------ r6936 | sbains | 2010-04-01 02:46:52 +0300 (Thu, 01 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/sync/sync0sync.c branches/innodb+multibp: Because now we have multiple instances of a mutex at the same level and these mutexes can be acquired simultaneously we can't simply check for <= level. We need to check for <= level - 1. ------------------------------------------------------------------------ r6937 | sbains | 2010-04-01 04:40:17 +0300 (Thu, 01 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/trx/trx0purge.c branches/innodb+multibp: We need to check if the history list len is > than some threshold not that it is evenly divisible by the some batch size. While running tests on dscczz01 I've observed that the purge thread can't keep up with the generation of the UNDO log records because of the faster code. ------------------------------------------------------------------------ r6938 | irana | 2010-04-01 10:15:00 +0300 (Thu, 01 Apr 2010) | 7 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.h M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/include/log0log.h M /branches/innodb+multibp/include/sync0sync.h M /branches/innodb+multibp/log/log0log.c M /branches/innodb+multibp/log/log0recv.c M /branches/innodb+multibp/mtr/mtr0mtr.c M /branches/innodb+multibp/sync/sync0sync.c branches/innodb+multibp The buf_flush_order patch that was ported in from 1.1 won't work with multiple buffer pools. This patch moves the mutex protecting order of insertion in the flush list(s) to log_sys struct so that we can have one global mutex protecting insertions into all flush list(s) ------------------------------------------------------------------------ r6941 | sbains | 2010-04-02 00:51:28 +0300 (Fri, 02 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/lock/lock0lock.c branches/innodb+multibp: We should get the record heap no to check recursively only if we are checking a record lock. Prior to this fix we were doing it for table locks as well, this is a bug. ------------------------------------------------------------------------ r6942 | csun | 2010-04-02 02:39:10 +0300 (Fri, 02 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/ha/ha0ha.c branches/innodb+multibp: fix compiler errors on Windows. Move ut_ad() to after declarations for C file. ------------------------------------------------------------------------ r6943 | sbains | 2010-04-03 05:14:25 +0300 (Sat, 03 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: Remove the code that created the fake buffer pool. ------------------------------------------------------------------------ r6945 | irana | 2010-04-05 23:35:29 +0300 (Mon, 05 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/lock/lock0lock.c branches/innodb+multibp Revert r6941 as it does not resolve the issue and we have to take back the whole fix for bug#49047 ------------------------------------------------------------------------ r6946 | irana | 2010-04-05 23:50:42 +0300 (Mon, 05 Apr 2010) | 6 lines Changed paths: M /branches/innodb+multibp/include/ut0ut.h M /branches/innodb+multibp/include/ut0ut.ic M /branches/innodb+multibp/lock/lock0lock.c branches/innodb+multibp Merged revisions 6932:6944 from branches/innodb+ This solely includes the reversal of fix for bug#49047 ------------------------------------------------------------------------ r6947 | sbains | 2010-04-06 01:33:46 +0300 (Tue, 06 Apr 2010) | 3 lines Changed paths: M /branches/innodb+multibp/buf/buf0lru.c branches/innodb+multibp: Remove the log sys mutex acquisition when doing buffer pool stat aggregation. A dirty read here should suffice. ------------------------------------------------------------------------ r6951 | irana | 2010-04-06 17:25:29 +0300 (Tue, 06 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+mbp Initialize the buf_page_t::buf_pool pointer when the descriptor is allocated using buf_buddy_alloc(). ------------------------------------------------------------------------ r6954 | jyang | 2010-04-06 21:24:46 +0300 (Tue, 06 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp: Fix a possible null pointer of index_mapping in a race condition. ------------------------------------------------------------------------ r6958 | sbains | 2010-04-07 00:27:44 +0300 (Wed, 07 Apr 2010) | 3 lines Changed paths: M /branches/innodb+multibp/include/ut0mem.h M /branches/innodb+multibp/ut/ut0mem.c branches/innodb+multibp: Fix part of Bug#52546. We allow ut_free() to accept a NULL pointer and treat it as a nop. ------------------------------------------------------------------------ r6961 | jyang | 2010-04-07 10:50:03 +0300 (Wed, 07 Apr 2010) | 9 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp: Fix for bug #52580: Crash in ha_innobase::open on executing INSERT with concurrent ALTER TABLE. Change in MySQL bug #51557 releases the mutex LOCK_open before ha_innobase::open(), causing racing condition for index translation table creation. Fix it by adding dict_sys mutex for the operation. rb://283, approved by Marko. ------------------------------------------------------------------------ r6963 | irana | 2010-04-07 19:14:10 +0300 (Wed, 07 Apr 2010) | 15 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp Force setting of buf_pool->LRU_old_ratio by calling buf_LRU_old_ratio_update() with adjust set to TRUE. This will make sure that we grab the buf_pool mutex and actually adjust the buf_pool->LRU_old pointer instead of just updating the buf_pool->LRU_old_ratio. Note that after this change there is no call to buf_LRU_old_ratio_update() with adjust set to FALSE and therefore this parameter should be removed. I am keeping it for now to first make sure that the fix does work. Approved by: No one. Sunny agreed with my hypothesis of the problem. ------------------------------------------------------------------------ r6964 | irana | 2010-04-07 19:59:59 +0300 (Wed, 07 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp Remove a too strong assertion on behalf of Jimmy. ------------------------------------------------------------------------ r6971 | sbains | 2010-04-09 13:23:33 +0300 (Fri, 09 Apr 2010) | 6 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: When getting the oldest (minimum) LSN value from all the flush lists we need to acquire the flush list mutex. We were incorrectly acquiring the buffer pool mutex. This patch should fix a slew of bugs reported by Michael. ------------------------------------------------------------------------ r6972 | sbains | 2010-04-10 00:25:09 +0300 (Sat, 10 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: We should not reset the lsn to 0 when we encounter an empty flush list. Oldest LSN should be 0 only when all flush lists are empty. e.g., without this fix if even one flush list was empty we would end up breaking WAL. ------------------------------------------------------------------------ r6987 | sbains | 2010-04-14 00:14:13 +0300 (Wed, 14 Apr 2010) | 12 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: When calculating the oldest_lsn we can have a situation where we've iterated to say buffer pool 3 and another thread adds two new dirty pages, the first to buffer pool 1 and the second to buffer pool 4. Up to say buffer pool 3 the oldest_lsn was 0. Now, we will end up returning the lsn at buffer pool 4 as the oldest LSN. We prevent this by acquiring the flush order mutex. One other future option is to calculate the min_lsn when flushing pages from the list and maintaining a running total using atomics. That way we can get rid of this function altogether. The atomics will only really be required when we do parallel flushing. ------------------------------------------------------------------------ r6992 | sbains | 2010-04-14 02:45:59 +0300 (Wed, 14 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/include/ut0rbt.h M /branches/innodb+multibp/ut/ut0rbt.c branches/innodb+multibp: Fix copyright of the rbt code. ------------------------------------------------------------------------
16 years ago
branches/innodb+ Merge r6915:6992 from branches/innodb+multipbp (i.e.: all the changes made since it's creation) This also reverts r6930 to branches/innodb+ because a different solution for that issue is already present in innodb+multibp which is being merged. After this commit branches/innodb+multibp should be discarded and this branch should become our main development tree. ------------------------------------------------------------------------ r6915 | sbains | 2010-03-31 07:33:43 +0300 (Wed, 31 Mar 2010) | 1 line Changed paths: A /branches/innodb+multibp (from /branches/innodb+:6914) Creating a branch for the multiple buffer pool ------------------------------------------------------------------------ r6916 | sbains | 2010-03-31 08:21:00 +0300 (Wed, 31 Mar 2010) | 3 lines Changed paths: M /branches/innodb+multibp/CMakeLists.txt M /branches/innodb+multibp/btr/btr0btr.c M /branches/innodb+multibp/btr/btr0cur.c M /branches/innodb+multibp/btr/btr0sea.c M /branches/innodb+multibp/buf/buf0buddy.c M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/buf/buf0lru.c M /branches/innodb+multibp/buf/buf0rea.c M /branches/innodb+multibp/handler/ha_innodb.cc M /branches/innodb+multibp/handler/i_s.cc M /branches/innodb+multibp/ibuf/ibuf0ibuf.c M /branches/innodb+multibp/include/buf0buddy.h M /branches/innodb+multibp/include/buf0buddy.ic M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.h M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/include/buf0lru.h M /branches/innodb+multibp/include/buf0rea.h M /branches/innodb+multibp/include/buf0types.h M /branches/innodb+multibp/include/ibuf0ibuf.ic M /branches/innodb+multibp/include/srv0srv.h M /branches/innodb+multibp/include/univ.i M /branches/innodb+multibp/log/log0log.c M /branches/innodb+multibp/log/log0recv.c M /branches/innodb+multibp/mem/mem0mem.c M /branches/innodb+multibp/page/page0zip.c M /branches/innodb+multibp/srv/srv0srv.c M /branches/innodb+multibp/srv/srv0start.c M /branches/innodb+multibp/trx/trx0trx.c M /branches/innodb+multibp/trx/trx0undo.c branches/innodb+multibp: Unable to crash it with UNIV_DEBUG and UNIV_SYNC_DEBUG with both ibtests and Sysbench. The patch now needs a workout from Michael. ------------------------------------------------------------------------ r6917 | sbains | 2010-03-31 08:56:18 +0300 (Wed, 31 Mar 2010) | 2 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp: Fix error introduced in r6916. ------------------------------------------------------------------------ r6923 | sbains | 2010-03-31 15:16:04 +0300 (Wed, 31 Mar 2010) | 3 lines Changed paths: M /branches/innodb+multibp/btr/btr0cur.c M /branches/innodb+multibp/buf/buf0buddy.c M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/buf/buf0lru.c M /branches/innodb+multibp/include/buf0buddy.ic M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/page/page0zip.c branches/innodb+multibp: Fix whitespace issues. Add function buf_pool_from_block(). Add some comments to parameters. ------------------------------------------------------------------------ r6932 | sbains | 2010-04-01 01:12:07 +0300 (Thu, 01 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/univ.i branches/innodb+multibp: Remove bogus assertion. It's possible for the space and offset of a page to be undefined during the lifecycle of a page. Remove the debug #defines from univ.i. ------------------------------------------------------------------------ r6933 | sbains | 2010-04-01 01:22:40 +0300 (Thu, 01 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/srv/srv0start.c branches/innodb+multibp: Fix whitespace issues. ------------------------------------------------------------------------ r6934 | sbains | 2010-04-01 01:53:18 +0300 (Thu, 01 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/CMakeLists.txt M /branches/innodb+multibp/ChangeLog M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/handler/ha_innodb.cc M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/include/srv0srv.h M /branches/innodb+multibp/include/sync0sync.h M /branches/innodb+multibp/include/trx0purge.h M /branches/innodb+multibp/include/ut0ut.h M /branches/innodb+multibp/include/ut0ut.ic M /branches/innodb+multibp/lock/lock0lock.c M /branches/innodb+multibp/log/log0recv.c M /branches/innodb+multibp/mtr/mtr0mtr.c M /branches/innodb+multibp/mysql-test/innodb_bug38231.test A /branches/innodb+multibp/mysql-test/innodb_bug51920.result (from /branches/innodb+/mysql-test/innodb_bug51920.result:6931) A /branches/innodb+multibp/mysql-test/innodb_bug51920.test (from /branches/innodb+/mysql-test/innodb_bug51920.test:6931) M /branches/innodb+multibp/row/row0sel.c M /branches/innodb+multibp/srv/srv0srv.c M /branches/innodb+multibp/srv/srv0start.c M /branches/innodb+multibp/sync/sync0sync.c M /branches/innodb+multibp/trx/trx0purge.c branches/innodb+multibp: Merge revisions r6914:6931 from branches/innodb+ ------------------------------------------------------------------------ r6935 | sbains | 2010-04-01 02:08:32 +0300 (Thu, 01 Apr 2010) | 3 lines Changed paths: M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/mtr/mtr0mtr.c branches/innodb+multibp: Fix the debug assertions for flush order mutex. These were missed in r6934. ------------------------------------------------------------------------ r6936 | sbains | 2010-04-01 02:46:52 +0300 (Thu, 01 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/sync/sync0sync.c branches/innodb+multibp: Because now we have multiple instances of a mutex at the same level and these mutexes can be acquired simultaneously we can't simply check for <= level. We need to check for <= level - 1. ------------------------------------------------------------------------ r6937 | sbains | 2010-04-01 04:40:17 +0300 (Thu, 01 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/trx/trx0purge.c branches/innodb+multibp: We need to check if the history list len is > than some threshold not that it is evenly divisible by the some batch size. While running tests on dscczz01 I've observed that the purge thread can't keep up with the generation of the UNDO log records because of the faster code. ------------------------------------------------------------------------ r6938 | irana | 2010-04-01 10:15:00 +0300 (Thu, 01 Apr 2010) | 7 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.h M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/include/log0log.h M /branches/innodb+multibp/include/sync0sync.h M /branches/innodb+multibp/log/log0log.c M /branches/innodb+multibp/log/log0recv.c M /branches/innodb+multibp/mtr/mtr0mtr.c M /branches/innodb+multibp/sync/sync0sync.c branches/innodb+multibp The buf_flush_order patch that was ported in from 1.1 won't work with multiple buffer pools. This patch moves the mutex protecting order of insertion in the flush list(s) to log_sys struct so that we can have one global mutex protecting insertions into all flush list(s) ------------------------------------------------------------------------ r6941 | sbains | 2010-04-02 00:51:28 +0300 (Fri, 02 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/lock/lock0lock.c branches/innodb+multibp: We should get the record heap no to check recursively only if we are checking a record lock. Prior to this fix we were doing it for table locks as well, this is a bug. ------------------------------------------------------------------------ r6942 | csun | 2010-04-02 02:39:10 +0300 (Fri, 02 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/ha/ha0ha.c branches/innodb+multibp: fix compiler errors on Windows. Move ut_ad() to after declarations for C file. ------------------------------------------------------------------------ r6943 | sbains | 2010-04-03 05:14:25 +0300 (Sat, 03 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: Remove the code that created the fake buffer pool. ------------------------------------------------------------------------ r6945 | irana | 2010-04-05 23:35:29 +0300 (Mon, 05 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/lock/lock0lock.c branches/innodb+multibp Revert r6941 as it does not resolve the issue and we have to take back the whole fix for bug#49047 ------------------------------------------------------------------------ r6946 | irana | 2010-04-05 23:50:42 +0300 (Mon, 05 Apr 2010) | 6 lines Changed paths: M /branches/innodb+multibp/include/ut0ut.h M /branches/innodb+multibp/include/ut0ut.ic M /branches/innodb+multibp/lock/lock0lock.c branches/innodb+multibp Merged revisions 6932:6944 from branches/innodb+ This solely includes the reversal of fix for bug#49047 ------------------------------------------------------------------------ r6947 | sbains | 2010-04-06 01:33:46 +0300 (Tue, 06 Apr 2010) | 3 lines Changed paths: M /branches/innodb+multibp/buf/buf0lru.c branches/innodb+multibp: Remove the log sys mutex acquisition when doing buffer pool stat aggregation. A dirty read here should suffice. ------------------------------------------------------------------------ r6951 | irana | 2010-04-06 17:25:29 +0300 (Tue, 06 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+mbp Initialize the buf_page_t::buf_pool pointer when the descriptor is allocated using buf_buddy_alloc(). ------------------------------------------------------------------------ r6954 | jyang | 2010-04-06 21:24:46 +0300 (Tue, 06 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp: Fix a possible null pointer of index_mapping in a race condition. ------------------------------------------------------------------------ r6958 | sbains | 2010-04-07 00:27:44 +0300 (Wed, 07 Apr 2010) | 3 lines Changed paths: M /branches/innodb+multibp/include/ut0mem.h M /branches/innodb+multibp/ut/ut0mem.c branches/innodb+multibp: Fix part of Bug#52546. We allow ut_free() to accept a NULL pointer and treat it as a nop. ------------------------------------------------------------------------ r6961 | jyang | 2010-04-07 10:50:03 +0300 (Wed, 07 Apr 2010) | 9 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp: Fix for bug #52580: Crash in ha_innobase::open on executing INSERT with concurrent ALTER TABLE. Change in MySQL bug #51557 releases the mutex LOCK_open before ha_innobase::open(), causing racing condition for index translation table creation. Fix it by adding dict_sys mutex for the operation. rb://283, approved by Marko. ------------------------------------------------------------------------ r6963 | irana | 2010-04-07 19:14:10 +0300 (Wed, 07 Apr 2010) | 15 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp Force setting of buf_pool->LRU_old_ratio by calling buf_LRU_old_ratio_update() with adjust set to TRUE. This will make sure that we grab the buf_pool mutex and actually adjust the buf_pool->LRU_old pointer instead of just updating the buf_pool->LRU_old_ratio. Note that after this change there is no call to buf_LRU_old_ratio_update() with adjust set to FALSE and therefore this parameter should be removed. I am keeping it for now to first make sure that the fix does work. Approved by: No one. Sunny agreed with my hypothesis of the problem. ------------------------------------------------------------------------ r6964 | irana | 2010-04-07 19:59:59 +0300 (Wed, 07 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp Remove a too strong assertion on behalf of Jimmy. ------------------------------------------------------------------------ r6971 | sbains | 2010-04-09 13:23:33 +0300 (Fri, 09 Apr 2010) | 6 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: When getting the oldest (minimum) LSN value from all the flush lists we need to acquire the flush list mutex. We were incorrectly acquiring the buffer pool mutex. This patch should fix a slew of bugs reported by Michael. ------------------------------------------------------------------------ r6972 | sbains | 2010-04-10 00:25:09 +0300 (Sat, 10 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: We should not reset the lsn to 0 when we encounter an empty flush list. Oldest LSN should be 0 only when all flush lists are empty. e.g., without this fix if even one flush list was empty we would end up breaking WAL. ------------------------------------------------------------------------ r6987 | sbains | 2010-04-14 00:14:13 +0300 (Wed, 14 Apr 2010) | 12 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: When calculating the oldest_lsn we can have a situation where we've iterated to say buffer pool 3 and another thread adds two new dirty pages, the first to buffer pool 1 and the second to buffer pool 4. Up to say buffer pool 3 the oldest_lsn was 0. Now, we will end up returning the lsn at buffer pool 4 as the oldest LSN. We prevent this by acquiring the flush order mutex. One other future option is to calculate the min_lsn when flushing pages from the list and maintaining a running total using atomics. That way we can get rid of this function altogether. The atomics will only really be required when we do parallel flushing. ------------------------------------------------------------------------ r6992 | sbains | 2010-04-14 02:45:59 +0300 (Wed, 14 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/include/ut0rbt.h M /branches/innodb+multibp/ut/ut0rbt.c branches/innodb+multibp: Fix copyright of the rbt code. ------------------------------------------------------------------------
16 years ago
branches/innodb+ Merge r6915:6992 from branches/innodb+multipbp (i.e.: all the changes made since it's creation) This also reverts r6930 to branches/innodb+ because a different solution for that issue is already present in innodb+multibp which is being merged. After this commit branches/innodb+multibp should be discarded and this branch should become our main development tree. ------------------------------------------------------------------------ r6915 | sbains | 2010-03-31 07:33:43 +0300 (Wed, 31 Mar 2010) | 1 line Changed paths: A /branches/innodb+multibp (from /branches/innodb+:6914) Creating a branch for the multiple buffer pool ------------------------------------------------------------------------ r6916 | sbains | 2010-03-31 08:21:00 +0300 (Wed, 31 Mar 2010) | 3 lines Changed paths: M /branches/innodb+multibp/CMakeLists.txt M /branches/innodb+multibp/btr/btr0btr.c M /branches/innodb+multibp/btr/btr0cur.c M /branches/innodb+multibp/btr/btr0sea.c M /branches/innodb+multibp/buf/buf0buddy.c M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/buf/buf0lru.c M /branches/innodb+multibp/buf/buf0rea.c M /branches/innodb+multibp/handler/ha_innodb.cc M /branches/innodb+multibp/handler/i_s.cc M /branches/innodb+multibp/ibuf/ibuf0ibuf.c M /branches/innodb+multibp/include/buf0buddy.h M /branches/innodb+multibp/include/buf0buddy.ic M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.h M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/include/buf0lru.h M /branches/innodb+multibp/include/buf0rea.h M /branches/innodb+multibp/include/buf0types.h M /branches/innodb+multibp/include/ibuf0ibuf.ic M /branches/innodb+multibp/include/srv0srv.h M /branches/innodb+multibp/include/univ.i M /branches/innodb+multibp/log/log0log.c M /branches/innodb+multibp/log/log0recv.c M /branches/innodb+multibp/mem/mem0mem.c M /branches/innodb+multibp/page/page0zip.c M /branches/innodb+multibp/srv/srv0srv.c M /branches/innodb+multibp/srv/srv0start.c M /branches/innodb+multibp/trx/trx0trx.c M /branches/innodb+multibp/trx/trx0undo.c branches/innodb+multibp: Unable to crash it with UNIV_DEBUG and UNIV_SYNC_DEBUG with both ibtests and Sysbench. The patch now needs a workout from Michael. ------------------------------------------------------------------------ r6917 | sbains | 2010-03-31 08:56:18 +0300 (Wed, 31 Mar 2010) | 2 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp: Fix error introduced in r6916. ------------------------------------------------------------------------ r6923 | sbains | 2010-03-31 15:16:04 +0300 (Wed, 31 Mar 2010) | 3 lines Changed paths: M /branches/innodb+multibp/btr/btr0cur.c M /branches/innodb+multibp/buf/buf0buddy.c M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/buf/buf0lru.c M /branches/innodb+multibp/include/buf0buddy.ic M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/page/page0zip.c branches/innodb+multibp: Fix whitespace issues. Add function buf_pool_from_block(). Add some comments to parameters. ------------------------------------------------------------------------ r6932 | sbains | 2010-04-01 01:12:07 +0300 (Thu, 01 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/univ.i branches/innodb+multibp: Remove bogus assertion. It's possible for the space and offset of a page to be undefined during the lifecycle of a page. Remove the debug #defines from univ.i. ------------------------------------------------------------------------ r6933 | sbains | 2010-04-01 01:22:40 +0300 (Thu, 01 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/srv/srv0start.c branches/innodb+multibp: Fix whitespace issues. ------------------------------------------------------------------------ r6934 | sbains | 2010-04-01 01:53:18 +0300 (Thu, 01 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/CMakeLists.txt M /branches/innodb+multibp/ChangeLog M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/handler/ha_innodb.cc M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/include/srv0srv.h M /branches/innodb+multibp/include/sync0sync.h M /branches/innodb+multibp/include/trx0purge.h M /branches/innodb+multibp/include/ut0ut.h M /branches/innodb+multibp/include/ut0ut.ic M /branches/innodb+multibp/lock/lock0lock.c M /branches/innodb+multibp/log/log0recv.c M /branches/innodb+multibp/mtr/mtr0mtr.c M /branches/innodb+multibp/mysql-test/innodb_bug38231.test A /branches/innodb+multibp/mysql-test/innodb_bug51920.result (from /branches/innodb+/mysql-test/innodb_bug51920.result:6931) A /branches/innodb+multibp/mysql-test/innodb_bug51920.test (from /branches/innodb+/mysql-test/innodb_bug51920.test:6931) M /branches/innodb+multibp/row/row0sel.c M /branches/innodb+multibp/srv/srv0srv.c M /branches/innodb+multibp/srv/srv0start.c M /branches/innodb+multibp/sync/sync0sync.c M /branches/innodb+multibp/trx/trx0purge.c branches/innodb+multibp: Merge revisions r6914:6931 from branches/innodb+ ------------------------------------------------------------------------ r6935 | sbains | 2010-04-01 02:08:32 +0300 (Thu, 01 Apr 2010) | 3 lines Changed paths: M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/mtr/mtr0mtr.c branches/innodb+multibp: Fix the debug assertions for flush order mutex. These were missed in r6934. ------------------------------------------------------------------------ r6936 | sbains | 2010-04-01 02:46:52 +0300 (Thu, 01 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/sync/sync0sync.c branches/innodb+multibp: Because now we have multiple instances of a mutex at the same level and these mutexes can be acquired simultaneously we can't simply check for <= level. We need to check for <= level - 1. ------------------------------------------------------------------------ r6937 | sbains | 2010-04-01 04:40:17 +0300 (Thu, 01 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/trx/trx0purge.c branches/innodb+multibp: We need to check if the history list len is > than some threshold not that it is evenly divisible by the some batch size. While running tests on dscczz01 I've observed that the purge thread can't keep up with the generation of the UNDO log records because of the faster code. ------------------------------------------------------------------------ r6938 | irana | 2010-04-01 10:15:00 +0300 (Thu, 01 Apr 2010) | 7 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.h M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/include/log0log.h M /branches/innodb+multibp/include/sync0sync.h M /branches/innodb+multibp/log/log0log.c M /branches/innodb+multibp/log/log0recv.c M /branches/innodb+multibp/mtr/mtr0mtr.c M /branches/innodb+multibp/sync/sync0sync.c branches/innodb+multibp The buf_flush_order patch that was ported in from 1.1 won't work with multiple buffer pools. This patch moves the mutex protecting order of insertion in the flush list(s) to log_sys struct so that we can have one global mutex protecting insertions into all flush list(s) ------------------------------------------------------------------------ r6941 | sbains | 2010-04-02 00:51:28 +0300 (Fri, 02 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/lock/lock0lock.c branches/innodb+multibp: We should get the record heap no to check recursively only if we are checking a record lock. Prior to this fix we were doing it for table locks as well, this is a bug. ------------------------------------------------------------------------ r6942 | csun | 2010-04-02 02:39:10 +0300 (Fri, 02 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/ha/ha0ha.c branches/innodb+multibp: fix compiler errors on Windows. Move ut_ad() to after declarations for C file. ------------------------------------------------------------------------ r6943 | sbains | 2010-04-03 05:14:25 +0300 (Sat, 03 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: Remove the code that created the fake buffer pool. ------------------------------------------------------------------------ r6945 | irana | 2010-04-05 23:35:29 +0300 (Mon, 05 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/lock/lock0lock.c branches/innodb+multibp Revert r6941 as it does not resolve the issue and we have to take back the whole fix for bug#49047 ------------------------------------------------------------------------ r6946 | irana | 2010-04-05 23:50:42 +0300 (Mon, 05 Apr 2010) | 6 lines Changed paths: M /branches/innodb+multibp/include/ut0ut.h M /branches/innodb+multibp/include/ut0ut.ic M /branches/innodb+multibp/lock/lock0lock.c branches/innodb+multibp Merged revisions 6932:6944 from branches/innodb+ This solely includes the reversal of fix for bug#49047 ------------------------------------------------------------------------ r6947 | sbains | 2010-04-06 01:33:46 +0300 (Tue, 06 Apr 2010) | 3 lines Changed paths: M /branches/innodb+multibp/buf/buf0lru.c branches/innodb+multibp: Remove the log sys mutex acquisition when doing buffer pool stat aggregation. A dirty read here should suffice. ------------------------------------------------------------------------ r6951 | irana | 2010-04-06 17:25:29 +0300 (Tue, 06 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+mbp Initialize the buf_page_t::buf_pool pointer when the descriptor is allocated using buf_buddy_alloc(). ------------------------------------------------------------------------ r6954 | jyang | 2010-04-06 21:24:46 +0300 (Tue, 06 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp: Fix a possible null pointer of index_mapping in a race condition. ------------------------------------------------------------------------ r6958 | sbains | 2010-04-07 00:27:44 +0300 (Wed, 07 Apr 2010) | 3 lines Changed paths: M /branches/innodb+multibp/include/ut0mem.h M /branches/innodb+multibp/ut/ut0mem.c branches/innodb+multibp: Fix part of Bug#52546. We allow ut_free() to accept a NULL pointer and treat it as a nop. ------------------------------------------------------------------------ r6961 | jyang | 2010-04-07 10:50:03 +0300 (Wed, 07 Apr 2010) | 9 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp: Fix for bug #52580: Crash in ha_innobase::open on executing INSERT with concurrent ALTER TABLE. Change in MySQL bug #51557 releases the mutex LOCK_open before ha_innobase::open(), causing racing condition for index translation table creation. Fix it by adding dict_sys mutex for the operation. rb://283, approved by Marko. ------------------------------------------------------------------------ r6963 | irana | 2010-04-07 19:14:10 +0300 (Wed, 07 Apr 2010) | 15 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp Force setting of buf_pool->LRU_old_ratio by calling buf_LRU_old_ratio_update() with adjust set to TRUE. This will make sure that we grab the buf_pool mutex and actually adjust the buf_pool->LRU_old pointer instead of just updating the buf_pool->LRU_old_ratio. Note that after this change there is no call to buf_LRU_old_ratio_update() with adjust set to FALSE and therefore this parameter should be removed. I am keeping it for now to first make sure that the fix does work. Approved by: No one. Sunny agreed with my hypothesis of the problem. ------------------------------------------------------------------------ r6964 | irana | 2010-04-07 19:59:59 +0300 (Wed, 07 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp Remove a too strong assertion on behalf of Jimmy. ------------------------------------------------------------------------ r6971 | sbains | 2010-04-09 13:23:33 +0300 (Fri, 09 Apr 2010) | 6 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: When getting the oldest (minimum) LSN value from all the flush lists we need to acquire the flush list mutex. We were incorrectly acquiring the buffer pool mutex. This patch should fix a slew of bugs reported by Michael. ------------------------------------------------------------------------ r6972 | sbains | 2010-04-10 00:25:09 +0300 (Sat, 10 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: We should not reset the lsn to 0 when we encounter an empty flush list. Oldest LSN should be 0 only when all flush lists are empty. e.g., without this fix if even one flush list was empty we would end up breaking WAL. ------------------------------------------------------------------------ r6987 | sbains | 2010-04-14 00:14:13 +0300 (Wed, 14 Apr 2010) | 12 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: When calculating the oldest_lsn we can have a situation where we've iterated to say buffer pool 3 and another thread adds two new dirty pages, the first to buffer pool 1 and the second to buffer pool 4. Up to say buffer pool 3 the oldest_lsn was 0. Now, we will end up returning the lsn at buffer pool 4 as the oldest LSN. We prevent this by acquiring the flush order mutex. One other future option is to calculate the min_lsn when flushing pages from the list and maintaining a running total using atomics. That way we can get rid of this function altogether. The atomics will only really be required when we do parallel flushing. ------------------------------------------------------------------------ r6992 | sbains | 2010-04-14 02:45:59 +0300 (Wed, 14 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/include/ut0rbt.h M /branches/innodb+multibp/ut/ut0rbt.c branches/innodb+multibp: Fix copyright of the rbt code. ------------------------------------------------------------------------
16 years ago
branches/innodb+ Merge r6915:6992 from branches/innodb+multipbp (i.e.: all the changes made since it's creation) This also reverts r6930 to branches/innodb+ because a different solution for that issue is already present in innodb+multibp which is being merged. After this commit branches/innodb+multibp should be discarded and this branch should become our main development tree. ------------------------------------------------------------------------ r6915 | sbains | 2010-03-31 07:33:43 +0300 (Wed, 31 Mar 2010) | 1 line Changed paths: A /branches/innodb+multibp (from /branches/innodb+:6914) Creating a branch for the multiple buffer pool ------------------------------------------------------------------------ r6916 | sbains | 2010-03-31 08:21:00 +0300 (Wed, 31 Mar 2010) | 3 lines Changed paths: M /branches/innodb+multibp/CMakeLists.txt M /branches/innodb+multibp/btr/btr0btr.c M /branches/innodb+multibp/btr/btr0cur.c M /branches/innodb+multibp/btr/btr0sea.c M /branches/innodb+multibp/buf/buf0buddy.c M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/buf/buf0lru.c M /branches/innodb+multibp/buf/buf0rea.c M /branches/innodb+multibp/handler/ha_innodb.cc M /branches/innodb+multibp/handler/i_s.cc M /branches/innodb+multibp/ibuf/ibuf0ibuf.c M /branches/innodb+multibp/include/buf0buddy.h M /branches/innodb+multibp/include/buf0buddy.ic M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.h M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/include/buf0lru.h M /branches/innodb+multibp/include/buf0rea.h M /branches/innodb+multibp/include/buf0types.h M /branches/innodb+multibp/include/ibuf0ibuf.ic M /branches/innodb+multibp/include/srv0srv.h M /branches/innodb+multibp/include/univ.i M /branches/innodb+multibp/log/log0log.c M /branches/innodb+multibp/log/log0recv.c M /branches/innodb+multibp/mem/mem0mem.c M /branches/innodb+multibp/page/page0zip.c M /branches/innodb+multibp/srv/srv0srv.c M /branches/innodb+multibp/srv/srv0start.c M /branches/innodb+multibp/trx/trx0trx.c M /branches/innodb+multibp/trx/trx0undo.c branches/innodb+multibp: Unable to crash it with UNIV_DEBUG and UNIV_SYNC_DEBUG with both ibtests and Sysbench. The patch now needs a workout from Michael. ------------------------------------------------------------------------ r6917 | sbains | 2010-03-31 08:56:18 +0300 (Wed, 31 Mar 2010) | 2 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp: Fix error introduced in r6916. ------------------------------------------------------------------------ r6923 | sbains | 2010-03-31 15:16:04 +0300 (Wed, 31 Mar 2010) | 3 lines Changed paths: M /branches/innodb+multibp/btr/btr0cur.c M /branches/innodb+multibp/buf/buf0buddy.c M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/buf/buf0lru.c M /branches/innodb+multibp/include/buf0buddy.ic M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/page/page0zip.c branches/innodb+multibp: Fix whitespace issues. Add function buf_pool_from_block(). Add some comments to parameters. ------------------------------------------------------------------------ r6932 | sbains | 2010-04-01 01:12:07 +0300 (Thu, 01 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/univ.i branches/innodb+multibp: Remove bogus assertion. It's possible for the space and offset of a page to be undefined during the lifecycle of a page. Remove the debug #defines from univ.i. ------------------------------------------------------------------------ r6933 | sbains | 2010-04-01 01:22:40 +0300 (Thu, 01 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/srv/srv0start.c branches/innodb+multibp: Fix whitespace issues. ------------------------------------------------------------------------ r6934 | sbains | 2010-04-01 01:53:18 +0300 (Thu, 01 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/CMakeLists.txt M /branches/innodb+multibp/ChangeLog M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/handler/ha_innodb.cc M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/include/srv0srv.h M /branches/innodb+multibp/include/sync0sync.h M /branches/innodb+multibp/include/trx0purge.h M /branches/innodb+multibp/include/ut0ut.h M /branches/innodb+multibp/include/ut0ut.ic M /branches/innodb+multibp/lock/lock0lock.c M /branches/innodb+multibp/log/log0recv.c M /branches/innodb+multibp/mtr/mtr0mtr.c M /branches/innodb+multibp/mysql-test/innodb_bug38231.test A /branches/innodb+multibp/mysql-test/innodb_bug51920.result (from /branches/innodb+/mysql-test/innodb_bug51920.result:6931) A /branches/innodb+multibp/mysql-test/innodb_bug51920.test (from /branches/innodb+/mysql-test/innodb_bug51920.test:6931) M /branches/innodb+multibp/row/row0sel.c M /branches/innodb+multibp/srv/srv0srv.c M /branches/innodb+multibp/srv/srv0start.c M /branches/innodb+multibp/sync/sync0sync.c M /branches/innodb+multibp/trx/trx0purge.c branches/innodb+multibp: Merge revisions r6914:6931 from branches/innodb+ ------------------------------------------------------------------------ r6935 | sbains | 2010-04-01 02:08:32 +0300 (Thu, 01 Apr 2010) | 3 lines Changed paths: M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/mtr/mtr0mtr.c branches/innodb+multibp: Fix the debug assertions for flush order mutex. These were missed in r6934. ------------------------------------------------------------------------ r6936 | sbains | 2010-04-01 02:46:52 +0300 (Thu, 01 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/sync/sync0sync.c branches/innodb+multibp: Because now we have multiple instances of a mutex at the same level and these mutexes can be acquired simultaneously we can't simply check for <= level. We need to check for <= level - 1. ------------------------------------------------------------------------ r6937 | sbains | 2010-04-01 04:40:17 +0300 (Thu, 01 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/trx/trx0purge.c branches/innodb+multibp: We need to check if the history list len is > than some threshold not that it is evenly divisible by the some batch size. While running tests on dscczz01 I've observed that the purge thread can't keep up with the generation of the UNDO log records because of the faster code. ------------------------------------------------------------------------ r6938 | irana | 2010-04-01 10:15:00 +0300 (Thu, 01 Apr 2010) | 7 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.h M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/include/log0log.h M /branches/innodb+multibp/include/sync0sync.h M /branches/innodb+multibp/log/log0log.c M /branches/innodb+multibp/log/log0recv.c M /branches/innodb+multibp/mtr/mtr0mtr.c M /branches/innodb+multibp/sync/sync0sync.c branches/innodb+multibp The buf_flush_order patch that was ported in from 1.1 won't work with multiple buffer pools. This patch moves the mutex protecting order of insertion in the flush list(s) to log_sys struct so that we can have one global mutex protecting insertions into all flush list(s) ------------------------------------------------------------------------ r6941 | sbains | 2010-04-02 00:51:28 +0300 (Fri, 02 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/lock/lock0lock.c branches/innodb+multibp: We should get the record heap no to check recursively only if we are checking a record lock. Prior to this fix we were doing it for table locks as well, this is a bug. ------------------------------------------------------------------------ r6942 | csun | 2010-04-02 02:39:10 +0300 (Fri, 02 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/ha/ha0ha.c branches/innodb+multibp: fix compiler errors on Windows. Move ut_ad() to after declarations for C file. ------------------------------------------------------------------------ r6943 | sbains | 2010-04-03 05:14:25 +0300 (Sat, 03 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: Remove the code that created the fake buffer pool. ------------------------------------------------------------------------ r6945 | irana | 2010-04-05 23:35:29 +0300 (Mon, 05 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/lock/lock0lock.c branches/innodb+multibp Revert r6941 as it does not resolve the issue and we have to take back the whole fix for bug#49047 ------------------------------------------------------------------------ r6946 | irana | 2010-04-05 23:50:42 +0300 (Mon, 05 Apr 2010) | 6 lines Changed paths: M /branches/innodb+multibp/include/ut0ut.h M /branches/innodb+multibp/include/ut0ut.ic M /branches/innodb+multibp/lock/lock0lock.c branches/innodb+multibp Merged revisions 6932:6944 from branches/innodb+ This solely includes the reversal of fix for bug#49047 ------------------------------------------------------------------------ r6947 | sbains | 2010-04-06 01:33:46 +0300 (Tue, 06 Apr 2010) | 3 lines Changed paths: M /branches/innodb+multibp/buf/buf0lru.c branches/innodb+multibp: Remove the log sys mutex acquisition when doing buffer pool stat aggregation. A dirty read here should suffice. ------------------------------------------------------------------------ r6951 | irana | 2010-04-06 17:25:29 +0300 (Tue, 06 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+mbp Initialize the buf_page_t::buf_pool pointer when the descriptor is allocated using buf_buddy_alloc(). ------------------------------------------------------------------------ r6954 | jyang | 2010-04-06 21:24:46 +0300 (Tue, 06 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp: Fix a possible null pointer of index_mapping in a race condition. ------------------------------------------------------------------------ r6958 | sbains | 2010-04-07 00:27:44 +0300 (Wed, 07 Apr 2010) | 3 lines Changed paths: M /branches/innodb+multibp/include/ut0mem.h M /branches/innodb+multibp/ut/ut0mem.c branches/innodb+multibp: Fix part of Bug#52546. We allow ut_free() to accept a NULL pointer and treat it as a nop. ------------------------------------------------------------------------ r6961 | jyang | 2010-04-07 10:50:03 +0300 (Wed, 07 Apr 2010) | 9 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp: Fix for bug #52580: Crash in ha_innobase::open on executing INSERT with concurrent ALTER TABLE. Change in MySQL bug #51557 releases the mutex LOCK_open before ha_innobase::open(), causing racing condition for index translation table creation. Fix it by adding dict_sys mutex for the operation. rb://283, approved by Marko. ------------------------------------------------------------------------ r6963 | irana | 2010-04-07 19:14:10 +0300 (Wed, 07 Apr 2010) | 15 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp Force setting of buf_pool->LRU_old_ratio by calling buf_LRU_old_ratio_update() with adjust set to TRUE. This will make sure that we grab the buf_pool mutex and actually adjust the buf_pool->LRU_old pointer instead of just updating the buf_pool->LRU_old_ratio. Note that after this change there is no call to buf_LRU_old_ratio_update() with adjust set to FALSE and therefore this parameter should be removed. I am keeping it for now to first make sure that the fix does work. Approved by: No one. Sunny agreed with my hypothesis of the problem. ------------------------------------------------------------------------ r6964 | irana | 2010-04-07 19:59:59 +0300 (Wed, 07 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp Remove a too strong assertion on behalf of Jimmy. ------------------------------------------------------------------------ r6971 | sbains | 2010-04-09 13:23:33 +0300 (Fri, 09 Apr 2010) | 6 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: When getting the oldest (minimum) LSN value from all the flush lists we need to acquire the flush list mutex. We were incorrectly acquiring the buffer pool mutex. This patch should fix a slew of bugs reported by Michael. ------------------------------------------------------------------------ r6972 | sbains | 2010-04-10 00:25:09 +0300 (Sat, 10 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: We should not reset the lsn to 0 when we encounter an empty flush list. Oldest LSN should be 0 only when all flush lists are empty. e.g., without this fix if even one flush list was empty we would end up breaking WAL. ------------------------------------------------------------------------ r6987 | sbains | 2010-04-14 00:14:13 +0300 (Wed, 14 Apr 2010) | 12 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: When calculating the oldest_lsn we can have a situation where we've iterated to say buffer pool 3 and another thread adds two new dirty pages, the first to buffer pool 1 and the second to buffer pool 4. Up to say buffer pool 3 the oldest_lsn was 0. Now, we will end up returning the lsn at buffer pool 4 as the oldest LSN. We prevent this by acquiring the flush order mutex. One other future option is to calculate the min_lsn when flushing pages from the list and maintaining a running total using atomics. That way we can get rid of this function altogether. The atomics will only really be required when we do parallel flushing. ------------------------------------------------------------------------ r6992 | sbains | 2010-04-14 02:45:59 +0300 (Wed, 14 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/include/ut0rbt.h M /branches/innodb+multibp/ut/ut0rbt.c branches/innodb+multibp: Fix copyright of the rbt code. ------------------------------------------------------------------------
16 years ago
branches/innodb+ Merge r6915:6992 from branches/innodb+multipbp (i.e.: all the changes made since it's creation) This also reverts r6930 to branches/innodb+ because a different solution for that issue is already present in innodb+multibp which is being merged. After this commit branches/innodb+multibp should be discarded and this branch should become our main development tree. ------------------------------------------------------------------------ r6915 | sbains | 2010-03-31 07:33:43 +0300 (Wed, 31 Mar 2010) | 1 line Changed paths: A /branches/innodb+multibp (from /branches/innodb+:6914) Creating a branch for the multiple buffer pool ------------------------------------------------------------------------ r6916 | sbains | 2010-03-31 08:21:00 +0300 (Wed, 31 Mar 2010) | 3 lines Changed paths: M /branches/innodb+multibp/CMakeLists.txt M /branches/innodb+multibp/btr/btr0btr.c M /branches/innodb+multibp/btr/btr0cur.c M /branches/innodb+multibp/btr/btr0sea.c M /branches/innodb+multibp/buf/buf0buddy.c M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/buf/buf0lru.c M /branches/innodb+multibp/buf/buf0rea.c M /branches/innodb+multibp/handler/ha_innodb.cc M /branches/innodb+multibp/handler/i_s.cc M /branches/innodb+multibp/ibuf/ibuf0ibuf.c M /branches/innodb+multibp/include/buf0buddy.h M /branches/innodb+multibp/include/buf0buddy.ic M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.h M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/include/buf0lru.h M /branches/innodb+multibp/include/buf0rea.h M /branches/innodb+multibp/include/buf0types.h M /branches/innodb+multibp/include/ibuf0ibuf.ic M /branches/innodb+multibp/include/srv0srv.h M /branches/innodb+multibp/include/univ.i M /branches/innodb+multibp/log/log0log.c M /branches/innodb+multibp/log/log0recv.c M /branches/innodb+multibp/mem/mem0mem.c M /branches/innodb+multibp/page/page0zip.c M /branches/innodb+multibp/srv/srv0srv.c M /branches/innodb+multibp/srv/srv0start.c M /branches/innodb+multibp/trx/trx0trx.c M /branches/innodb+multibp/trx/trx0undo.c branches/innodb+multibp: Unable to crash it with UNIV_DEBUG and UNIV_SYNC_DEBUG with both ibtests and Sysbench. The patch now needs a workout from Michael. ------------------------------------------------------------------------ r6917 | sbains | 2010-03-31 08:56:18 +0300 (Wed, 31 Mar 2010) | 2 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp: Fix error introduced in r6916. ------------------------------------------------------------------------ r6923 | sbains | 2010-03-31 15:16:04 +0300 (Wed, 31 Mar 2010) | 3 lines Changed paths: M /branches/innodb+multibp/btr/btr0cur.c M /branches/innodb+multibp/buf/buf0buddy.c M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/buf/buf0lru.c M /branches/innodb+multibp/include/buf0buddy.ic M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/page/page0zip.c branches/innodb+multibp: Fix whitespace issues. Add function buf_pool_from_block(). Add some comments to parameters. ------------------------------------------------------------------------ r6932 | sbains | 2010-04-01 01:12:07 +0300 (Thu, 01 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/univ.i branches/innodb+multibp: Remove bogus assertion. It's possible for the space and offset of a page to be undefined during the lifecycle of a page. Remove the debug #defines from univ.i. ------------------------------------------------------------------------ r6933 | sbains | 2010-04-01 01:22:40 +0300 (Thu, 01 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/srv/srv0start.c branches/innodb+multibp: Fix whitespace issues. ------------------------------------------------------------------------ r6934 | sbains | 2010-04-01 01:53:18 +0300 (Thu, 01 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/CMakeLists.txt M /branches/innodb+multibp/ChangeLog M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/handler/ha_innodb.cc M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/include/srv0srv.h M /branches/innodb+multibp/include/sync0sync.h M /branches/innodb+multibp/include/trx0purge.h M /branches/innodb+multibp/include/ut0ut.h M /branches/innodb+multibp/include/ut0ut.ic M /branches/innodb+multibp/lock/lock0lock.c M /branches/innodb+multibp/log/log0recv.c M /branches/innodb+multibp/mtr/mtr0mtr.c M /branches/innodb+multibp/mysql-test/innodb_bug38231.test A /branches/innodb+multibp/mysql-test/innodb_bug51920.result (from /branches/innodb+/mysql-test/innodb_bug51920.result:6931) A /branches/innodb+multibp/mysql-test/innodb_bug51920.test (from /branches/innodb+/mysql-test/innodb_bug51920.test:6931) M /branches/innodb+multibp/row/row0sel.c M /branches/innodb+multibp/srv/srv0srv.c M /branches/innodb+multibp/srv/srv0start.c M /branches/innodb+multibp/sync/sync0sync.c M /branches/innodb+multibp/trx/trx0purge.c branches/innodb+multibp: Merge revisions r6914:6931 from branches/innodb+ ------------------------------------------------------------------------ r6935 | sbains | 2010-04-01 02:08:32 +0300 (Thu, 01 Apr 2010) | 3 lines Changed paths: M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/mtr/mtr0mtr.c branches/innodb+multibp: Fix the debug assertions for flush order mutex. These were missed in r6934. ------------------------------------------------------------------------ r6936 | sbains | 2010-04-01 02:46:52 +0300 (Thu, 01 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/sync/sync0sync.c branches/innodb+multibp: Because now we have multiple instances of a mutex at the same level and these mutexes can be acquired simultaneously we can't simply check for <= level. We need to check for <= level - 1. ------------------------------------------------------------------------ r6937 | sbains | 2010-04-01 04:40:17 +0300 (Thu, 01 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/trx/trx0purge.c branches/innodb+multibp: We need to check if the history list len is > than some threshold not that it is evenly divisible by the some batch size. While running tests on dscczz01 I've observed that the purge thread can't keep up with the generation of the UNDO log records because of the faster code. ------------------------------------------------------------------------ r6938 | irana | 2010-04-01 10:15:00 +0300 (Thu, 01 Apr 2010) | 7 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.h M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/include/log0log.h M /branches/innodb+multibp/include/sync0sync.h M /branches/innodb+multibp/log/log0log.c M /branches/innodb+multibp/log/log0recv.c M /branches/innodb+multibp/mtr/mtr0mtr.c M /branches/innodb+multibp/sync/sync0sync.c branches/innodb+multibp The buf_flush_order patch that was ported in from 1.1 won't work with multiple buffer pools. This patch moves the mutex protecting order of insertion in the flush list(s) to log_sys struct so that we can have one global mutex protecting insertions into all flush list(s) ------------------------------------------------------------------------ r6941 | sbains | 2010-04-02 00:51:28 +0300 (Fri, 02 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/lock/lock0lock.c branches/innodb+multibp: We should get the record heap no to check recursively only if we are checking a record lock. Prior to this fix we were doing it for table locks as well, this is a bug. ------------------------------------------------------------------------ r6942 | csun | 2010-04-02 02:39:10 +0300 (Fri, 02 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/ha/ha0ha.c branches/innodb+multibp: fix compiler errors on Windows. Move ut_ad() to after declarations for C file. ------------------------------------------------------------------------ r6943 | sbains | 2010-04-03 05:14:25 +0300 (Sat, 03 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: Remove the code that created the fake buffer pool. ------------------------------------------------------------------------ r6945 | irana | 2010-04-05 23:35:29 +0300 (Mon, 05 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/lock/lock0lock.c branches/innodb+multibp Revert r6941 as it does not resolve the issue and we have to take back the whole fix for bug#49047 ------------------------------------------------------------------------ r6946 | irana | 2010-04-05 23:50:42 +0300 (Mon, 05 Apr 2010) | 6 lines Changed paths: M /branches/innodb+multibp/include/ut0ut.h M /branches/innodb+multibp/include/ut0ut.ic M /branches/innodb+multibp/lock/lock0lock.c branches/innodb+multibp Merged revisions 6932:6944 from branches/innodb+ This solely includes the reversal of fix for bug#49047 ------------------------------------------------------------------------ r6947 | sbains | 2010-04-06 01:33:46 +0300 (Tue, 06 Apr 2010) | 3 lines Changed paths: M /branches/innodb+multibp/buf/buf0lru.c branches/innodb+multibp: Remove the log sys mutex acquisition when doing buffer pool stat aggregation. A dirty read here should suffice. ------------------------------------------------------------------------ r6951 | irana | 2010-04-06 17:25:29 +0300 (Tue, 06 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+mbp Initialize the buf_page_t::buf_pool pointer when the descriptor is allocated using buf_buddy_alloc(). ------------------------------------------------------------------------ r6954 | jyang | 2010-04-06 21:24:46 +0300 (Tue, 06 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp: Fix a possible null pointer of index_mapping in a race condition. ------------------------------------------------------------------------ r6958 | sbains | 2010-04-07 00:27:44 +0300 (Wed, 07 Apr 2010) | 3 lines Changed paths: M /branches/innodb+multibp/include/ut0mem.h M /branches/innodb+multibp/ut/ut0mem.c branches/innodb+multibp: Fix part of Bug#52546. We allow ut_free() to accept a NULL pointer and treat it as a nop. ------------------------------------------------------------------------ r6961 | jyang | 2010-04-07 10:50:03 +0300 (Wed, 07 Apr 2010) | 9 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp: Fix for bug #52580: Crash in ha_innobase::open on executing INSERT with concurrent ALTER TABLE. Change in MySQL bug #51557 releases the mutex LOCK_open before ha_innobase::open(), causing racing condition for index translation table creation. Fix it by adding dict_sys mutex for the operation. rb://283, approved by Marko. ------------------------------------------------------------------------ r6963 | irana | 2010-04-07 19:14:10 +0300 (Wed, 07 Apr 2010) | 15 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp Force setting of buf_pool->LRU_old_ratio by calling buf_LRU_old_ratio_update() with adjust set to TRUE. This will make sure that we grab the buf_pool mutex and actually adjust the buf_pool->LRU_old pointer instead of just updating the buf_pool->LRU_old_ratio. Note that after this change there is no call to buf_LRU_old_ratio_update() with adjust set to FALSE and therefore this parameter should be removed. I am keeping it for now to first make sure that the fix does work. Approved by: No one. Sunny agreed with my hypothesis of the problem. ------------------------------------------------------------------------ r6964 | irana | 2010-04-07 19:59:59 +0300 (Wed, 07 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp Remove a too strong assertion on behalf of Jimmy. ------------------------------------------------------------------------ r6971 | sbains | 2010-04-09 13:23:33 +0300 (Fri, 09 Apr 2010) | 6 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: When getting the oldest (minimum) LSN value from all the flush lists we need to acquire the flush list mutex. We were incorrectly acquiring the buffer pool mutex. This patch should fix a slew of bugs reported by Michael. ------------------------------------------------------------------------ r6972 | sbains | 2010-04-10 00:25:09 +0300 (Sat, 10 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: We should not reset the lsn to 0 when we encounter an empty flush list. Oldest LSN should be 0 only when all flush lists are empty. e.g., without this fix if even one flush list was empty we would end up breaking WAL. ------------------------------------------------------------------------ r6987 | sbains | 2010-04-14 00:14:13 +0300 (Wed, 14 Apr 2010) | 12 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: When calculating the oldest_lsn we can have a situation where we've iterated to say buffer pool 3 and another thread adds two new dirty pages, the first to buffer pool 1 and the second to buffer pool 4. Up to say buffer pool 3 the oldest_lsn was 0. Now, we will end up returning the lsn at buffer pool 4 as the oldest LSN. We prevent this by acquiring the flush order mutex. One other future option is to calculate the min_lsn when flushing pages from the list and maintaining a running total using atomics. That way we can get rid of this function altogether. The atomics will only really be required when we do parallel flushing. ------------------------------------------------------------------------ r6992 | sbains | 2010-04-14 02:45:59 +0300 (Wed, 14 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/include/ut0rbt.h M /branches/innodb+multibp/ut/ut0rbt.c branches/innodb+multibp: Fix copyright of the rbt code. ------------------------------------------------------------------------
16 years ago
12 years ago
branches/innodb+ Merge r6915:6992 from branches/innodb+multipbp (i.e.: all the changes made since it's creation) This also reverts r6930 to branches/innodb+ because a different solution for that issue is already present in innodb+multibp which is being merged. After this commit branches/innodb+multibp should be discarded and this branch should become our main development tree. ------------------------------------------------------------------------ r6915 | sbains | 2010-03-31 07:33:43 +0300 (Wed, 31 Mar 2010) | 1 line Changed paths: A /branches/innodb+multibp (from /branches/innodb+:6914) Creating a branch for the multiple buffer pool ------------------------------------------------------------------------ r6916 | sbains | 2010-03-31 08:21:00 +0300 (Wed, 31 Mar 2010) | 3 lines Changed paths: M /branches/innodb+multibp/CMakeLists.txt M /branches/innodb+multibp/btr/btr0btr.c M /branches/innodb+multibp/btr/btr0cur.c M /branches/innodb+multibp/btr/btr0sea.c M /branches/innodb+multibp/buf/buf0buddy.c M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/buf/buf0lru.c M /branches/innodb+multibp/buf/buf0rea.c M /branches/innodb+multibp/handler/ha_innodb.cc M /branches/innodb+multibp/handler/i_s.cc M /branches/innodb+multibp/ibuf/ibuf0ibuf.c M /branches/innodb+multibp/include/buf0buddy.h M /branches/innodb+multibp/include/buf0buddy.ic M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.h M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/include/buf0lru.h M /branches/innodb+multibp/include/buf0rea.h M /branches/innodb+multibp/include/buf0types.h M /branches/innodb+multibp/include/ibuf0ibuf.ic M /branches/innodb+multibp/include/srv0srv.h M /branches/innodb+multibp/include/univ.i M /branches/innodb+multibp/log/log0log.c M /branches/innodb+multibp/log/log0recv.c M /branches/innodb+multibp/mem/mem0mem.c M /branches/innodb+multibp/page/page0zip.c M /branches/innodb+multibp/srv/srv0srv.c M /branches/innodb+multibp/srv/srv0start.c M /branches/innodb+multibp/trx/trx0trx.c M /branches/innodb+multibp/trx/trx0undo.c branches/innodb+multibp: Unable to crash it with UNIV_DEBUG and UNIV_SYNC_DEBUG with both ibtests and Sysbench. The patch now needs a workout from Michael. ------------------------------------------------------------------------ r6917 | sbains | 2010-03-31 08:56:18 +0300 (Wed, 31 Mar 2010) | 2 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp: Fix error introduced in r6916. ------------------------------------------------------------------------ r6923 | sbains | 2010-03-31 15:16:04 +0300 (Wed, 31 Mar 2010) | 3 lines Changed paths: M /branches/innodb+multibp/btr/btr0cur.c M /branches/innodb+multibp/buf/buf0buddy.c M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/buf/buf0lru.c M /branches/innodb+multibp/include/buf0buddy.ic M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/page/page0zip.c branches/innodb+multibp: Fix whitespace issues. Add function buf_pool_from_block(). Add some comments to parameters. ------------------------------------------------------------------------ r6932 | sbains | 2010-04-01 01:12:07 +0300 (Thu, 01 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/univ.i branches/innodb+multibp: Remove bogus assertion. It's possible for the space and offset of a page to be undefined during the lifecycle of a page. Remove the debug #defines from univ.i. ------------------------------------------------------------------------ r6933 | sbains | 2010-04-01 01:22:40 +0300 (Thu, 01 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/srv/srv0start.c branches/innodb+multibp: Fix whitespace issues. ------------------------------------------------------------------------ r6934 | sbains | 2010-04-01 01:53:18 +0300 (Thu, 01 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/CMakeLists.txt M /branches/innodb+multibp/ChangeLog M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/handler/ha_innodb.cc M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/include/srv0srv.h M /branches/innodb+multibp/include/sync0sync.h M /branches/innodb+multibp/include/trx0purge.h M /branches/innodb+multibp/include/ut0ut.h M /branches/innodb+multibp/include/ut0ut.ic M /branches/innodb+multibp/lock/lock0lock.c M /branches/innodb+multibp/log/log0recv.c M /branches/innodb+multibp/mtr/mtr0mtr.c M /branches/innodb+multibp/mysql-test/innodb_bug38231.test A /branches/innodb+multibp/mysql-test/innodb_bug51920.result (from /branches/innodb+/mysql-test/innodb_bug51920.result:6931) A /branches/innodb+multibp/mysql-test/innodb_bug51920.test (from /branches/innodb+/mysql-test/innodb_bug51920.test:6931) M /branches/innodb+multibp/row/row0sel.c M /branches/innodb+multibp/srv/srv0srv.c M /branches/innodb+multibp/srv/srv0start.c M /branches/innodb+multibp/sync/sync0sync.c M /branches/innodb+multibp/trx/trx0purge.c branches/innodb+multibp: Merge revisions r6914:6931 from branches/innodb+ ------------------------------------------------------------------------ r6935 | sbains | 2010-04-01 02:08:32 +0300 (Thu, 01 Apr 2010) | 3 lines Changed paths: M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/mtr/mtr0mtr.c branches/innodb+multibp: Fix the debug assertions for flush order mutex. These were missed in r6934. ------------------------------------------------------------------------ r6936 | sbains | 2010-04-01 02:46:52 +0300 (Thu, 01 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/sync/sync0sync.c branches/innodb+multibp: Because now we have multiple instances of a mutex at the same level and these mutexes can be acquired simultaneously we can't simply check for <= level. We need to check for <= level - 1. ------------------------------------------------------------------------ r6937 | sbains | 2010-04-01 04:40:17 +0300 (Thu, 01 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/trx/trx0purge.c branches/innodb+multibp: We need to check if the history list len is > than some threshold not that it is evenly divisible by the some batch size. While running tests on dscczz01 I've observed that the purge thread can't keep up with the generation of the UNDO log records because of the faster code. ------------------------------------------------------------------------ r6938 | irana | 2010-04-01 10:15:00 +0300 (Thu, 01 Apr 2010) | 7 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c M /branches/innodb+multibp/buf/buf0flu.c M /branches/innodb+multibp/include/buf0buf.h M /branches/innodb+multibp/include/buf0buf.ic M /branches/innodb+multibp/include/buf0flu.h M /branches/innodb+multibp/include/buf0flu.ic M /branches/innodb+multibp/include/log0log.h M /branches/innodb+multibp/include/sync0sync.h M /branches/innodb+multibp/log/log0log.c M /branches/innodb+multibp/log/log0recv.c M /branches/innodb+multibp/mtr/mtr0mtr.c M /branches/innodb+multibp/sync/sync0sync.c branches/innodb+multibp The buf_flush_order patch that was ported in from 1.1 won't work with multiple buffer pools. This patch moves the mutex protecting order of insertion in the flush list(s) to log_sys struct so that we can have one global mutex protecting insertions into all flush list(s) ------------------------------------------------------------------------ r6941 | sbains | 2010-04-02 00:51:28 +0300 (Fri, 02 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/lock/lock0lock.c branches/innodb+multibp: We should get the record heap no to check recursively only if we are checking a record lock. Prior to this fix we were doing it for table locks as well, this is a bug. ------------------------------------------------------------------------ r6942 | csun | 2010-04-02 02:39:10 +0300 (Fri, 02 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/ha/ha0ha.c branches/innodb+multibp: fix compiler errors on Windows. Move ut_ad() to after declarations for C file. ------------------------------------------------------------------------ r6943 | sbains | 2010-04-03 05:14:25 +0300 (Sat, 03 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: Remove the code that created the fake buffer pool. ------------------------------------------------------------------------ r6945 | irana | 2010-04-05 23:35:29 +0300 (Mon, 05 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/lock/lock0lock.c branches/innodb+multibp Revert r6941 as it does not resolve the issue and we have to take back the whole fix for bug#49047 ------------------------------------------------------------------------ r6946 | irana | 2010-04-05 23:50:42 +0300 (Mon, 05 Apr 2010) | 6 lines Changed paths: M /branches/innodb+multibp/include/ut0ut.h M /branches/innodb+multibp/include/ut0ut.ic M /branches/innodb+multibp/lock/lock0lock.c branches/innodb+multibp Merged revisions 6932:6944 from branches/innodb+ This solely includes the reversal of fix for bug#49047 ------------------------------------------------------------------------ r6947 | sbains | 2010-04-06 01:33:46 +0300 (Tue, 06 Apr 2010) | 3 lines Changed paths: M /branches/innodb+multibp/buf/buf0lru.c branches/innodb+multibp: Remove the log sys mutex acquisition when doing buffer pool stat aggregation. A dirty read here should suffice. ------------------------------------------------------------------------ r6951 | irana | 2010-04-06 17:25:29 +0300 (Tue, 06 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+mbp Initialize the buf_page_t::buf_pool pointer when the descriptor is allocated using buf_buddy_alloc(). ------------------------------------------------------------------------ r6954 | jyang | 2010-04-06 21:24:46 +0300 (Tue, 06 Apr 2010) | 4 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp: Fix a possible null pointer of index_mapping in a race condition. ------------------------------------------------------------------------ r6958 | sbains | 2010-04-07 00:27:44 +0300 (Wed, 07 Apr 2010) | 3 lines Changed paths: M /branches/innodb+multibp/include/ut0mem.h M /branches/innodb+multibp/ut/ut0mem.c branches/innodb+multibp: Fix part of Bug#52546. We allow ut_free() to accept a NULL pointer and treat it as a nop. ------------------------------------------------------------------------ r6961 | jyang | 2010-04-07 10:50:03 +0300 (Wed, 07 Apr 2010) | 9 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp: Fix for bug #52580: Crash in ha_innobase::open on executing INSERT with concurrent ALTER TABLE. Change in MySQL bug #51557 releases the mutex LOCK_open before ha_innobase::open(), causing racing condition for index translation table creation. Fix it by adding dict_sys mutex for the operation. rb://283, approved by Marko. ------------------------------------------------------------------------ r6963 | irana | 2010-04-07 19:14:10 +0300 (Wed, 07 Apr 2010) | 15 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp Force setting of buf_pool->LRU_old_ratio by calling buf_LRU_old_ratio_update() with adjust set to TRUE. This will make sure that we grab the buf_pool mutex and actually adjust the buf_pool->LRU_old pointer instead of just updating the buf_pool->LRU_old_ratio. Note that after this change there is no call to buf_LRU_old_ratio_update() with adjust set to FALSE and therefore this parameter should be removed. I am keeping it for now to first make sure that the fix does work. Approved by: No one. Sunny agreed with my hypothesis of the problem. ------------------------------------------------------------------------ r6964 | irana | 2010-04-07 19:59:59 +0300 (Wed, 07 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/handler/ha_innodb.cc branches/innodb+multibp Remove a too strong assertion on behalf of Jimmy. ------------------------------------------------------------------------ r6971 | sbains | 2010-04-09 13:23:33 +0300 (Fri, 09 Apr 2010) | 6 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: When getting the oldest (minimum) LSN value from all the flush lists we need to acquire the flush list mutex. We were incorrectly acquiring the buffer pool mutex. This patch should fix a slew of bugs reported by Michael. ------------------------------------------------------------------------ r6972 | sbains | 2010-04-10 00:25:09 +0300 (Sat, 10 Apr 2010) | 5 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: We should not reset the lsn to 0 when we encounter an empty flush list. Oldest LSN should be 0 only when all flush lists are empty. e.g., without this fix if even one flush list was empty we would end up breaking WAL. ------------------------------------------------------------------------ r6987 | sbains | 2010-04-14 00:14:13 +0300 (Wed, 14 Apr 2010) | 12 lines Changed paths: M /branches/innodb+multibp/buf/buf0buf.c branches/innodb+multibp: When calculating the oldest_lsn we can have a situation where we've iterated to say buffer pool 3 and another thread adds two new dirty pages, the first to buffer pool 1 and the second to buffer pool 4. Up to say buffer pool 3 the oldest_lsn was 0. Now, we will end up returning the lsn at buffer pool 4 as the oldest LSN. We prevent this by acquiring the flush order mutex. One other future option is to calculate the min_lsn when flushing pages from the list and maintaining a running total using atomics. That way we can get rid of this function altogether. The atomics will only really be required when we do parallel flushing. ------------------------------------------------------------------------ r6992 | sbains | 2010-04-14 02:45:59 +0300 (Wed, 14 Apr 2010) | 2 lines Changed paths: M /branches/innodb+multibp/include/ut0rbt.h M /branches/innodb+multibp/ut/ut0rbt.c branches/innodb+multibp: Fix copyright of the rbt code. ------------------------------------------------------------------------
16 years ago
12 years ago
12 years ago
12 years ago
12 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
12 years ago
12 years ago
12 years ago
branches/innodb+: Merge revisions 5091:5143 from branches/zip: ------------------------------------------------------------------------ r5092 | marko | 2009-05-25 09:54:17 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Adjust some function comments after r5091. ------------------------------------------------------------------------ r5100 | marko | 2009-05-25 12:09:45 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Split some long lines that were introduced in r5091. ------------------------------------------------------------------------ r5101 | marko | 2009-05-25 12:42:47 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR. This is to avoid triggering an error in Doxygen. ------------------------------------------------------------------------ r5102 | marko | 2009-05-25 13:47:14 +0300 (Mon, 25 May 2009) | 1 line branches/zip: Add missing file comments. ------------------------------------------------------------------------ r5103 | marko | 2009-05-25 13:52:29 +0300 (Mon, 25 May 2009) | 10 lines branches/zip: Add @file comments, and convert decorative /********************************* comments to Doxygen /** style like this: /*****************************//** This conversion was performed by the following command: perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) { s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2} print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i ------------------------------------------------------------------------ r5104 | marko | 2009-05-25 14:39:07 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Revert ut0auxconf_* to r5102, that is, make Doxygen ignore these test programs. ------------------------------------------------------------------------ r5105 | marko | 2009-05-25 14:52:20 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Enclose some #error checks inside #ifndef DOXYGEN to prevent bogus Doxygen errors. ------------------------------------------------------------------------ r5106 | marko | 2009-05-25 16:09:24 +0300 (Mon, 25 May 2009) | 2 lines branches/zip: Add some Doxygen comments, mainly to structs, typedefs, macros and global variables. Many more to go. ------------------------------------------------------------------------ r5108 | marko | 2009-05-26 00:32:35 +0300 (Tue, 26 May 2009) | 2 lines branches/zip: lexyy.c: Remove the inadvertently added @file directive. There is nothing for Doxygen to see in this file, move along. ------------------------------------------------------------------------ r5125 | marko | 2009-05-26 16:28:49 +0300 (Tue, 26 May 2009) | 3 lines branches/zip: Add some Doxygen comments for many structs, typedefs, #defines and global variables. Many are still missing. ------------------------------------------------------------------------ r5134 | marko | 2009-05-27 09:08:43 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add some Doxygen @return comments. ------------------------------------------------------------------------ r5139 | marko | 2009-05-27 10:01:40 +0300 (Wed, 27 May 2009) | 1 line branches/zip: Add Doxyfile. ------------------------------------------------------------------------ r5143 | marko | 2009-05-27 10:57:25 +0300 (Wed, 27 May 2009) | 3 lines branches/zip: buf0buf.h, Doxyfile: Fix the Doxygen translation. @defgroup is for source code modules, not for field groups. Tell Doxygen to expand the UT_LIST declarations. ------------------------------------------------------------------------
17 years ago
12 years ago
9 years ago
9 years ago
9 years ago
9 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
11 years ago
12 years ago
12 years ago
12 years ago
9 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
11 years ago
9 years ago
11 years ago
9 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
Merge Google encryption commit 195158e9889365dc3298f8c1f3bcaa745992f27f Author: Minli Zhu <minliz@google.com> Date: Mon Nov 25 11:05:55 2013 -0800 Innodb redo log encryption/decryption. Use start lsn of a log block as part of AES CTR counter. Record key version with each checkpoint. Internally key version 0 means no encryption. Tests done (see test_innodb_log_encryption.sh for detail): - Verify flag innodb_encrypt_log on or off, combined with various key versions passed through CLI, and dynamically set after startup, will not corrupt database. This includes tests from being unencrypted to encrypted, and encrypted to unencrypted. - Verify start-up with no redo logs succeeds. - Verify fresh start-up succeeds. Change-Id: I4ce4c2afdf3076be2fce90ebbc2a7ce01184b612 commit c1b97273659f07866758c25f4a56f680a1fbad24 Author: Jonas Oreland <jonaso@google.com> Date: Tue Dec 3 18:47:27 2013 +0100 encryption of aria data&index files this patch implements encryption of aria data & index files. this is implemented as 1) add read/write hooks (renamed from callbacks) that does encrypt/decrypt (also add pre_read and post_write hooks) 2) modify page headers for data/index to contain key version (making the data-page header size different for with/without encryption) 3) modify index page 0 to contain IV (and crypt header) 4) AES CRT crypt functions 5) counter block is implemented using combination of page no, lsn and table specific id NOTE: 1) log files are not encrypted, this is not needed for if aria is only used for internal temporary tables and they are not transactional (i.e not logged) 2) all encrypted tables are using PAGE_CHECKSUM (crc) normal internal temporary tables are (currently) not CHECKSUM:ed 3) This patch adds insert-order semantics to aria block_format. The default behaviour of aria block-format is best-fit, meaning that rows gets allocated to page trying to fill the pages as much as possible. However, certain sql constructs materialize temporary result in tmp-tables, and expect that a table scan will later return the rows in the same order they were inserted. This implementation of insert-order is only enabled when explicitly requested by sql-layer. CHANGES: 1) found bug in ma_write that made code try to abort a record that was never written unsure why this is not exposed Change-Id: Ia82bbaa92e2c0629c08693c5add2f56b815c0509 commit 89dc1ab651fe0205d55b4eb588f62df550aa65fc Author: Jonas Oreland <jonaso@google.com> Date: Mon Feb 17 08:04:50 2014 -0800 Implement encryption of innodb datafiles. Pages are encrypted before written to disk and decrypted when read from disk. Each page except first page (page 0) in tablespace is encrypted. Page 0 is unencrypted and contains IV for the tablespace. FIL_PAGE_FILE_FLUSH_LSN on each page (except page 0) is used to store a 32-bit key-version, so that multiple keys can be active in a tablespace simultaneous. The other 32-bit of the FIL_PAGE_FILE_FLUSH_LSN field contains a checksum that is computed after encryption. This checksum is used by innochecksum and when restoring from double-write-buffer. The encryption is performed using AES CRT. Monitoring of encryption is enabled using new IS-table INNODB_TABLESPACES_ENCRYPTION. In addition to that new status variables innodb_encryption_rotation_{ pages_read_from_cache, pages_read_from_disk, pages_modified,pages_flushed } has been added. The following tunables are introduces - innodb_encrypt_tables - innodb_encryption_threads - innodb_encryption_rotate_key_age - innodb_encryption_rotation_iops Change-Id: I8f651795a30b52e71b16d6bc9cb7559be349d0b2 commit a17eef2f6948e58219c9e26fc35633d6fd4de1de Author: Andrew Ford <andrewford@google.com> Date: Thu Jan 2 15:43:09 2014 -0800 Key management skeleton with debug hooks. Change-Id: Ifd6aa3743d7ea291c70083f433a059c439aed866 commit 68a399838ad72264fd61b3dc67fecd29bbdb0af1 Author: Andrew Ford <andrewford@google.com> Date: Mon Oct 28 16:27:44 2013 -0700 Add AES-128 CTR and GCM encryption classes. Change-Id: I116305eced2a233db15306bc2ef5b9d398d1a3a2
11 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
Merge Google encryption commit 195158e9889365dc3298f8c1f3bcaa745992f27f Author: Minli Zhu <minliz@google.com> Date: Mon Nov 25 11:05:55 2013 -0800 Innodb redo log encryption/decryption. Use start lsn of a log block as part of AES CTR counter. Record key version with each checkpoint. Internally key version 0 means no encryption. Tests done (see test_innodb_log_encryption.sh for detail): - Verify flag innodb_encrypt_log on or off, combined with various key versions passed through CLI, and dynamically set after startup, will not corrupt database. This includes tests from being unencrypted to encrypted, and encrypted to unencrypted. - Verify start-up with no redo logs succeeds. - Verify fresh start-up succeeds. Change-Id: I4ce4c2afdf3076be2fce90ebbc2a7ce01184b612 commit c1b97273659f07866758c25f4a56f680a1fbad24 Author: Jonas Oreland <jonaso@google.com> Date: Tue Dec 3 18:47:27 2013 +0100 encryption of aria data&index files this patch implements encryption of aria data & index files. this is implemented as 1) add read/write hooks (renamed from callbacks) that does encrypt/decrypt (also add pre_read and post_write hooks) 2) modify page headers for data/index to contain key version (making the data-page header size different for with/without encryption) 3) modify index page 0 to contain IV (and crypt header) 4) AES CRT crypt functions 5) counter block is implemented using combination of page no, lsn and table specific id NOTE: 1) log files are not encrypted, this is not needed for if aria is only used for internal temporary tables and they are not transactional (i.e not logged) 2) all encrypted tables are using PAGE_CHECKSUM (crc) normal internal temporary tables are (currently) not CHECKSUM:ed 3) This patch adds insert-order semantics to aria block_format. The default behaviour of aria block-format is best-fit, meaning that rows gets allocated to page trying to fill the pages as much as possible. However, certain sql constructs materialize temporary result in tmp-tables, and expect that a table scan will later return the rows in the same order they were inserted. This implementation of insert-order is only enabled when explicitly requested by sql-layer. CHANGES: 1) found bug in ma_write that made code try to abort a record that was never written unsure why this is not exposed Change-Id: Ia82bbaa92e2c0629c08693c5add2f56b815c0509 commit 89dc1ab651fe0205d55b4eb588f62df550aa65fc Author: Jonas Oreland <jonaso@google.com> Date: Mon Feb 17 08:04:50 2014 -0800 Implement encryption of innodb datafiles. Pages are encrypted before written to disk and decrypted when read from disk. Each page except first page (page 0) in tablespace is encrypted. Page 0 is unencrypted and contains IV for the tablespace. FIL_PAGE_FILE_FLUSH_LSN on each page (except page 0) is used to store a 32-bit key-version, so that multiple keys can be active in a tablespace simultaneous. The other 32-bit of the FIL_PAGE_FILE_FLUSH_LSN field contains a checksum that is computed after encryption. This checksum is used by innochecksum and when restoring from double-write-buffer. The encryption is performed using AES CRT. Monitoring of encryption is enabled using new IS-table INNODB_TABLESPACES_ENCRYPTION. In addition to that new status variables innodb_encryption_rotation_{ pages_read_from_cache, pages_read_from_disk, pages_modified,pages_flushed } has been added. The following tunables are introduces - innodb_encrypt_tables - innodb_encryption_threads - innodb_encryption_rotate_key_age - innodb_encryption_rotation_iops Change-Id: I8f651795a30b52e71b16d6bc9cb7559be349d0b2 commit a17eef2f6948e58219c9e26fc35633d6fd4de1de Author: Andrew Ford <andrewford@google.com> Date: Thu Jan 2 15:43:09 2014 -0800 Key management skeleton with debug hooks. Change-Id: Ifd6aa3743d7ea291c70083f433a059c439aed866 commit 68a399838ad72264fd61b3dc67fecd29bbdb0af1 Author: Andrew Ford <andrewford@google.com> Date: Mon Oct 28 16:27:44 2013 -0700 Add AES-128 CTR and GCM encryption classes. Change-Id: I116305eced2a233db15306bc2ef5b9d398d1a3a2
11 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
Merge Google encryption commit 195158e9889365dc3298f8c1f3bcaa745992f27f Author: Minli Zhu <minliz@google.com> Date: Mon Nov 25 11:05:55 2013 -0800 Innodb redo log encryption/decryption. Use start lsn of a log block as part of AES CTR counter. Record key version with each checkpoint. Internally key version 0 means no encryption. Tests done (see test_innodb_log_encryption.sh for detail): - Verify flag innodb_encrypt_log on or off, combined with various key versions passed through CLI, and dynamically set after startup, will not corrupt database. This includes tests from being unencrypted to encrypted, and encrypted to unencrypted. - Verify start-up with no redo logs succeeds. - Verify fresh start-up succeeds. Change-Id: I4ce4c2afdf3076be2fce90ebbc2a7ce01184b612 commit c1b97273659f07866758c25f4a56f680a1fbad24 Author: Jonas Oreland <jonaso@google.com> Date: Tue Dec 3 18:47:27 2013 +0100 encryption of aria data&index files this patch implements encryption of aria data & index files. this is implemented as 1) add read/write hooks (renamed from callbacks) that does encrypt/decrypt (also add pre_read and post_write hooks) 2) modify page headers for data/index to contain key version (making the data-page header size different for with/without encryption) 3) modify index page 0 to contain IV (and crypt header) 4) AES CRT crypt functions 5) counter block is implemented using combination of page no, lsn and table specific id NOTE: 1) log files are not encrypted, this is not needed for if aria is only used for internal temporary tables and they are not transactional (i.e not logged) 2) all encrypted tables are using PAGE_CHECKSUM (crc) normal internal temporary tables are (currently) not CHECKSUM:ed 3) This patch adds insert-order semantics to aria block_format. The default behaviour of aria block-format is best-fit, meaning that rows gets allocated to page trying to fill the pages as much as possible. However, certain sql constructs materialize temporary result in tmp-tables, and expect that a table scan will later return the rows in the same order they were inserted. This implementation of insert-order is only enabled when explicitly requested by sql-layer. CHANGES: 1) found bug in ma_write that made code try to abort a record that was never written unsure why this is not exposed Change-Id: Ia82bbaa92e2c0629c08693c5add2f56b815c0509 commit 89dc1ab651fe0205d55b4eb588f62df550aa65fc Author: Jonas Oreland <jonaso@google.com> Date: Mon Feb 17 08:04:50 2014 -0800 Implement encryption of innodb datafiles. Pages are encrypted before written to disk and decrypted when read from disk. Each page except first page (page 0) in tablespace is encrypted. Page 0 is unencrypted and contains IV for the tablespace. FIL_PAGE_FILE_FLUSH_LSN on each page (except page 0) is used to store a 32-bit key-version, so that multiple keys can be active in a tablespace simultaneous. The other 32-bit of the FIL_PAGE_FILE_FLUSH_LSN field contains a checksum that is computed after encryption. This checksum is used by innochecksum and when restoring from double-write-buffer. The encryption is performed using AES CRT. Monitoring of encryption is enabled using new IS-table INNODB_TABLESPACES_ENCRYPTION. In addition to that new status variables innodb_encryption_rotation_{ pages_read_from_cache, pages_read_from_disk, pages_modified,pages_flushed } has been added. The following tunables are introduces - innodb_encrypt_tables - innodb_encryption_threads - innodb_encryption_rotate_key_age - innodb_encryption_rotation_iops Change-Id: I8f651795a30b52e71b16d6bc9cb7559be349d0b2 commit a17eef2f6948e58219c9e26fc35633d6fd4de1de Author: Andrew Ford <andrewford@google.com> Date: Thu Jan 2 15:43:09 2014 -0800 Key management skeleton with debug hooks. Change-Id: Ifd6aa3743d7ea291c70083f433a059c439aed866 commit 68a399838ad72264fd61b3dc67fecd29bbdb0af1 Author: Andrew Ford <andrewford@google.com> Date: Mon Oct 28 16:27:44 2013 -0700 Add AES-128 CTR and GCM encryption classes. Change-Id: I116305eced2a233db15306bc2ef5b9d398d1a3a2
11 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
Merge Google encryption commit 195158e9889365dc3298f8c1f3bcaa745992f27f Author: Minli Zhu <minliz@google.com> Date: Mon Nov 25 11:05:55 2013 -0800 Innodb redo log encryption/decryption. Use start lsn of a log block as part of AES CTR counter. Record key version with each checkpoint. Internally key version 0 means no encryption. Tests done (see test_innodb_log_encryption.sh for detail): - Verify flag innodb_encrypt_log on or off, combined with various key versions passed through CLI, and dynamically set after startup, will not corrupt database. This includes tests from being unencrypted to encrypted, and encrypted to unencrypted. - Verify start-up with no redo logs succeeds. - Verify fresh start-up succeeds. Change-Id: I4ce4c2afdf3076be2fce90ebbc2a7ce01184b612 commit c1b97273659f07866758c25f4a56f680a1fbad24 Author: Jonas Oreland <jonaso@google.com> Date: Tue Dec 3 18:47:27 2013 +0100 encryption of aria data&index files this patch implements encryption of aria data & index files. this is implemented as 1) add read/write hooks (renamed from callbacks) that does encrypt/decrypt (also add pre_read and post_write hooks) 2) modify page headers for data/index to contain key version (making the data-page header size different for with/without encryption) 3) modify index page 0 to contain IV (and crypt header) 4) AES CRT crypt functions 5) counter block is implemented using combination of page no, lsn and table specific id NOTE: 1) log files are not encrypted, this is not needed for if aria is only used for internal temporary tables and they are not transactional (i.e not logged) 2) all encrypted tables are using PAGE_CHECKSUM (crc) normal internal temporary tables are (currently) not CHECKSUM:ed 3) This patch adds insert-order semantics to aria block_format. The default behaviour of aria block-format is best-fit, meaning that rows gets allocated to page trying to fill the pages as much as possible. However, certain sql constructs materialize temporary result in tmp-tables, and expect that a table scan will later return the rows in the same order they were inserted. This implementation of insert-order is only enabled when explicitly requested by sql-layer. CHANGES: 1) found bug in ma_write that made code try to abort a record that was never written unsure why this is not exposed Change-Id: Ia82bbaa92e2c0629c08693c5add2f56b815c0509 commit 89dc1ab651fe0205d55b4eb588f62df550aa65fc Author: Jonas Oreland <jonaso@google.com> Date: Mon Feb 17 08:04:50 2014 -0800 Implement encryption of innodb datafiles. Pages are encrypted before written to disk and decrypted when read from disk. Each page except first page (page 0) in tablespace is encrypted. Page 0 is unencrypted and contains IV for the tablespace. FIL_PAGE_FILE_FLUSH_LSN on each page (except page 0) is used to store a 32-bit key-version, so that multiple keys can be active in a tablespace simultaneous. The other 32-bit of the FIL_PAGE_FILE_FLUSH_LSN field contains a checksum that is computed after encryption. This checksum is used by innochecksum and when restoring from double-write-buffer. The encryption is performed using AES CRT. Monitoring of encryption is enabled using new IS-table INNODB_TABLESPACES_ENCRYPTION. In addition to that new status variables innodb_encryption_rotation_{ pages_read_from_cache, pages_read_from_disk, pages_modified,pages_flushed } has been added. The following tunables are introduces - innodb_encrypt_tables - innodb_encryption_threads - innodb_encryption_rotate_key_age - innodb_encryption_rotation_iops Change-Id: I8f651795a30b52e71b16d6bc9cb7559be349d0b2 commit a17eef2f6948e58219c9e26fc35633d6fd4de1de Author: Andrew Ford <andrewford@google.com> Date: Thu Jan 2 15:43:09 2014 -0800 Key management skeleton with debug hooks. Change-Id: Ifd6aa3743d7ea291c70083f433a059c439aed866 commit 68a399838ad72264fd61b3dc67fecd29bbdb0af1 Author: Andrew Ford <andrewford@google.com> Date: Mon Oct 28 16:27:44 2013 -0700 Add AES-128 CTR and GCM encryption classes. Change-Id: I116305eced2a233db15306bc2ef5b9d398d1a3a2
11 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
Merge Google encryption commit 195158e9889365dc3298f8c1f3bcaa745992f27f Author: Minli Zhu <minliz@google.com> Date: Mon Nov 25 11:05:55 2013 -0800 Innodb redo log encryption/decryption. Use start lsn of a log block as part of AES CTR counter. Record key version with each checkpoint. Internally key version 0 means no encryption. Tests done (see test_innodb_log_encryption.sh for detail): - Verify flag innodb_encrypt_log on or off, combined with various key versions passed through CLI, and dynamically set after startup, will not corrupt database. This includes tests from being unencrypted to encrypted, and encrypted to unencrypted. - Verify start-up with no redo logs succeeds. - Verify fresh start-up succeeds. Change-Id: I4ce4c2afdf3076be2fce90ebbc2a7ce01184b612 commit c1b97273659f07866758c25f4a56f680a1fbad24 Author: Jonas Oreland <jonaso@google.com> Date: Tue Dec 3 18:47:27 2013 +0100 encryption of aria data&index files this patch implements encryption of aria data & index files. this is implemented as 1) add read/write hooks (renamed from callbacks) that does encrypt/decrypt (also add pre_read and post_write hooks) 2) modify page headers for data/index to contain key version (making the data-page header size different for with/without encryption) 3) modify index page 0 to contain IV (and crypt header) 4) AES CRT crypt functions 5) counter block is implemented using combination of page no, lsn and table specific id NOTE: 1) log files are not encrypted, this is not needed for if aria is only used for internal temporary tables and they are not transactional (i.e not logged) 2) all encrypted tables are using PAGE_CHECKSUM (crc) normal internal temporary tables are (currently) not CHECKSUM:ed 3) This patch adds insert-order semantics to aria block_format. The default behaviour of aria block-format is best-fit, meaning that rows gets allocated to page trying to fill the pages as much as possible. However, certain sql constructs materialize temporary result in tmp-tables, and expect that a table scan will later return the rows in the same order they were inserted. This implementation of insert-order is only enabled when explicitly requested by sql-layer. CHANGES: 1) found bug in ma_write that made code try to abort a record that was never written unsure why this is not exposed Change-Id: Ia82bbaa92e2c0629c08693c5add2f56b815c0509 commit 89dc1ab651fe0205d55b4eb588f62df550aa65fc Author: Jonas Oreland <jonaso@google.com> Date: Mon Feb 17 08:04:50 2014 -0800 Implement encryption of innodb datafiles. Pages are encrypted before written to disk and decrypted when read from disk. Each page except first page (page 0) in tablespace is encrypted. Page 0 is unencrypted and contains IV for the tablespace. FIL_PAGE_FILE_FLUSH_LSN on each page (except page 0) is used to store a 32-bit key-version, so that multiple keys can be active in a tablespace simultaneous. The other 32-bit of the FIL_PAGE_FILE_FLUSH_LSN field contains a checksum that is computed after encryption. This checksum is used by innochecksum and when restoring from double-write-buffer. The encryption is performed using AES CRT. Monitoring of encryption is enabled using new IS-table INNODB_TABLESPACES_ENCRYPTION. In addition to that new status variables innodb_encryption_rotation_{ pages_read_from_cache, pages_read_from_disk, pages_modified,pages_flushed } has been added. The following tunables are introduces - innodb_encrypt_tables - innodb_encryption_threads - innodb_encryption_rotate_key_age - innodb_encryption_rotation_iops Change-Id: I8f651795a30b52e71b16d6bc9cb7559be349d0b2 commit a17eef2f6948e58219c9e26fc35633d6fd4de1de Author: Andrew Ford <andrewford@google.com> Date: Thu Jan 2 15:43:09 2014 -0800 Key management skeleton with debug hooks. Change-Id: Ifd6aa3743d7ea291c70083f433a059c439aed866 commit 68a399838ad72264fd61b3dc67fecd29bbdb0af1 Author: Andrew Ford <andrewford@google.com> Date: Mon Oct 28 16:27:44 2013 -0700 Add AES-128 CTR and GCM encryption classes. Change-Id: I116305eced2a233db15306bc2ef5b9d398d1a3a2
11 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
Merge Google encryption commit 195158e9889365dc3298f8c1f3bcaa745992f27f Author: Minli Zhu <minliz@google.com> Date: Mon Nov 25 11:05:55 2013 -0800 Innodb redo log encryption/decryption. Use start lsn of a log block as part of AES CTR counter. Record key version with each checkpoint. Internally key version 0 means no encryption. Tests done (see test_innodb_log_encryption.sh for detail): - Verify flag innodb_encrypt_log on or off, combined with various key versions passed through CLI, and dynamically set after startup, will not corrupt database. This includes tests from being unencrypted to encrypted, and encrypted to unencrypted. - Verify start-up with no redo logs succeeds. - Verify fresh start-up succeeds. Change-Id: I4ce4c2afdf3076be2fce90ebbc2a7ce01184b612 commit c1b97273659f07866758c25f4a56f680a1fbad24 Author: Jonas Oreland <jonaso@google.com> Date: Tue Dec 3 18:47:27 2013 +0100 encryption of aria data&index files this patch implements encryption of aria data & index files. this is implemented as 1) add read/write hooks (renamed from callbacks) that does encrypt/decrypt (also add pre_read and post_write hooks) 2) modify page headers for data/index to contain key version (making the data-page header size different for with/without encryption) 3) modify index page 0 to contain IV (and crypt header) 4) AES CRT crypt functions 5) counter block is implemented using combination of page no, lsn and table specific id NOTE: 1) log files are not encrypted, this is not needed for if aria is only used for internal temporary tables and they are not transactional (i.e not logged) 2) all encrypted tables are using PAGE_CHECKSUM (crc) normal internal temporary tables are (currently) not CHECKSUM:ed 3) This patch adds insert-order semantics to aria block_format. The default behaviour of aria block-format is best-fit, meaning that rows gets allocated to page trying to fill the pages as much as possible. However, certain sql constructs materialize temporary result in tmp-tables, and expect that a table scan will later return the rows in the same order they were inserted. This implementation of insert-order is only enabled when explicitly requested by sql-layer. CHANGES: 1) found bug in ma_write that made code try to abort a record that was never written unsure why this is not exposed Change-Id: Ia82bbaa92e2c0629c08693c5add2f56b815c0509 commit 89dc1ab651fe0205d55b4eb588f62df550aa65fc Author: Jonas Oreland <jonaso@google.com> Date: Mon Feb 17 08:04:50 2014 -0800 Implement encryption of innodb datafiles. Pages are encrypted before written to disk and decrypted when read from disk. Each page except first page (page 0) in tablespace is encrypted. Page 0 is unencrypted and contains IV for the tablespace. FIL_PAGE_FILE_FLUSH_LSN on each page (except page 0) is used to store a 32-bit key-version, so that multiple keys can be active in a tablespace simultaneous. The other 32-bit of the FIL_PAGE_FILE_FLUSH_LSN field contains a checksum that is computed after encryption. This checksum is used by innochecksum and when restoring from double-write-buffer. The encryption is performed using AES CRT. Monitoring of encryption is enabled using new IS-table INNODB_TABLESPACES_ENCRYPTION. In addition to that new status variables innodb_encryption_rotation_{ pages_read_from_cache, pages_read_from_disk, pages_modified,pages_flushed } has been added. The following tunables are introduces - innodb_encrypt_tables - innodb_encryption_threads - innodb_encryption_rotate_key_age - innodb_encryption_rotation_iops Change-Id: I8f651795a30b52e71b16d6bc9cb7559be349d0b2 commit a17eef2f6948e58219c9e26fc35633d6fd4de1de Author: Andrew Ford <andrewford@google.com> Date: Thu Jan 2 15:43:09 2014 -0800 Key management skeleton with debug hooks. Change-Id: Ifd6aa3743d7ea291c70083f433a059c439aed866 commit 68a399838ad72264fd61b3dc67fecd29bbdb0af1 Author: Andrew Ford <andrewford@google.com> Date: Mon Oct 28 16:27:44 2013 -0700 Add AES-128 CTR and GCM encryption classes. Change-Id: I116305eced2a233db15306bc2ef5b9d398d1a3a2
11 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
Merge Google encryption commit 195158e9889365dc3298f8c1f3bcaa745992f27f Author: Minli Zhu <minliz@google.com> Date: Mon Nov 25 11:05:55 2013 -0800 Innodb redo log encryption/decryption. Use start lsn of a log block as part of AES CTR counter. Record key version with each checkpoint. Internally key version 0 means no encryption. Tests done (see test_innodb_log_encryption.sh for detail): - Verify flag innodb_encrypt_log on or off, combined with various key versions passed through CLI, and dynamically set after startup, will not corrupt database. This includes tests from being unencrypted to encrypted, and encrypted to unencrypted. - Verify start-up with no redo logs succeeds. - Verify fresh start-up succeeds. Change-Id: I4ce4c2afdf3076be2fce90ebbc2a7ce01184b612 commit c1b97273659f07866758c25f4a56f680a1fbad24 Author: Jonas Oreland <jonaso@google.com> Date: Tue Dec 3 18:47:27 2013 +0100 encryption of aria data&index files this patch implements encryption of aria data & index files. this is implemented as 1) add read/write hooks (renamed from callbacks) that does encrypt/decrypt (also add pre_read and post_write hooks) 2) modify page headers for data/index to contain key version (making the data-page header size different for with/without encryption) 3) modify index page 0 to contain IV (and crypt header) 4) AES CRT crypt functions 5) counter block is implemented using combination of page no, lsn and table specific id NOTE: 1) log files are not encrypted, this is not needed for if aria is only used for internal temporary tables and they are not transactional (i.e not logged) 2) all encrypted tables are using PAGE_CHECKSUM (crc) normal internal temporary tables are (currently) not CHECKSUM:ed 3) This patch adds insert-order semantics to aria block_format. The default behaviour of aria block-format is best-fit, meaning that rows gets allocated to page trying to fill the pages as much as possible. However, certain sql constructs materialize temporary result in tmp-tables, and expect that a table scan will later return the rows in the same order they were inserted. This implementation of insert-order is only enabled when explicitly requested by sql-layer. CHANGES: 1) found bug in ma_write that made code try to abort a record that was never written unsure why this is not exposed Change-Id: Ia82bbaa92e2c0629c08693c5add2f56b815c0509 commit 89dc1ab651fe0205d55b4eb588f62df550aa65fc Author: Jonas Oreland <jonaso@google.com> Date: Mon Feb 17 08:04:50 2014 -0800 Implement encryption of innodb datafiles. Pages are encrypted before written to disk and decrypted when read from disk. Each page except first page (page 0) in tablespace is encrypted. Page 0 is unencrypted and contains IV for the tablespace. FIL_PAGE_FILE_FLUSH_LSN on each page (except page 0) is used to store a 32-bit key-version, so that multiple keys can be active in a tablespace simultaneous. The other 32-bit of the FIL_PAGE_FILE_FLUSH_LSN field contains a checksum that is computed after encryption. This checksum is used by innochecksum and when restoring from double-write-buffer. The encryption is performed using AES CRT. Monitoring of encryption is enabled using new IS-table INNODB_TABLESPACES_ENCRYPTION. In addition to that new status variables innodb_encryption_rotation_{ pages_read_from_cache, pages_read_from_disk, pages_modified,pages_flushed } has been added. The following tunables are introduces - innodb_encrypt_tables - innodb_encryption_threads - innodb_encryption_rotate_key_age - innodb_encryption_rotation_iops Change-Id: I8f651795a30b52e71b16d6bc9cb7559be349d0b2 commit a17eef2f6948e58219c9e26fc35633d6fd4de1de Author: Andrew Ford <andrewford@google.com> Date: Thu Jan 2 15:43:09 2014 -0800 Key management skeleton with debug hooks. Change-Id: Ifd6aa3743d7ea291c70083f433a059c439aed866 commit 68a399838ad72264fd61b3dc67fecd29bbdb0af1 Author: Andrew Ford <andrewford@google.com> Date: Mon Oct 28 16:27:44 2013 -0700 Add AES-128 CTR and GCM encryption classes. Change-Id: I116305eced2a233db15306bc2ef5b9d398d1a3a2
11 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
Merge Google encryption commit 195158e9889365dc3298f8c1f3bcaa745992f27f Author: Minli Zhu <minliz@google.com> Date: Mon Nov 25 11:05:55 2013 -0800 Innodb redo log encryption/decryption. Use start lsn of a log block as part of AES CTR counter. Record key version with each checkpoint. Internally key version 0 means no encryption. Tests done (see test_innodb_log_encryption.sh for detail): - Verify flag innodb_encrypt_log on or off, combined with various key versions passed through CLI, and dynamically set after startup, will not corrupt database. This includes tests from being unencrypted to encrypted, and encrypted to unencrypted. - Verify start-up with no redo logs succeeds. - Verify fresh start-up succeeds. Change-Id: I4ce4c2afdf3076be2fce90ebbc2a7ce01184b612 commit c1b97273659f07866758c25f4a56f680a1fbad24 Author: Jonas Oreland <jonaso@google.com> Date: Tue Dec 3 18:47:27 2013 +0100 encryption of aria data&index files this patch implements encryption of aria data & index files. this is implemented as 1) add read/write hooks (renamed from callbacks) that does encrypt/decrypt (also add pre_read and post_write hooks) 2) modify page headers for data/index to contain key version (making the data-page header size different for with/without encryption) 3) modify index page 0 to contain IV (and crypt header) 4) AES CRT crypt functions 5) counter block is implemented using combination of page no, lsn and table specific id NOTE: 1) log files are not encrypted, this is not needed for if aria is only used for internal temporary tables and they are not transactional (i.e not logged) 2) all encrypted tables are using PAGE_CHECKSUM (crc) normal internal temporary tables are (currently) not CHECKSUM:ed 3) This patch adds insert-order semantics to aria block_format. The default behaviour of aria block-format is best-fit, meaning that rows gets allocated to page trying to fill the pages as much as possible. However, certain sql constructs materialize temporary result in tmp-tables, and expect that a table scan will later return the rows in the same order they were inserted. This implementation of insert-order is only enabled when explicitly requested by sql-layer. CHANGES: 1) found bug in ma_write that made code try to abort a record that was never written unsure why this is not exposed Change-Id: Ia82bbaa92e2c0629c08693c5add2f56b815c0509 commit 89dc1ab651fe0205d55b4eb588f62df550aa65fc Author: Jonas Oreland <jonaso@google.com> Date: Mon Feb 17 08:04:50 2014 -0800 Implement encryption of innodb datafiles. Pages are encrypted before written to disk and decrypted when read from disk. Each page except first page (page 0) in tablespace is encrypted. Page 0 is unencrypted and contains IV for the tablespace. FIL_PAGE_FILE_FLUSH_LSN on each page (except page 0) is used to store a 32-bit key-version, so that multiple keys can be active in a tablespace simultaneous. The other 32-bit of the FIL_PAGE_FILE_FLUSH_LSN field contains a checksum that is computed after encryption. This checksum is used by innochecksum and when restoring from double-write-buffer. The encryption is performed using AES CRT. Monitoring of encryption is enabled using new IS-table INNODB_TABLESPACES_ENCRYPTION. In addition to that new status variables innodb_encryption_rotation_{ pages_read_from_cache, pages_read_from_disk, pages_modified,pages_flushed } has been added. The following tunables are introduces - innodb_encrypt_tables - innodb_encryption_threads - innodb_encryption_rotate_key_age - innodb_encryption_rotation_iops Change-Id: I8f651795a30b52e71b16d6bc9cb7559be349d0b2 commit a17eef2f6948e58219c9e26fc35633d6fd4de1de Author: Andrew Ford <andrewford@google.com> Date: Thu Jan 2 15:43:09 2014 -0800 Key management skeleton with debug hooks. Change-Id: Ifd6aa3743d7ea291c70083f433a059c439aed866 commit 68a399838ad72264fd61b3dc67fecd29bbdb0af1 Author: Andrew Ford <andrewford@google.com> Date: Mon Oct 28 16:27:44 2013 -0700 Add AES-128 CTR and GCM encryption classes. Change-Id: I116305eced2a233db15306bc2ef5b9d398d1a3a2
11 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
Merge Google encryption commit 195158e9889365dc3298f8c1f3bcaa745992f27f Author: Minli Zhu <minliz@google.com> Date: Mon Nov 25 11:05:55 2013 -0800 Innodb redo log encryption/decryption. Use start lsn of a log block as part of AES CTR counter. Record key version with each checkpoint. Internally key version 0 means no encryption. Tests done (see test_innodb_log_encryption.sh for detail): - Verify flag innodb_encrypt_log on or off, combined with various key versions passed through CLI, and dynamically set after startup, will not corrupt database. This includes tests from being unencrypted to encrypted, and encrypted to unencrypted. - Verify start-up with no redo logs succeeds. - Verify fresh start-up succeeds. Change-Id: I4ce4c2afdf3076be2fce90ebbc2a7ce01184b612 commit c1b97273659f07866758c25f4a56f680a1fbad24 Author: Jonas Oreland <jonaso@google.com> Date: Tue Dec 3 18:47:27 2013 +0100 encryption of aria data&index files this patch implements encryption of aria data & index files. this is implemented as 1) add read/write hooks (renamed from callbacks) that does encrypt/decrypt (also add pre_read and post_write hooks) 2) modify page headers for data/index to contain key version (making the data-page header size different for with/without encryption) 3) modify index page 0 to contain IV (and crypt header) 4) AES CRT crypt functions 5) counter block is implemented using combination of page no, lsn and table specific id NOTE: 1) log files are not encrypted, this is not needed for if aria is only used for internal temporary tables and they are not transactional (i.e not logged) 2) all encrypted tables are using PAGE_CHECKSUM (crc) normal internal temporary tables are (currently) not CHECKSUM:ed 3) This patch adds insert-order semantics to aria block_format. The default behaviour of aria block-format is best-fit, meaning that rows gets allocated to page trying to fill the pages as much as possible. However, certain sql constructs materialize temporary result in tmp-tables, and expect that a table scan will later return the rows in the same order they were inserted. This implementation of insert-order is only enabled when explicitly requested by sql-layer. CHANGES: 1) found bug in ma_write that made code try to abort a record that was never written unsure why this is not exposed Change-Id: Ia82bbaa92e2c0629c08693c5add2f56b815c0509 commit 89dc1ab651fe0205d55b4eb588f62df550aa65fc Author: Jonas Oreland <jonaso@google.com> Date: Mon Feb 17 08:04:50 2014 -0800 Implement encryption of innodb datafiles. Pages are encrypted before written to disk and decrypted when read from disk. Each page except first page (page 0) in tablespace is encrypted. Page 0 is unencrypted and contains IV for the tablespace. FIL_PAGE_FILE_FLUSH_LSN on each page (except page 0) is used to store a 32-bit key-version, so that multiple keys can be active in a tablespace simultaneous. The other 32-bit of the FIL_PAGE_FILE_FLUSH_LSN field contains a checksum that is computed after encryption. This checksum is used by innochecksum and when restoring from double-write-buffer. The encryption is performed using AES CRT. Monitoring of encryption is enabled using new IS-table INNODB_TABLESPACES_ENCRYPTION. In addition to that new status variables innodb_encryption_rotation_{ pages_read_from_cache, pages_read_from_disk, pages_modified,pages_flushed } has been added. The following tunables are introduces - innodb_encrypt_tables - innodb_encryption_threads - innodb_encryption_rotate_key_age - innodb_encryption_rotation_iops Change-Id: I8f651795a30b52e71b16d6bc9cb7559be349d0b2 commit a17eef2f6948e58219c9e26fc35633d6fd4de1de Author: Andrew Ford <andrewford@google.com> Date: Thu Jan 2 15:43:09 2014 -0800 Key management skeleton with debug hooks. Change-Id: Ifd6aa3743d7ea291c70083f433a059c439aed866 commit 68a399838ad72264fd61b3dc67fecd29bbdb0af1 Author: Andrew Ford <andrewford@google.com> Date: Mon Oct 28 16:27:44 2013 -0700 Add AES-128 CTR and GCM encryption classes. Change-Id: I116305eced2a233db15306bc2ef5b9d398d1a3a2
11 years ago
Merge Google encryption commit 195158e9889365dc3298f8c1f3bcaa745992f27f Author: Minli Zhu <minliz@google.com> Date: Mon Nov 25 11:05:55 2013 -0800 Innodb redo log encryption/decryption. Use start lsn of a log block as part of AES CTR counter. Record key version with each checkpoint. Internally key version 0 means no encryption. Tests done (see test_innodb_log_encryption.sh for detail): - Verify flag innodb_encrypt_log on or off, combined with various key versions passed through CLI, and dynamically set after startup, will not corrupt database. This includes tests from being unencrypted to encrypted, and encrypted to unencrypted. - Verify start-up with no redo logs succeeds. - Verify fresh start-up succeeds. Change-Id: I4ce4c2afdf3076be2fce90ebbc2a7ce01184b612 commit c1b97273659f07866758c25f4a56f680a1fbad24 Author: Jonas Oreland <jonaso@google.com> Date: Tue Dec 3 18:47:27 2013 +0100 encryption of aria data&index files this patch implements encryption of aria data & index files. this is implemented as 1) add read/write hooks (renamed from callbacks) that does encrypt/decrypt (also add pre_read and post_write hooks) 2) modify page headers for data/index to contain key version (making the data-page header size different for with/without encryption) 3) modify index page 0 to contain IV (and crypt header) 4) AES CRT crypt functions 5) counter block is implemented using combination of page no, lsn and table specific id NOTE: 1) log files are not encrypted, this is not needed for if aria is only used for internal temporary tables and they are not transactional (i.e not logged) 2) all encrypted tables are using PAGE_CHECKSUM (crc) normal internal temporary tables are (currently) not CHECKSUM:ed 3) This patch adds insert-order semantics to aria block_format. The default behaviour of aria block-format is best-fit, meaning that rows gets allocated to page trying to fill the pages as much as possible. However, certain sql constructs materialize temporary result in tmp-tables, and expect that a table scan will later return the rows in the same order they were inserted. This implementation of insert-order is only enabled when explicitly requested by sql-layer. CHANGES: 1) found bug in ma_write that made code try to abort a record that was never written unsure why this is not exposed Change-Id: Ia82bbaa92e2c0629c08693c5add2f56b815c0509 commit 89dc1ab651fe0205d55b4eb588f62df550aa65fc Author: Jonas Oreland <jonaso@google.com> Date: Mon Feb 17 08:04:50 2014 -0800 Implement encryption of innodb datafiles. Pages are encrypted before written to disk and decrypted when read from disk. Each page except first page (page 0) in tablespace is encrypted. Page 0 is unencrypted and contains IV for the tablespace. FIL_PAGE_FILE_FLUSH_LSN on each page (except page 0) is used to store a 32-bit key-version, so that multiple keys can be active in a tablespace simultaneous. The other 32-bit of the FIL_PAGE_FILE_FLUSH_LSN field contains a checksum that is computed after encryption. This checksum is used by innochecksum and when restoring from double-write-buffer. The encryption is performed using AES CRT. Monitoring of encryption is enabled using new IS-table INNODB_TABLESPACES_ENCRYPTION. In addition to that new status variables innodb_encryption_rotation_{ pages_read_from_cache, pages_read_from_disk, pages_modified,pages_flushed } has been added. The following tunables are introduces - innodb_encrypt_tables - innodb_encryption_threads - innodb_encryption_rotate_key_age - innodb_encryption_rotation_iops Change-Id: I8f651795a30b52e71b16d6bc9cb7559be349d0b2 commit a17eef2f6948e58219c9e26fc35633d6fd4de1de Author: Andrew Ford <andrewford@google.com> Date: Thu Jan 2 15:43:09 2014 -0800 Key management skeleton with debug hooks. Change-Id: Ifd6aa3743d7ea291c70083f433a059c439aed866 commit 68a399838ad72264fd61b3dc67fecd29bbdb0af1 Author: Andrew Ford <andrewford@google.com> Date: Mon Oct 28 16:27:44 2013 -0700 Add AES-128 CTR and GCM encryption classes. Change-Id: I116305eced2a233db15306bc2ef5b9d398d1a3a2
11 years ago
Merge Google encryption commit 195158e9889365dc3298f8c1f3bcaa745992f27f Author: Minli Zhu <minliz@google.com> Date: Mon Nov 25 11:05:55 2013 -0800 Innodb redo log encryption/decryption. Use start lsn of a log block as part of AES CTR counter. Record key version with each checkpoint. Internally key version 0 means no encryption. Tests done (see test_innodb_log_encryption.sh for detail): - Verify flag innodb_encrypt_log on or off, combined with various key versions passed through CLI, and dynamically set after startup, will not corrupt database. This includes tests from being unencrypted to encrypted, and encrypted to unencrypted. - Verify start-up with no redo logs succeeds. - Verify fresh start-up succeeds. Change-Id: I4ce4c2afdf3076be2fce90ebbc2a7ce01184b612 commit c1b97273659f07866758c25f4a56f680a1fbad24 Author: Jonas Oreland <jonaso@google.com> Date: Tue Dec 3 18:47:27 2013 +0100 encryption of aria data&index files this patch implements encryption of aria data & index files. this is implemented as 1) add read/write hooks (renamed from callbacks) that does encrypt/decrypt (also add pre_read and post_write hooks) 2) modify page headers for data/index to contain key version (making the data-page header size different for with/without encryption) 3) modify index page 0 to contain IV (and crypt header) 4) AES CRT crypt functions 5) counter block is implemented using combination of page no, lsn and table specific id NOTE: 1) log files are not encrypted, this is not needed for if aria is only used for internal temporary tables and they are not transactional (i.e not logged) 2) all encrypted tables are using PAGE_CHECKSUM (crc) normal internal temporary tables are (currently) not CHECKSUM:ed 3) This patch adds insert-order semantics to aria block_format. The default behaviour of aria block-format is best-fit, meaning that rows gets allocated to page trying to fill the pages as much as possible. However, certain sql constructs materialize temporary result in tmp-tables, and expect that a table scan will later return the rows in the same order they were inserted. This implementation of insert-order is only enabled when explicitly requested by sql-layer. CHANGES: 1) found bug in ma_write that made code try to abort a record that was never written unsure why this is not exposed Change-Id: Ia82bbaa92e2c0629c08693c5add2f56b815c0509 commit 89dc1ab651fe0205d55b4eb588f62df550aa65fc Author: Jonas Oreland <jonaso@google.com> Date: Mon Feb 17 08:04:50 2014 -0800 Implement encryption of innodb datafiles. Pages are encrypted before written to disk and decrypted when read from disk. Each page except first page (page 0) in tablespace is encrypted. Page 0 is unencrypted and contains IV for the tablespace. FIL_PAGE_FILE_FLUSH_LSN on each page (except page 0) is used to store a 32-bit key-version, so that multiple keys can be active in a tablespace simultaneous. The other 32-bit of the FIL_PAGE_FILE_FLUSH_LSN field contains a checksum that is computed after encryption. This checksum is used by innochecksum and when restoring from double-write-buffer. The encryption is performed using AES CRT. Monitoring of encryption is enabled using new IS-table INNODB_TABLESPACES_ENCRYPTION. In addition to that new status variables innodb_encryption_rotation_{ pages_read_from_cache, pages_read_from_disk, pages_modified,pages_flushed } has been added. The following tunables are introduces - innodb_encrypt_tables - innodb_encryption_threads - innodb_encryption_rotate_key_age - innodb_encryption_rotation_iops Change-Id: I8f651795a30b52e71b16d6bc9cb7559be349d0b2 commit a17eef2f6948e58219c9e26fc35633d6fd4de1de Author: Andrew Ford <andrewford@google.com> Date: Thu Jan 2 15:43:09 2014 -0800 Key management skeleton with debug hooks. Change-Id: Ifd6aa3743d7ea291c70083f433a059c439aed866 commit 68a399838ad72264fd61b3dc67fecd29bbdb0af1 Author: Andrew Ford <andrewford@google.com> Date: Mon Oct 28 16:27:44 2013 -0700 Add AES-128 CTR and GCM encryption classes. Change-Id: I116305eced2a233db15306bc2ef5b9d398d1a3a2
11 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
Merge Google encryption commit 195158e9889365dc3298f8c1f3bcaa745992f27f Author: Minli Zhu <minliz@google.com> Date: Mon Nov 25 11:05:55 2013 -0800 Innodb redo log encryption/decryption. Use start lsn of a log block as part of AES CTR counter. Record key version with each checkpoint. Internally key version 0 means no encryption. Tests done (see test_innodb_log_encryption.sh for detail): - Verify flag innodb_encrypt_log on or off, combined with various key versions passed through CLI, and dynamically set after startup, will not corrupt database. This includes tests from being unencrypted to encrypted, and encrypted to unencrypted. - Verify start-up with no redo logs succeeds. - Verify fresh start-up succeeds. Change-Id: I4ce4c2afdf3076be2fce90ebbc2a7ce01184b612 commit c1b97273659f07866758c25f4a56f680a1fbad24 Author: Jonas Oreland <jonaso@google.com> Date: Tue Dec 3 18:47:27 2013 +0100 encryption of aria data&index files this patch implements encryption of aria data & index files. this is implemented as 1) add read/write hooks (renamed from callbacks) that does encrypt/decrypt (also add pre_read and post_write hooks) 2) modify page headers for data/index to contain key version (making the data-page header size different for with/without encryption) 3) modify index page 0 to contain IV (and crypt header) 4) AES CRT crypt functions 5) counter block is implemented using combination of page no, lsn and table specific id NOTE: 1) log files are not encrypted, this is not needed for if aria is only used for internal temporary tables and they are not transactional (i.e not logged) 2) all encrypted tables are using PAGE_CHECKSUM (crc) normal internal temporary tables are (currently) not CHECKSUM:ed 3) This patch adds insert-order semantics to aria block_format. The default behaviour of aria block-format is best-fit, meaning that rows gets allocated to page trying to fill the pages as much as possible. However, certain sql constructs materialize temporary result in tmp-tables, and expect that a table scan will later return the rows in the same order they were inserted. This implementation of insert-order is only enabled when explicitly requested by sql-layer. CHANGES: 1) found bug in ma_write that made code try to abort a record that was never written unsure why this is not exposed Change-Id: Ia82bbaa92e2c0629c08693c5add2f56b815c0509 commit 89dc1ab651fe0205d55b4eb588f62df550aa65fc Author: Jonas Oreland <jonaso@google.com> Date: Mon Feb 17 08:04:50 2014 -0800 Implement encryption of innodb datafiles. Pages are encrypted before written to disk and decrypted when read from disk. Each page except first page (page 0) in tablespace is encrypted. Page 0 is unencrypted and contains IV for the tablespace. FIL_PAGE_FILE_FLUSH_LSN on each page (except page 0) is used to store a 32-bit key-version, so that multiple keys can be active in a tablespace simultaneous. The other 32-bit of the FIL_PAGE_FILE_FLUSH_LSN field contains a checksum that is computed after encryption. This checksum is used by innochecksum and when restoring from double-write-buffer. The encryption is performed using AES CRT. Monitoring of encryption is enabled using new IS-table INNODB_TABLESPACES_ENCRYPTION. In addition to that new status variables innodb_encryption_rotation_{ pages_read_from_cache, pages_read_from_disk, pages_modified,pages_flushed } has been added. The following tunables are introduces - innodb_encrypt_tables - innodb_encryption_threads - innodb_encryption_rotate_key_age - innodb_encryption_rotation_iops Change-Id: I8f651795a30b52e71b16d6bc9cb7559be349d0b2 commit a17eef2f6948e58219c9e26fc35633d6fd4de1de Author: Andrew Ford <andrewford@google.com> Date: Thu Jan 2 15:43:09 2014 -0800 Key management skeleton with debug hooks. Change-Id: Ifd6aa3743d7ea291c70083f433a059c439aed866 commit 68a399838ad72264fd61b3dc67fecd29bbdb0af1 Author: Andrew Ford <andrewford@google.com> Date: Mon Oct 28 16:27:44 2013 -0700 Add AES-128 CTR and GCM encryption classes. Change-Id: I116305eced2a233db15306bc2ef5b9d398d1a3a2
11 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
Merge Google encryption commit 195158e9889365dc3298f8c1f3bcaa745992f27f Author: Minli Zhu <minliz@google.com> Date: Mon Nov 25 11:05:55 2013 -0800 Innodb redo log encryption/decryption. Use start lsn of a log block as part of AES CTR counter. Record key version with each checkpoint. Internally key version 0 means no encryption. Tests done (see test_innodb_log_encryption.sh for detail): - Verify flag innodb_encrypt_log on or off, combined with various key versions passed through CLI, and dynamically set after startup, will not corrupt database. This includes tests from being unencrypted to encrypted, and encrypted to unencrypted. - Verify start-up with no redo logs succeeds. - Verify fresh start-up succeeds. Change-Id: I4ce4c2afdf3076be2fce90ebbc2a7ce01184b612 commit c1b97273659f07866758c25f4a56f680a1fbad24 Author: Jonas Oreland <jonaso@google.com> Date: Tue Dec 3 18:47:27 2013 +0100 encryption of aria data&index files this patch implements encryption of aria data & index files. this is implemented as 1) add read/write hooks (renamed from callbacks) that does encrypt/decrypt (also add pre_read and post_write hooks) 2) modify page headers for data/index to contain key version (making the data-page header size different for with/without encryption) 3) modify index page 0 to contain IV (and crypt header) 4) AES CRT crypt functions 5) counter block is implemented using combination of page no, lsn and table specific id NOTE: 1) log files are not encrypted, this is not needed for if aria is only used for internal temporary tables and they are not transactional (i.e not logged) 2) all encrypted tables are using PAGE_CHECKSUM (crc) normal internal temporary tables are (currently) not CHECKSUM:ed 3) This patch adds insert-order semantics to aria block_format. The default behaviour of aria block-format is best-fit, meaning that rows gets allocated to page trying to fill the pages as much as possible. However, certain sql constructs materialize temporary result in tmp-tables, and expect that a table scan will later return the rows in the same order they were inserted. This implementation of insert-order is only enabled when explicitly requested by sql-layer. CHANGES: 1) found bug in ma_write that made code try to abort a record that was never written unsure why this is not exposed Change-Id: Ia82bbaa92e2c0629c08693c5add2f56b815c0509 commit 89dc1ab651fe0205d55b4eb588f62df550aa65fc Author: Jonas Oreland <jonaso@google.com> Date: Mon Feb 17 08:04:50 2014 -0800 Implement encryption of innodb datafiles. Pages are encrypted before written to disk and decrypted when read from disk. Each page except first page (page 0) in tablespace is encrypted. Page 0 is unencrypted and contains IV for the tablespace. FIL_PAGE_FILE_FLUSH_LSN on each page (except page 0) is used to store a 32-bit key-version, so that multiple keys can be active in a tablespace simultaneous. The other 32-bit of the FIL_PAGE_FILE_FLUSH_LSN field contains a checksum that is computed after encryption. This checksum is used by innochecksum and when restoring from double-write-buffer. The encryption is performed using AES CRT. Monitoring of encryption is enabled using new IS-table INNODB_TABLESPACES_ENCRYPTION. In addition to that new status variables innodb_encryption_rotation_{ pages_read_from_cache, pages_read_from_disk, pages_modified,pages_flushed } has been added. The following tunables are introduces - innodb_encrypt_tables - innodb_encryption_threads - innodb_encryption_rotate_key_age - innodb_encryption_rotation_iops Change-Id: I8f651795a30b52e71b16d6bc9cb7559be349d0b2 commit a17eef2f6948e58219c9e26fc35633d6fd4de1de Author: Andrew Ford <andrewford@google.com> Date: Thu Jan 2 15:43:09 2014 -0800 Key management skeleton with debug hooks. Change-Id: Ifd6aa3743d7ea291c70083f433a059c439aed866 commit 68a399838ad72264fd61b3dc67fecd29bbdb0af1 Author: Andrew Ford <andrewford@google.com> Date: Mon Oct 28 16:27:44 2013 -0700 Add AES-128 CTR and GCM encryption classes. Change-Id: I116305eced2a233db15306bc2ef5b9d398d1a3a2
11 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
Merge Google encryption commit 195158e9889365dc3298f8c1f3bcaa745992f27f Author: Minli Zhu <minliz@google.com> Date: Mon Nov 25 11:05:55 2013 -0800 Innodb redo log encryption/decryption. Use start lsn of a log block as part of AES CTR counter. Record key version with each checkpoint. Internally key version 0 means no encryption. Tests done (see test_innodb_log_encryption.sh for detail): - Verify flag innodb_encrypt_log on or off, combined with various key versions passed through CLI, and dynamically set after startup, will not corrupt database. This includes tests from being unencrypted to encrypted, and encrypted to unencrypted. - Verify start-up with no redo logs succeeds. - Verify fresh start-up succeeds. Change-Id: I4ce4c2afdf3076be2fce90ebbc2a7ce01184b612 commit c1b97273659f07866758c25f4a56f680a1fbad24 Author: Jonas Oreland <jonaso@google.com> Date: Tue Dec 3 18:47:27 2013 +0100 encryption of aria data&index files this patch implements encryption of aria data & index files. this is implemented as 1) add read/write hooks (renamed from callbacks) that does encrypt/decrypt (also add pre_read and post_write hooks) 2) modify page headers for data/index to contain key version (making the data-page header size different for with/without encryption) 3) modify index page 0 to contain IV (and crypt header) 4) AES CRT crypt functions 5) counter block is implemented using combination of page no, lsn and table specific id NOTE: 1) log files are not encrypted, this is not needed for if aria is only used for internal temporary tables and they are not transactional (i.e not logged) 2) all encrypted tables are using PAGE_CHECKSUM (crc) normal internal temporary tables are (currently) not CHECKSUM:ed 3) This patch adds insert-order semantics to aria block_format. The default behaviour of aria block-format is best-fit, meaning that rows gets allocated to page trying to fill the pages as much as possible. However, certain sql constructs materialize temporary result in tmp-tables, and expect that a table scan will later return the rows in the same order they were inserted. This implementation of insert-order is only enabled when explicitly requested by sql-layer. CHANGES: 1) found bug in ma_write that made code try to abort a record that was never written unsure why this is not exposed Change-Id: Ia82bbaa92e2c0629c08693c5add2f56b815c0509 commit 89dc1ab651fe0205d55b4eb588f62df550aa65fc Author: Jonas Oreland <jonaso@google.com> Date: Mon Feb 17 08:04:50 2014 -0800 Implement encryption of innodb datafiles. Pages are encrypted before written to disk and decrypted when read from disk. Each page except first page (page 0) in tablespace is encrypted. Page 0 is unencrypted and contains IV for the tablespace. FIL_PAGE_FILE_FLUSH_LSN on each page (except page 0) is used to store a 32-bit key-version, so that multiple keys can be active in a tablespace simultaneous. The other 32-bit of the FIL_PAGE_FILE_FLUSH_LSN field contains a checksum that is computed after encryption. This checksum is used by innochecksum and when restoring from double-write-buffer. The encryption is performed using AES CRT. Monitoring of encryption is enabled using new IS-table INNODB_TABLESPACES_ENCRYPTION. In addition to that new status variables innodb_encryption_rotation_{ pages_read_from_cache, pages_read_from_disk, pages_modified,pages_flushed } has been added. The following tunables are introduces - innodb_encrypt_tables - innodb_encryption_threads - innodb_encryption_rotate_key_age - innodb_encryption_rotation_iops Change-Id: I8f651795a30b52e71b16d6bc9cb7559be349d0b2 commit a17eef2f6948e58219c9e26fc35633d6fd4de1de Author: Andrew Ford <andrewford@google.com> Date: Thu Jan 2 15:43:09 2014 -0800 Key management skeleton with debug hooks. Change-Id: Ifd6aa3743d7ea291c70083f433a059c439aed866 commit 68a399838ad72264fd61b3dc67fecd29bbdb0af1 Author: Andrew Ford <andrewford@google.com> Date: Mon Oct 28 16:27:44 2013 -0700 Add AES-128 CTR and GCM encryption classes. Change-Id: I116305eced2a233db15306bc2ef5b9d398d1a3a2
11 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
Merge Google encryption commit 195158e9889365dc3298f8c1f3bcaa745992f27f Author: Minli Zhu <minliz@google.com> Date: Mon Nov 25 11:05:55 2013 -0800 Innodb redo log encryption/decryption. Use start lsn of a log block as part of AES CTR counter. Record key version with each checkpoint. Internally key version 0 means no encryption. Tests done (see test_innodb_log_encryption.sh for detail): - Verify flag innodb_encrypt_log on or off, combined with various key versions passed through CLI, and dynamically set after startup, will not corrupt database. This includes tests from being unencrypted to encrypted, and encrypted to unencrypted. - Verify start-up with no redo logs succeeds. - Verify fresh start-up succeeds. Change-Id: I4ce4c2afdf3076be2fce90ebbc2a7ce01184b612 commit c1b97273659f07866758c25f4a56f680a1fbad24 Author: Jonas Oreland <jonaso@google.com> Date: Tue Dec 3 18:47:27 2013 +0100 encryption of aria data&index files this patch implements encryption of aria data & index files. this is implemented as 1) add read/write hooks (renamed from callbacks) that does encrypt/decrypt (also add pre_read and post_write hooks) 2) modify page headers for data/index to contain key version (making the data-page header size different for with/without encryption) 3) modify index page 0 to contain IV (and crypt header) 4) AES CRT crypt functions 5) counter block is implemented using combination of page no, lsn and table specific id NOTE: 1) log files are not encrypted, this is not needed for if aria is only used for internal temporary tables and they are not transactional (i.e not logged) 2) all encrypted tables are using PAGE_CHECKSUM (crc) normal internal temporary tables are (currently) not CHECKSUM:ed 3) This patch adds insert-order semantics to aria block_format. The default behaviour of aria block-format is best-fit, meaning that rows gets allocated to page trying to fill the pages as much as possible. However, certain sql constructs materialize temporary result in tmp-tables, and expect that a table scan will later return the rows in the same order they were inserted. This implementation of insert-order is only enabled when explicitly requested by sql-layer. CHANGES: 1) found bug in ma_write that made code try to abort a record that was never written unsure why this is not exposed Change-Id: Ia82bbaa92e2c0629c08693c5add2f56b815c0509 commit 89dc1ab651fe0205d55b4eb588f62df550aa65fc Author: Jonas Oreland <jonaso@google.com> Date: Mon Feb 17 08:04:50 2014 -0800 Implement encryption of innodb datafiles. Pages are encrypted before written to disk and decrypted when read from disk. Each page except first page (page 0) in tablespace is encrypted. Page 0 is unencrypted and contains IV for the tablespace. FIL_PAGE_FILE_FLUSH_LSN on each page (except page 0) is used to store a 32-bit key-version, so that multiple keys can be active in a tablespace simultaneous. The other 32-bit of the FIL_PAGE_FILE_FLUSH_LSN field contains a checksum that is computed after encryption. This checksum is used by innochecksum and when restoring from double-write-buffer. The encryption is performed using AES CRT. Monitoring of encryption is enabled using new IS-table INNODB_TABLESPACES_ENCRYPTION. In addition to that new status variables innodb_encryption_rotation_{ pages_read_from_cache, pages_read_from_disk, pages_modified,pages_flushed } has been added. The following tunables are introduces - innodb_encrypt_tables - innodb_encryption_threads - innodb_encryption_rotate_key_age - innodb_encryption_rotation_iops Change-Id: I8f651795a30b52e71b16d6bc9cb7559be349d0b2 commit a17eef2f6948e58219c9e26fc35633d6fd4de1de Author: Andrew Ford <andrewford@google.com> Date: Thu Jan 2 15:43:09 2014 -0800 Key management skeleton with debug hooks. Change-Id: Ifd6aa3743d7ea291c70083f433a059c439aed866 commit 68a399838ad72264fd61b3dc67fecd29bbdb0af1 Author: Andrew Ford <andrewford@google.com> Date: Mon Oct 28 16:27:44 2013 -0700 Add AES-128 CTR and GCM encryption classes. Change-Id: I116305eced2a233db15306bc2ef5b9d398d1a3a2
11 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
Merge Google encryption commit 195158e9889365dc3298f8c1f3bcaa745992f27f Author: Minli Zhu <minliz@google.com> Date: Mon Nov 25 11:05:55 2013 -0800 Innodb redo log encryption/decryption. Use start lsn of a log block as part of AES CTR counter. Record key version with each checkpoint. Internally key version 0 means no encryption. Tests done (see test_innodb_log_encryption.sh for detail): - Verify flag innodb_encrypt_log on or off, combined with various key versions passed through CLI, and dynamically set after startup, will not corrupt database. This includes tests from being unencrypted to encrypted, and encrypted to unencrypted. - Verify start-up with no redo logs succeeds. - Verify fresh start-up succeeds. Change-Id: I4ce4c2afdf3076be2fce90ebbc2a7ce01184b612 commit c1b97273659f07866758c25f4a56f680a1fbad24 Author: Jonas Oreland <jonaso@google.com> Date: Tue Dec 3 18:47:27 2013 +0100 encryption of aria data&index files this patch implements encryption of aria data & index files. this is implemented as 1) add read/write hooks (renamed from callbacks) that does encrypt/decrypt (also add pre_read and post_write hooks) 2) modify page headers for data/index to contain key version (making the data-page header size different for with/without encryption) 3) modify index page 0 to contain IV (and crypt header) 4) AES CRT crypt functions 5) counter block is implemented using combination of page no, lsn and table specific id NOTE: 1) log files are not encrypted, this is not needed for if aria is only used for internal temporary tables and they are not transactional (i.e not logged) 2) all encrypted tables are using PAGE_CHECKSUM (crc) normal internal temporary tables are (currently) not CHECKSUM:ed 3) This patch adds insert-order semantics to aria block_format. The default behaviour of aria block-format is best-fit, meaning that rows gets allocated to page trying to fill the pages as much as possible. However, certain sql constructs materialize temporary result in tmp-tables, and expect that a table scan will later return the rows in the same order they were inserted. This implementation of insert-order is only enabled when explicitly requested by sql-layer. CHANGES: 1) found bug in ma_write that made code try to abort a record that was never written unsure why this is not exposed Change-Id: Ia82bbaa92e2c0629c08693c5add2f56b815c0509 commit 89dc1ab651fe0205d55b4eb588f62df550aa65fc Author: Jonas Oreland <jonaso@google.com> Date: Mon Feb 17 08:04:50 2014 -0800 Implement encryption of innodb datafiles. Pages are encrypted before written to disk and decrypted when read from disk. Each page except first page (page 0) in tablespace is encrypted. Page 0 is unencrypted and contains IV for the tablespace. FIL_PAGE_FILE_FLUSH_LSN on each page (except page 0) is used to store a 32-bit key-version, so that multiple keys can be active in a tablespace simultaneous. The other 32-bit of the FIL_PAGE_FILE_FLUSH_LSN field contains a checksum that is computed after encryption. This checksum is used by innochecksum and when restoring from double-write-buffer. The encryption is performed using AES CRT. Monitoring of encryption is enabled using new IS-table INNODB_TABLESPACES_ENCRYPTION. In addition to that new status variables innodb_encryption_rotation_{ pages_read_from_cache, pages_read_from_disk, pages_modified,pages_flushed } has been added. The following tunables are introduces - innodb_encrypt_tables - innodb_encryption_threads - innodb_encryption_rotate_key_age - innodb_encryption_rotation_iops Change-Id: I8f651795a30b52e71b16d6bc9cb7559be349d0b2 commit a17eef2f6948e58219c9e26fc35633d6fd4de1de Author: Andrew Ford <andrewford@google.com> Date: Thu Jan 2 15:43:09 2014 -0800 Key management skeleton with debug hooks. Change-Id: Ifd6aa3743d7ea291c70083f433a059c439aed866 commit 68a399838ad72264fd61b3dc67fecd29bbdb0af1 Author: Andrew Ford <andrewford@google.com> Date: Mon Oct 28 16:27:44 2013 -0700 Add AES-128 CTR and GCM encryption classes. Change-Id: I116305eced2a233db15306bc2ef5b9d398d1a3a2
11 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
Merge Google encryption commit 195158e9889365dc3298f8c1f3bcaa745992f27f Author: Minli Zhu <minliz@google.com> Date: Mon Nov 25 11:05:55 2013 -0800 Innodb redo log encryption/decryption. Use start lsn of a log block as part of AES CTR counter. Record key version with each checkpoint. Internally key version 0 means no encryption. Tests done (see test_innodb_log_encryption.sh for detail): - Verify flag innodb_encrypt_log on or off, combined with various key versions passed through CLI, and dynamically set after startup, will not corrupt database. This includes tests from being unencrypted to encrypted, and encrypted to unencrypted. - Verify start-up with no redo logs succeeds. - Verify fresh start-up succeeds. Change-Id: I4ce4c2afdf3076be2fce90ebbc2a7ce01184b612 commit c1b97273659f07866758c25f4a56f680a1fbad24 Author: Jonas Oreland <jonaso@google.com> Date: Tue Dec 3 18:47:27 2013 +0100 encryption of aria data&index files this patch implements encryption of aria data & index files. this is implemented as 1) add read/write hooks (renamed from callbacks) that does encrypt/decrypt (also add pre_read and post_write hooks) 2) modify page headers for data/index to contain key version (making the data-page header size different for with/without encryption) 3) modify index page 0 to contain IV (and crypt header) 4) AES CRT crypt functions 5) counter block is implemented using combination of page no, lsn and table specific id NOTE: 1) log files are not encrypted, this is not needed for if aria is only used for internal temporary tables and they are not transactional (i.e not logged) 2) all encrypted tables are using PAGE_CHECKSUM (crc) normal internal temporary tables are (currently) not CHECKSUM:ed 3) This patch adds insert-order semantics to aria block_format. The default behaviour of aria block-format is best-fit, meaning that rows gets allocated to page trying to fill the pages as much as possible. However, certain sql constructs materialize temporary result in tmp-tables, and expect that a table scan will later return the rows in the same order they were inserted. This implementation of insert-order is only enabled when explicitly requested by sql-layer. CHANGES: 1) found bug in ma_write that made code try to abort a record that was never written unsure why this is not exposed Change-Id: Ia82bbaa92e2c0629c08693c5add2f56b815c0509 commit 89dc1ab651fe0205d55b4eb588f62df550aa65fc Author: Jonas Oreland <jonaso@google.com> Date: Mon Feb 17 08:04:50 2014 -0800 Implement encryption of innodb datafiles. Pages are encrypted before written to disk and decrypted when read from disk. Each page except first page (page 0) in tablespace is encrypted. Page 0 is unencrypted and contains IV for the tablespace. FIL_PAGE_FILE_FLUSH_LSN on each page (except page 0) is used to store a 32-bit key-version, so that multiple keys can be active in a tablespace simultaneous. The other 32-bit of the FIL_PAGE_FILE_FLUSH_LSN field contains a checksum that is computed after encryption. This checksum is used by innochecksum and when restoring from double-write-buffer. The encryption is performed using AES CRT. Monitoring of encryption is enabled using new IS-table INNODB_TABLESPACES_ENCRYPTION. In addition to that new status variables innodb_encryption_rotation_{ pages_read_from_cache, pages_read_from_disk, pages_modified,pages_flushed } has been added. The following tunables are introduces - innodb_encrypt_tables - innodb_encryption_threads - innodb_encryption_rotate_key_age - innodb_encryption_rotation_iops Change-Id: I8f651795a30b52e71b16d6bc9cb7559be349d0b2 commit a17eef2f6948e58219c9e26fc35633d6fd4de1de Author: Andrew Ford <andrewford@google.com> Date: Thu Jan 2 15:43:09 2014 -0800 Key management skeleton with debug hooks. Change-Id: Ifd6aa3743d7ea291c70083f433a059c439aed866 commit 68a399838ad72264fd61b3dc67fecd29bbdb0af1 Author: Andrew Ford <andrewford@google.com> Date: Mon Oct 28 16:27:44 2013 -0700 Add AES-128 CTR and GCM encryption classes. Change-Id: I116305eced2a233db15306bc2ef5b9d398d1a3a2
11 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
Merge Google encryption commit 195158e9889365dc3298f8c1f3bcaa745992f27f Author: Minli Zhu <minliz@google.com> Date: Mon Nov 25 11:05:55 2013 -0800 Innodb redo log encryption/decryption. Use start lsn of a log block as part of AES CTR counter. Record key version with each checkpoint. Internally key version 0 means no encryption. Tests done (see test_innodb_log_encryption.sh for detail): - Verify flag innodb_encrypt_log on or off, combined with various key versions passed through CLI, and dynamically set after startup, will not corrupt database. This includes tests from being unencrypted to encrypted, and encrypted to unencrypted. - Verify start-up with no redo logs succeeds. - Verify fresh start-up succeeds. Change-Id: I4ce4c2afdf3076be2fce90ebbc2a7ce01184b612 commit c1b97273659f07866758c25f4a56f680a1fbad24 Author: Jonas Oreland <jonaso@google.com> Date: Tue Dec 3 18:47:27 2013 +0100 encryption of aria data&index files this patch implements encryption of aria data & index files. this is implemented as 1) add read/write hooks (renamed from callbacks) that does encrypt/decrypt (also add pre_read and post_write hooks) 2) modify page headers for data/index to contain key version (making the data-page header size different for with/without encryption) 3) modify index page 0 to contain IV (and crypt header) 4) AES CRT crypt functions 5) counter block is implemented using combination of page no, lsn and table specific id NOTE: 1) log files are not encrypted, this is not needed for if aria is only used for internal temporary tables and they are not transactional (i.e not logged) 2) all encrypted tables are using PAGE_CHECKSUM (crc) normal internal temporary tables are (currently) not CHECKSUM:ed 3) This patch adds insert-order semantics to aria block_format. The default behaviour of aria block-format is best-fit, meaning that rows gets allocated to page trying to fill the pages as much as possible. However, certain sql constructs materialize temporary result in tmp-tables, and expect that a table scan will later return the rows in the same order they were inserted. This implementation of insert-order is only enabled when explicitly requested by sql-layer. CHANGES: 1) found bug in ma_write that made code try to abort a record that was never written unsure why this is not exposed Change-Id: Ia82bbaa92e2c0629c08693c5add2f56b815c0509 commit 89dc1ab651fe0205d55b4eb588f62df550aa65fc Author: Jonas Oreland <jonaso@google.com> Date: Mon Feb 17 08:04:50 2014 -0800 Implement encryption of innodb datafiles. Pages are encrypted before written to disk and decrypted when read from disk. Each page except first page (page 0) in tablespace is encrypted. Page 0 is unencrypted and contains IV for the tablespace. FIL_PAGE_FILE_FLUSH_LSN on each page (except page 0) is used to store a 32-bit key-version, so that multiple keys can be active in a tablespace simultaneous. The other 32-bit of the FIL_PAGE_FILE_FLUSH_LSN field contains a checksum that is computed after encryption. This checksum is used by innochecksum and when restoring from double-write-buffer. The encryption is performed using AES CRT. Monitoring of encryption is enabled using new IS-table INNODB_TABLESPACES_ENCRYPTION. In addition to that new status variables innodb_encryption_rotation_{ pages_read_from_cache, pages_read_from_disk, pages_modified,pages_flushed } has been added. The following tunables are introduces - innodb_encrypt_tables - innodb_encryption_threads - innodb_encryption_rotate_key_age - innodb_encryption_rotation_iops Change-Id: I8f651795a30b52e71b16d6bc9cb7559be349d0b2 commit a17eef2f6948e58219c9e26fc35633d6fd4de1de Author: Andrew Ford <andrewford@google.com> Date: Thu Jan 2 15:43:09 2014 -0800 Key management skeleton with debug hooks. Change-Id: Ifd6aa3743d7ea291c70083f433a059c439aed866 commit 68a399838ad72264fd61b3dc67fecd29bbdb0af1 Author: Andrew Ford <andrewford@google.com> Date: Mon Oct 28 16:27:44 2013 -0700 Add AES-128 CTR and GCM encryption classes. Change-Id: I116305eced2a233db15306bc2ef5b9d398d1a3a2
11 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
Merge Google encryption commit 195158e9889365dc3298f8c1f3bcaa745992f27f Author: Minli Zhu <minliz@google.com> Date: Mon Nov 25 11:05:55 2013 -0800 Innodb redo log encryption/decryption. Use start lsn of a log block as part of AES CTR counter. Record key version with each checkpoint. Internally key version 0 means no encryption. Tests done (see test_innodb_log_encryption.sh for detail): - Verify flag innodb_encrypt_log on or off, combined with various key versions passed through CLI, and dynamically set after startup, will not corrupt database. This includes tests from being unencrypted to encrypted, and encrypted to unencrypted. - Verify start-up with no redo logs succeeds. - Verify fresh start-up succeeds. Change-Id: I4ce4c2afdf3076be2fce90ebbc2a7ce01184b612 commit c1b97273659f07866758c25f4a56f680a1fbad24 Author: Jonas Oreland <jonaso@google.com> Date: Tue Dec 3 18:47:27 2013 +0100 encryption of aria data&index files this patch implements encryption of aria data & index files. this is implemented as 1) add read/write hooks (renamed from callbacks) that does encrypt/decrypt (also add pre_read and post_write hooks) 2) modify page headers for data/index to contain key version (making the data-page header size different for with/without encryption) 3) modify index page 0 to contain IV (and crypt header) 4) AES CRT crypt functions 5) counter block is implemented using combination of page no, lsn and table specific id NOTE: 1) log files are not encrypted, this is not needed for if aria is only used for internal temporary tables and they are not transactional (i.e not logged) 2) all encrypted tables are using PAGE_CHECKSUM (crc) normal internal temporary tables are (currently) not CHECKSUM:ed 3) This patch adds insert-order semantics to aria block_format. The default behaviour of aria block-format is best-fit, meaning that rows gets allocated to page trying to fill the pages as much as possible. However, certain sql constructs materialize temporary result in tmp-tables, and expect that a table scan will later return the rows in the same order they were inserted. This implementation of insert-order is only enabled when explicitly requested by sql-layer. CHANGES: 1) found bug in ma_write that made code try to abort a record that was never written unsure why this is not exposed Change-Id: Ia82bbaa92e2c0629c08693c5add2f56b815c0509 commit 89dc1ab651fe0205d55b4eb588f62df550aa65fc Author: Jonas Oreland <jonaso@google.com> Date: Mon Feb 17 08:04:50 2014 -0800 Implement encryption of innodb datafiles. Pages are encrypted before written to disk and decrypted when read from disk. Each page except first page (page 0) in tablespace is encrypted. Page 0 is unencrypted and contains IV for the tablespace. FIL_PAGE_FILE_FLUSH_LSN on each page (except page 0) is used to store a 32-bit key-version, so that multiple keys can be active in a tablespace simultaneous. The other 32-bit of the FIL_PAGE_FILE_FLUSH_LSN field contains a checksum that is computed after encryption. This checksum is used by innochecksum and when restoring from double-write-buffer. The encryption is performed using AES CRT. Monitoring of encryption is enabled using new IS-table INNODB_TABLESPACES_ENCRYPTION. In addition to that new status variables innodb_encryption_rotation_{ pages_read_from_cache, pages_read_from_disk, pages_modified,pages_flushed } has been added. The following tunables are introduces - innodb_encrypt_tables - innodb_encryption_threads - innodb_encryption_rotate_key_age - innodb_encryption_rotation_iops Change-Id: I8f651795a30b52e71b16d6bc9cb7559be349d0b2 commit a17eef2f6948e58219c9e26fc35633d6fd4de1de Author: Andrew Ford <andrewford@google.com> Date: Thu Jan 2 15:43:09 2014 -0800 Key management skeleton with debug hooks. Change-Id: Ifd6aa3743d7ea291c70083f433a059c439aed866 commit 68a399838ad72264fd61b3dc67fecd29bbdb0af1 Author: Andrew Ford <andrewford@google.com> Date: Mon Oct 28 16:27:44 2013 -0700 Add AES-128 CTR and GCM encryption classes. Change-Id: I116305eced2a233db15306bc2ef5b9d398d1a3a2
11 years ago
Merge Google encryption commit 195158e9889365dc3298f8c1f3bcaa745992f27f Author: Minli Zhu <minliz@google.com> Date: Mon Nov 25 11:05:55 2013 -0800 Innodb redo log encryption/decryption. Use start lsn of a log block as part of AES CTR counter. Record key version with each checkpoint. Internally key version 0 means no encryption. Tests done (see test_innodb_log_encryption.sh for detail): - Verify flag innodb_encrypt_log on or off, combined with various key versions passed through CLI, and dynamically set after startup, will not corrupt database. This includes tests from being unencrypted to encrypted, and encrypted to unencrypted. - Verify start-up with no redo logs succeeds. - Verify fresh start-up succeeds. Change-Id: I4ce4c2afdf3076be2fce90ebbc2a7ce01184b612 commit c1b97273659f07866758c25f4a56f680a1fbad24 Author: Jonas Oreland <jonaso@google.com> Date: Tue Dec 3 18:47:27 2013 +0100 encryption of aria data&index files this patch implements encryption of aria data & index files. this is implemented as 1) add read/write hooks (renamed from callbacks) that does encrypt/decrypt (also add pre_read and post_write hooks) 2) modify page headers for data/index to contain key version (making the data-page header size different for with/without encryption) 3) modify index page 0 to contain IV (and crypt header) 4) AES CRT crypt functions 5) counter block is implemented using combination of page no, lsn and table specific id NOTE: 1) log files are not encrypted, this is not needed for if aria is only used for internal temporary tables and they are not transactional (i.e not logged) 2) all encrypted tables are using PAGE_CHECKSUM (crc) normal internal temporary tables are (currently) not CHECKSUM:ed 3) This patch adds insert-order semantics to aria block_format. The default behaviour of aria block-format is best-fit, meaning that rows gets allocated to page trying to fill the pages as much as possible. However, certain sql constructs materialize temporary result in tmp-tables, and expect that a table scan will later return the rows in the same order they were inserted. This implementation of insert-order is only enabled when explicitly requested by sql-layer. CHANGES: 1) found bug in ma_write that made code try to abort a record that was never written unsure why this is not exposed Change-Id: Ia82bbaa92e2c0629c08693c5add2f56b815c0509 commit 89dc1ab651fe0205d55b4eb588f62df550aa65fc Author: Jonas Oreland <jonaso@google.com> Date: Mon Feb 17 08:04:50 2014 -0800 Implement encryption of innodb datafiles. Pages are encrypted before written to disk and decrypted when read from disk. Each page except first page (page 0) in tablespace is encrypted. Page 0 is unencrypted and contains IV for the tablespace. FIL_PAGE_FILE_FLUSH_LSN on each page (except page 0) is used to store a 32-bit key-version, so that multiple keys can be active in a tablespace simultaneous. The other 32-bit of the FIL_PAGE_FILE_FLUSH_LSN field contains a checksum that is computed after encryption. This checksum is used by innochecksum and when restoring from double-write-buffer. The encryption is performed using AES CRT. Monitoring of encryption is enabled using new IS-table INNODB_TABLESPACES_ENCRYPTION. In addition to that new status variables innodb_encryption_rotation_{ pages_read_from_cache, pages_read_from_disk, pages_modified,pages_flushed } has been added. The following tunables are introduces - innodb_encrypt_tables - innodb_encryption_threads - innodb_encryption_rotate_key_age - innodb_encryption_rotation_iops Change-Id: I8f651795a30b52e71b16d6bc9cb7559be349d0b2 commit a17eef2f6948e58219c9e26fc35633d6fd4de1de Author: Andrew Ford <andrewford@google.com> Date: Thu Jan 2 15:43:09 2014 -0800 Key management skeleton with debug hooks. Change-Id: Ifd6aa3743d7ea291c70083f433a059c439aed866 commit 68a399838ad72264fd61b3dc67fecd29bbdb0af1 Author: Andrew Ford <andrewford@google.com> Date: Mon Oct 28 16:27:44 2013 -0700 Add AES-128 CTR and GCM encryption classes. Change-Id: I116305eced2a233db15306bc2ef5b9d398d1a3a2
11 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing MDEV-11581: Mariadb starts InnoDB encryption threads when key has not changed or data scrubbing turned off Background: Key rotation is based on background threads (innodb-encryption-threads) periodically going through all tablespaces on fil_system. For each tablespace current used key version is compared to max key age (innodb-encryption-rotate-key-age). This process naturally takes CPU. Similarly, in same time need for scrubbing is investigated. Currently, key rotation is fully supported on Amazon AWS key management plugin only but InnoDB does not have knowledge what key management plugin is used. This patch re-purposes innodb-encryption-rotate-key-age=0 to disable key rotation and background data scrubbing. All new tables are added to special list for key rotation and key rotation is based on sending a event to background encryption threads instead of using periodic checking (i.e. timeout). fil0fil.cc: Added functions fil_space_acquire_low() to acquire a tablespace when it could be dropped concurrently. This function is used from fil_space_acquire() or fil_space_acquire_silent() that will not print any messages if we try to acquire space that does not exist. fil_space_release() to release a acquired tablespace. fil_space_next() to iterate tablespaces in fil_system using fil_space_acquire() and fil_space_release(). Similarly, fil_space_keyrotation_next() to iterate new list fil_system->rotation_list where new tables. are added if key rotation is disabled. Removed unnecessary functions fil_get_first_space_safe() fil_get_next_space_safe() fil_node_open_file(): After page 0 is read read also crypt_info if it is not yet read. btr_scrub_lock_dict_func() buf_page_check_corrupt() buf_page_encrypt_before_write() buf_merge_or_delete_for_page() lock_print_info_all_transactions() row_fts_psort_info_init() row_truncate_table_for_mysql() row_drop_table_for_mysql() Use fil_space_acquire()/release() to access fil_space_t. buf_page_decrypt_after_read(): Use fil_space_get_crypt_data() because at this point we might not yet have read page 0. fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly to functions needing it and store fil_space_t* to rotation state. Use fil_space_acquire()/release() when iterating tablespaces and removed unnecessary is_closing from fil_crypt_t. Use fil_space_t::is_stopping() to detect when access to tablespace should be stopped. Removed unnecessary fil_space_get_crypt_data(). fil_space_create(): Inform key rotation that there could be something to do if key rotation is disabled and new table with encryption enabled is created. Remove unnecessary functions fil_get_first_space_safe() and fil_get_next_space_safe(). fil_space_acquire() and fil_space_release() are used instead. Moved fil_space_get_crypt_data() and fil_space_set_crypt_data() to fil0crypt.cc. fsp_header_init(): Acquire fil_space_t*, write crypt_data and release space. check_table_options() Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_* i_s.cc: Added ROTATING_OR_FLUSHING field to information_schema.innodb_tablespace_encryption to show current status of key rotation.
9 years ago
  1. /*****************************************************************************
  2. Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
  3. Copyright (c) 2014, 2019, MariaDB Corporation.
  4. This program is free software; you can redistribute it and/or modify it under
  5. the terms of the GNU General Public License as published by the Free Software
  6. Foundation; version 2 of the License.
  7. This program is distributed in the hope that it will be useful, but WITHOUT
  8. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License along with
  11. this program; if not, write to the Free Software Foundation, Inc.,
  12. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
  13. *****************************************************************************/
  14. /**************************************************//**
  15. @file handler/i_s.cc
  16. InnoDB INFORMATION SCHEMA tables interface to MySQL.
  17. Created July 18, 2007 Vasil Dimov
  18. Modified Dec 29, 2014 Jan Lindström (Added sys_semaphore_waits)
  19. *******************************************************/
  20. #include "univ.i"
  21. #include <mysqld_error.h>
  22. #include <sql_acl.h>
  23. #include <m_ctype.h>
  24. #include <hash.h>
  25. #include <myisampack.h>
  26. #include <mysys_err.h>
  27. #include <my_sys.h>
  28. #include "i_s.h"
  29. #include <sql_plugin.h>
  30. #include <innodb_priv.h>
  31. #include "btr0pcur.h"
  32. #include "btr0types.h"
  33. #include "dict0dict.h"
  34. #include "dict0load.h"
  35. #include "buf0buddy.h"
  36. #include "buf0buf.h"
  37. #include "ibuf0ibuf.h"
  38. #include "dict0mem.h"
  39. #include "dict0types.h"
  40. #include "ha_prototypes.h"
  41. #include "srv0start.h"
  42. #include "trx0i_s.h"
  43. #include "trx0trx.h"
  44. #include "srv0mon.h"
  45. #include "fut0fut.h"
  46. #include "pars0pars.h"
  47. #include "fts0types.h"
  48. #include "fts0opt.h"
  49. #include "fts0priv.h"
  50. #include "btr0btr.h"
  51. #include "page0zip.h"
  52. #include "sync0arr.h"
  53. #include "fil0fil.h"
  54. #include "fil0crypt.h"
  55. /** structure associates a name string with a file page type and/or buffer
  56. page state. */
  57. struct buf_page_desc_t{
  58. const char* type_str; /*!< String explain the page
  59. type/state */
  60. ulint type_value; /*!< Page type or page state */
  61. };
  62. /** Change buffer B-tree page */
  63. #define I_S_PAGE_TYPE_IBUF (FIL_PAGE_TYPE_LAST + 1)
  64. /** Any states greater than I_S_PAGE_TYPE_IBUF would be treated as
  65. unknown. */
  66. #define I_S_PAGE_TYPE_UNKNOWN (I_S_PAGE_TYPE_IBUF + 1)
  67. /** We also define I_S_PAGE_TYPE_INDEX as the Index Page's position
  68. in i_s_page_type[] array */
  69. #define I_S_PAGE_TYPE_INDEX 1
  70. /** Name string for File Page Types */
  71. static buf_page_desc_t i_s_page_type[] = {
  72. {"ALLOCATED", FIL_PAGE_TYPE_ALLOCATED},
  73. {"INDEX", FIL_PAGE_INDEX},
  74. {"UNDO_LOG", FIL_PAGE_UNDO_LOG},
  75. {"INODE", FIL_PAGE_INODE},
  76. {"IBUF_FREE_LIST", FIL_PAGE_IBUF_FREE_LIST},
  77. {"IBUF_BITMAP", FIL_PAGE_IBUF_BITMAP},
  78. {"SYSTEM", FIL_PAGE_TYPE_SYS},
  79. {"TRX_SYSTEM", FIL_PAGE_TYPE_TRX_SYS},
  80. {"FILE_SPACE_HEADER", FIL_PAGE_TYPE_FSP_HDR},
  81. {"EXTENT_DESCRIPTOR", FIL_PAGE_TYPE_XDES},
  82. {"BLOB", FIL_PAGE_TYPE_BLOB},
  83. {"COMPRESSED_BLOB", FIL_PAGE_TYPE_ZBLOB},
  84. {"COMPRESSED_BLOB2", FIL_PAGE_TYPE_ZBLOB2},
  85. {"IBUF_INDEX", I_S_PAGE_TYPE_IBUF},
  86. {"PAGE COMPRESSED", FIL_PAGE_PAGE_COMPRESSED},
  87. {"UNKNOWN", I_S_PAGE_TYPE_UNKNOWN}
  88. };
  89. /* Check if we can hold all page type in a 4 bit value */
  90. #if I_S_PAGE_TYPE_UNKNOWN > 1<<4
  91. # error "i_s_page_type[] is too large"
  92. #endif
  93. /** This structure defines information we will fetch from pages
  94. currently cached in the buffer pool. It will be used to populate
  95. table INFORMATION_SCHEMA.INNODB_BUFFER_PAGE */
  96. struct buf_page_info_t{
  97. ulint block_id; /*!< Buffer Pool block ID */
  98. unsigned space_id:32; /*!< Tablespace ID */
  99. unsigned page_num:32; /*!< Page number/offset */
  100. unsigned access_time:32; /*!< Time of first access */
  101. unsigned pool_id:MAX_BUFFER_POOLS_BITS;
  102. /*!< Buffer Pool ID. Must be less than
  103. MAX_BUFFER_POOLS */
  104. unsigned flush_type:2; /*!< Flush type */
  105. unsigned io_fix:2; /*!< type of pending I/O operation */
  106. unsigned fix_count:19; /*!< Count of how manyfold this block
  107. is bufferfixed */
  108. unsigned hashed:1; /*!< Whether hash index has been
  109. built on this page */
  110. unsigned is_old:1; /*!< TRUE if the block is in the old
  111. blocks in buf_pool->LRU_old */
  112. unsigned freed_page_clock:31; /*!< the value of
  113. buf_pool->freed_page_clock */
  114. unsigned zip_ssize:PAGE_ZIP_SSIZE_BITS;
  115. /*!< Compressed page size */
  116. unsigned page_state:BUF_PAGE_STATE_BITS; /*!< Page state */
  117. unsigned page_type:4; /*!< Page type */
  118. unsigned num_recs:UNIV_PAGE_SIZE_SHIFT_MAX-2;
  119. /*!< Number of records on Page */
  120. unsigned data_size:UNIV_PAGE_SIZE_SHIFT_MAX;
  121. /*!< Sum of the sizes of the records */
  122. lsn_t newest_mod; /*!< Log sequence number of
  123. the youngest modification */
  124. lsn_t oldest_mod; /*!< Log sequence number of
  125. the oldest modification */
  126. index_id_t index_id; /*!< Index ID if a index page */
  127. };
  128. /*
  129. Use the following types mapping:
  130. C type ST_FIELD_INFO::field_type
  131. ---------------------------------
  132. long MYSQL_TYPE_LONGLONG
  133. (field_length=MY_INT64_NUM_DECIMAL_DIGITS)
  134. long unsigned MYSQL_TYPE_LONGLONG
  135. (field_length=MY_INT64_NUM_DECIMAL_DIGITS, field_flags=MY_I_S_UNSIGNED)
  136. char* MYSQL_TYPE_STRING
  137. (field_length=n)
  138. float MYSQL_TYPE_FLOAT
  139. (field_length=0 is ignored)
  140. void* MYSQL_TYPE_LONGLONG
  141. (field_length=MY_INT64_NUM_DECIMAL_DIGITS, field_flags=MY_I_S_UNSIGNED)
  142. boolean (if else) MYSQL_TYPE_LONG
  143. (field_length=1)
  144. time_t MYSQL_TYPE_DATETIME
  145. (field_length=0 ignored)
  146. ---------------------------------
  147. */
  148. /** Implemented on sync0arr.cc */
  149. /*******************************************************************//**
  150. Function to populate INFORMATION_SCHEMA.INNODB_SYS_SEMAPHORE_WAITS table.
  151. Loop through each item on sync array, and extract the column
  152. information and fill the INFORMATION_SCHEMA.INNODB_SYS_SEMAPHORE_WAITS table.
  153. @return 0 on success */
  154. UNIV_INTERN
  155. int
  156. sync_arr_fill_sys_semphore_waits_table(
  157. /*===================================*/
  158. THD* thd, /*!< in: thread */
  159. TABLE_LIST* tables, /*!< in/out: tables to fill */
  160. Item* ); /*!< in: condition (not used) */
  161. /*******************************************************************//**
  162. Common function to fill any of the dynamic tables:
  163. INFORMATION_SCHEMA.innodb_trx
  164. INFORMATION_SCHEMA.innodb_locks
  165. INFORMATION_SCHEMA.innodb_lock_waits
  166. @return 0 on success */
  167. static
  168. int
  169. trx_i_s_common_fill_table(
  170. /*======================*/
  171. THD* thd, /*!< in: thread */
  172. TABLE_LIST* tables, /*!< in/out: tables to fill */
  173. Item* ); /*!< in: condition (not used) */
  174. /*******************************************************************//**
  175. Unbind a dynamic INFORMATION_SCHEMA table.
  176. @return 0 on success */
  177. static
  178. int
  179. i_s_common_deinit(
  180. /*==============*/
  181. void* p); /*!< in/out: table schema object */
  182. /*******************************************************************//**
  183. Auxiliary function to store time_t value in MYSQL_TYPE_DATETIME
  184. field.
  185. @return 0 on success */
  186. static
  187. int
  188. field_store_time_t(
  189. /*===============*/
  190. Field* field, /*!< in/out: target field for storage */
  191. time_t time) /*!< in: value to store */
  192. {
  193. MYSQL_TIME my_time;
  194. struct tm tm_time;
  195. if (time) {
  196. #if 0
  197. /* use this if you are sure that `variables' and `time_zone'
  198. are always initialized */
  199. thd->variables.time_zone->gmt_sec_to_TIME(
  200. &my_time, (my_time_t) time);
  201. #else
  202. localtime_r(&time, &tm_time);
  203. localtime_to_TIME(&my_time, &tm_time);
  204. my_time.time_type = MYSQL_TIMESTAMP_DATETIME;
  205. #endif
  206. } else {
  207. memset(&my_time, 0, sizeof(my_time));
  208. }
  209. return(field->store_time(&my_time));
  210. }
  211. /*******************************************************************//**
  212. Auxiliary function to store char* value in MYSQL_TYPE_STRING field.
  213. @return 0 on success */
  214. int
  215. field_store_string(
  216. /*===============*/
  217. Field* field, /*!< in/out: target field for storage */
  218. const char* str) /*!< in: NUL-terminated utf-8 string,
  219. or NULL */
  220. {
  221. int ret;
  222. if (str != NULL) {
  223. ret = field->store(str, static_cast<uint>(strlen(str)),
  224. system_charset_info);
  225. field->set_notnull();
  226. } else {
  227. ret = 0; /* success */
  228. field->set_null();
  229. }
  230. return(ret);
  231. }
  232. /*******************************************************************//**
  233. Store the name of an index in a MYSQL_TYPE_VARCHAR field.
  234. Handles the names of incomplete secondary indexes.
  235. @return 0 on success */
  236. static
  237. int
  238. field_store_index_name(
  239. /*===================*/
  240. Field* field, /*!< in/out: target field for
  241. storage */
  242. const char* index_name) /*!< in: NUL-terminated utf-8
  243. index name, possibly starting with
  244. TEMP_INDEX_PREFIX */
  245. {
  246. int ret;
  247. ut_ad(index_name != NULL);
  248. ut_ad(field->real_type() == MYSQL_TYPE_VARCHAR);
  249. /* Since TEMP_INDEX_PREFIX is not a valid UTF8, we need to convert
  250. it to something else. */
  251. if (index_name[0] == TEMP_INDEX_PREFIX) {
  252. char buf[NAME_LEN + 1];
  253. buf[0] = '?';
  254. memcpy(buf + 1, index_name + 1, strlen(index_name));
  255. ret = field->store(
  256. buf, static_cast<uint>(strlen(buf)),
  257. system_charset_info);
  258. } else {
  259. ret = field->store(
  260. index_name, static_cast<uint>(strlen(index_name)),
  261. system_charset_info);
  262. }
  263. field->set_notnull();
  264. return(ret);
  265. }
  266. /*******************************************************************//**
  267. Auxiliary function to store ulint value in MYSQL_TYPE_LONGLONG field.
  268. If the value is ULINT_UNDEFINED then the field it set to NULL.
  269. @return 0 on success */
  270. int
  271. field_store_ulint(
  272. /*==============*/
  273. Field* field, /*!< in/out: target field for storage */
  274. ulint n) /*!< in: value to store */
  275. {
  276. int ret;
  277. if (n != ULINT_UNDEFINED) {
  278. ret = field->store(static_cast<double>(n));
  279. field->set_notnull();
  280. } else {
  281. ret = 0; /* success */
  282. field->set_null();
  283. }
  284. return(ret);
  285. }
  286. /* Fields of the dynamic table INFORMATION_SCHEMA.innodb_trx */
  287. static ST_FIELD_INFO innodb_trx_fields_info[] =
  288. {
  289. #define IDX_TRX_ID 0
  290. {STRUCT_FLD(field_name, "trx_id"),
  291. STRUCT_FLD(field_length, TRX_ID_MAX_LEN + 1),
  292. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  293. STRUCT_FLD(value, 0),
  294. STRUCT_FLD(field_flags, 0),
  295. STRUCT_FLD(old_name, ""),
  296. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  297. #define IDX_TRX_STATE 1
  298. {STRUCT_FLD(field_name, "trx_state"),
  299. STRUCT_FLD(field_length, TRX_QUE_STATE_STR_MAX_LEN + 1),
  300. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  301. STRUCT_FLD(value, 0),
  302. STRUCT_FLD(field_flags, 0),
  303. STRUCT_FLD(old_name, ""),
  304. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  305. #define IDX_TRX_STARTED 2
  306. {STRUCT_FLD(field_name, "trx_started"),
  307. STRUCT_FLD(field_length, 0),
  308. STRUCT_FLD(field_type, MYSQL_TYPE_DATETIME),
  309. STRUCT_FLD(value, 0),
  310. STRUCT_FLD(field_flags, 0),
  311. STRUCT_FLD(old_name, ""),
  312. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  313. #define IDX_TRX_REQUESTED_LOCK_ID 3
  314. {STRUCT_FLD(field_name, "trx_requested_lock_id"),
  315. STRUCT_FLD(field_length, TRX_I_S_LOCK_ID_MAX_LEN + 1),
  316. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  317. STRUCT_FLD(value, 0),
  318. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  319. STRUCT_FLD(old_name, ""),
  320. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  321. #define IDX_TRX_WAIT_STARTED 4
  322. {STRUCT_FLD(field_name, "trx_wait_started"),
  323. STRUCT_FLD(field_length, 0),
  324. STRUCT_FLD(field_type, MYSQL_TYPE_DATETIME),
  325. STRUCT_FLD(value, 0),
  326. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  327. STRUCT_FLD(old_name, ""),
  328. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  329. #define IDX_TRX_WEIGHT 5
  330. {STRUCT_FLD(field_name, "trx_weight"),
  331. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  332. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  333. STRUCT_FLD(value, 0),
  334. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  335. STRUCT_FLD(old_name, ""),
  336. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  337. #define IDX_TRX_MYSQL_THREAD_ID 6
  338. {STRUCT_FLD(field_name, "trx_mysql_thread_id"),
  339. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  340. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  341. STRUCT_FLD(value, 0),
  342. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  343. STRUCT_FLD(old_name, ""),
  344. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  345. #define IDX_TRX_QUERY 7
  346. {STRUCT_FLD(field_name, "trx_query"),
  347. STRUCT_FLD(field_length, TRX_I_S_TRX_QUERY_MAX_LEN),
  348. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  349. STRUCT_FLD(value, 0),
  350. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  351. STRUCT_FLD(old_name, ""),
  352. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  353. #define IDX_TRX_OPERATION_STATE 8
  354. {STRUCT_FLD(field_name, "trx_operation_state"),
  355. STRUCT_FLD(field_length, TRX_I_S_TRX_OP_STATE_MAX_LEN),
  356. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  357. STRUCT_FLD(value, 0),
  358. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  359. STRUCT_FLD(old_name, ""),
  360. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  361. #define IDX_TRX_TABLES_IN_USE 9
  362. {STRUCT_FLD(field_name, "trx_tables_in_use"),
  363. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  364. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  365. STRUCT_FLD(value, 0),
  366. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  367. STRUCT_FLD(old_name, ""),
  368. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  369. #define IDX_TRX_TABLES_LOCKED 10
  370. {STRUCT_FLD(field_name, "trx_tables_locked"),
  371. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  372. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  373. STRUCT_FLD(value, 0),
  374. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  375. STRUCT_FLD(old_name, ""),
  376. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  377. #define IDX_TRX_LOCK_STRUCTS 11
  378. {STRUCT_FLD(field_name, "trx_lock_structs"),
  379. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  380. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  381. STRUCT_FLD(value, 0),
  382. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  383. STRUCT_FLD(old_name, ""),
  384. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  385. #define IDX_TRX_LOCK_MEMORY_BYTES 12
  386. {STRUCT_FLD(field_name, "trx_lock_memory_bytes"),
  387. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  388. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  389. STRUCT_FLD(value, 0),
  390. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  391. STRUCT_FLD(old_name, ""),
  392. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  393. #define IDX_TRX_ROWS_LOCKED 13
  394. {STRUCT_FLD(field_name, "trx_rows_locked"),
  395. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  396. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  397. STRUCT_FLD(value, 0),
  398. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  399. STRUCT_FLD(old_name, ""),
  400. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  401. #define IDX_TRX_ROWS_MODIFIED 14
  402. {STRUCT_FLD(field_name, "trx_rows_modified"),
  403. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  404. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  405. STRUCT_FLD(value, 0),
  406. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  407. STRUCT_FLD(old_name, ""),
  408. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  409. #define IDX_TRX_CONNCURRENCY_TICKETS 15
  410. {STRUCT_FLD(field_name, "trx_concurrency_tickets"),
  411. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  412. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  413. STRUCT_FLD(value, 0),
  414. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  415. STRUCT_FLD(old_name, ""),
  416. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  417. #define IDX_TRX_ISOLATION_LEVEL 16
  418. {STRUCT_FLD(field_name, "trx_isolation_level"),
  419. STRUCT_FLD(field_length, TRX_I_S_TRX_ISOLATION_LEVEL_MAX_LEN),
  420. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  421. STRUCT_FLD(value, 0),
  422. STRUCT_FLD(field_flags, 0),
  423. STRUCT_FLD(old_name, ""),
  424. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  425. #define IDX_TRX_UNIQUE_CHECKS 17
  426. {STRUCT_FLD(field_name, "trx_unique_checks"),
  427. STRUCT_FLD(field_length, 1),
  428. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  429. STRUCT_FLD(value, 1),
  430. STRUCT_FLD(field_flags, 0),
  431. STRUCT_FLD(old_name, ""),
  432. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  433. #define IDX_TRX_FOREIGN_KEY_CHECKS 18
  434. {STRUCT_FLD(field_name, "trx_foreign_key_checks"),
  435. STRUCT_FLD(field_length, 1),
  436. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  437. STRUCT_FLD(value, 1),
  438. STRUCT_FLD(field_flags, 0),
  439. STRUCT_FLD(old_name, ""),
  440. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  441. #define IDX_TRX_LAST_FOREIGN_KEY_ERROR 19
  442. {STRUCT_FLD(field_name, "trx_last_foreign_key_error"),
  443. STRUCT_FLD(field_length, TRX_I_S_TRX_FK_ERROR_MAX_LEN),
  444. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  445. STRUCT_FLD(value, 0),
  446. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  447. STRUCT_FLD(old_name, ""),
  448. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  449. #define IDX_TRX_ADAPTIVE_HASH_LATCHED 20
  450. {STRUCT_FLD(field_name, "trx_adaptive_hash_latched"),
  451. STRUCT_FLD(field_length, 1),
  452. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  453. STRUCT_FLD(value, 0),
  454. STRUCT_FLD(field_flags, 0),
  455. STRUCT_FLD(old_name, ""),
  456. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  457. #define IDX_TRX_ADAPTIVE_HASH_TIMEOUT 21
  458. {STRUCT_FLD(field_name, "trx_adaptive_hash_timeout"),
  459. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  460. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  461. STRUCT_FLD(value, 0),
  462. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  463. STRUCT_FLD(old_name, ""),
  464. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  465. #define IDX_TRX_READ_ONLY 22
  466. {STRUCT_FLD(field_name, "trx_is_read_only"),
  467. STRUCT_FLD(field_length, 1),
  468. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  469. STRUCT_FLD(value, 0),
  470. STRUCT_FLD(field_flags, 0),
  471. STRUCT_FLD(old_name, ""),
  472. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  473. #define IDX_TRX_AUTOCOMMIT_NON_LOCKING 23
  474. {STRUCT_FLD(field_name, "trx_autocommit_non_locking"),
  475. STRUCT_FLD(field_length, 1),
  476. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  477. STRUCT_FLD(value, 0),
  478. STRUCT_FLD(field_flags, 0),
  479. STRUCT_FLD(old_name, ""),
  480. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  481. END_OF_ST_FIELD_INFO
  482. };
  483. /*******************************************************************//**
  484. Read data from cache buffer and fill the INFORMATION_SCHEMA.innodb_trx
  485. table with it.
  486. @return 0 on success */
  487. static
  488. int
  489. fill_innodb_trx_from_cache(
  490. /*=======================*/
  491. trx_i_s_cache_t* cache, /*!< in: cache to read from */
  492. THD* thd, /*!< in: used to call
  493. schema_table_store_record() */
  494. TABLE* table) /*!< in/out: fill this table */
  495. {
  496. Field** fields;
  497. ulint rows_num;
  498. char lock_id[TRX_I_S_LOCK_ID_MAX_LEN + 1];
  499. ulint i;
  500. DBUG_ENTER("fill_innodb_trx_from_cache");
  501. fields = table->field;
  502. rows_num = trx_i_s_cache_get_rows_used(cache,
  503. I_S_INNODB_TRX);
  504. for (i = 0; i < rows_num; i++) {
  505. i_s_trx_row_t* row;
  506. char trx_id[TRX_ID_MAX_LEN + 1];
  507. row = (i_s_trx_row_t*)
  508. trx_i_s_cache_get_nth_row(
  509. cache, I_S_INNODB_TRX, i);
  510. /* trx_id */
  511. ut_snprintf(trx_id, sizeof(trx_id), TRX_ID_FMT, row->trx_id);
  512. OK(field_store_string(fields[IDX_TRX_ID], trx_id));
  513. /* trx_state */
  514. OK(field_store_string(fields[IDX_TRX_STATE],
  515. row->trx_state));
  516. /* trx_started */
  517. OK(field_store_time_t(fields[IDX_TRX_STARTED],
  518. (time_t) row->trx_started));
  519. /* trx_requested_lock_id */
  520. /* trx_wait_started */
  521. if (row->trx_wait_started != 0) {
  522. OK(field_store_string(
  523. fields[IDX_TRX_REQUESTED_LOCK_ID],
  524. trx_i_s_create_lock_id(
  525. row->requested_lock_row,
  526. lock_id, sizeof(lock_id))));
  527. /* field_store_string() sets it no notnull */
  528. OK(field_store_time_t(
  529. fields[IDX_TRX_WAIT_STARTED],
  530. (time_t) row->trx_wait_started));
  531. fields[IDX_TRX_WAIT_STARTED]->set_notnull();
  532. } else {
  533. fields[IDX_TRX_REQUESTED_LOCK_ID]->set_null();
  534. fields[IDX_TRX_WAIT_STARTED]->set_null();
  535. }
  536. /* trx_weight */
  537. OK(fields[IDX_TRX_WEIGHT]->store((longlong) row->trx_weight,
  538. true));
  539. /* trx_mysql_thread_id */
  540. OK(fields[IDX_TRX_MYSQL_THREAD_ID]->store(
  541. static_cast<double>(row->trx_mysql_thread_id)));
  542. /* trx_query */
  543. if (row->trx_query) {
  544. /* store will do appropriate character set
  545. conversion check */
  546. fields[IDX_TRX_QUERY]->store(
  547. row->trx_query,
  548. static_cast<uint>(strlen(row->trx_query)),
  549. row->trx_query_cs);
  550. fields[IDX_TRX_QUERY]->set_notnull();
  551. } else {
  552. fields[IDX_TRX_QUERY]->set_null();
  553. }
  554. /* trx_operation_state */
  555. OK(field_store_string(fields[IDX_TRX_OPERATION_STATE],
  556. row->trx_operation_state));
  557. /* trx_tables_in_use */
  558. OK(fields[IDX_TRX_TABLES_IN_USE]->store(
  559. (longlong) row->trx_tables_in_use, true));
  560. /* trx_tables_locked */
  561. OK(fields[IDX_TRX_TABLES_LOCKED]->store(
  562. (longlong) row->trx_tables_locked, true));
  563. /* trx_lock_structs */
  564. OK(fields[IDX_TRX_LOCK_STRUCTS]->store(
  565. (longlong) row->trx_lock_structs, true));
  566. /* trx_lock_memory_bytes */
  567. OK(fields[IDX_TRX_LOCK_MEMORY_BYTES]->store(
  568. (longlong) row->trx_lock_memory_bytes, true));
  569. /* trx_rows_locked */
  570. OK(fields[IDX_TRX_ROWS_LOCKED]->store(
  571. (longlong) row->trx_rows_locked, true));
  572. /* trx_rows_modified */
  573. OK(fields[IDX_TRX_ROWS_MODIFIED]->store(
  574. (longlong) row->trx_rows_modified, true));
  575. /* trx_concurrency_tickets */
  576. OK(fields[IDX_TRX_CONNCURRENCY_TICKETS]->store(
  577. (longlong) row->trx_concurrency_tickets, true));
  578. /* trx_isolation_level */
  579. OK(field_store_string(fields[IDX_TRX_ISOLATION_LEVEL],
  580. row->trx_isolation_level));
  581. /* trx_unique_checks */
  582. OK(fields[IDX_TRX_UNIQUE_CHECKS]->store(
  583. static_cast<double>(row->trx_unique_checks)));
  584. /* trx_foreign_key_checks */
  585. OK(fields[IDX_TRX_FOREIGN_KEY_CHECKS]->store(
  586. static_cast<double>(row->trx_foreign_key_checks)));
  587. /* trx_last_foreign_key_error */
  588. OK(field_store_string(fields[IDX_TRX_LAST_FOREIGN_KEY_ERROR],
  589. row->trx_foreign_key_error));
  590. /* trx_adaptive_hash_latched */
  591. OK(fields[IDX_TRX_ADAPTIVE_HASH_LATCHED]->store(
  592. static_cast<double>(row->trx_has_search_latch)));
  593. /* trx_adaptive_hash_timeout */
  594. OK(fields[IDX_TRX_ADAPTIVE_HASH_TIMEOUT]->store(
  595. (longlong) row->trx_search_latch_timeout, true));
  596. /* trx_is_read_only*/
  597. OK(fields[IDX_TRX_READ_ONLY]->store(
  598. (longlong) row->trx_is_read_only, true));
  599. /* trx_is_autocommit_non_locking */
  600. OK(fields[IDX_TRX_AUTOCOMMIT_NON_LOCKING]->store(
  601. (longlong) row->trx_is_autocommit_non_locking,
  602. true));
  603. OK(schema_table_store_record(thd, table));
  604. }
  605. DBUG_RETURN(0);
  606. }
  607. /*******************************************************************//**
  608. Bind the dynamic table INFORMATION_SCHEMA.innodb_trx
  609. @return 0 on success */
  610. static
  611. int
  612. innodb_trx_init(
  613. /*============*/
  614. void* p) /*!< in/out: table schema object */
  615. {
  616. ST_SCHEMA_TABLE* schema;
  617. DBUG_ENTER("innodb_trx_init");
  618. schema = (ST_SCHEMA_TABLE*) p;
  619. schema->fields_info = innodb_trx_fields_info;
  620. schema->fill_table = trx_i_s_common_fill_table;
  621. DBUG_RETURN(0);
  622. }
  623. static struct st_mysql_information_schema i_s_info =
  624. {
  625. MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION
  626. };
  627. UNIV_INTERN struct st_maria_plugin i_s_innodb_trx =
  628. {
  629. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  630. /* int */
  631. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  632. /* pointer to type-specific plugin descriptor */
  633. /* void* */
  634. STRUCT_FLD(info, &i_s_info),
  635. /* plugin name */
  636. /* const char* */
  637. STRUCT_FLD(name, "INNODB_TRX"),
  638. /* plugin author (for SHOW PLUGINS) */
  639. /* const char* */
  640. STRUCT_FLD(author, plugin_author),
  641. /* general descriptive text (for SHOW PLUGINS) */
  642. /* const char* */
  643. STRUCT_FLD(descr, "InnoDB transactions"),
  644. /* the plugin license (PLUGIN_LICENSE_XXX) */
  645. /* int */
  646. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  647. /* the function to invoke when plugin is loaded */
  648. /* int (*)(void*); */
  649. STRUCT_FLD(init, innodb_trx_init),
  650. /* the function to invoke when plugin is unloaded */
  651. /* int (*)(void*); */
  652. STRUCT_FLD(deinit, i_s_common_deinit),
  653. /* plugin version (for SHOW PLUGINS) */
  654. /* unsigned int */
  655. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  656. /* struct st_mysql_show_var* */
  657. STRUCT_FLD(status_vars, NULL),
  658. /* struct st_mysql_sys_var** */
  659. STRUCT_FLD(system_vars, NULL),
  660. /* Maria extension */
  661. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  662. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  663. };
  664. /* Fields of the dynamic table INFORMATION_SCHEMA.innodb_locks */
  665. static ST_FIELD_INFO innodb_locks_fields_info[] =
  666. {
  667. #define IDX_LOCK_ID 0
  668. {STRUCT_FLD(field_name, "lock_id"),
  669. STRUCT_FLD(field_length, TRX_I_S_LOCK_ID_MAX_LEN + 1),
  670. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  671. STRUCT_FLD(value, 0),
  672. STRUCT_FLD(field_flags, 0),
  673. STRUCT_FLD(old_name, ""),
  674. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  675. #define IDX_LOCK_TRX_ID 1
  676. {STRUCT_FLD(field_name, "lock_trx_id"),
  677. STRUCT_FLD(field_length, TRX_ID_MAX_LEN + 1),
  678. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  679. STRUCT_FLD(value, 0),
  680. STRUCT_FLD(field_flags, 0),
  681. STRUCT_FLD(old_name, ""),
  682. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  683. #define IDX_LOCK_MODE 2
  684. {STRUCT_FLD(field_name, "lock_mode"),
  685. /* S[,GAP] X[,GAP] IS[,GAP] IX[,GAP] AUTO_INC UNKNOWN */
  686. STRUCT_FLD(field_length, 32),
  687. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  688. STRUCT_FLD(value, 0),
  689. STRUCT_FLD(field_flags, 0),
  690. STRUCT_FLD(old_name, ""),
  691. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  692. #define IDX_LOCK_TYPE 3
  693. {STRUCT_FLD(field_name, "lock_type"),
  694. STRUCT_FLD(field_length, 32 /* RECORD|TABLE|UNKNOWN */),
  695. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  696. STRUCT_FLD(value, 0),
  697. STRUCT_FLD(field_flags, 0),
  698. STRUCT_FLD(old_name, ""),
  699. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  700. #define IDX_LOCK_TABLE 4
  701. {STRUCT_FLD(field_name, "lock_table"),
  702. STRUCT_FLD(field_length, 1024),
  703. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  704. STRUCT_FLD(value, 0),
  705. STRUCT_FLD(field_flags, 0),
  706. STRUCT_FLD(old_name, ""),
  707. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  708. #define IDX_LOCK_INDEX 5
  709. {STRUCT_FLD(field_name, "lock_index"),
  710. STRUCT_FLD(field_length, 1024),
  711. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  712. STRUCT_FLD(value, 0),
  713. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  714. STRUCT_FLD(old_name, ""),
  715. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  716. #define IDX_LOCK_SPACE 6
  717. {STRUCT_FLD(field_name, "lock_space"),
  718. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  719. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  720. STRUCT_FLD(value, 0),
  721. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL),
  722. STRUCT_FLD(old_name, ""),
  723. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  724. #define IDX_LOCK_PAGE 7
  725. {STRUCT_FLD(field_name, "lock_page"),
  726. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  727. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  728. STRUCT_FLD(value, 0),
  729. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL),
  730. STRUCT_FLD(old_name, ""),
  731. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  732. #define IDX_LOCK_REC 8
  733. {STRUCT_FLD(field_name, "lock_rec"),
  734. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  735. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  736. STRUCT_FLD(value, 0),
  737. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL),
  738. STRUCT_FLD(old_name, ""),
  739. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  740. #define IDX_LOCK_DATA 9
  741. {STRUCT_FLD(field_name, "lock_data"),
  742. STRUCT_FLD(field_length, TRX_I_S_LOCK_DATA_MAX_LEN),
  743. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  744. STRUCT_FLD(value, 0),
  745. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  746. STRUCT_FLD(old_name, ""),
  747. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  748. END_OF_ST_FIELD_INFO
  749. };
  750. /*******************************************************************//**
  751. Read data from cache buffer and fill the INFORMATION_SCHEMA.innodb_locks
  752. table with it.
  753. @return 0 on success */
  754. static
  755. int
  756. fill_innodb_locks_from_cache(
  757. /*=========================*/
  758. trx_i_s_cache_t* cache, /*!< in: cache to read from */
  759. THD* thd, /*!< in: MySQL client connection */
  760. TABLE* table) /*!< in/out: fill this table */
  761. {
  762. Field** fields;
  763. ulint rows_num;
  764. char lock_id[TRX_I_S_LOCK_ID_MAX_LEN + 1];
  765. ulint i;
  766. DBUG_ENTER("fill_innodb_locks_from_cache");
  767. fields = table->field;
  768. rows_num = trx_i_s_cache_get_rows_used(cache,
  769. I_S_INNODB_LOCKS);
  770. for (i = 0; i < rows_num; i++) {
  771. i_s_locks_row_t* row;
  772. char buf[MAX_FULL_NAME_LEN + 1];
  773. const char* bufend;
  774. char lock_trx_id[TRX_ID_MAX_LEN + 1];
  775. row = (i_s_locks_row_t*)
  776. trx_i_s_cache_get_nth_row(
  777. cache, I_S_INNODB_LOCKS, i);
  778. /* lock_id */
  779. trx_i_s_create_lock_id(row, lock_id, sizeof(lock_id));
  780. OK(field_store_string(fields[IDX_LOCK_ID],
  781. lock_id));
  782. /* lock_trx_id */
  783. ut_snprintf(lock_trx_id, sizeof(lock_trx_id),
  784. TRX_ID_FMT, row->lock_trx_id);
  785. OK(field_store_string(fields[IDX_LOCK_TRX_ID], lock_trx_id));
  786. /* lock_mode */
  787. OK(field_store_string(fields[IDX_LOCK_MODE],
  788. row->lock_mode));
  789. /* lock_type */
  790. OK(field_store_string(fields[IDX_LOCK_TYPE],
  791. row->lock_type));
  792. /* lock_table */
  793. bufend = innobase_convert_name(buf, sizeof(buf),
  794. row->lock_table,
  795. strlen(row->lock_table),
  796. thd, TRUE);
  797. OK(fields[IDX_LOCK_TABLE]->store(
  798. buf, static_cast<uint>(bufend - buf),
  799. system_charset_info));
  800. /* lock_index */
  801. if (row->lock_index != NULL) {
  802. OK(field_store_index_name(fields[IDX_LOCK_INDEX],
  803. row->lock_index));
  804. } else {
  805. fields[IDX_LOCK_INDEX]->set_null();
  806. }
  807. /* lock_space */
  808. OK(field_store_ulint(fields[IDX_LOCK_SPACE],
  809. row->lock_space));
  810. /* lock_page */
  811. OK(field_store_ulint(fields[IDX_LOCK_PAGE],
  812. row->lock_page));
  813. /* lock_rec */
  814. OK(field_store_ulint(fields[IDX_LOCK_REC],
  815. row->lock_rec));
  816. /* lock_data */
  817. OK(field_store_string(fields[IDX_LOCK_DATA],
  818. row->lock_data));
  819. OK(schema_table_store_record(thd, table));
  820. }
  821. DBUG_RETURN(0);
  822. }
  823. /*******************************************************************//**
  824. Bind the dynamic table INFORMATION_SCHEMA.innodb_locks
  825. @return 0 on success */
  826. static
  827. int
  828. innodb_locks_init(
  829. /*==============*/
  830. void* p) /*!< in/out: table schema object */
  831. {
  832. ST_SCHEMA_TABLE* schema;
  833. DBUG_ENTER("innodb_locks_init");
  834. schema = (ST_SCHEMA_TABLE*) p;
  835. schema->fields_info = innodb_locks_fields_info;
  836. schema->fill_table = trx_i_s_common_fill_table;
  837. DBUG_RETURN(0);
  838. }
  839. UNIV_INTERN struct st_maria_plugin i_s_innodb_locks =
  840. {
  841. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  842. /* int */
  843. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  844. /* pointer to type-specific plugin descriptor */
  845. /* void* */
  846. STRUCT_FLD(info, &i_s_info),
  847. /* plugin name */
  848. /* const char* */
  849. STRUCT_FLD(name, "INNODB_LOCKS"),
  850. /* plugin author (for SHOW PLUGINS) */
  851. /* const char* */
  852. STRUCT_FLD(author, plugin_author),
  853. /* general descriptive text (for SHOW PLUGINS) */
  854. /* const char* */
  855. STRUCT_FLD(descr, "InnoDB conflicting locks"),
  856. /* the plugin license (PLUGIN_LICENSE_XXX) */
  857. /* int */
  858. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  859. /* the function to invoke when plugin is loaded */
  860. /* int (*)(void*); */
  861. STRUCT_FLD(init, innodb_locks_init),
  862. /* the function to invoke when plugin is unloaded */
  863. /* int (*)(void*); */
  864. STRUCT_FLD(deinit, i_s_common_deinit),
  865. /* plugin version (for SHOW PLUGINS) */
  866. /* unsigned int */
  867. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  868. /* struct st_mysql_show_var* */
  869. STRUCT_FLD(status_vars, NULL),
  870. /* struct st_mysql_sys_var** */
  871. STRUCT_FLD(system_vars, NULL),
  872. /* Maria extension */
  873. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  874. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  875. };
  876. /* Fields of the dynamic table INFORMATION_SCHEMA.innodb_lock_waits */
  877. static ST_FIELD_INFO innodb_lock_waits_fields_info[] =
  878. {
  879. #define IDX_REQUESTING_TRX_ID 0
  880. {STRUCT_FLD(field_name, "requesting_trx_id"),
  881. STRUCT_FLD(field_length, TRX_ID_MAX_LEN + 1),
  882. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  883. STRUCT_FLD(value, 0),
  884. STRUCT_FLD(field_flags, 0),
  885. STRUCT_FLD(old_name, ""),
  886. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  887. #define IDX_REQUESTED_LOCK_ID 1
  888. {STRUCT_FLD(field_name, "requested_lock_id"),
  889. STRUCT_FLD(field_length, TRX_I_S_LOCK_ID_MAX_LEN + 1),
  890. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  891. STRUCT_FLD(value, 0),
  892. STRUCT_FLD(field_flags, 0),
  893. STRUCT_FLD(old_name, ""),
  894. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  895. #define IDX_BLOCKING_TRX_ID 2
  896. {STRUCT_FLD(field_name, "blocking_trx_id"),
  897. STRUCT_FLD(field_length, TRX_ID_MAX_LEN + 1),
  898. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  899. STRUCT_FLD(value, 0),
  900. STRUCT_FLD(field_flags, 0),
  901. STRUCT_FLD(old_name, ""),
  902. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  903. #define IDX_BLOCKING_LOCK_ID 3
  904. {STRUCT_FLD(field_name, "blocking_lock_id"),
  905. STRUCT_FLD(field_length, TRX_I_S_LOCK_ID_MAX_LEN + 1),
  906. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  907. STRUCT_FLD(value, 0),
  908. STRUCT_FLD(field_flags, 0),
  909. STRUCT_FLD(old_name, ""),
  910. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  911. END_OF_ST_FIELD_INFO
  912. };
  913. /*******************************************************************//**
  914. Read data from cache buffer and fill the
  915. INFORMATION_SCHEMA.innodb_lock_waits table with it.
  916. @return 0 on success */
  917. static
  918. int
  919. fill_innodb_lock_waits_from_cache(
  920. /*==============================*/
  921. trx_i_s_cache_t* cache, /*!< in: cache to read from */
  922. THD* thd, /*!< in: used to call
  923. schema_table_store_record() */
  924. TABLE* table) /*!< in/out: fill this table */
  925. {
  926. Field** fields;
  927. ulint rows_num;
  928. char requested_lock_id[TRX_I_S_LOCK_ID_MAX_LEN + 1];
  929. char blocking_lock_id[TRX_I_S_LOCK_ID_MAX_LEN + 1];
  930. ulint i;
  931. DBUG_ENTER("fill_innodb_lock_waits_from_cache");
  932. fields = table->field;
  933. rows_num = trx_i_s_cache_get_rows_used(cache,
  934. I_S_INNODB_LOCK_WAITS);
  935. for (i = 0; i < rows_num; i++) {
  936. i_s_lock_waits_row_t* row;
  937. char requesting_trx_id[TRX_ID_MAX_LEN + 1];
  938. char blocking_trx_id[TRX_ID_MAX_LEN + 1];
  939. row = (i_s_lock_waits_row_t*)
  940. trx_i_s_cache_get_nth_row(
  941. cache, I_S_INNODB_LOCK_WAITS, i);
  942. /* requesting_trx_id */
  943. ut_snprintf(requesting_trx_id, sizeof(requesting_trx_id),
  944. TRX_ID_FMT, row->requested_lock_row->lock_trx_id);
  945. OK(field_store_string(fields[IDX_REQUESTING_TRX_ID],
  946. requesting_trx_id));
  947. /* requested_lock_id */
  948. OK(field_store_string(
  949. fields[IDX_REQUESTED_LOCK_ID],
  950. trx_i_s_create_lock_id(
  951. row->requested_lock_row,
  952. requested_lock_id,
  953. sizeof(requested_lock_id))));
  954. /* blocking_trx_id */
  955. ut_snprintf(blocking_trx_id, sizeof(blocking_trx_id),
  956. TRX_ID_FMT, row->blocking_lock_row->lock_trx_id);
  957. OK(field_store_string(fields[IDX_BLOCKING_TRX_ID],
  958. blocking_trx_id));
  959. /* blocking_lock_id */
  960. OK(field_store_string(
  961. fields[IDX_BLOCKING_LOCK_ID],
  962. trx_i_s_create_lock_id(
  963. row->blocking_lock_row,
  964. blocking_lock_id,
  965. sizeof(blocking_lock_id))));
  966. OK(schema_table_store_record(thd, table));
  967. }
  968. DBUG_RETURN(0);
  969. }
  970. /*******************************************************************//**
  971. Bind the dynamic table INFORMATION_SCHEMA.innodb_lock_waits
  972. @return 0 on success */
  973. static
  974. int
  975. innodb_lock_waits_init(
  976. /*===================*/
  977. void* p) /*!< in/out: table schema object */
  978. {
  979. ST_SCHEMA_TABLE* schema;
  980. DBUG_ENTER("innodb_lock_waits_init");
  981. schema = (ST_SCHEMA_TABLE*) p;
  982. schema->fields_info = innodb_lock_waits_fields_info;
  983. schema->fill_table = trx_i_s_common_fill_table;
  984. DBUG_RETURN(0);
  985. }
  986. UNIV_INTERN struct st_maria_plugin i_s_innodb_lock_waits =
  987. {
  988. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  989. /* int */
  990. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  991. /* pointer to type-specific plugin descriptor */
  992. /* void* */
  993. STRUCT_FLD(info, &i_s_info),
  994. /* plugin name */
  995. /* const char* */
  996. STRUCT_FLD(name, "INNODB_LOCK_WAITS"),
  997. /* plugin author (for SHOW PLUGINS) */
  998. /* const char* */
  999. STRUCT_FLD(author, plugin_author),
  1000. /* general descriptive text (for SHOW PLUGINS) */
  1001. /* const char* */
  1002. STRUCT_FLD(descr, "InnoDB which lock is blocking which"),
  1003. /* the plugin license (PLUGIN_LICENSE_XXX) */
  1004. /* int */
  1005. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  1006. /* the function to invoke when plugin is loaded */
  1007. /* int (*)(void*); */
  1008. STRUCT_FLD(init, innodb_lock_waits_init),
  1009. /* the function to invoke when plugin is unloaded */
  1010. /* int (*)(void*); */
  1011. STRUCT_FLD(deinit, i_s_common_deinit),
  1012. /* plugin version (for SHOW PLUGINS) */
  1013. /* unsigned int */
  1014. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  1015. /* struct st_mysql_show_var* */
  1016. STRUCT_FLD(status_vars, NULL),
  1017. /* struct st_mysql_sys_var** */
  1018. STRUCT_FLD(system_vars, NULL),
  1019. /* Maria extension */
  1020. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  1021. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  1022. };
  1023. /*******************************************************************//**
  1024. Common function to fill any of the dynamic tables:
  1025. INFORMATION_SCHEMA.innodb_trx
  1026. INFORMATION_SCHEMA.innodb_locks
  1027. INFORMATION_SCHEMA.innodb_lock_waits
  1028. @return 0 on success */
  1029. static
  1030. int
  1031. trx_i_s_common_fill_table(
  1032. /*======================*/
  1033. THD* thd, /*!< in: thread */
  1034. TABLE_LIST* tables, /*!< in/out: tables to fill */
  1035. Item* ) /*!< in: condition (not used) */
  1036. {
  1037. const char* table_name;
  1038. int ret;
  1039. trx_i_s_cache_t* cache;
  1040. DBUG_ENTER("trx_i_s_common_fill_table");
  1041. /* deny access to non-superusers */
  1042. if (check_global_access(thd, PROCESS_ACL)) {
  1043. DBUG_RETURN(0);
  1044. }
  1045. /* minimize the number of places where global variables are
  1046. referenced */
  1047. cache = trx_i_s_cache;
  1048. /* which table we have to fill? */
  1049. table_name = tables->schema_table_name;
  1050. /* or table_name = tables->schema_table->table_name; */
  1051. RETURN_IF_INNODB_NOT_STARTED(table_name);
  1052. /* update the cache */
  1053. trx_i_s_cache_start_write(cache);
  1054. trx_i_s_possibly_fetch_data_into_cache(cache);
  1055. trx_i_s_cache_end_write(cache);
  1056. if (trx_i_s_cache_is_truncated(cache)) {
  1057. /* XXX show warning to user if possible */
  1058. fprintf(stderr, "Warning: data in %s truncated due to "
  1059. "memory limit of %d bytes\n", table_name,
  1060. TRX_I_S_MEM_LIMIT);
  1061. }
  1062. ret = 0;
  1063. trx_i_s_cache_start_read(cache);
  1064. if (innobase_strcasecmp(table_name, "innodb_trx") == 0) {
  1065. if (fill_innodb_trx_from_cache(
  1066. cache, thd, tables->table) != 0) {
  1067. ret = 1;
  1068. }
  1069. } else if (innobase_strcasecmp(table_name, "innodb_locks") == 0) {
  1070. if (fill_innodb_locks_from_cache(
  1071. cache, thd, tables->table) != 0) {
  1072. ret = 1;
  1073. }
  1074. } else if (innobase_strcasecmp(table_name, "innodb_lock_waits") == 0) {
  1075. if (fill_innodb_lock_waits_from_cache(
  1076. cache, thd, tables->table) != 0) {
  1077. ret = 1;
  1078. }
  1079. } else {
  1080. /* huh! what happened!? */
  1081. fprintf(stderr,
  1082. "InnoDB: trx_i_s_common_fill_table() was "
  1083. "called to fill unknown table: %s.\n"
  1084. "This function only knows how to fill "
  1085. "innodb_trx, innodb_locks and "
  1086. "innodb_lock_waits tables.\n", table_name);
  1087. ret = 1;
  1088. }
  1089. trx_i_s_cache_end_read(cache);
  1090. #if 0
  1091. DBUG_RETURN(ret);
  1092. #else
  1093. /* if this function returns something else than 0 then a
  1094. deadlock occurs between the mysqld server and mysql client,
  1095. see http://bugs.mysql.com/29900 ; when that bug is resolved
  1096. we can enable the DBUG_RETURN(ret) above */
  1097. ret++; // silence a gcc46 warning
  1098. DBUG_RETURN(0);
  1099. #endif
  1100. }
  1101. /* Fields of the dynamic table information_schema.innodb_cmp. */
  1102. static ST_FIELD_INFO i_s_cmp_fields_info[] =
  1103. {
  1104. {STRUCT_FLD(field_name, "page_size"),
  1105. STRUCT_FLD(field_length, 5),
  1106. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  1107. STRUCT_FLD(value, 0),
  1108. STRUCT_FLD(field_flags, 0),
  1109. STRUCT_FLD(old_name, "Compressed Page Size"),
  1110. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1111. {STRUCT_FLD(field_name, "compress_ops"),
  1112. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  1113. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  1114. STRUCT_FLD(value, 0),
  1115. STRUCT_FLD(field_flags, 0),
  1116. STRUCT_FLD(old_name, "Total Number of Compressions"),
  1117. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1118. {STRUCT_FLD(field_name, "compress_ops_ok"),
  1119. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  1120. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  1121. STRUCT_FLD(value, 0),
  1122. STRUCT_FLD(field_flags, 0),
  1123. STRUCT_FLD(old_name, "Total Number of"
  1124. " Successful Compressions"),
  1125. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1126. {STRUCT_FLD(field_name, "compress_time"),
  1127. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  1128. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  1129. STRUCT_FLD(value, 0),
  1130. STRUCT_FLD(field_flags, 0),
  1131. STRUCT_FLD(old_name, "Total Duration of Compressions,"
  1132. " in Seconds"),
  1133. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1134. {STRUCT_FLD(field_name, "uncompress_ops"),
  1135. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  1136. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  1137. STRUCT_FLD(value, 0),
  1138. STRUCT_FLD(field_flags, 0),
  1139. STRUCT_FLD(old_name, "Total Number of Decompressions"),
  1140. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1141. {STRUCT_FLD(field_name, "uncompress_time"),
  1142. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  1143. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  1144. STRUCT_FLD(value, 0),
  1145. STRUCT_FLD(field_flags, 0),
  1146. STRUCT_FLD(old_name, "Total Duration of Decompressions,"
  1147. " in Seconds"),
  1148. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1149. END_OF_ST_FIELD_INFO
  1150. };
  1151. /*******************************************************************//**
  1152. Fill the dynamic table information_schema.innodb_cmp or
  1153. innodb_cmp_reset.
  1154. @return 0 on success, 1 on failure */
  1155. static
  1156. int
  1157. i_s_cmp_fill_low(
  1158. /*=============*/
  1159. THD* thd, /*!< in: thread */
  1160. TABLE_LIST* tables, /*!< in/out: tables to fill */
  1161. Item* , /*!< in: condition (ignored) */
  1162. ibool reset) /*!< in: TRUE=reset cumulated counts */
  1163. {
  1164. TABLE* table = (TABLE*) tables->table;
  1165. int status = 0;
  1166. DBUG_ENTER("i_s_cmp_fill_low");
  1167. /* deny access to non-superusers */
  1168. if (check_global_access(thd, PROCESS_ACL)) {
  1169. DBUG_RETURN(0);
  1170. }
  1171. RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
  1172. for (uint i = 0; i < PAGE_ZIP_SSIZE_MAX; i++) {
  1173. page_zip_stat_t* zip_stat = &page_zip_stat[i];
  1174. table->field[0]->store(UNIV_ZIP_SIZE_MIN << i);
  1175. /* The cumulated counts are not protected by any
  1176. mutex. Thus, some operation in page0zip.cc could
  1177. increment a counter between the time we read it and
  1178. clear it. We could introduce mutex protection, but it
  1179. could cause a measureable performance hit in
  1180. page0zip.cc. */
  1181. table->field[1]->store(zip_stat->compressed, true);
  1182. table->field[2]->store(zip_stat->compressed_ok, true);
  1183. table->field[3]->store(zip_stat->compressed_usec / 1000000,
  1184. true);
  1185. table->field[4]->store(zip_stat->decompressed, true);
  1186. table->field[5]->store(zip_stat->decompressed_usec / 1000000,
  1187. true);
  1188. if (reset) {
  1189. new (zip_stat) page_zip_stat_t();
  1190. }
  1191. if (schema_table_store_record(thd, table)) {
  1192. status = 1;
  1193. break;
  1194. }
  1195. }
  1196. DBUG_RETURN(status);
  1197. }
  1198. /*******************************************************************//**
  1199. Fill the dynamic table information_schema.innodb_cmp.
  1200. @return 0 on success, 1 on failure */
  1201. static
  1202. int
  1203. i_s_cmp_fill(
  1204. /*=========*/
  1205. THD* thd, /*!< in: thread */
  1206. TABLE_LIST* tables, /*!< in/out: tables to fill */
  1207. Item* cond) /*!< in: condition (ignored) */
  1208. {
  1209. return(i_s_cmp_fill_low(thd, tables, cond, FALSE));
  1210. }
  1211. /*******************************************************************//**
  1212. Fill the dynamic table information_schema.innodb_cmp_reset.
  1213. @return 0 on success, 1 on failure */
  1214. static
  1215. int
  1216. i_s_cmp_reset_fill(
  1217. /*===============*/
  1218. THD* thd, /*!< in: thread */
  1219. TABLE_LIST* tables, /*!< in/out: tables to fill */
  1220. Item* cond) /*!< in: condition (ignored) */
  1221. {
  1222. return(i_s_cmp_fill_low(thd, tables, cond, TRUE));
  1223. }
  1224. /*******************************************************************//**
  1225. Bind the dynamic table information_schema.innodb_cmp.
  1226. @return 0 on success */
  1227. static
  1228. int
  1229. i_s_cmp_init(
  1230. /*=========*/
  1231. void* p) /*!< in/out: table schema object */
  1232. {
  1233. DBUG_ENTER("i_s_cmp_init");
  1234. ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
  1235. schema->fields_info = i_s_cmp_fields_info;
  1236. schema->fill_table = i_s_cmp_fill;
  1237. DBUG_RETURN(0);
  1238. }
  1239. /*******************************************************************//**
  1240. Bind the dynamic table information_schema.innodb_cmp_reset.
  1241. @return 0 on success */
  1242. static
  1243. int
  1244. i_s_cmp_reset_init(
  1245. /*===============*/
  1246. void* p) /*!< in/out: table schema object */
  1247. {
  1248. DBUG_ENTER("i_s_cmp_reset_init");
  1249. ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
  1250. schema->fields_info = i_s_cmp_fields_info;
  1251. schema->fill_table = i_s_cmp_reset_fill;
  1252. DBUG_RETURN(0);
  1253. }
  1254. UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp =
  1255. {
  1256. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  1257. /* int */
  1258. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  1259. /* pointer to type-specific plugin descriptor */
  1260. /* void* */
  1261. STRUCT_FLD(info, &i_s_info),
  1262. /* plugin name */
  1263. /* const char* */
  1264. STRUCT_FLD(name, "INNODB_CMP"),
  1265. /* plugin author (for SHOW PLUGINS) */
  1266. /* const char* */
  1267. STRUCT_FLD(author, plugin_author),
  1268. /* general descriptive text (for SHOW PLUGINS) */
  1269. /* const char* */
  1270. STRUCT_FLD(descr, "Statistics for the InnoDB compression"),
  1271. /* the plugin license (PLUGIN_LICENSE_XXX) */
  1272. /* int */
  1273. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  1274. /* the function to invoke when plugin is loaded */
  1275. /* int (*)(void*); */
  1276. STRUCT_FLD(init, i_s_cmp_init),
  1277. /* the function to invoke when plugin is unloaded */
  1278. /* int (*)(void*); */
  1279. STRUCT_FLD(deinit, i_s_common_deinit),
  1280. /* plugin version (for SHOW PLUGINS) */
  1281. /* unsigned int */
  1282. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  1283. /* struct st_mysql_show_var* */
  1284. STRUCT_FLD(status_vars, NULL),
  1285. /* struct st_mysql_sys_var** */
  1286. STRUCT_FLD(system_vars, NULL),
  1287. /* Maria extension */
  1288. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  1289. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  1290. };
  1291. UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp_reset =
  1292. {
  1293. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  1294. /* int */
  1295. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  1296. /* pointer to type-specific plugin descriptor */
  1297. /* void* */
  1298. STRUCT_FLD(info, &i_s_info),
  1299. /* plugin name */
  1300. /* const char* */
  1301. STRUCT_FLD(name, "INNODB_CMP_RESET"),
  1302. /* plugin author (for SHOW PLUGINS) */
  1303. /* const char* */
  1304. STRUCT_FLD(author, plugin_author),
  1305. /* general descriptive text (for SHOW PLUGINS) */
  1306. /* const char* */
  1307. STRUCT_FLD(descr, "Statistics for the InnoDB compression;"
  1308. " reset cumulated counts"),
  1309. /* the plugin license (PLUGIN_LICENSE_XXX) */
  1310. /* int */
  1311. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  1312. /* the function to invoke when plugin is loaded */
  1313. /* int (*)(void*); */
  1314. STRUCT_FLD(init, i_s_cmp_reset_init),
  1315. /* the function to invoke when plugin is unloaded */
  1316. /* int (*)(void*); */
  1317. STRUCT_FLD(deinit, i_s_common_deinit),
  1318. /* plugin version (for SHOW PLUGINS) */
  1319. /* unsigned int */
  1320. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  1321. /* struct st_mysql_show_var* */
  1322. STRUCT_FLD(status_vars, NULL),
  1323. /* struct st_mysql_sys_var** */
  1324. STRUCT_FLD(system_vars, NULL),
  1325. /* Maria extension */
  1326. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  1327. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  1328. };
  1329. /* Fields of the dynamic tables
  1330. information_schema.innodb_cmp_per_index and
  1331. information_schema.innodb_cmp_per_index_reset. */
  1332. static ST_FIELD_INFO i_s_cmp_per_index_fields_info[] =
  1333. {
  1334. #define IDX_DATABASE_NAME 0
  1335. {STRUCT_FLD(field_name, "database_name"),
  1336. STRUCT_FLD(field_length, 192),
  1337. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  1338. STRUCT_FLD(value, 0),
  1339. STRUCT_FLD(field_flags, 0),
  1340. STRUCT_FLD(old_name, ""),
  1341. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1342. #define IDX_TABLE_NAME 1
  1343. {STRUCT_FLD(field_name, "table_name"),
  1344. STRUCT_FLD(field_length, 192),
  1345. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  1346. STRUCT_FLD(value, 0),
  1347. STRUCT_FLD(field_flags, 0),
  1348. STRUCT_FLD(old_name, ""),
  1349. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1350. #define IDX_INDEX_NAME 2
  1351. {STRUCT_FLD(field_name, "index_name"),
  1352. STRUCT_FLD(field_length, 192),
  1353. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  1354. STRUCT_FLD(value, 0),
  1355. STRUCT_FLD(field_flags, 0),
  1356. STRUCT_FLD(old_name, ""),
  1357. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1358. #define IDX_COMPRESS_OPS 3
  1359. {STRUCT_FLD(field_name, "compress_ops"),
  1360. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  1361. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  1362. STRUCT_FLD(value, 0),
  1363. STRUCT_FLD(field_flags, 0),
  1364. STRUCT_FLD(old_name, ""),
  1365. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1366. #define IDX_COMPRESS_OPS_OK 4
  1367. {STRUCT_FLD(field_name, "compress_ops_ok"),
  1368. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  1369. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  1370. STRUCT_FLD(value, 0),
  1371. STRUCT_FLD(field_flags, 0),
  1372. STRUCT_FLD(old_name, ""),
  1373. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1374. #define IDX_COMPRESS_TIME 5
  1375. {STRUCT_FLD(field_name, "compress_time"),
  1376. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  1377. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  1378. STRUCT_FLD(value, 0),
  1379. STRUCT_FLD(field_flags, 0),
  1380. STRUCT_FLD(old_name, ""),
  1381. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1382. #define IDX_UNCOMPRESS_OPS 6
  1383. {STRUCT_FLD(field_name, "uncompress_ops"),
  1384. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  1385. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  1386. STRUCT_FLD(value, 0),
  1387. STRUCT_FLD(field_flags, 0),
  1388. STRUCT_FLD(old_name, ""),
  1389. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1390. #define IDX_UNCOMPRESS_TIME 7
  1391. {STRUCT_FLD(field_name, "uncompress_time"),
  1392. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  1393. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  1394. STRUCT_FLD(value, 0),
  1395. STRUCT_FLD(field_flags, 0),
  1396. STRUCT_FLD(old_name, ""),
  1397. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1398. END_OF_ST_FIELD_INFO
  1399. };
  1400. /*******************************************************************//**
  1401. Fill the dynamic table
  1402. information_schema.innodb_cmp_per_index or
  1403. information_schema.innodb_cmp_per_index_reset.
  1404. @return 0 on success, 1 on failure */
  1405. static
  1406. int
  1407. i_s_cmp_per_index_fill_low(
  1408. /*=======================*/
  1409. THD* thd, /*!< in: thread */
  1410. TABLE_LIST* tables, /*!< in/out: tables to fill */
  1411. Item* , /*!< in: condition (ignored) */
  1412. ibool reset) /*!< in: TRUE=reset cumulated counts */
  1413. {
  1414. TABLE* table = tables->table;
  1415. Field** fields = table->field;
  1416. int status = 0;
  1417. DBUG_ENTER("i_s_cmp_per_index_fill_low");
  1418. /* deny access to non-superusers */
  1419. if (check_global_access(thd, PROCESS_ACL)) {
  1420. DBUG_RETURN(0);
  1421. }
  1422. RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
  1423. /* Create a snapshot of the stats so we do not bump into lock
  1424. order violations with dict_sys->mutex below. */
  1425. mutex_enter(&page_zip_stat_per_index_mutex);
  1426. page_zip_stat_per_index_t snap (page_zip_stat_per_index);
  1427. mutex_exit(&page_zip_stat_per_index_mutex);
  1428. mutex_enter(&dict_sys->mutex);
  1429. page_zip_stat_per_index_t::iterator iter;
  1430. ulint i;
  1431. for (iter = snap.begin(), i = 0; iter != snap.end(); iter++, i++) {
  1432. char name[192];
  1433. dict_index_t* index = dict_index_find_on_id_low(iter->first);
  1434. if (index != NULL) {
  1435. char db_utf8[MAX_DB_UTF8_LEN];
  1436. char table_utf8[MAX_TABLE_UTF8_LEN];
  1437. dict_fs2utf8(index->table_name,
  1438. db_utf8, sizeof(db_utf8),
  1439. table_utf8, sizeof(table_utf8));
  1440. field_store_string(fields[IDX_DATABASE_NAME], db_utf8);
  1441. field_store_string(fields[IDX_TABLE_NAME], table_utf8);
  1442. field_store_index_name(fields[IDX_INDEX_NAME],
  1443. index->name);
  1444. } else {
  1445. /* index not found */
  1446. ut_snprintf(name, sizeof(name),
  1447. "index_id:" IB_ID_FMT, iter->first);
  1448. field_store_string(fields[IDX_DATABASE_NAME],
  1449. "unknown");
  1450. field_store_string(fields[IDX_TABLE_NAME],
  1451. "unknown");
  1452. field_store_string(fields[IDX_INDEX_NAME],
  1453. name);
  1454. }
  1455. fields[IDX_COMPRESS_OPS]->store(
  1456. static_cast<double>(iter->second.compressed));
  1457. fields[IDX_COMPRESS_OPS_OK]->store(
  1458. static_cast<double>(iter->second.compressed_ok));
  1459. fields[IDX_COMPRESS_TIME]->store(
  1460. static_cast<double>(iter->second.compressed_usec / 1000000));
  1461. fields[IDX_UNCOMPRESS_OPS]->store(
  1462. static_cast<double>(iter->second.decompressed));
  1463. fields[IDX_UNCOMPRESS_TIME]->store(
  1464. static_cast<double>(iter->second.decompressed_usec / 1000000));
  1465. if (schema_table_store_record(thd, table)) {
  1466. status = 1;
  1467. break;
  1468. }
  1469. /* Release and reacquire the dict mutex to allow other
  1470. threads to proceed. This could eventually result in the
  1471. contents of INFORMATION_SCHEMA.innodb_cmp_per_index being
  1472. inconsistent, but it is an acceptable compromise. */
  1473. if (i % 1000 == 0) {
  1474. mutex_exit(&dict_sys->mutex);
  1475. mutex_enter(&dict_sys->mutex);
  1476. }
  1477. }
  1478. mutex_exit(&dict_sys->mutex);
  1479. if (reset) {
  1480. page_zip_reset_stat_per_index();
  1481. }
  1482. DBUG_RETURN(status);
  1483. }
  1484. /*******************************************************************//**
  1485. Fill the dynamic table information_schema.innodb_cmp_per_index.
  1486. @return 0 on success, 1 on failure */
  1487. static
  1488. int
  1489. i_s_cmp_per_index_fill(
  1490. /*===================*/
  1491. THD* thd, /*!< in: thread */
  1492. TABLE_LIST* tables, /*!< in/out: tables to fill */
  1493. Item* cond) /*!< in: condition (ignored) */
  1494. {
  1495. return(i_s_cmp_per_index_fill_low(thd, tables, cond, FALSE));
  1496. }
  1497. /*******************************************************************//**
  1498. Fill the dynamic table information_schema.innodb_cmp_per_index_reset.
  1499. @return 0 on success, 1 on failure */
  1500. static
  1501. int
  1502. i_s_cmp_per_index_reset_fill(
  1503. /*=========================*/
  1504. THD* thd, /*!< in: thread */
  1505. TABLE_LIST* tables, /*!< in/out: tables to fill */
  1506. Item* cond) /*!< in: condition (ignored) */
  1507. {
  1508. return(i_s_cmp_per_index_fill_low(thd, tables, cond, TRUE));
  1509. }
  1510. /*******************************************************************//**
  1511. Bind the dynamic table information_schema.innodb_cmp_per_index.
  1512. @return 0 on success */
  1513. static
  1514. int
  1515. i_s_cmp_per_index_init(
  1516. /*===================*/
  1517. void* p) /*!< in/out: table schema object */
  1518. {
  1519. DBUG_ENTER("i_s_cmp_init");
  1520. ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
  1521. schema->fields_info = i_s_cmp_per_index_fields_info;
  1522. schema->fill_table = i_s_cmp_per_index_fill;
  1523. DBUG_RETURN(0);
  1524. }
  1525. /*******************************************************************//**
  1526. Bind the dynamic table information_schema.innodb_cmp_per_index_reset.
  1527. @return 0 on success */
  1528. static
  1529. int
  1530. i_s_cmp_per_index_reset_init(
  1531. /*=========================*/
  1532. void* p) /*!< in/out: table schema object */
  1533. {
  1534. DBUG_ENTER("i_s_cmp_reset_init");
  1535. ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
  1536. schema->fields_info = i_s_cmp_per_index_fields_info;
  1537. schema->fill_table = i_s_cmp_per_index_reset_fill;
  1538. DBUG_RETURN(0);
  1539. }
  1540. UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp_per_index =
  1541. {
  1542. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  1543. /* int */
  1544. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  1545. /* pointer to type-specific plugin descriptor */
  1546. /* void* */
  1547. STRUCT_FLD(info, &i_s_info),
  1548. /* plugin name */
  1549. /* const char* */
  1550. STRUCT_FLD(name, "INNODB_CMP_PER_INDEX"),
  1551. /* plugin author (for SHOW PLUGINS) */
  1552. /* const char* */
  1553. STRUCT_FLD(author, plugin_author),
  1554. /* general descriptive text (for SHOW PLUGINS) */
  1555. /* const char* */
  1556. STRUCT_FLD(descr, "Statistics for the InnoDB compression (per index)"),
  1557. /* the plugin license (PLUGIN_LICENSE_XXX) */
  1558. /* int */
  1559. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  1560. /* the function to invoke when plugin is loaded */
  1561. /* int (*)(void*); */
  1562. STRUCT_FLD(init, i_s_cmp_per_index_init),
  1563. /* the function to invoke when plugin is unloaded */
  1564. /* int (*)(void*); */
  1565. STRUCT_FLD(deinit, i_s_common_deinit),
  1566. /* plugin version (for SHOW PLUGINS) */
  1567. /* unsigned int */
  1568. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  1569. /* struct st_mysql_show_var* */
  1570. STRUCT_FLD(status_vars, NULL),
  1571. /* struct st_mysql_sys_var** */
  1572. STRUCT_FLD(system_vars, NULL),
  1573. /* Maria extension */
  1574. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  1575. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  1576. };
  1577. UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp_per_index_reset =
  1578. {
  1579. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  1580. /* int */
  1581. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  1582. /* pointer to type-specific plugin descriptor */
  1583. /* void* */
  1584. STRUCT_FLD(info, &i_s_info),
  1585. /* plugin name */
  1586. /* const char* */
  1587. STRUCT_FLD(name, "INNODB_CMP_PER_INDEX_RESET"),
  1588. /* plugin author (for SHOW PLUGINS) */
  1589. /* const char* */
  1590. STRUCT_FLD(author, plugin_author),
  1591. /* general descriptive text (for SHOW PLUGINS) */
  1592. /* const char* */
  1593. STRUCT_FLD(descr, "Statistics for the InnoDB compression (per index);"
  1594. " reset cumulated counts"),
  1595. /* the plugin license (PLUGIN_LICENSE_XXX) */
  1596. /* int */
  1597. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  1598. /* the function to invoke when plugin is loaded */
  1599. /* int (*)(void*); */
  1600. STRUCT_FLD(init, i_s_cmp_per_index_reset_init),
  1601. /* the function to invoke when plugin is unloaded */
  1602. /* int (*)(void*); */
  1603. STRUCT_FLD(deinit, i_s_common_deinit),
  1604. /* plugin version (for SHOW PLUGINS) */
  1605. /* unsigned int */
  1606. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  1607. /* struct st_mysql_show_var* */
  1608. STRUCT_FLD(status_vars, NULL),
  1609. /* struct st_mysql_sys_var** */
  1610. STRUCT_FLD(system_vars, NULL),
  1611. /* Maria extension */
  1612. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  1613. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  1614. };
  1615. /* Fields of the dynamic table information_schema.innodb_cmpmem. */
  1616. static ST_FIELD_INFO i_s_cmpmem_fields_info[] =
  1617. {
  1618. {STRUCT_FLD(field_name, "page_size"),
  1619. STRUCT_FLD(field_length, 5),
  1620. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  1621. STRUCT_FLD(value, 0),
  1622. STRUCT_FLD(field_flags, 0),
  1623. STRUCT_FLD(old_name, "Buddy Block Size"),
  1624. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1625. {STRUCT_FLD(field_name, "buffer_pool_instance"),
  1626. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  1627. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  1628. STRUCT_FLD(value, 0),
  1629. STRUCT_FLD(field_flags, 0),
  1630. STRUCT_FLD(old_name, "Buffer Pool Id"),
  1631. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1632. {STRUCT_FLD(field_name, "pages_used"),
  1633. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  1634. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  1635. STRUCT_FLD(value, 0),
  1636. STRUCT_FLD(field_flags, 0),
  1637. STRUCT_FLD(old_name, "Currently in Use"),
  1638. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1639. {STRUCT_FLD(field_name, "pages_free"),
  1640. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  1641. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  1642. STRUCT_FLD(value, 0),
  1643. STRUCT_FLD(field_flags, 0),
  1644. STRUCT_FLD(old_name, "Currently Available"),
  1645. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1646. {STRUCT_FLD(field_name, "relocation_ops"),
  1647. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  1648. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  1649. STRUCT_FLD(value, 0),
  1650. STRUCT_FLD(field_flags, 0),
  1651. STRUCT_FLD(old_name, "Total Number of Relocations"),
  1652. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1653. {STRUCT_FLD(field_name, "relocation_time"),
  1654. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  1655. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  1656. STRUCT_FLD(value, 0),
  1657. STRUCT_FLD(field_flags, 0),
  1658. STRUCT_FLD(old_name, "Total Duration of Relocations,"
  1659. " in Seconds"),
  1660. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1661. END_OF_ST_FIELD_INFO
  1662. };
  1663. /*******************************************************************//**
  1664. Fill the dynamic table information_schema.innodb_cmpmem or
  1665. innodb_cmpmem_reset.
  1666. @return 0 on success, 1 on failure */
  1667. static
  1668. int
  1669. i_s_cmpmem_fill_low(
  1670. /*================*/
  1671. THD* thd, /*!< in: thread */
  1672. TABLE_LIST* tables, /*!< in/out: tables to fill */
  1673. Item* , /*!< in: condition (ignored) */
  1674. ibool reset) /*!< in: TRUE=reset cumulated counts */
  1675. {
  1676. int status = 0;
  1677. TABLE* table = (TABLE*) tables->table;
  1678. DBUG_ENTER("i_s_cmpmem_fill_low");
  1679. /* deny access to non-superusers */
  1680. if (check_global_access(thd, PROCESS_ACL)) {
  1681. DBUG_RETURN(0);
  1682. }
  1683. RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
  1684. for (ulint i = 0; i < srv_buf_pool_instances; i++) {
  1685. buf_pool_t* buf_pool;
  1686. status = 0;
  1687. buf_pool = buf_pool_from_array(i);
  1688. buf_pool_mutex_enter(buf_pool);
  1689. for (uint x = 0; x <= BUF_BUDDY_SIZES; x++) {
  1690. buf_buddy_stat_t* buddy_stat;
  1691. buddy_stat = &buf_pool->buddy_stat[x];
  1692. table->field[0]->store(BUF_BUDDY_LOW << x);
  1693. table->field[1]->store(static_cast<double>(i));
  1694. table->field[2]->store(static_cast<double>(
  1695. buddy_stat->used));
  1696. table->field[3]->store(static_cast<double>(
  1697. (x < BUF_BUDDY_SIZES)
  1698. ? UT_LIST_GET_LEN(buf_pool->zip_free[x])
  1699. : 0));
  1700. table->field[4]->store(
  1701. (longlong) buddy_stat->relocated, true);
  1702. table->field[5]->store(
  1703. static_cast<double>(buddy_stat->relocated_usec / 1000000));
  1704. if (reset) {
  1705. /* This is protected by buf_pool->mutex. */
  1706. buddy_stat->relocated = 0;
  1707. buddy_stat->relocated_usec = 0;
  1708. }
  1709. if (schema_table_store_record(thd, table)) {
  1710. status = 1;
  1711. break;
  1712. }
  1713. }
  1714. buf_pool_mutex_exit(buf_pool);
  1715. if (status) {
  1716. break;
  1717. }
  1718. }
  1719. DBUG_RETURN(status);
  1720. }
  1721. /*******************************************************************//**
  1722. Fill the dynamic table information_schema.innodb_cmpmem.
  1723. @return 0 on success, 1 on failure */
  1724. static
  1725. int
  1726. i_s_cmpmem_fill(
  1727. /*============*/
  1728. THD* thd, /*!< in: thread */
  1729. TABLE_LIST* tables, /*!< in/out: tables to fill */
  1730. Item* cond) /*!< in: condition (ignored) */
  1731. {
  1732. return(i_s_cmpmem_fill_low(thd, tables, cond, FALSE));
  1733. }
  1734. /*******************************************************************//**
  1735. Fill the dynamic table information_schema.innodb_cmpmem_reset.
  1736. @return 0 on success, 1 on failure */
  1737. static
  1738. int
  1739. i_s_cmpmem_reset_fill(
  1740. /*==================*/
  1741. THD* thd, /*!< in: thread */
  1742. TABLE_LIST* tables, /*!< in/out: tables to fill */
  1743. Item* cond) /*!< in: condition (ignored) */
  1744. {
  1745. return(i_s_cmpmem_fill_low(thd, tables, cond, TRUE));
  1746. }
  1747. /*******************************************************************//**
  1748. Bind the dynamic table information_schema.innodb_cmpmem.
  1749. @return 0 on success */
  1750. static
  1751. int
  1752. i_s_cmpmem_init(
  1753. /*============*/
  1754. void* p) /*!< in/out: table schema object */
  1755. {
  1756. DBUG_ENTER("i_s_cmpmem_init");
  1757. ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
  1758. schema->fields_info = i_s_cmpmem_fields_info;
  1759. schema->fill_table = i_s_cmpmem_fill;
  1760. DBUG_RETURN(0);
  1761. }
  1762. /*******************************************************************//**
  1763. Bind the dynamic table information_schema.innodb_cmpmem_reset.
  1764. @return 0 on success */
  1765. static
  1766. int
  1767. i_s_cmpmem_reset_init(
  1768. /*==================*/
  1769. void* p) /*!< in/out: table schema object */
  1770. {
  1771. DBUG_ENTER("i_s_cmpmem_reset_init");
  1772. ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
  1773. schema->fields_info = i_s_cmpmem_fields_info;
  1774. schema->fill_table = i_s_cmpmem_reset_fill;
  1775. DBUG_RETURN(0);
  1776. }
  1777. UNIV_INTERN struct st_maria_plugin i_s_innodb_cmpmem =
  1778. {
  1779. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  1780. /* int */
  1781. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  1782. /* pointer to type-specific plugin descriptor */
  1783. /* void* */
  1784. STRUCT_FLD(info, &i_s_info),
  1785. /* plugin name */
  1786. /* const char* */
  1787. STRUCT_FLD(name, "INNODB_CMPMEM"),
  1788. /* plugin author (for SHOW PLUGINS) */
  1789. /* const char* */
  1790. STRUCT_FLD(author, plugin_author),
  1791. /* general descriptive text (for SHOW PLUGINS) */
  1792. /* const char* */
  1793. STRUCT_FLD(descr, "Statistics for the InnoDB compressed buffer pool"),
  1794. /* the plugin license (PLUGIN_LICENSE_XXX) */
  1795. /* int */
  1796. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  1797. /* the function to invoke when plugin is loaded */
  1798. /* int (*)(void*); */
  1799. STRUCT_FLD(init, i_s_cmpmem_init),
  1800. /* the function to invoke when plugin is unloaded */
  1801. /* int (*)(void*); */
  1802. STRUCT_FLD(deinit, i_s_common_deinit),
  1803. /* plugin version (for SHOW PLUGINS) */
  1804. /* unsigned int */
  1805. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  1806. /* struct st_mysql_show_var* */
  1807. STRUCT_FLD(status_vars, NULL),
  1808. /* struct st_mysql_sys_var** */
  1809. STRUCT_FLD(system_vars, NULL),
  1810. /* Maria extension */
  1811. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  1812. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  1813. };
  1814. UNIV_INTERN struct st_maria_plugin i_s_innodb_cmpmem_reset =
  1815. {
  1816. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  1817. /* int */
  1818. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  1819. /* pointer to type-specific plugin descriptor */
  1820. /* void* */
  1821. STRUCT_FLD(info, &i_s_info),
  1822. /* plugin name */
  1823. /* const char* */
  1824. STRUCT_FLD(name, "INNODB_CMPMEM_RESET"),
  1825. /* plugin author (for SHOW PLUGINS) */
  1826. /* const char* */
  1827. STRUCT_FLD(author, plugin_author),
  1828. /* general descriptive text (for SHOW PLUGINS) */
  1829. /* const char* */
  1830. STRUCT_FLD(descr, "Statistics for the InnoDB compressed buffer pool;"
  1831. " reset cumulated counts"),
  1832. /* the plugin license (PLUGIN_LICENSE_XXX) */
  1833. /* int */
  1834. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  1835. /* the function to invoke when plugin is loaded */
  1836. /* int (*)(void*); */
  1837. STRUCT_FLD(init, i_s_cmpmem_reset_init),
  1838. /* the function to invoke when plugin is unloaded */
  1839. /* int (*)(void*); */
  1840. STRUCT_FLD(deinit, i_s_common_deinit),
  1841. /* plugin version (for SHOW PLUGINS) */
  1842. /* unsigned int */
  1843. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  1844. /* struct st_mysql_show_var* */
  1845. STRUCT_FLD(status_vars, NULL),
  1846. /* struct st_mysql_sys_var** */
  1847. STRUCT_FLD(system_vars, NULL),
  1848. /* Maria extension */
  1849. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  1850. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  1851. };
  1852. /* Fields of the dynamic table INFORMATION_SCHEMA.innodb_metrics */
  1853. static ST_FIELD_INFO innodb_metrics_fields_info[] =
  1854. {
  1855. #define METRIC_NAME 0
  1856. {STRUCT_FLD(field_name, "NAME"),
  1857. STRUCT_FLD(field_length, NAME_LEN + 1),
  1858. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  1859. STRUCT_FLD(value, 0),
  1860. STRUCT_FLD(field_flags, 0),
  1861. STRUCT_FLD(old_name, ""),
  1862. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1863. #define METRIC_SUBSYS 1
  1864. {STRUCT_FLD(field_name, "SUBSYSTEM"),
  1865. STRUCT_FLD(field_length, NAME_LEN + 1),
  1866. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  1867. STRUCT_FLD(value, 0),
  1868. STRUCT_FLD(field_flags, 0),
  1869. STRUCT_FLD(old_name, ""),
  1870. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1871. #define METRIC_VALUE_START 2
  1872. {STRUCT_FLD(field_name, "COUNT"),
  1873. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  1874. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  1875. STRUCT_FLD(value, 0),
  1876. STRUCT_FLD(field_flags, 0),
  1877. STRUCT_FLD(old_name, ""),
  1878. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1879. #define METRIC_MAX_VALUE_START 3
  1880. {STRUCT_FLD(field_name, "MAX_COUNT"),
  1881. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  1882. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  1883. STRUCT_FLD(value, 0),
  1884. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  1885. STRUCT_FLD(old_name, ""),
  1886. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1887. #define METRIC_MIN_VALUE_START 4
  1888. {STRUCT_FLD(field_name, "MIN_COUNT"),
  1889. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  1890. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  1891. STRUCT_FLD(value, 0),
  1892. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  1893. STRUCT_FLD(old_name, ""),
  1894. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1895. #define METRIC_AVG_VALUE_START 5
  1896. {STRUCT_FLD(field_name, "AVG_COUNT"),
  1897. STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
  1898. STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
  1899. STRUCT_FLD(value, 0),
  1900. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  1901. STRUCT_FLD(old_name, ""),
  1902. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1903. #define METRIC_VALUE_RESET 6
  1904. {STRUCT_FLD(field_name, "COUNT_RESET"),
  1905. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  1906. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  1907. STRUCT_FLD(value, 0),
  1908. STRUCT_FLD(field_flags, 0),
  1909. STRUCT_FLD(old_name, ""),
  1910. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1911. #define METRIC_MAX_VALUE_RESET 7
  1912. {STRUCT_FLD(field_name, "MAX_COUNT_RESET"),
  1913. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  1914. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  1915. STRUCT_FLD(value, 0),
  1916. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  1917. STRUCT_FLD(old_name, ""),
  1918. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1919. #define METRIC_MIN_VALUE_RESET 8
  1920. {STRUCT_FLD(field_name, "MIN_COUNT_RESET"),
  1921. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  1922. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  1923. STRUCT_FLD(value, 0),
  1924. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  1925. STRUCT_FLD(old_name, ""),
  1926. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1927. #define METRIC_AVG_VALUE_RESET 9
  1928. {STRUCT_FLD(field_name, "AVG_COUNT_RESET"),
  1929. STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
  1930. STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
  1931. STRUCT_FLD(value, 0),
  1932. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  1933. STRUCT_FLD(old_name, ""),
  1934. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1935. #define METRIC_START_TIME 10
  1936. {STRUCT_FLD(field_name, "TIME_ENABLED"),
  1937. STRUCT_FLD(field_length, 0),
  1938. STRUCT_FLD(field_type, MYSQL_TYPE_DATETIME),
  1939. STRUCT_FLD(value, 0),
  1940. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  1941. STRUCT_FLD(old_name, ""),
  1942. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1943. #define METRIC_STOP_TIME 11
  1944. {STRUCT_FLD(field_name, "TIME_DISABLED"),
  1945. STRUCT_FLD(field_length, 0),
  1946. STRUCT_FLD(field_type, MYSQL_TYPE_DATETIME),
  1947. STRUCT_FLD(value, 0),
  1948. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  1949. STRUCT_FLD(old_name, ""),
  1950. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1951. #define METRIC_TIME_ELAPSED 12
  1952. {STRUCT_FLD(field_name, "TIME_ELAPSED"),
  1953. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  1954. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  1955. STRUCT_FLD(value, 0),
  1956. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  1957. STRUCT_FLD(old_name, ""),
  1958. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1959. #define METRIC_RESET_TIME 13
  1960. {STRUCT_FLD(field_name, "TIME_RESET"),
  1961. STRUCT_FLD(field_length, 0),
  1962. STRUCT_FLD(field_type, MYSQL_TYPE_DATETIME),
  1963. STRUCT_FLD(value, 0),
  1964. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  1965. STRUCT_FLD(old_name, ""),
  1966. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1967. #define METRIC_STATUS 14
  1968. {STRUCT_FLD(field_name, "STATUS"),
  1969. STRUCT_FLD(field_length, NAME_LEN + 1),
  1970. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  1971. STRUCT_FLD(value, 0),
  1972. STRUCT_FLD(field_flags, 0),
  1973. STRUCT_FLD(old_name, ""),
  1974. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1975. #define METRIC_TYPE 15
  1976. {STRUCT_FLD(field_name, "TYPE"),
  1977. STRUCT_FLD(field_length, NAME_LEN + 1),
  1978. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  1979. STRUCT_FLD(value, 0),
  1980. STRUCT_FLD(field_flags, 0),
  1981. STRUCT_FLD(old_name, ""),
  1982. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1983. #define METRIC_DESC 16
  1984. {STRUCT_FLD(field_name, "COMMENT"),
  1985. STRUCT_FLD(field_length, NAME_LEN + 1),
  1986. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  1987. STRUCT_FLD(value, 0),
  1988. STRUCT_FLD(field_flags, 0),
  1989. STRUCT_FLD(old_name, ""),
  1990. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  1991. END_OF_ST_FIELD_INFO
  1992. };
  1993. /**********************************************************************//**
  1994. Fill the information schema metrics table.
  1995. @return 0 on success */
  1996. static
  1997. int
  1998. i_s_metrics_fill(
  1999. /*=============*/
  2000. THD* thd, /*!< in: thread */
  2001. TABLE* table_to_fill) /*!< in/out: fill this table */
  2002. {
  2003. int count;
  2004. Field** fields;
  2005. double time_diff = 0;
  2006. monitor_info_t* monitor_info;
  2007. mon_type_t min_val;
  2008. mon_type_t max_val;
  2009. DBUG_ENTER("i_s_metrics_fill");
  2010. fields = table_to_fill->field;
  2011. for (count = 0; count < NUM_MONITOR; count++) {
  2012. monitor_info = srv_mon_get_info((monitor_id_t) count);
  2013. /* A good place to sanity check the Monitor ID */
  2014. ut_a(count == monitor_info->monitor_id);
  2015. /* If the item refers to a Module, nothing to fill,
  2016. continue. */
  2017. if ((monitor_info->monitor_type & MONITOR_MODULE)
  2018. || (monitor_info->monitor_type & MONITOR_HIDDEN)) {
  2019. continue;
  2020. }
  2021. /* If this is an existing "status variable", and
  2022. its corresponding counter is still on, we need
  2023. to calculate the result from its corresponding
  2024. counter. */
  2025. if (monitor_info->monitor_type & MONITOR_EXISTING
  2026. && MONITOR_IS_ON(count)) {
  2027. srv_mon_process_existing_counter((monitor_id_t) count,
  2028. MONITOR_GET_VALUE);
  2029. }
  2030. /* Fill in counter's basic information */
  2031. OK(field_store_string(fields[METRIC_NAME],
  2032. monitor_info->monitor_name));
  2033. OK(field_store_string(fields[METRIC_SUBSYS],
  2034. monitor_info->monitor_module));
  2035. OK(field_store_string(fields[METRIC_DESC],
  2036. monitor_info->monitor_desc));
  2037. /* Fill in counter values */
  2038. OK(fields[METRIC_VALUE_RESET]->store(
  2039. MONITOR_VALUE(count), FALSE));
  2040. OK(fields[METRIC_VALUE_START]->store(
  2041. MONITOR_VALUE_SINCE_START(count), FALSE));
  2042. /* If the max value is MAX_RESERVED, counter max
  2043. value has not been updated. Set the column value
  2044. to NULL. */
  2045. if (MONITOR_MAX_VALUE(count) == MAX_RESERVED
  2046. || MONITOR_MAX_MIN_NOT_INIT(count)) {
  2047. fields[METRIC_MAX_VALUE_RESET]->set_null();
  2048. } else {
  2049. OK(fields[METRIC_MAX_VALUE_RESET]->store(
  2050. MONITOR_MAX_VALUE(count), FALSE));
  2051. fields[METRIC_MAX_VALUE_RESET]->set_notnull();
  2052. }
  2053. /* If the min value is MAX_RESERVED, counter min
  2054. value has not been updated. Set the column value
  2055. to NULL. */
  2056. if (MONITOR_MIN_VALUE(count) == MIN_RESERVED
  2057. || MONITOR_MAX_MIN_NOT_INIT(count)) {
  2058. fields[METRIC_MIN_VALUE_RESET]->set_null();
  2059. } else {
  2060. OK(fields[METRIC_MIN_VALUE_RESET]->store(
  2061. MONITOR_MIN_VALUE(count), FALSE));
  2062. fields[METRIC_MIN_VALUE_RESET]->set_notnull();
  2063. }
  2064. /* Calculate the max value since counter started */
  2065. max_val = srv_mon_calc_max_since_start((monitor_id_t) count);
  2066. if (max_val == MAX_RESERVED
  2067. || MONITOR_MAX_MIN_NOT_INIT(count)) {
  2068. fields[METRIC_MAX_VALUE_START]->set_null();
  2069. } else {
  2070. OK(fields[METRIC_MAX_VALUE_START]->store(
  2071. max_val, FALSE));
  2072. fields[METRIC_MAX_VALUE_START]->set_notnull();
  2073. }
  2074. /* Calculate the min value since counter started */
  2075. min_val = srv_mon_calc_min_since_start((monitor_id_t) count);
  2076. if (min_val == MIN_RESERVED
  2077. || MONITOR_MAX_MIN_NOT_INIT(count)) {
  2078. fields[METRIC_MIN_VALUE_START]->set_null();
  2079. } else {
  2080. OK(fields[METRIC_MIN_VALUE_START]->store(
  2081. min_val, FALSE));
  2082. fields[METRIC_MIN_VALUE_START]->set_notnull();
  2083. }
  2084. /* If monitor has been enabled (no matter it is disabled
  2085. or not now), fill METRIC_START_TIME and METRIC_TIME_ELAPSED
  2086. field */
  2087. if (MONITOR_FIELD(count, mon_start_time)) {
  2088. OK(field_store_time_t(fields[METRIC_START_TIME],
  2089. (time_t)MONITOR_FIELD(count, mon_start_time)));
  2090. fields[METRIC_START_TIME]->set_notnull();
  2091. /* If monitor is enabled, the TIME_ELAPSED is the
  2092. time difference between current and time when monitor
  2093. is enabled. Otherwise, it is the time difference
  2094. between time when monitor is enabled and time
  2095. when it is disabled */
  2096. if (MONITOR_IS_ON(count)) {
  2097. time_diff = difftime(time(NULL),
  2098. MONITOR_FIELD(count, mon_start_time));
  2099. } else {
  2100. time_diff = difftime(
  2101. MONITOR_FIELD(count, mon_stop_time),
  2102. MONITOR_FIELD(count, mon_start_time));
  2103. }
  2104. OK(fields[METRIC_TIME_ELAPSED]->store(
  2105. time_diff));
  2106. fields[METRIC_TIME_ELAPSED]->set_notnull();
  2107. } else {
  2108. fields[METRIC_START_TIME]->set_null();
  2109. fields[METRIC_TIME_ELAPSED]->set_null();
  2110. time_diff = 0;
  2111. }
  2112. /* Unless MONITOR__NO_AVERAGE is marked, we will need
  2113. to calculate the average value. If this is a monitor set
  2114. owner marked by MONITOR_SET_OWNER, divide
  2115. the value by another counter (number of calls) designated
  2116. by monitor_info->monitor_related_id.
  2117. Otherwise average the counter value by the time between the
  2118. time that the counter is enabled and time it is disabled
  2119. or time it is sampled. */
  2120. if (!(monitor_info->monitor_type & MONITOR_NO_AVERAGE)
  2121. && (monitor_info->monitor_type & MONITOR_SET_OWNER)
  2122. && monitor_info->monitor_related_id) {
  2123. mon_type_t value_start
  2124. = MONITOR_VALUE_SINCE_START(
  2125. monitor_info->monitor_related_id);
  2126. if (value_start) {
  2127. OK(fields[METRIC_AVG_VALUE_START]->store(
  2128. MONITOR_VALUE_SINCE_START(count)
  2129. / value_start, FALSE));
  2130. fields[METRIC_AVG_VALUE_START]->set_notnull();
  2131. } else {
  2132. fields[METRIC_AVG_VALUE_START]->set_null();
  2133. }
  2134. if (MONITOR_VALUE(monitor_info->monitor_related_id)) {
  2135. OK(fields[METRIC_AVG_VALUE_RESET]->store(
  2136. MONITOR_VALUE(count)
  2137. / MONITOR_VALUE(
  2138. monitor_info->monitor_related_id),
  2139. FALSE));
  2140. } else {
  2141. fields[METRIC_AVG_VALUE_RESET]->set_null();
  2142. }
  2143. } else if (!(monitor_info->monitor_type & MONITOR_NO_AVERAGE)
  2144. && !(monitor_info->monitor_type
  2145. & MONITOR_DISPLAY_CURRENT)) {
  2146. if (time_diff) {
  2147. OK(fields[METRIC_AVG_VALUE_START]->store(
  2148. (double) MONITOR_VALUE_SINCE_START(
  2149. count) / time_diff));
  2150. fields[METRIC_AVG_VALUE_START]->set_notnull();
  2151. } else {
  2152. fields[METRIC_AVG_VALUE_START]->set_null();
  2153. }
  2154. if (MONITOR_FIELD(count, mon_reset_time)) {
  2155. /* calculate the time difference since last
  2156. reset */
  2157. if (MONITOR_IS_ON(count)) {
  2158. time_diff = difftime(
  2159. time(NULL), MONITOR_FIELD(
  2160. count, mon_reset_time));
  2161. } else {
  2162. time_diff = difftime(
  2163. MONITOR_FIELD(count, mon_stop_time),
  2164. MONITOR_FIELD(count, mon_reset_time));
  2165. }
  2166. } else {
  2167. time_diff = 0;
  2168. }
  2169. if (time_diff) {
  2170. OK(fields[METRIC_AVG_VALUE_RESET]->store(
  2171. static_cast<double>(
  2172. MONITOR_VALUE(count) / time_diff)));
  2173. fields[METRIC_AVG_VALUE_RESET]->set_notnull();
  2174. } else {
  2175. fields[METRIC_AVG_VALUE_RESET]->set_null();
  2176. }
  2177. } else {
  2178. fields[METRIC_AVG_VALUE_START]->set_null();
  2179. fields[METRIC_AVG_VALUE_RESET]->set_null();
  2180. }
  2181. if (MONITOR_IS_ON(count)) {
  2182. /* If monitor is on, the stop time will set to NULL */
  2183. fields[METRIC_STOP_TIME]->set_null();
  2184. /* Display latest Monitor Reset Time only if Monitor
  2185. counter is on. */
  2186. if (MONITOR_FIELD(count, mon_reset_time)) {
  2187. OK(field_store_time_t(
  2188. fields[METRIC_RESET_TIME],
  2189. (time_t)MONITOR_FIELD(
  2190. count, mon_reset_time)));
  2191. fields[METRIC_RESET_TIME]->set_notnull();
  2192. } else {
  2193. fields[METRIC_RESET_TIME]->set_null();
  2194. }
  2195. /* Display the monitor status as "enabled" */
  2196. OK(field_store_string(fields[METRIC_STATUS],
  2197. "enabled"));
  2198. } else {
  2199. if (MONITOR_FIELD(count, mon_stop_time)) {
  2200. OK(field_store_time_t(fields[METRIC_STOP_TIME],
  2201. (time_t)MONITOR_FIELD(count, mon_stop_time)));
  2202. fields[METRIC_STOP_TIME]->set_notnull();
  2203. } else {
  2204. fields[METRIC_STOP_TIME]->set_null();
  2205. }
  2206. fields[METRIC_RESET_TIME]->set_null();
  2207. OK(field_store_string(fields[METRIC_STATUS],
  2208. "disabled"));
  2209. }
  2210. if (monitor_info->monitor_type & MONITOR_DISPLAY_CURRENT) {
  2211. OK(field_store_string(fields[METRIC_TYPE],
  2212. "value"));
  2213. } else if (monitor_info->monitor_type & MONITOR_EXISTING) {
  2214. OK(field_store_string(fields[METRIC_TYPE],
  2215. "status_counter"));
  2216. } else if (monitor_info->monitor_type & MONITOR_SET_OWNER) {
  2217. OK(field_store_string(fields[METRIC_TYPE],
  2218. "set_owner"));
  2219. } else if ( monitor_info->monitor_type & MONITOR_SET_MEMBER) {
  2220. OK(field_store_string(fields[METRIC_TYPE],
  2221. "set_member"));
  2222. } else {
  2223. OK(field_store_string(fields[METRIC_TYPE],
  2224. "counter"));
  2225. }
  2226. OK(schema_table_store_record(thd, table_to_fill));
  2227. }
  2228. DBUG_RETURN(0);
  2229. }
  2230. /*******************************************************************//**
  2231. Function to fill information schema metrics tables.
  2232. @return 0 on success */
  2233. static
  2234. int
  2235. i_s_metrics_fill_table(
  2236. /*===================*/
  2237. THD* thd, /*!< in: thread */
  2238. TABLE_LIST* tables, /*!< in/out: tables to fill */
  2239. Item* ) /*!< in: condition (not used) */
  2240. {
  2241. DBUG_ENTER("i_s_metrics_fill_table");
  2242. /* deny access to non-superusers */
  2243. if (check_global_access(thd, PROCESS_ACL)) {
  2244. DBUG_RETURN(0);
  2245. }
  2246. i_s_metrics_fill(thd, tables->table);
  2247. DBUG_RETURN(0);
  2248. }
  2249. /*******************************************************************//**
  2250. Bind the dynamic table INFORMATION_SCHEMA.innodb_metrics
  2251. @return 0 on success */
  2252. static
  2253. int
  2254. innodb_metrics_init(
  2255. /*================*/
  2256. void* p) /*!< in/out: table schema object */
  2257. {
  2258. ST_SCHEMA_TABLE* schema;
  2259. DBUG_ENTER("innodb_metrics_init");
  2260. schema = (ST_SCHEMA_TABLE*) p;
  2261. schema->fields_info = innodb_metrics_fields_info;
  2262. schema->fill_table = i_s_metrics_fill_table;
  2263. DBUG_RETURN(0);
  2264. }
  2265. UNIV_INTERN struct st_maria_plugin i_s_innodb_metrics =
  2266. {
  2267. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  2268. /* int */
  2269. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  2270. /* pointer to type-specific plugin descriptor */
  2271. /* void* */
  2272. STRUCT_FLD(info, &i_s_info),
  2273. /* plugin name */
  2274. /* const char* */
  2275. STRUCT_FLD(name, "INNODB_METRICS"),
  2276. /* plugin author (for SHOW PLUGINS) */
  2277. /* const char* */
  2278. STRUCT_FLD(author, plugin_author),
  2279. /* general descriptive text (for SHOW PLUGINS) */
  2280. /* const char* */
  2281. STRUCT_FLD(descr, "InnoDB Metrics Info"),
  2282. /* the plugin license (PLUGIN_LICENSE_XXX) */
  2283. /* int */
  2284. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  2285. /* the function to invoke when plugin is loaded */
  2286. /* int (*)(void*); */
  2287. STRUCT_FLD(init, innodb_metrics_init),
  2288. /* the function to invoke when plugin is unloaded */
  2289. /* int (*)(void*); */
  2290. STRUCT_FLD(deinit, i_s_common_deinit),
  2291. /* plugin version (for SHOW PLUGINS) */
  2292. /* unsigned int */
  2293. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  2294. /* struct st_mysql_show_var* */
  2295. STRUCT_FLD(status_vars, NULL),
  2296. /* struct st_mysql_sys_var** */
  2297. STRUCT_FLD(system_vars, NULL),
  2298. /* Maria extension */
  2299. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  2300. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  2301. };
  2302. /* Fields of the dynamic table INFORMATION_SCHEMA.innodb_ft_default_stopword */
  2303. static ST_FIELD_INFO i_s_stopword_fields_info[] =
  2304. {
  2305. #define STOPWORD_VALUE 0
  2306. {STRUCT_FLD(field_name, "value"),
  2307. STRUCT_FLD(field_length, TRX_ID_MAX_LEN + 1),
  2308. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  2309. STRUCT_FLD(value, 0),
  2310. STRUCT_FLD(field_flags, 0),
  2311. STRUCT_FLD(old_name, ""),
  2312. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  2313. END_OF_ST_FIELD_INFO
  2314. };
  2315. /*******************************************************************//**
  2316. Fill the dynamic table information_schema.innodb_ft_default_stopword.
  2317. @return 0 on success, 1 on failure */
  2318. static
  2319. int
  2320. i_s_stopword_fill(
  2321. /*==============*/
  2322. THD* thd, /*!< in: thread */
  2323. TABLE_LIST* tables, /*!< in/out: tables to fill */
  2324. Item* ) /*!< in: condition (not used) */
  2325. {
  2326. Field** fields;
  2327. ulint i = 0;
  2328. TABLE* table = (TABLE*) tables->table;
  2329. DBUG_ENTER("i_s_stopword_fill");
  2330. fields = table->field;
  2331. /* Fill with server default stopword list in array
  2332. fts_default_stopword */
  2333. while (fts_default_stopword[i]) {
  2334. OK(field_store_string(fields[STOPWORD_VALUE],
  2335. fts_default_stopword[i]));
  2336. OK(schema_table_store_record(thd, table));
  2337. i++;
  2338. }
  2339. DBUG_RETURN(0);
  2340. }
  2341. /*******************************************************************//**
  2342. Bind the dynamic table information_schema.innodb_ft_default_stopword.
  2343. @return 0 on success */
  2344. static
  2345. int
  2346. i_s_stopword_init(
  2347. /*==============*/
  2348. void* p) /*!< in/out: table schema object */
  2349. {
  2350. DBUG_ENTER("i_s_stopword_init");
  2351. ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
  2352. schema->fields_info = i_s_stopword_fields_info;
  2353. schema->fill_table = i_s_stopword_fill;
  2354. DBUG_RETURN(0);
  2355. }
  2356. UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_default_stopword =
  2357. {
  2358. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  2359. /* int */
  2360. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  2361. /* pointer to type-specific plugin descriptor */
  2362. /* void* */
  2363. STRUCT_FLD(info, &i_s_info),
  2364. /* plugin name */
  2365. /* const char* */
  2366. STRUCT_FLD(name, "INNODB_FT_DEFAULT_STOPWORD"),
  2367. /* plugin author (for SHOW PLUGINS) */
  2368. /* const char* */
  2369. STRUCT_FLD(author, plugin_author),
  2370. /* general descriptive text (for SHOW PLUGINS) */
  2371. /* const char* */
  2372. STRUCT_FLD(descr, "Default stopword list for InnoDB Full Text Search"),
  2373. /* the plugin license (PLUGIN_LICENSE_XXX) */
  2374. /* int */
  2375. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  2376. /* the function to invoke when plugin is loaded */
  2377. /* int (*)(void*); */
  2378. STRUCT_FLD(init, i_s_stopword_init),
  2379. /* the function to invoke when plugin is unloaded */
  2380. /* int (*)(void*); */
  2381. STRUCT_FLD(deinit, i_s_common_deinit),
  2382. /* plugin version (for SHOW PLUGINS) */
  2383. /* unsigned int */
  2384. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  2385. /* struct st_mysql_show_var* */
  2386. STRUCT_FLD(status_vars, NULL),
  2387. /* struct st_mysql_sys_var** */
  2388. STRUCT_FLD(system_vars, NULL),
  2389. /* Maria extension */
  2390. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  2391. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  2392. };
  2393. /* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_FT_DELETED
  2394. INFORMATION_SCHEMA.INNODB_FT_BEING_DELETED */
  2395. static ST_FIELD_INFO i_s_fts_doc_fields_info[] =
  2396. {
  2397. #define I_S_FTS_DOC_ID 0
  2398. {STRUCT_FLD(field_name, "DOC_ID"),
  2399. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  2400. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  2401. STRUCT_FLD(value, 0),
  2402. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  2403. STRUCT_FLD(old_name, ""),
  2404. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  2405. END_OF_ST_FIELD_INFO
  2406. };
  2407. /*******************************************************************//**
  2408. Fill the dynamic table INFORMATION_SCHEMA.INNODB_FT_DELETED or
  2409. INFORMATION_SCHEMA.INNODB_FT_BEING_DELETED
  2410. @return 0 on success, 1 on failure */
  2411. static
  2412. int
  2413. i_s_fts_deleted_generic_fill(
  2414. /*=========================*/
  2415. THD* thd, /*!< in: thread */
  2416. TABLE_LIST* tables, /*!< in/out: tables to fill */
  2417. ibool being_deleted) /*!< in: BEING_DELTED table */
  2418. {
  2419. Field** fields;
  2420. TABLE* table = (TABLE*) tables->table;
  2421. trx_t* trx;
  2422. fts_table_t fts_table;
  2423. fts_doc_ids_t* deleted;
  2424. dict_table_t* user_table;
  2425. DBUG_ENTER("i_s_fts_deleted_generic_fill");
  2426. /* deny access to non-superusers */
  2427. if (check_global_access(thd, PROCESS_ACL)) {
  2428. DBUG_RETURN(0);
  2429. }
  2430. if (!fts_internal_tbl_name) {
  2431. DBUG_RETURN(0);
  2432. }
  2433. /* Prevent DDL to drop fts aux tables. */
  2434. rw_lock_s_lock(&dict_operation_lock);
  2435. user_table = dict_table_open_on_name(
  2436. fts_internal_tbl_name, FALSE, FALSE, DICT_ERR_IGNORE_NONE);
  2437. if (!user_table) {
  2438. rw_lock_s_unlock(&dict_operation_lock);
  2439. DBUG_RETURN(0);
  2440. } else if (!dict_table_has_fts_index(user_table)) {
  2441. dict_table_close(user_table, FALSE, FALSE);
  2442. rw_lock_s_unlock(&dict_operation_lock);
  2443. DBUG_RETURN(0);
  2444. }
  2445. deleted = fts_doc_ids_create();
  2446. trx = trx_allocate_for_background();
  2447. trx->op_info = "Select for FTS DELETE TABLE";
  2448. FTS_INIT_FTS_TABLE(&fts_table,
  2449. (being_deleted) ? "BEING_DELETED" : "DELETED",
  2450. FTS_COMMON_TABLE, user_table);
  2451. fts_table_fetch_doc_ids(trx, &fts_table, deleted);
  2452. fields = table->field;
  2453. int ret = 0;
  2454. for (ulint j = 0; j < ib_vector_size(deleted->doc_ids); ++j) {
  2455. doc_id_t doc_id;
  2456. doc_id = *(doc_id_t*) ib_vector_get_const(deleted->doc_ids, j);
  2457. BREAK_IF(ret = fields[I_S_FTS_DOC_ID]->store(doc_id, true));
  2458. BREAK_IF(ret = schema_table_store_record(thd, table));
  2459. }
  2460. trx_free_for_background(trx);
  2461. fts_doc_ids_free(deleted);
  2462. dict_table_close(user_table, FALSE, FALSE);
  2463. rw_lock_s_unlock(&dict_operation_lock);
  2464. DBUG_RETURN(ret);
  2465. }
  2466. /*******************************************************************//**
  2467. Fill the dynamic table INFORMATION_SCHEMA.INNODB_FT_DELETED
  2468. @return 0 on success, 1 on failure */
  2469. static
  2470. int
  2471. i_s_fts_deleted_fill(
  2472. /*=================*/
  2473. THD* thd, /*!< in: thread */
  2474. TABLE_LIST* tables, /*!< in/out: tables to fill */
  2475. Item* ) /*!< in: condition (ignored) */
  2476. {
  2477. DBUG_ENTER("i_s_fts_deleted_fill");
  2478. DBUG_RETURN(i_s_fts_deleted_generic_fill(thd, tables, FALSE));
  2479. }
  2480. /*******************************************************************//**
  2481. Bind the dynamic table INFORMATION_SCHEMA.INNODB_FT_DELETED
  2482. @return 0 on success */
  2483. static
  2484. int
  2485. i_s_fts_deleted_init(
  2486. /*=================*/
  2487. void* p) /*!< in/out: table schema object */
  2488. {
  2489. DBUG_ENTER("i_s_fts_deleted_init");
  2490. ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
  2491. schema->fields_info = i_s_fts_doc_fields_info;
  2492. schema->fill_table = i_s_fts_deleted_fill;
  2493. DBUG_RETURN(0);
  2494. }
  2495. UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_deleted =
  2496. {
  2497. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  2498. /* int */
  2499. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  2500. /* pointer to type-specific plugin descriptor */
  2501. /* void* */
  2502. STRUCT_FLD(info, &i_s_info),
  2503. /* plugin name */
  2504. /* const char* */
  2505. STRUCT_FLD(name, "INNODB_FT_DELETED"),
  2506. /* plugin author (for SHOW PLUGINS) */
  2507. /* const char* */
  2508. STRUCT_FLD(author, plugin_author),
  2509. /* general descriptive text (for SHOW PLUGINS) */
  2510. /* const char* */
  2511. STRUCT_FLD(descr, "INNODB AUXILIARY FTS DELETED TABLE"),
  2512. /* the plugin license (PLUGIN_LICENSE_XXX) */
  2513. /* int */
  2514. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  2515. /* the function to invoke when plugin is loaded */
  2516. /* int (*)(void*); */
  2517. STRUCT_FLD(init, i_s_fts_deleted_init),
  2518. /* the function to invoke when plugin is unloaded */
  2519. /* int (*)(void*); */
  2520. STRUCT_FLD(deinit, i_s_common_deinit),
  2521. /* plugin version (for SHOW PLUGINS) */
  2522. /* unsigned int */
  2523. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  2524. /* struct st_mysql_show_var* */
  2525. STRUCT_FLD(status_vars, NULL),
  2526. /* struct st_mysql_sys_var** */
  2527. STRUCT_FLD(system_vars, NULL),
  2528. /* Maria extension */
  2529. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  2530. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  2531. };
  2532. /*******************************************************************//**
  2533. Fill the dynamic table INFORMATION_SCHEMA.INNODB_FT_BEING_DELETED
  2534. @return 0 on success, 1 on failure */
  2535. static
  2536. int
  2537. i_s_fts_being_deleted_fill(
  2538. /*=======================*/
  2539. THD* thd, /*!< in: thread */
  2540. TABLE_LIST* tables, /*!< in/out: tables to fill */
  2541. Item* ) /*!< in: condition (ignored) */
  2542. {
  2543. DBUG_ENTER("i_s_fts_being_deleted_fill");
  2544. DBUG_RETURN(i_s_fts_deleted_generic_fill(thd, tables, TRUE));
  2545. }
  2546. /*******************************************************************//**
  2547. Bind the dynamic table INFORMATION_SCHEMA.INNODB_FT_BEING_DELETED
  2548. @return 0 on success */
  2549. static
  2550. int
  2551. i_s_fts_being_deleted_init(
  2552. /*=======================*/
  2553. void* p) /*!< in/out: table schema object */
  2554. {
  2555. DBUG_ENTER("i_s_fts_deleted_init");
  2556. ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
  2557. schema->fields_info = i_s_fts_doc_fields_info;
  2558. schema->fill_table = i_s_fts_being_deleted_fill;
  2559. DBUG_RETURN(0);
  2560. }
  2561. UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_being_deleted =
  2562. {
  2563. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  2564. /* int */
  2565. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  2566. /* pointer to type-specific plugin descriptor */
  2567. /* void* */
  2568. STRUCT_FLD(info, &i_s_info),
  2569. /* plugin name */
  2570. /* const char* */
  2571. STRUCT_FLD(name, "INNODB_FT_BEING_DELETED"),
  2572. /* plugin author (for SHOW PLUGINS) */
  2573. /* const char* */
  2574. STRUCT_FLD(author, plugin_author),
  2575. /* general descriptive text (for SHOW PLUGINS) */
  2576. /* const char* */
  2577. STRUCT_FLD(descr, "INNODB AUXILIARY FTS BEING DELETED TABLE"),
  2578. /* the plugin license (PLUGIN_LICENSE_XXX) */
  2579. /* int */
  2580. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  2581. /* the function to invoke when plugin is loaded */
  2582. /* int (*)(void*); */
  2583. STRUCT_FLD(init, i_s_fts_being_deleted_init),
  2584. /* the function to invoke when plugin is unloaded */
  2585. /* int (*)(void*); */
  2586. STRUCT_FLD(deinit, i_s_common_deinit),
  2587. /* plugin version (for SHOW PLUGINS) */
  2588. /* unsigned int */
  2589. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  2590. /* struct st_mysql_show_var* */
  2591. STRUCT_FLD(status_vars, NULL),
  2592. /* struct st_mysql_sys_var** */
  2593. STRUCT_FLD(system_vars, NULL),
  2594. /* Maria extension */
  2595. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  2596. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  2597. };
  2598. /* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHED and
  2599. INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE */
  2600. static ST_FIELD_INFO i_s_fts_index_fields_info[] =
  2601. {
  2602. #define I_S_FTS_WORD 0
  2603. {STRUCT_FLD(field_name, "WORD"),
  2604. STRUCT_FLD(field_length, FTS_MAX_WORD_LEN + 1),
  2605. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  2606. STRUCT_FLD(value, 0),
  2607. STRUCT_FLD(field_flags, 0),
  2608. STRUCT_FLD(old_name, ""),
  2609. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  2610. #define I_S_FTS_FIRST_DOC_ID 1
  2611. {STRUCT_FLD(field_name, "FIRST_DOC_ID"),
  2612. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  2613. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  2614. STRUCT_FLD(value, 0),
  2615. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  2616. STRUCT_FLD(old_name, ""),
  2617. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  2618. #define I_S_FTS_LAST_DOC_ID 2
  2619. {STRUCT_FLD(field_name, "LAST_DOC_ID"),
  2620. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  2621. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  2622. STRUCT_FLD(value, 0),
  2623. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  2624. STRUCT_FLD(old_name, ""),
  2625. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  2626. #define I_S_FTS_DOC_COUNT 3
  2627. {STRUCT_FLD(field_name, "DOC_COUNT"),
  2628. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  2629. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  2630. STRUCT_FLD(value, 0),
  2631. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  2632. STRUCT_FLD(old_name, ""),
  2633. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  2634. #define I_S_FTS_ILIST_DOC_ID 4
  2635. {STRUCT_FLD(field_name, "DOC_ID"),
  2636. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  2637. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  2638. STRUCT_FLD(value, 0),
  2639. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  2640. STRUCT_FLD(old_name, ""),
  2641. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  2642. #define I_S_FTS_ILIST_DOC_POS 5
  2643. {STRUCT_FLD(field_name, "POSITION"),
  2644. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  2645. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  2646. STRUCT_FLD(value, 0),
  2647. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  2648. STRUCT_FLD(old_name, ""),
  2649. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  2650. END_OF_ST_FIELD_INFO
  2651. };
  2652. /*******************************************************************//**
  2653. Go through the Doc Node and its ilist, fill the dynamic table
  2654. INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHED for one FTS index on the table.
  2655. @return 0 on success, 1 on failure */
  2656. static
  2657. int
  2658. i_s_fts_index_cache_fill_one_index(
  2659. /*===============================*/
  2660. fts_index_cache_t* index_cache, /*!< in: FTS index cache */
  2661. THD* thd, /*!< in: thread */
  2662. fts_string_t* conv_str, /*!< in/out: buffer */
  2663. TABLE_LIST* tables) /*!< in/out: tables to fill */
  2664. {
  2665. TABLE* table = (TABLE*) tables->table;
  2666. Field** fields;
  2667. CHARSET_INFO* index_charset;
  2668. const ib_rbt_node_t* rbt_node;
  2669. uint dummy_errors;
  2670. char* word_str;
  2671. DBUG_ENTER("i_s_fts_index_cache_fill_one_index");
  2672. fields = table->field;
  2673. index_charset = index_cache->charset;
  2674. conv_str->f_n_char = 0;
  2675. int ret = 0;
  2676. /* Go through each word in the index cache */
  2677. for (rbt_node = rbt_first(index_cache->words);
  2678. rbt_node;
  2679. rbt_node = rbt_next(index_cache->words, rbt_node)) {
  2680. fts_tokenizer_word_t* word;
  2681. word = rbt_value(fts_tokenizer_word_t, rbt_node);
  2682. /* Convert word from index charset to system_charset_info */
  2683. if (index_charset->cset != system_charset_info->cset) {
  2684. conv_str->f_n_char = my_convert(
  2685. reinterpret_cast<char*>(conv_str->f_str),
  2686. static_cast<uint32>(conv_str->f_len),
  2687. system_charset_info,
  2688. reinterpret_cast<char*>(word->text.f_str),
  2689. static_cast<uint32>(word->text.f_len),
  2690. index_charset, &dummy_errors);
  2691. ut_ad(conv_str->f_n_char <= conv_str->f_len);
  2692. conv_str->f_str[conv_str->f_n_char] = 0;
  2693. word_str = reinterpret_cast<char*>(conv_str->f_str);
  2694. } else {
  2695. word_str = reinterpret_cast<char*>(word->text.f_str);
  2696. }
  2697. /* Decrypt the ilist, and display Dod ID and word position */
  2698. for (ulint i = 0; i < ib_vector_size(word->nodes); i++) {
  2699. fts_node_t* node;
  2700. byte* ptr;
  2701. ulint decoded = 0;
  2702. doc_id_t doc_id = 0;
  2703. node = static_cast<fts_node_t*> (ib_vector_get(
  2704. word->nodes, i));
  2705. ptr = node->ilist;
  2706. while (decoded < node->ilist_size) {
  2707. ulint pos = fts_decode_vlc(&ptr);
  2708. doc_id += pos;
  2709. /* Get position info */
  2710. while (*ptr) {
  2711. pos = fts_decode_vlc(&ptr);
  2712. OK(field_store_string(
  2713. fields[I_S_FTS_WORD],
  2714. word_str));
  2715. OK(fields[I_S_FTS_FIRST_DOC_ID]->store(
  2716. (longlong) node->first_doc_id,
  2717. true));
  2718. OK(fields[I_S_FTS_LAST_DOC_ID]->store(
  2719. (longlong) node->last_doc_id,
  2720. true));
  2721. OK(fields[I_S_FTS_DOC_COUNT]->store(
  2722. static_cast<double>(node->doc_count)));
  2723. OK(fields[I_S_FTS_ILIST_DOC_ID]->store(
  2724. (longlong) doc_id, true));
  2725. OK(fields[I_S_FTS_ILIST_DOC_POS]->store(
  2726. static_cast<double>(pos)));
  2727. OK(schema_table_store_record(
  2728. thd, table));
  2729. }
  2730. ++ptr;
  2731. decoded = ptr - (byte*) node->ilist;
  2732. }
  2733. }
  2734. }
  2735. DBUG_RETURN(ret);
  2736. }
  2737. /*******************************************************************//**
  2738. Fill the dynamic table INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHED
  2739. @return 0 on success, 1 on failure */
  2740. static
  2741. int
  2742. i_s_fts_index_cache_fill(
  2743. /*=====================*/
  2744. THD* thd, /*!< in: thread */
  2745. TABLE_LIST* tables, /*!< in/out: tables to fill */
  2746. Item* ) /*!< in: condition (ignored) */
  2747. {
  2748. dict_table_t* user_table;
  2749. fts_cache_t* cache;
  2750. DBUG_ENTER("i_s_fts_index_cache_fill");
  2751. /* deny access to non-superusers */
  2752. if (check_global_access(thd, PROCESS_ACL)) {
  2753. DBUG_RETURN(0);
  2754. }
  2755. if (!fts_internal_tbl_name) {
  2756. DBUG_RETURN(0);
  2757. }
  2758. user_table = dict_table_open_on_name(
  2759. fts_internal_tbl_name, FALSE, FALSE, DICT_ERR_IGNORE_NONE);
  2760. if (!user_table) {
  2761. DBUG_RETURN(0);
  2762. }
  2763. if (user_table->fts == NULL || user_table->fts->cache == NULL) {
  2764. dict_table_close(user_table, FALSE, FALSE);
  2765. DBUG_RETURN(0);
  2766. }
  2767. cache = user_table->fts->cache;
  2768. ut_a(cache);
  2769. int ret = 0;
  2770. fts_string_t conv_str;
  2771. conv_str.f_len = system_charset_info->mbmaxlen
  2772. * FTS_MAX_WORD_LEN_IN_CHAR;
  2773. conv_str.f_str = static_cast<byte*>(ut_malloc(conv_str.f_len));
  2774. for (ulint i = 0; i < ib_vector_size(cache->indexes); i++) {
  2775. fts_index_cache_t* index_cache;
  2776. index_cache = static_cast<fts_index_cache_t*> (
  2777. ib_vector_get(cache->indexes, i));
  2778. BREAK_IF(ret = i_s_fts_index_cache_fill_one_index(
  2779. index_cache, thd, &conv_str, tables));
  2780. }
  2781. ut_free(conv_str.f_str);
  2782. dict_table_close(user_table, FALSE, FALSE);
  2783. DBUG_RETURN(ret);
  2784. }
  2785. /*******************************************************************//**
  2786. Bind the dynamic table INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE
  2787. @return 0 on success */
  2788. static
  2789. int
  2790. i_s_fts_index_cache_init(
  2791. /*=====================*/
  2792. void* p) /*!< in/out: table schema object */
  2793. {
  2794. DBUG_ENTER("i_s_fts_index_cache_init");
  2795. ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
  2796. schema->fields_info = i_s_fts_index_fields_info;
  2797. schema->fill_table = i_s_fts_index_cache_fill;
  2798. DBUG_RETURN(0);
  2799. }
  2800. UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_index_cache =
  2801. {
  2802. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  2803. /* int */
  2804. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  2805. /* pointer to type-specific plugin descriptor */
  2806. /* void* */
  2807. STRUCT_FLD(info, &i_s_info),
  2808. /* plugin name */
  2809. /* const char* */
  2810. STRUCT_FLD(name, "INNODB_FT_INDEX_CACHE"),
  2811. /* plugin author (for SHOW PLUGINS) */
  2812. /* const char* */
  2813. STRUCT_FLD(author, plugin_author),
  2814. /* general descriptive text (for SHOW PLUGINS) */
  2815. /* const char* */
  2816. STRUCT_FLD(descr, "INNODB AUXILIARY FTS INDEX CACHED"),
  2817. /* the plugin license (PLUGIN_LICENSE_XXX) */
  2818. /* int */
  2819. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  2820. /* the function to invoke when plugin is loaded */
  2821. /* int (*)(void*); */
  2822. STRUCT_FLD(init, i_s_fts_index_cache_init),
  2823. /* the function to invoke when plugin is unloaded */
  2824. /* int (*)(void*); */
  2825. STRUCT_FLD(deinit, i_s_common_deinit),
  2826. /* plugin version (for SHOW PLUGINS) */
  2827. /* unsigned int */
  2828. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  2829. /* struct st_mysql_show_var* */
  2830. STRUCT_FLD(status_vars, NULL),
  2831. /* struct st_mysql_sys_var** */
  2832. STRUCT_FLD(system_vars, NULL),
  2833. /* Maria extension */
  2834. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  2835. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  2836. };
  2837. /*******************************************************************//**
  2838. Go through a FTS index auxiliary table, fetch its rows and fill
  2839. FTS word cache structure.
  2840. @return DB_SUCCESS on success, otherwise error code */
  2841. static
  2842. dberr_t
  2843. i_s_fts_index_table_fill_selected(
  2844. /*==============================*/
  2845. dict_index_t* index, /*!< in: FTS index */
  2846. ib_vector_t* words, /*!< in/out: vector to hold
  2847. fetched words */
  2848. ulint selected, /*!< in: selected FTS index */
  2849. fts_string_t* word) /*!< in: word to select */
  2850. {
  2851. pars_info_t* info;
  2852. fts_table_t fts_table;
  2853. trx_t* trx;
  2854. que_t* graph;
  2855. dberr_t error;
  2856. fts_fetch_t fetch;
  2857. char table_name[MAX_FULL_NAME_LEN];
  2858. info = pars_info_create();
  2859. fetch.read_arg = words;
  2860. fetch.read_record = fts_optimize_index_fetch_node;
  2861. fetch.total_memory = 0;
  2862. DBUG_EXECUTE_IF("fts_instrument_result_cache_limit",
  2863. fts_result_cache_limit = 8192;
  2864. );
  2865. trx = trx_allocate_for_background();
  2866. trx->op_info = "fetching FTS index nodes";
  2867. pars_info_bind_function(info, "my_func", fetch.read_record, &fetch);
  2868. pars_info_bind_varchar_literal(info, "word", word->f_str, word->f_len);
  2869. FTS_INIT_INDEX_TABLE(&fts_table, fts_get_suffix(selected),
  2870. FTS_INDEX_TABLE, index);
  2871. fts_get_table_name(&fts_table, table_name);
  2872. pars_info_bind_id(info, true, "table_name", table_name);
  2873. graph = fts_parse_sql(
  2874. &fts_table, info,
  2875. "DECLARE FUNCTION my_func;\n"
  2876. "DECLARE CURSOR c IS"
  2877. " SELECT word, doc_count, first_doc_id, last_doc_id, "
  2878. "ilist\n"
  2879. " FROM $table_name WHERE word >= :word;\n"
  2880. "BEGIN\n"
  2881. "\n"
  2882. "OPEN c;\n"
  2883. "WHILE 1 = 1 LOOP\n"
  2884. " FETCH c INTO my_func();\n"
  2885. " IF c % NOTFOUND THEN\n"
  2886. " EXIT;\n"
  2887. " END IF;\n"
  2888. "END LOOP;\n"
  2889. "CLOSE c;");
  2890. for(;;) {
  2891. error = fts_eval_sql(trx, graph);
  2892. if (error == DB_SUCCESS) {
  2893. fts_sql_commit(trx);
  2894. break;
  2895. } else {
  2896. fts_sql_rollback(trx);
  2897. ut_print_timestamp(stderr);
  2898. if (error == DB_LOCK_WAIT_TIMEOUT) {
  2899. fprintf(stderr, " InnoDB: Warning: "
  2900. "lock wait timeout reading "
  2901. "FTS index. Retrying!\n");
  2902. trx->error_state = DB_SUCCESS;
  2903. } else {
  2904. fprintf(stderr, " InnoDB: Error: %d "
  2905. "while reading FTS index.\n", error);
  2906. break;
  2907. }
  2908. }
  2909. }
  2910. mutex_enter(&dict_sys->mutex);
  2911. que_graph_free(graph);
  2912. mutex_exit(&dict_sys->mutex);
  2913. trx_free_for_background(trx);
  2914. if (fetch.total_memory >= fts_result_cache_limit) {
  2915. error = DB_FTS_EXCEED_RESULT_CACHE_LIMIT;
  2916. }
  2917. return(error);
  2918. }
  2919. /*******************************************************************//**
  2920. Free words. */
  2921. static
  2922. void
  2923. i_s_fts_index_table_free_one_fetch(
  2924. /*===============================*/
  2925. ib_vector_t* words) /*!< in: words fetched */
  2926. {
  2927. for (ulint i = 0; i < ib_vector_size(words); i++) {
  2928. fts_word_t* word;
  2929. word = static_cast<fts_word_t*>(ib_vector_get(words, i));
  2930. for (ulint j = 0; j < ib_vector_size(word->nodes); j++) {
  2931. fts_node_t* node;
  2932. node = static_cast<fts_node_t*> (ib_vector_get(
  2933. word->nodes, j));
  2934. ut_free(node->ilist);
  2935. }
  2936. fts_word_free(word);
  2937. }
  2938. ib_vector_reset(words);
  2939. }
  2940. /*******************************************************************//**
  2941. Go through words, fill INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE.
  2942. @return 0 on success, 1 on failure */
  2943. static
  2944. int
  2945. i_s_fts_index_table_fill_one_fetch(
  2946. /*===============================*/
  2947. CHARSET_INFO* index_charset, /*!< in: FTS index charset */
  2948. THD* thd, /*!< in: thread */
  2949. TABLE_LIST* tables, /*!< in/out: tables to fill */
  2950. ib_vector_t* words, /*!< in: words fetched */
  2951. fts_string_t* conv_str, /*!< in: string for conversion*/
  2952. bool has_more) /*!< in: has more to fetch */
  2953. {
  2954. TABLE* table = (TABLE*) tables->table;
  2955. Field** fields;
  2956. uint dummy_errors;
  2957. char* word_str;
  2958. ulint words_size;
  2959. int ret = 0;
  2960. DBUG_ENTER("i_s_fts_index_table_fill_one_fetch");
  2961. fields = table->field;
  2962. words_size = ib_vector_size(words);
  2963. if (has_more) {
  2964. /* the last word is not fetched completely. */
  2965. ut_ad(words_size > 1);
  2966. words_size -= 1;
  2967. }
  2968. /* Go through each word in the index cache */
  2969. for (ulint i = 0; i < words_size; i++) {
  2970. fts_word_t* word;
  2971. word = static_cast<fts_word_t*>(ib_vector_get(words, i));
  2972. word->text.f_str[word->text.f_len] = 0;
  2973. /* Convert word from index charset to system_charset_info */
  2974. if (index_charset->cset != system_charset_info->cset) {
  2975. conv_str->f_n_char = my_convert(
  2976. reinterpret_cast<char*>(conv_str->f_str),
  2977. static_cast<uint32>(conv_str->f_len),
  2978. system_charset_info,
  2979. reinterpret_cast<char*>(word->text.f_str),
  2980. static_cast<uint32>(word->text.f_len),
  2981. index_charset, &dummy_errors);
  2982. ut_ad(conv_str->f_n_char <= conv_str->f_len);
  2983. conv_str->f_str[conv_str->f_n_char] = 0;
  2984. word_str = reinterpret_cast<char*>(conv_str->f_str);
  2985. } else {
  2986. word_str = reinterpret_cast<char*>(word->text.f_str);
  2987. }
  2988. /* Decrypt the ilist, and display Dod ID and word position */
  2989. for (ulint i = 0; i < ib_vector_size(word->nodes); i++) {
  2990. fts_node_t* node;
  2991. byte* ptr;
  2992. ulint decoded = 0;
  2993. doc_id_t doc_id = 0;
  2994. node = static_cast<fts_node_t*> (ib_vector_get(
  2995. word->nodes, i));
  2996. ptr = node->ilist;
  2997. while (decoded < node->ilist_size) {
  2998. ulint pos = fts_decode_vlc(&ptr);
  2999. doc_id += pos;
  3000. /* Get position info */
  3001. while (*ptr) {
  3002. pos = fts_decode_vlc(&ptr);
  3003. OK(field_store_string(
  3004. fields[I_S_FTS_WORD],
  3005. word_str));
  3006. OK(fields[I_S_FTS_FIRST_DOC_ID]->store(
  3007. (longlong) node->first_doc_id,
  3008. true));
  3009. OK(fields[I_S_FTS_LAST_DOC_ID]->store(
  3010. (longlong) node->last_doc_id,
  3011. true));
  3012. OK(fields[I_S_FTS_DOC_COUNT]->store(
  3013. static_cast<double>(node->doc_count)));
  3014. OK(fields[I_S_FTS_ILIST_DOC_ID]->store(
  3015. (longlong) doc_id, true));
  3016. OK(fields[I_S_FTS_ILIST_DOC_POS]->store(
  3017. static_cast<double>(pos)));
  3018. OK(schema_table_store_record(
  3019. thd, table));
  3020. }
  3021. ++ptr;
  3022. decoded = ptr - (byte*) node->ilist;
  3023. }
  3024. }
  3025. }
  3026. DBUG_RETURN(ret);
  3027. }
  3028. /*******************************************************************//**
  3029. Go through a FTS index and its auxiliary tables, fetch rows in each table
  3030. and fill INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE.
  3031. @return 0 on success, 1 on failure */
  3032. static
  3033. int
  3034. i_s_fts_index_table_fill_one_index(
  3035. /*===============================*/
  3036. dict_index_t* index, /*!< in: FTS index */
  3037. THD* thd, /*!< in: thread */
  3038. fts_string_t* conv_str, /*!< in/out: buffer */
  3039. TABLE_LIST* tables) /*!< in/out: tables to fill */
  3040. {
  3041. ib_vector_t* words;
  3042. mem_heap_t* heap;
  3043. fts_string_t word;
  3044. CHARSET_INFO* index_charset;
  3045. dberr_t error;
  3046. int ret = 0;
  3047. DBUG_ENTER("i_s_fts_index_table_fill_one_index");
  3048. DBUG_ASSERT(!dict_index_is_online_ddl(index));
  3049. heap = mem_heap_create(1024);
  3050. words = ib_vector_create(ib_heap_allocator_create(heap),
  3051. sizeof(fts_word_t), 256);
  3052. word.f_str = NULL;
  3053. word.f_len = 0;
  3054. word.f_n_char = 0;
  3055. index_charset = fts_index_get_charset(index);
  3056. /* Iterate through each auxiliary table as described in
  3057. fts_index_selector */
  3058. for (ulint selected = 0; fts_index_selector[selected].value;
  3059. selected++) {
  3060. bool has_more = false;
  3061. do {
  3062. /* Fetch from index */
  3063. error = i_s_fts_index_table_fill_selected(
  3064. index, words, selected, &word);
  3065. if (error == DB_SUCCESS) {
  3066. has_more = false;
  3067. } else if (error == DB_FTS_EXCEED_RESULT_CACHE_LIMIT) {
  3068. has_more = true;
  3069. } else {
  3070. i_s_fts_index_table_free_one_fetch(words);
  3071. ret = 1;
  3072. goto func_exit;
  3073. }
  3074. if (has_more) {
  3075. fts_word_t* last_word;
  3076. /* Prepare start point for next fetch */
  3077. last_word = static_cast<fts_word_t*>(ib_vector_last(words));
  3078. ut_ad(last_word != NULL);
  3079. fts_utf8_string_dup(&word, &last_word->text, heap);
  3080. }
  3081. /* Fill into tables */
  3082. ret = i_s_fts_index_table_fill_one_fetch(
  3083. index_charset, thd, tables, words, conv_str,
  3084. has_more);
  3085. i_s_fts_index_table_free_one_fetch(words);
  3086. if (ret != 0) {
  3087. goto func_exit;
  3088. }
  3089. } while (has_more);
  3090. }
  3091. func_exit:
  3092. mem_heap_free(heap);
  3093. DBUG_RETURN(ret);
  3094. }
  3095. /*******************************************************************//**
  3096. Fill the dynamic table INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE
  3097. @return 0 on success, 1 on failure */
  3098. static
  3099. int
  3100. i_s_fts_index_table_fill(
  3101. /*=====================*/
  3102. THD* thd, /*!< in: thread */
  3103. TABLE_LIST* tables, /*!< in/out: tables to fill */
  3104. Item* ) /*!< in: condition (ignored) */
  3105. {
  3106. dict_table_t* user_table;
  3107. dict_index_t* index;
  3108. DBUG_ENTER("i_s_fts_index_table_fill");
  3109. /* deny access to non-superusers */
  3110. if (check_global_access(thd, PROCESS_ACL)) {
  3111. DBUG_RETURN(0);
  3112. }
  3113. if (!fts_internal_tbl_name) {
  3114. DBUG_RETURN(0);
  3115. }
  3116. /* Prevent DDL to drop fts aux tables. */
  3117. rw_lock_s_lock(&dict_operation_lock);
  3118. user_table = dict_table_open_on_name(
  3119. fts_internal_tbl_name, FALSE, FALSE, DICT_ERR_IGNORE_NONE);
  3120. if (!user_table) {
  3121. rw_lock_s_unlock(&dict_operation_lock);
  3122. DBUG_RETURN(0);
  3123. }
  3124. int ret = 0;
  3125. fts_string_t conv_str;
  3126. conv_str.f_len = system_charset_info->mbmaxlen
  3127. * FTS_MAX_WORD_LEN_IN_CHAR;
  3128. conv_str.f_str = static_cast<byte*>(ut_malloc(conv_str.f_len));
  3129. for (index = dict_table_get_first_index(user_table);
  3130. index; index = dict_table_get_next_index(index)) {
  3131. if (index->type & DICT_FTS) {
  3132. BREAK_IF(ret = i_s_fts_index_table_fill_one_index(
  3133. index, thd, &conv_str, tables));
  3134. }
  3135. }
  3136. dict_table_close(user_table, FALSE, FALSE);
  3137. rw_lock_s_unlock(&dict_operation_lock);
  3138. ut_free(conv_str.f_str);
  3139. DBUG_RETURN(ret);
  3140. }
  3141. /*******************************************************************//**
  3142. Bind the dynamic table INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE
  3143. @return 0 on success */
  3144. static
  3145. int
  3146. i_s_fts_index_table_init(
  3147. /*=====================*/
  3148. void* p) /*!< in/out: table schema object */
  3149. {
  3150. DBUG_ENTER("i_s_fts_index_table_init");
  3151. ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
  3152. schema->fields_info = i_s_fts_index_fields_info;
  3153. schema->fill_table = i_s_fts_index_table_fill;
  3154. DBUG_RETURN(0);
  3155. }
  3156. UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_index_table =
  3157. {
  3158. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  3159. /* int */
  3160. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  3161. /* pointer to type-specific plugin descriptor */
  3162. /* void* */
  3163. STRUCT_FLD(info, &i_s_info),
  3164. /* plugin name */
  3165. /* const char* */
  3166. STRUCT_FLD(name, "INNODB_FT_INDEX_TABLE"),
  3167. /* plugin author (for SHOW PLUGINS) */
  3168. /* const char* */
  3169. STRUCT_FLD(author, plugin_author),
  3170. /* general descriptive text (for SHOW PLUGINS) */
  3171. /* const char* */
  3172. STRUCT_FLD(descr, "INNODB AUXILIARY FTS INDEX TABLE"),
  3173. /* the plugin license (PLUGIN_LICENSE_XXX) */
  3174. /* int */
  3175. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  3176. /* the function to invoke when plugin is loaded */
  3177. /* int (*)(void*); */
  3178. STRUCT_FLD(init, i_s_fts_index_table_init),
  3179. /* the function to invoke when plugin is unloaded */
  3180. /* int (*)(void*); */
  3181. STRUCT_FLD(deinit, i_s_common_deinit),
  3182. /* plugin version (for SHOW PLUGINS) */
  3183. /* unsigned int */
  3184. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  3185. /* struct st_mysql_show_var* */
  3186. STRUCT_FLD(status_vars, NULL),
  3187. /* struct st_mysql_sys_var** */
  3188. STRUCT_FLD(system_vars, NULL),
  3189. /* Maria extension */
  3190. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  3191. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  3192. };
  3193. /* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_FT_CONFIG */
  3194. static ST_FIELD_INFO i_s_fts_config_fields_info[] =
  3195. {
  3196. #define FTS_CONFIG_KEY 0
  3197. {STRUCT_FLD(field_name, "KEY"),
  3198. STRUCT_FLD(field_length, NAME_LEN + 1),
  3199. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  3200. STRUCT_FLD(value, 0),
  3201. STRUCT_FLD(field_flags, 0),
  3202. STRUCT_FLD(old_name, ""),
  3203. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3204. #define FTS_CONFIG_VALUE 1
  3205. {STRUCT_FLD(field_name, "VALUE"),
  3206. STRUCT_FLD(field_length, NAME_LEN + 1),
  3207. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  3208. STRUCT_FLD(value, 0),
  3209. STRUCT_FLD(field_flags, 0),
  3210. STRUCT_FLD(old_name, ""),
  3211. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3212. END_OF_ST_FIELD_INFO
  3213. };
  3214. static const char* fts_config_key[] = {
  3215. FTS_OPTIMIZE_LIMIT_IN_SECS,
  3216. FTS_SYNCED_DOC_ID,
  3217. FTS_STOPWORD_TABLE_NAME,
  3218. FTS_USE_STOPWORD,
  3219. NULL
  3220. };
  3221. /*******************************************************************//**
  3222. Fill the dynamic table INFORMATION_SCHEMA.INNODB_FT_CONFIG
  3223. @return 0 on success, 1 on failure */
  3224. static
  3225. int
  3226. i_s_fts_config_fill(
  3227. /*================*/
  3228. THD* thd, /*!< in: thread */
  3229. TABLE_LIST* tables, /*!< in/out: tables to fill */
  3230. Item* ) /*!< in: condition (ignored) */
  3231. {
  3232. Field** fields;
  3233. TABLE* table = (TABLE*) tables->table;
  3234. trx_t* trx;
  3235. fts_table_t fts_table;
  3236. dict_table_t* user_table;
  3237. ulint i = 0;
  3238. dict_index_t* index = NULL;
  3239. unsigned char str[FTS_MAX_CONFIG_VALUE_LEN + 1];
  3240. DBUG_ENTER("i_s_fts_config_fill");
  3241. /* deny access to non-superusers */
  3242. if (check_global_access(thd, PROCESS_ACL)) {
  3243. DBUG_RETURN(0);
  3244. }
  3245. if (!fts_internal_tbl_name) {
  3246. DBUG_RETURN(0);
  3247. }
  3248. DEBUG_SYNC_C("i_s_fts_config_fille_check");
  3249. fields = table->field;
  3250. /* Prevent DDL to drop fts aux tables. */
  3251. rw_lock_s_lock(&dict_operation_lock);
  3252. user_table = dict_table_open_on_name(
  3253. fts_internal_tbl_name, FALSE, FALSE, DICT_ERR_IGNORE_NONE);
  3254. if (!user_table) {
  3255. rw_lock_s_unlock(&dict_operation_lock);
  3256. DBUG_RETURN(0);
  3257. } else if (!dict_table_has_fts_index(user_table)) {
  3258. dict_table_close(user_table, FALSE, FALSE);
  3259. rw_lock_s_unlock(&dict_operation_lock);
  3260. DBUG_RETURN(0);
  3261. }
  3262. trx = trx_allocate_for_background();
  3263. trx->op_info = "Select for FTS CONFIG TABLE";
  3264. FTS_INIT_FTS_TABLE(&fts_table, "CONFIG", FTS_COMMON_TABLE, user_table);
  3265. if (!ib_vector_is_empty(user_table->fts->indexes)) {
  3266. index = (dict_index_t*) ib_vector_getp_const(
  3267. user_table->fts->indexes, 0);
  3268. DBUG_ASSERT(!dict_index_is_online_ddl(index));
  3269. }
  3270. int ret = 0;
  3271. while (fts_config_key[i]) {
  3272. fts_string_t value;
  3273. char* key_name;
  3274. ulint allocated = FALSE;
  3275. value.f_len = FTS_MAX_CONFIG_VALUE_LEN;
  3276. value.f_str = str;
  3277. if (index
  3278. && strcmp(fts_config_key[i], FTS_TOTAL_WORD_COUNT) == 0) {
  3279. key_name = fts_config_create_index_param_name(
  3280. fts_config_key[i], index);
  3281. allocated = TRUE;
  3282. } else {
  3283. key_name = (char*) fts_config_key[i];
  3284. }
  3285. fts_config_get_value(trx, &fts_table, key_name, &value);
  3286. if (allocated) {
  3287. ut_free(key_name);
  3288. }
  3289. BREAK_IF(ret = field_store_string(
  3290. fields[FTS_CONFIG_KEY], fts_config_key[i]));
  3291. BREAK_IF(ret = field_store_string(
  3292. fields[FTS_CONFIG_VALUE],
  3293. reinterpret_cast<const char*>(value.f_str)));
  3294. BREAK_IF(ret = schema_table_store_record(thd, table));
  3295. i++;
  3296. }
  3297. fts_sql_commit(trx);
  3298. trx_free_for_background(trx);
  3299. dict_table_close(user_table, FALSE, FALSE);
  3300. rw_lock_s_unlock(&dict_operation_lock);
  3301. DBUG_RETURN(ret);
  3302. }
  3303. /*******************************************************************//**
  3304. Bind the dynamic table INFORMATION_SCHEMA.INNODB_FT_CONFIG
  3305. @return 0 on success */
  3306. static
  3307. int
  3308. i_s_fts_config_init(
  3309. /*=================*/
  3310. void* p) /*!< in/out: table schema object */
  3311. {
  3312. DBUG_ENTER("i_s_fts_config_init");
  3313. ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
  3314. schema->fields_info = i_s_fts_config_fields_info;
  3315. schema->fill_table = i_s_fts_config_fill;
  3316. DBUG_RETURN(0);
  3317. }
  3318. UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_config =
  3319. {
  3320. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  3321. /* int */
  3322. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  3323. /* pointer to type-specific plugin descriptor */
  3324. /* void* */
  3325. STRUCT_FLD(info, &i_s_info),
  3326. /* plugin name */
  3327. /* const char* */
  3328. STRUCT_FLD(name, "INNODB_FT_CONFIG"),
  3329. /* plugin author (for SHOW PLUGINS) */
  3330. /* const char* */
  3331. STRUCT_FLD(author, plugin_author),
  3332. /* general descriptive text (for SHOW PLUGINS) */
  3333. /* const char* */
  3334. STRUCT_FLD(descr, "INNODB AUXILIARY FTS CONFIG TABLE"),
  3335. /* the plugin license (PLUGIN_LICENSE_XXX) */
  3336. /* int */
  3337. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  3338. /* the function to invoke when plugin is loaded */
  3339. /* int (*)(void*); */
  3340. STRUCT_FLD(init, i_s_fts_config_init),
  3341. /* the function to invoke when plugin is unloaded */
  3342. /* int (*)(void*); */
  3343. STRUCT_FLD(deinit, i_s_common_deinit),
  3344. /* plugin version (for SHOW PLUGINS) */
  3345. /* unsigned int */
  3346. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  3347. /* struct st_mysql_show_var* */
  3348. STRUCT_FLD(status_vars, NULL),
  3349. /* struct st_mysql_sys_var** */
  3350. STRUCT_FLD(system_vars, NULL),
  3351. /* Maria extension */
  3352. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  3353. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  3354. };
  3355. /* Fields of the dynamic table INNODB_BUFFER_POOL_STATS. */
  3356. static ST_FIELD_INFO i_s_innodb_buffer_stats_fields_info[] =
  3357. {
  3358. #define IDX_BUF_STATS_POOL_ID 0
  3359. {STRUCT_FLD(field_name, "POOL_ID"),
  3360. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3361. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3362. STRUCT_FLD(value, 0),
  3363. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3364. STRUCT_FLD(old_name, ""),
  3365. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3366. #define IDX_BUF_STATS_POOL_SIZE 1
  3367. {STRUCT_FLD(field_name, "POOL_SIZE"),
  3368. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3369. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3370. STRUCT_FLD(value, 0),
  3371. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3372. STRUCT_FLD(old_name, ""),
  3373. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3374. #define IDX_BUF_STATS_FREE_BUFFERS 2
  3375. {STRUCT_FLD(field_name, "FREE_BUFFERS"),
  3376. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3377. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3378. STRUCT_FLD(value, 0),
  3379. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3380. STRUCT_FLD(old_name, ""),
  3381. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3382. #define IDX_BUF_STATS_LRU_LEN 3
  3383. {STRUCT_FLD(field_name, "DATABASE_PAGES"),
  3384. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3385. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3386. STRUCT_FLD(value, 0),
  3387. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3388. STRUCT_FLD(old_name, ""),
  3389. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3390. #define IDX_BUF_STATS_OLD_LRU_LEN 4
  3391. {STRUCT_FLD(field_name, "OLD_DATABASE_PAGES"),
  3392. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3393. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3394. STRUCT_FLD(value, 0),
  3395. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3396. STRUCT_FLD(old_name, ""),
  3397. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3398. #define IDX_BUF_STATS_FLUSH_LIST_LEN 5
  3399. {STRUCT_FLD(field_name, "MODIFIED_DATABASE_PAGES"),
  3400. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3401. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3402. STRUCT_FLD(value, 0),
  3403. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3404. STRUCT_FLD(old_name, ""),
  3405. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3406. #define IDX_BUF_STATS_PENDING_ZIP 6
  3407. {STRUCT_FLD(field_name, "PENDING_DECOMPRESS"),
  3408. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3409. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3410. STRUCT_FLD(value, 0),
  3411. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3412. STRUCT_FLD(old_name, ""),
  3413. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3414. #define IDX_BUF_STATS_PENDING_READ 7
  3415. {STRUCT_FLD(field_name, "PENDING_READS"),
  3416. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3417. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3418. STRUCT_FLD(value, 0),
  3419. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3420. STRUCT_FLD(old_name, ""),
  3421. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3422. #define IDX_BUF_STATS_FLUSH_LRU 8
  3423. {STRUCT_FLD(field_name, "PENDING_FLUSH_LRU"),
  3424. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3425. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3426. STRUCT_FLD(value, 0),
  3427. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3428. STRUCT_FLD(old_name, ""),
  3429. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3430. #define IDX_BUF_STATS_FLUSH_LIST 9
  3431. {STRUCT_FLD(field_name, "PENDING_FLUSH_LIST"),
  3432. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3433. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3434. STRUCT_FLD(value, 0),
  3435. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3436. STRUCT_FLD(old_name, ""),
  3437. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3438. #define IDX_BUF_STATS_PAGE_YOUNG 10
  3439. {STRUCT_FLD(field_name, "PAGES_MADE_YOUNG"),
  3440. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3441. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3442. STRUCT_FLD(value, 0),
  3443. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3444. STRUCT_FLD(old_name, ""),
  3445. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3446. #define IDX_BUF_STATS_PAGE_NOT_YOUNG 11
  3447. {STRUCT_FLD(field_name, "PAGES_NOT_MADE_YOUNG"),
  3448. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3449. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3450. STRUCT_FLD(value, 0),
  3451. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3452. STRUCT_FLD(old_name, ""),
  3453. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3454. #define IDX_BUF_STATS_PAGE_YOUNG_RATE 12
  3455. {STRUCT_FLD(field_name, "PAGES_MADE_YOUNG_RATE"),
  3456. STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
  3457. STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
  3458. STRUCT_FLD(value, 0),
  3459. STRUCT_FLD(field_flags, 0),
  3460. STRUCT_FLD(old_name, ""),
  3461. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3462. #define IDX_BUF_STATS_PAGE_NOT_YOUNG_RATE 13
  3463. {STRUCT_FLD(field_name, "PAGES_MADE_NOT_YOUNG_RATE"),
  3464. STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
  3465. STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
  3466. STRUCT_FLD(value, 0),
  3467. STRUCT_FLD(field_flags, 0),
  3468. STRUCT_FLD(old_name, ""),
  3469. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3470. #define IDX_BUF_STATS_PAGE_READ 14
  3471. {STRUCT_FLD(field_name, "NUMBER_PAGES_READ"),
  3472. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3473. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3474. STRUCT_FLD(value, 0),
  3475. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3476. STRUCT_FLD(old_name, ""),
  3477. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3478. #define IDX_BUF_STATS_PAGE_CREATED 15
  3479. {STRUCT_FLD(field_name, "NUMBER_PAGES_CREATED"),
  3480. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3481. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3482. STRUCT_FLD(value, 0),
  3483. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3484. STRUCT_FLD(old_name, ""),
  3485. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3486. #define IDX_BUF_STATS_PAGE_WRITTEN 16
  3487. {STRUCT_FLD(field_name, "NUMBER_PAGES_WRITTEN"),
  3488. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3489. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3490. STRUCT_FLD(value, 0),
  3491. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3492. STRUCT_FLD(old_name, ""),
  3493. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3494. #define IDX_BUF_STATS_PAGE_READ_RATE 17
  3495. {STRUCT_FLD(field_name, "PAGES_READ_RATE"),
  3496. STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
  3497. STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
  3498. STRUCT_FLD(value, 0),
  3499. STRUCT_FLD(field_flags, 0),
  3500. STRUCT_FLD(old_name, ""),
  3501. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3502. #define IDX_BUF_STATS_PAGE_CREATE_RATE 18
  3503. {STRUCT_FLD(field_name, "PAGES_CREATE_RATE"),
  3504. STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
  3505. STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
  3506. STRUCT_FLD(value, 0),
  3507. STRUCT_FLD(field_flags, 0),
  3508. STRUCT_FLD(old_name, ""),
  3509. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3510. #define IDX_BUF_STATS_PAGE_WRITTEN_RATE 19
  3511. {STRUCT_FLD(field_name, "PAGES_WRITTEN_RATE"),
  3512. STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
  3513. STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
  3514. STRUCT_FLD(value, 0),
  3515. STRUCT_FLD(field_flags, 0),
  3516. STRUCT_FLD(old_name, ""),
  3517. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3518. #define IDX_BUF_STATS_GET 20
  3519. {STRUCT_FLD(field_name, "NUMBER_PAGES_GET"),
  3520. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3521. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3522. STRUCT_FLD(value, 0),
  3523. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3524. STRUCT_FLD(old_name, ""),
  3525. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3526. #define IDX_BUF_STATS_HIT_RATE 21
  3527. {STRUCT_FLD(field_name, "HIT_RATE"),
  3528. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3529. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3530. STRUCT_FLD(value, 0),
  3531. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3532. STRUCT_FLD(old_name, ""),
  3533. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3534. #define IDX_BUF_STATS_MADE_YOUNG_PCT 22
  3535. {STRUCT_FLD(field_name, "YOUNG_MAKE_PER_THOUSAND_GETS"),
  3536. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3537. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3538. STRUCT_FLD(value, 0),
  3539. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3540. STRUCT_FLD(old_name, ""),
  3541. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3542. #define IDX_BUF_STATS_NOT_MADE_YOUNG_PCT 23
  3543. {STRUCT_FLD(field_name, "NOT_YOUNG_MAKE_PER_THOUSAND_GETS"),
  3544. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3545. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3546. STRUCT_FLD(value, 0),
  3547. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3548. STRUCT_FLD(old_name, ""),
  3549. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3550. #define IDX_BUF_STATS_READ_AHREAD 24
  3551. {STRUCT_FLD(field_name, "NUMBER_PAGES_READ_AHEAD"),
  3552. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3553. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3554. STRUCT_FLD(value, 0),
  3555. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3556. STRUCT_FLD(old_name, ""),
  3557. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3558. #define IDX_BUF_STATS_READ_AHEAD_EVICTED 25
  3559. {STRUCT_FLD(field_name, "NUMBER_READ_AHEAD_EVICTED"),
  3560. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3561. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3562. STRUCT_FLD(value, 0),
  3563. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3564. STRUCT_FLD(old_name, ""),
  3565. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3566. #define IDX_BUF_STATS_READ_AHEAD_RATE 26
  3567. {STRUCT_FLD(field_name, "READ_AHEAD_RATE"),
  3568. STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
  3569. STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
  3570. STRUCT_FLD(value, 0),
  3571. STRUCT_FLD(field_flags, 0),
  3572. STRUCT_FLD(old_name, ""),
  3573. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3574. #define IDX_BUF_STATS_READ_AHEAD_EVICT_RATE 27
  3575. {STRUCT_FLD(field_name, "READ_AHEAD_EVICTED_RATE"),
  3576. STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
  3577. STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
  3578. STRUCT_FLD(value, 0),
  3579. STRUCT_FLD(field_flags, 0),
  3580. STRUCT_FLD(old_name, ""),
  3581. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3582. #define IDX_BUF_STATS_LRU_IO_SUM 28
  3583. {STRUCT_FLD(field_name, "LRU_IO_TOTAL"),
  3584. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3585. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3586. STRUCT_FLD(value, 0),
  3587. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3588. STRUCT_FLD(old_name, ""),
  3589. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3590. #define IDX_BUF_STATS_LRU_IO_CUR 29
  3591. {STRUCT_FLD(field_name, "LRU_IO_CURRENT"),
  3592. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3593. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3594. STRUCT_FLD(value, 0),
  3595. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3596. STRUCT_FLD(old_name, ""),
  3597. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3598. #define IDX_BUF_STATS_UNZIP_SUM 30
  3599. {STRUCT_FLD(field_name, "UNCOMPRESS_TOTAL"),
  3600. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3601. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3602. STRUCT_FLD(value, 0),
  3603. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3604. STRUCT_FLD(old_name, ""),
  3605. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3606. #define IDX_BUF_STATS_UNZIP_CUR 31
  3607. {STRUCT_FLD(field_name, "UNCOMPRESS_CURRENT"),
  3608. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3609. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3610. STRUCT_FLD(value, 0),
  3611. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3612. STRUCT_FLD(old_name, ""),
  3613. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3614. END_OF_ST_FIELD_INFO
  3615. };
  3616. /*******************************************************************//**
  3617. Fill Information Schema table INNODB_BUFFER_POOL_STATS for a particular
  3618. buffer pool
  3619. @return 0 on success, 1 on failure */
  3620. static
  3621. int
  3622. i_s_innodb_stats_fill(
  3623. /*==================*/
  3624. THD* thd, /*!< in: thread */
  3625. TABLE_LIST* tables, /*!< in/out: tables to fill */
  3626. const buf_pool_info_t* info) /*!< in: buffer pool
  3627. information */
  3628. {
  3629. TABLE* table;
  3630. Field** fields;
  3631. DBUG_ENTER("i_s_innodb_stats_fill");
  3632. table = tables->table;
  3633. fields = table->field;
  3634. OK(fields[IDX_BUF_STATS_POOL_ID]->store(
  3635. static_cast<double>(info->pool_unique_id)));
  3636. OK(fields[IDX_BUF_STATS_POOL_SIZE]->store(
  3637. static_cast<double>(info->pool_size)));
  3638. OK(fields[IDX_BUF_STATS_LRU_LEN]->store(
  3639. static_cast<double>(info->lru_len)));
  3640. OK(fields[IDX_BUF_STATS_OLD_LRU_LEN]->store(
  3641. static_cast<double>(info->old_lru_len)));
  3642. OK(fields[IDX_BUF_STATS_FREE_BUFFERS]->store(
  3643. static_cast<double>(info->free_list_len)));
  3644. OK(fields[IDX_BUF_STATS_FLUSH_LIST_LEN]->store(
  3645. static_cast<double>(info->flush_list_len)));
  3646. OK(fields[IDX_BUF_STATS_PENDING_ZIP]->store(
  3647. static_cast<double>(info->n_pend_unzip)));
  3648. OK(fields[IDX_BUF_STATS_PENDING_READ]->store(
  3649. static_cast<double>(info->n_pend_reads)));
  3650. OK(fields[IDX_BUF_STATS_FLUSH_LRU]->store(
  3651. static_cast<double>(info->n_pending_flush_lru)));
  3652. OK(fields[IDX_BUF_STATS_FLUSH_LIST]->store(
  3653. static_cast<double>(info->n_pending_flush_list)));
  3654. OK(fields[IDX_BUF_STATS_PAGE_YOUNG]->store(
  3655. static_cast<double>(info->n_pages_made_young)));
  3656. OK(fields[IDX_BUF_STATS_PAGE_NOT_YOUNG]->store(
  3657. static_cast<double>(info->n_pages_not_made_young)));
  3658. OK(fields[IDX_BUF_STATS_PAGE_YOUNG_RATE]->store(
  3659. info->page_made_young_rate));
  3660. OK(fields[IDX_BUF_STATS_PAGE_NOT_YOUNG_RATE]->store(
  3661. info->page_not_made_young_rate));
  3662. OK(fields[IDX_BUF_STATS_PAGE_READ]->store(
  3663. static_cast<double>(info->n_pages_read)));
  3664. OK(fields[IDX_BUF_STATS_PAGE_CREATED]->store(
  3665. static_cast<double>(info->n_pages_created)));
  3666. OK(fields[IDX_BUF_STATS_PAGE_WRITTEN]->store(
  3667. static_cast<double>(info->n_pages_written)));
  3668. OK(fields[IDX_BUF_STATS_GET]->store(
  3669. static_cast<double>(info->n_page_gets)));
  3670. OK(fields[IDX_BUF_STATS_PAGE_READ_RATE]->store(
  3671. info->pages_read_rate));
  3672. OK(fields[IDX_BUF_STATS_PAGE_CREATE_RATE]->store(
  3673. info->pages_created_rate));
  3674. OK(fields[IDX_BUF_STATS_PAGE_WRITTEN_RATE]->store(
  3675. info->pages_written_rate));
  3676. if (info->n_page_get_delta) {
  3677. if (info->page_read_delta <= info->n_page_get_delta) {
  3678. OK(fields[IDX_BUF_STATS_HIT_RATE]->store(
  3679. static_cast<double>(
  3680. 1000 - (1000 * info->page_read_delta
  3681. / info->n_page_get_delta))));
  3682. } else {
  3683. OK(fields[IDX_BUF_STATS_HIT_RATE]->store(0));
  3684. }
  3685. OK(fields[IDX_BUF_STATS_MADE_YOUNG_PCT]->store(
  3686. static_cast<double>(
  3687. 1000 * info->young_making_delta
  3688. / info->n_page_get_delta)));
  3689. OK(fields[IDX_BUF_STATS_NOT_MADE_YOUNG_PCT]->store(
  3690. static_cast<double>(
  3691. 1000 * info->not_young_making_delta
  3692. / info->n_page_get_delta)));
  3693. } else {
  3694. OK(fields[IDX_BUF_STATS_HIT_RATE]->store(0));
  3695. OK(fields[IDX_BUF_STATS_MADE_YOUNG_PCT]->store(0));
  3696. OK(fields[IDX_BUF_STATS_NOT_MADE_YOUNG_PCT]->store(0));
  3697. }
  3698. OK(fields[IDX_BUF_STATS_READ_AHREAD]->store(
  3699. static_cast<double>(info->n_ra_pages_read)));
  3700. OK(fields[IDX_BUF_STATS_READ_AHEAD_EVICTED]->store(
  3701. static_cast<double>(info->n_ra_pages_evicted)));
  3702. OK(fields[IDX_BUF_STATS_READ_AHEAD_RATE]->store(
  3703. info->pages_readahead_rate));
  3704. OK(fields[IDX_BUF_STATS_READ_AHEAD_EVICT_RATE]->store(
  3705. info->pages_evicted_rate));
  3706. OK(fields[IDX_BUF_STATS_LRU_IO_SUM]->store(
  3707. static_cast<double>(info->io_sum)));
  3708. OK(fields[IDX_BUF_STATS_LRU_IO_CUR]->store(
  3709. static_cast<double>(info->io_cur)));
  3710. OK(fields[IDX_BUF_STATS_UNZIP_SUM]->store(
  3711. static_cast<double>(info->unzip_sum)));
  3712. OK(fields[IDX_BUF_STATS_UNZIP_CUR]->store(
  3713. static_cast<double>(info->unzip_cur)));
  3714. DBUG_RETURN(schema_table_store_record(thd, table));
  3715. }
  3716. /*******************************************************************//**
  3717. This is the function that loops through each buffer pool and fetch buffer
  3718. pool stats to information schema table: I_S_INNODB_BUFFER_POOL_STATS
  3719. @return 0 on success, 1 on failure */
  3720. static
  3721. int
  3722. i_s_innodb_buffer_stats_fill_table(
  3723. /*===============================*/
  3724. THD* thd, /*!< in: thread */
  3725. TABLE_LIST* tables, /*!< in/out: tables to fill */
  3726. Item* ) /*!< in: condition (ignored) */
  3727. {
  3728. int status = 0;
  3729. buf_pool_info_t* pool_info;
  3730. DBUG_ENTER("i_s_innodb_buffer_fill_general");
  3731. RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
  3732. /* Only allow the PROCESS privilege holder to access the stats */
  3733. if (check_global_access(thd, PROCESS_ACL)) {
  3734. DBUG_RETURN(0);
  3735. }
  3736. pool_info = (buf_pool_info_t*) mem_zalloc(
  3737. srv_buf_pool_instances * sizeof *pool_info);
  3738. /* Walk through each buffer pool */
  3739. for (ulint i = 0; i < srv_buf_pool_instances; i++) {
  3740. buf_pool_t* buf_pool;
  3741. buf_pool = buf_pool_from_array(i);
  3742. /* Fetch individual buffer pool info */
  3743. buf_stats_get_pool_info(buf_pool, i, pool_info);
  3744. status = i_s_innodb_stats_fill(thd, tables, &pool_info[i]);
  3745. /* If something goes wrong, break and return */
  3746. if (status) {
  3747. break;
  3748. }
  3749. }
  3750. mem_free(pool_info);
  3751. DBUG_RETURN(status);
  3752. }
  3753. /*******************************************************************//**
  3754. Bind the dynamic table INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS.
  3755. @return 0 on success, 1 on failure */
  3756. static
  3757. int
  3758. i_s_innodb_buffer_pool_stats_init(
  3759. /*==============================*/
  3760. void* p) /*!< in/out: table schema object */
  3761. {
  3762. ST_SCHEMA_TABLE* schema;
  3763. DBUG_ENTER("i_s_innodb_buffer_pool_stats_init");
  3764. schema = reinterpret_cast<ST_SCHEMA_TABLE*>(p);
  3765. schema->fields_info = i_s_innodb_buffer_stats_fields_info;
  3766. schema->fill_table = i_s_innodb_buffer_stats_fill_table;
  3767. DBUG_RETURN(0);
  3768. }
  3769. UNIV_INTERN struct st_maria_plugin i_s_innodb_buffer_stats =
  3770. {
  3771. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  3772. /* int */
  3773. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  3774. /* pointer to type-specific plugin descriptor */
  3775. /* void* */
  3776. STRUCT_FLD(info, &i_s_info),
  3777. /* plugin name */
  3778. /* const char* */
  3779. STRUCT_FLD(name, "INNODB_BUFFER_POOL_STATS"),
  3780. /* plugin author (for SHOW PLUGINS) */
  3781. /* const char* */
  3782. STRUCT_FLD(author, plugin_author),
  3783. /* general descriptive text (for SHOW PLUGINS) */
  3784. /* const char* */
  3785. STRUCT_FLD(descr, "InnoDB Buffer Pool Statistics Information "),
  3786. /* the plugin license (PLUGIN_LICENSE_XXX) */
  3787. /* int */
  3788. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  3789. /* the function to invoke when plugin is loaded */
  3790. /* int (*)(void*); */
  3791. STRUCT_FLD(init, i_s_innodb_buffer_pool_stats_init),
  3792. /* the function to invoke when plugin is unloaded */
  3793. /* int (*)(void*); */
  3794. STRUCT_FLD(deinit, i_s_common_deinit),
  3795. /* plugin version (for SHOW PLUGINS) */
  3796. /* unsigned int */
  3797. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  3798. /* struct st_mysql_show_var* */
  3799. STRUCT_FLD(status_vars, NULL),
  3800. /* struct st_mysql_sys_var** */
  3801. STRUCT_FLD(system_vars, NULL),
  3802. /* Maria extension */
  3803. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  3804. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  3805. };
  3806. /* Fields of the dynamic table INNODB_BUFFER_POOL_PAGE. */
  3807. static ST_FIELD_INFO i_s_innodb_buffer_page_fields_info[] =
  3808. {
  3809. #define IDX_BUFFER_POOL_ID 0
  3810. {STRUCT_FLD(field_name, "POOL_ID"),
  3811. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3812. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3813. STRUCT_FLD(value, 0),
  3814. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3815. STRUCT_FLD(old_name, ""),
  3816. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3817. #define IDX_BUFFER_BLOCK_ID 1
  3818. {STRUCT_FLD(field_name, "BLOCK_ID"),
  3819. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3820. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3821. STRUCT_FLD(value, 0),
  3822. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3823. STRUCT_FLD(old_name, ""),
  3824. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3825. #define IDX_BUFFER_PAGE_SPACE 2
  3826. {STRUCT_FLD(field_name, "SPACE"),
  3827. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3828. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3829. STRUCT_FLD(value, 0),
  3830. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3831. STRUCT_FLD(old_name, ""),
  3832. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3833. #define IDX_BUFFER_PAGE_NUM 3
  3834. {STRUCT_FLD(field_name, "PAGE_NUMBER"),
  3835. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3836. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3837. STRUCT_FLD(value, 0),
  3838. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3839. STRUCT_FLD(old_name, ""),
  3840. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3841. #define IDX_BUFFER_PAGE_TYPE 4
  3842. {STRUCT_FLD(field_name, "PAGE_TYPE"),
  3843. STRUCT_FLD(field_length, 64),
  3844. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  3845. STRUCT_FLD(value, 0),
  3846. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  3847. STRUCT_FLD(old_name, ""),
  3848. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3849. #define IDX_BUFFER_PAGE_FLUSH_TYPE 5
  3850. {STRUCT_FLD(field_name, "FLUSH_TYPE"),
  3851. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3852. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3853. STRUCT_FLD(value, 0),
  3854. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3855. STRUCT_FLD(old_name, ""),
  3856. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3857. #define IDX_BUFFER_PAGE_FIX_COUNT 6
  3858. {STRUCT_FLD(field_name, "FIX_COUNT"),
  3859. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3860. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3861. STRUCT_FLD(value, 0),
  3862. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3863. STRUCT_FLD(old_name, ""),
  3864. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3865. #define IDX_BUFFER_PAGE_HASHED 7
  3866. {STRUCT_FLD(field_name, "IS_HASHED"),
  3867. STRUCT_FLD(field_length, 3),
  3868. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  3869. STRUCT_FLD(value, 0),
  3870. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  3871. STRUCT_FLD(old_name, ""),
  3872. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3873. #define IDX_BUFFER_PAGE_NEWEST_MOD 8
  3874. {STRUCT_FLD(field_name, "NEWEST_MODIFICATION"),
  3875. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3876. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3877. STRUCT_FLD(value, 0),
  3878. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3879. STRUCT_FLD(old_name, ""),
  3880. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3881. #define IDX_BUFFER_PAGE_OLDEST_MOD 9
  3882. {STRUCT_FLD(field_name, "OLDEST_MODIFICATION"),
  3883. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3884. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3885. STRUCT_FLD(value, 0),
  3886. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3887. STRUCT_FLD(old_name, ""),
  3888. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3889. #define IDX_BUFFER_PAGE_ACCESS_TIME 10
  3890. {STRUCT_FLD(field_name, "ACCESS_TIME"),
  3891. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3892. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3893. STRUCT_FLD(value, 0),
  3894. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3895. STRUCT_FLD(old_name, ""),
  3896. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3897. #define IDX_BUFFER_PAGE_TABLE_NAME 11
  3898. {STRUCT_FLD(field_name, "TABLE_NAME"),
  3899. STRUCT_FLD(field_length, 1024),
  3900. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  3901. STRUCT_FLD(value, 0),
  3902. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  3903. STRUCT_FLD(old_name, ""),
  3904. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3905. #define IDX_BUFFER_PAGE_INDEX_NAME 12
  3906. {STRUCT_FLD(field_name, "INDEX_NAME"),
  3907. STRUCT_FLD(field_length, 1024),
  3908. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  3909. STRUCT_FLD(value, 0),
  3910. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  3911. STRUCT_FLD(old_name, ""),
  3912. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3913. #define IDX_BUFFER_PAGE_NUM_RECS 13
  3914. {STRUCT_FLD(field_name, "NUMBER_RECORDS"),
  3915. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3916. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3917. STRUCT_FLD(value, 0),
  3918. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3919. STRUCT_FLD(old_name, ""),
  3920. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3921. #define IDX_BUFFER_PAGE_DATA_SIZE 14
  3922. {STRUCT_FLD(field_name, "DATA_SIZE"),
  3923. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3924. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3925. STRUCT_FLD(value, 0),
  3926. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3927. STRUCT_FLD(old_name, ""),
  3928. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3929. #define IDX_BUFFER_PAGE_ZIP_SIZE 15
  3930. {STRUCT_FLD(field_name, "COMPRESSED_SIZE"),
  3931. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3932. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3933. STRUCT_FLD(value, 0),
  3934. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3935. STRUCT_FLD(old_name, ""),
  3936. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3937. #define IDX_BUFFER_PAGE_STATE 16
  3938. {STRUCT_FLD(field_name, "PAGE_STATE"),
  3939. STRUCT_FLD(field_length, 64),
  3940. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  3941. STRUCT_FLD(value, 0),
  3942. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  3943. STRUCT_FLD(old_name, ""),
  3944. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3945. #define IDX_BUFFER_PAGE_IO_FIX 17
  3946. {STRUCT_FLD(field_name, "IO_FIX"),
  3947. STRUCT_FLD(field_length, 64),
  3948. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  3949. STRUCT_FLD(value, 0),
  3950. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  3951. STRUCT_FLD(old_name, ""),
  3952. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3953. #define IDX_BUFFER_PAGE_IS_OLD 18
  3954. {STRUCT_FLD(field_name, "IS_OLD"),
  3955. STRUCT_FLD(field_length, 3),
  3956. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  3957. STRUCT_FLD(value, 0),
  3958. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  3959. STRUCT_FLD(old_name, ""),
  3960. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3961. #define IDX_BUFFER_PAGE_FREE_CLOCK 19
  3962. {STRUCT_FLD(field_name, "FREE_PAGE_CLOCK"),
  3963. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  3964. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  3965. STRUCT_FLD(value, 0),
  3966. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  3967. STRUCT_FLD(old_name, ""),
  3968. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  3969. END_OF_ST_FIELD_INFO
  3970. };
  3971. /*******************************************************************//**
  3972. Fill Information Schema table INNODB_BUFFER_PAGE with information
  3973. cached in the buf_page_info_t array
  3974. @return 0 on success, 1 on failure */
  3975. static
  3976. int
  3977. i_s_innodb_buffer_page_fill(
  3978. /*========================*/
  3979. THD* thd, /*!< in: thread */
  3980. TABLE_LIST* tables, /*!< in/out: tables to fill */
  3981. const buf_page_info_t* info_array, /*!< in: array cached page
  3982. info */
  3983. ulint num_page) /*!< in: number of page info
  3984. cached */
  3985. {
  3986. TABLE* table;
  3987. Field** fields;
  3988. DBUG_ENTER("i_s_innodb_buffer_page_fill");
  3989. table = tables->table;
  3990. fields = table->field;
  3991. /* Iterate through the cached array and fill the I_S table rows */
  3992. for (ulint i = 0; i < num_page; i++) {
  3993. const buf_page_info_t* page_info;
  3994. char table_name[MAX_FULL_NAME_LEN + 1];
  3995. const char* table_name_end = NULL;
  3996. const char* state_str;
  3997. enum buf_page_state state;
  3998. page_info = info_array + i;
  3999. state_str = NULL;
  4000. OK(fields[IDX_BUFFER_POOL_ID]->store(
  4001. page_info->pool_id, true));
  4002. OK(fields[IDX_BUFFER_BLOCK_ID]->store(
  4003. page_info->block_id, true));
  4004. OK(fields[IDX_BUFFER_PAGE_SPACE]->store(
  4005. page_info->space_id, true));
  4006. OK(fields[IDX_BUFFER_PAGE_NUM]->store(
  4007. page_info->page_num, true));
  4008. OK(field_store_string(
  4009. fields[IDX_BUFFER_PAGE_TYPE],
  4010. i_s_page_type[page_info->page_type].type_str));
  4011. OK(fields[IDX_BUFFER_PAGE_FLUSH_TYPE]->store(
  4012. page_info->flush_type, true));
  4013. OK(fields[IDX_BUFFER_PAGE_FIX_COUNT]->store(
  4014. page_info->fix_count, true));
  4015. OK(field_store_string(fields[IDX_BUFFER_PAGE_HASHED],
  4016. page_info->hashed ? "YES" : "NO"));
  4017. OK(fields[IDX_BUFFER_PAGE_NEWEST_MOD]->store(
  4018. (longlong) page_info->newest_mod, true));
  4019. OK(fields[IDX_BUFFER_PAGE_OLDEST_MOD]->store(
  4020. (longlong) page_info->oldest_mod, true));
  4021. OK(fields[IDX_BUFFER_PAGE_ACCESS_TIME]->store(
  4022. page_info->access_time, true));
  4023. fields[IDX_BUFFER_PAGE_TABLE_NAME]->set_null();
  4024. fields[IDX_BUFFER_PAGE_INDEX_NAME]->set_null();
  4025. /* If this is an index page, fetch the index name
  4026. and table name */
  4027. if (page_info->page_type == I_S_PAGE_TYPE_INDEX) {
  4028. bool ret = false;
  4029. mutex_enter(&dict_sys->mutex);
  4030. const dict_index_t* index =
  4031. dict_index_get_if_in_cache_low(
  4032. page_info->index_id);
  4033. if (index) {
  4034. table_name_end = innobase_convert_name(
  4035. table_name, sizeof(table_name),
  4036. index->table_name,
  4037. strlen(index->table_name),
  4038. thd, TRUE);
  4039. ret = fields[IDX_BUFFER_PAGE_TABLE_NAME]
  4040. ->store(table_name,
  4041. static_cast<uint>(
  4042. table_name_end
  4043. - table_name),
  4044. system_charset_info)
  4045. || field_store_index_name(
  4046. fields
  4047. [IDX_BUFFER_PAGE_INDEX_NAME],
  4048. index->name);
  4049. }
  4050. mutex_exit(&dict_sys->mutex);
  4051. OK(ret);
  4052. if (index) {
  4053. fields[IDX_BUFFER_PAGE_TABLE_NAME]
  4054. ->set_notnull();
  4055. }
  4056. }
  4057. OK(fields[IDX_BUFFER_PAGE_NUM_RECS]->store(
  4058. page_info->num_recs, true));
  4059. OK(fields[IDX_BUFFER_PAGE_DATA_SIZE]->store(
  4060. page_info->data_size, true));
  4061. OK(fields[IDX_BUFFER_PAGE_ZIP_SIZE]->store(
  4062. page_info->zip_ssize
  4063. ? (UNIV_ZIP_SIZE_MIN >> 1) << page_info->zip_ssize
  4064. : 0, true));
  4065. #if BUF_PAGE_STATE_BITS > 3
  4066. # error "BUF_PAGE_STATE_BITS > 3, please ensure that all 1<<BUF_PAGE_STATE_BITS values are checked for"
  4067. #endif
  4068. state = static_cast<enum buf_page_state>(page_info->page_state);
  4069. switch (state) {
  4070. /* First three states are for compression pages and
  4071. are not states we would get as we scan pages through
  4072. buffer blocks */
  4073. case BUF_BLOCK_POOL_WATCH:
  4074. case BUF_BLOCK_ZIP_PAGE:
  4075. case BUF_BLOCK_ZIP_DIRTY:
  4076. state_str = NULL;
  4077. break;
  4078. case BUF_BLOCK_NOT_USED:
  4079. state_str = "NOT_USED";
  4080. break;
  4081. case BUF_BLOCK_READY_FOR_USE:
  4082. state_str = "READY_FOR_USE";
  4083. break;
  4084. case BUF_BLOCK_FILE_PAGE:
  4085. state_str = "FILE_PAGE";
  4086. break;
  4087. case BUF_BLOCK_MEMORY:
  4088. state_str = "MEMORY";
  4089. break;
  4090. case BUF_BLOCK_REMOVE_HASH:
  4091. state_str = "REMOVE_HASH";
  4092. break;
  4093. };
  4094. OK(field_store_string(fields[IDX_BUFFER_PAGE_STATE],
  4095. state_str));
  4096. switch (page_info->io_fix) {
  4097. case BUF_IO_NONE:
  4098. state_str = "IO_NONE";
  4099. break;
  4100. case BUF_IO_READ:
  4101. state_str = "IO_READ";
  4102. break;
  4103. case BUF_IO_WRITE:
  4104. state_str = "IO_WRITE";
  4105. break;
  4106. case BUF_IO_PIN:
  4107. state_str = "IO_PIN";
  4108. break;
  4109. }
  4110. OK(field_store_string(fields[IDX_BUFFER_PAGE_IO_FIX],
  4111. state_str));
  4112. OK(field_store_string(fields[IDX_BUFFER_PAGE_IS_OLD],
  4113. (page_info->is_old) ? "YES" : "NO"));
  4114. OK(fields[IDX_BUFFER_PAGE_FREE_CLOCK]->store(
  4115. page_info->freed_page_clock));
  4116. OK(schema_table_store_record(thd, table));
  4117. }
  4118. DBUG_RETURN(0);
  4119. }
  4120. /*******************************************************************//**
  4121. Set appropriate page type to a buf_page_info_t structure */
  4122. static
  4123. void
  4124. i_s_innodb_set_page_type(
  4125. /*=====================*/
  4126. buf_page_info_t*page_info, /*!< in/out: structure to fill with
  4127. scanned info */
  4128. ulint page_type, /*!< in: page type */
  4129. const byte* frame) /*!< in: buffer frame */
  4130. {
  4131. if (page_type == FIL_PAGE_INDEX) {
  4132. const page_t* page = (const page_t*) frame;
  4133. page_info->index_id = btr_page_get_index_id(page);
  4134. /* FIL_PAGE_INDEX is a bit special, its value
  4135. is defined as 17855, so we cannot use FIL_PAGE_INDEX
  4136. to index into i_s_page_type[] array, its array index
  4137. in the i_s_page_type[] array is I_S_PAGE_TYPE_INDEX
  4138. (1) for index pages or I_S_PAGE_TYPE_IBUF for
  4139. change buffer index pages */
  4140. if (page_info->index_id
  4141. == static_cast<index_id_t>(DICT_IBUF_ID_MIN
  4142. + IBUF_SPACE_ID)) {
  4143. page_info->page_type = I_S_PAGE_TYPE_IBUF;
  4144. } else {
  4145. page_info->page_type = I_S_PAGE_TYPE_INDEX;
  4146. }
  4147. page_info->data_size = (ulint)(page_header_get_field(
  4148. page, PAGE_HEAP_TOP) - (page_is_comp(page)
  4149. ? PAGE_NEW_SUPREMUM_END
  4150. : PAGE_OLD_SUPREMUM_END)
  4151. - page_header_get_field(page, PAGE_GARBAGE));
  4152. page_info->num_recs = page_get_n_recs(page);
  4153. } else if (page_type > FIL_PAGE_TYPE_LAST) {
  4154. /* Encountered an unknown page type */
  4155. page_info->page_type = I_S_PAGE_TYPE_UNKNOWN;
  4156. } else {
  4157. /* Make sure we get the right index into the
  4158. i_s_page_type[] array */
  4159. ut_a(page_type == i_s_page_type[page_type].type_value);
  4160. page_info->page_type = page_type;
  4161. }
  4162. if (page_info->page_type == FIL_PAGE_TYPE_ZBLOB
  4163. || page_info->page_type == FIL_PAGE_TYPE_ZBLOB2) {
  4164. page_info->page_num = mach_read_from_4(
  4165. frame + FIL_PAGE_OFFSET);
  4166. page_info->space_id = mach_read_from_4(
  4167. frame + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID);
  4168. }
  4169. }
  4170. /*******************************************************************//**
  4171. Scans pages in the buffer cache, and collect their general information
  4172. into the buf_page_info_t array which is zero-filled. So any fields
  4173. that are not initialized in the function will default to 0 */
  4174. static
  4175. void
  4176. i_s_innodb_buffer_page_get_info(
  4177. /*============================*/
  4178. const buf_page_t*bpage, /*!< in: buffer pool page to scan */
  4179. ulint pool_id, /*!< in: buffer pool id */
  4180. ulint pos, /*!< in: buffer block position in
  4181. buffer pool or in the LRU list */
  4182. buf_page_info_t*page_info) /*!< in: zero filled info structure;
  4183. out: structure filled with scanned
  4184. info */
  4185. {
  4186. ut_ad(pool_id < MAX_BUFFER_POOLS);
  4187. page_info->pool_id = pool_id;
  4188. page_info->block_id = pos;
  4189. page_info->page_state = buf_page_get_state(bpage);
  4190. /* Only fetch information for buffers that map to a tablespace,
  4191. that is, buffer page with state BUF_BLOCK_ZIP_PAGE,
  4192. BUF_BLOCK_ZIP_DIRTY or BUF_BLOCK_FILE_PAGE */
  4193. if (buf_page_in_file(bpage)) {
  4194. const byte* frame;
  4195. ulint page_type;
  4196. page_info->space_id = buf_page_get_space(bpage);
  4197. page_info->page_num = buf_page_get_page_no(bpage);
  4198. page_info->flush_type = bpage->flush_type;
  4199. page_info->fix_count = bpage->buf_fix_count;
  4200. page_info->newest_mod = bpage->newest_modification;
  4201. page_info->oldest_mod = bpage->oldest_modification;
  4202. page_info->access_time = bpage->access_time;
  4203. page_info->zip_ssize = bpage->zip.ssize;
  4204. page_info->io_fix = bpage->io_fix;
  4205. page_info->is_old = bpage->old;
  4206. page_info->freed_page_clock = bpage->freed_page_clock;
  4207. switch (buf_page_get_io_fix(bpage)) {
  4208. case BUF_IO_NONE:
  4209. case BUF_IO_WRITE:
  4210. case BUF_IO_PIN:
  4211. break;
  4212. case BUF_IO_READ:
  4213. page_info->page_type = I_S_PAGE_TYPE_UNKNOWN;
  4214. return;
  4215. }
  4216. if (page_info->page_state == BUF_BLOCK_FILE_PAGE) {
  4217. const buf_block_t*block;
  4218. block = reinterpret_cast<const buf_block_t*>(bpage);
  4219. frame = block->frame;
  4220. page_info->hashed = (block->index != NULL);
  4221. } else {
  4222. ut_ad(page_info->zip_ssize);
  4223. frame = bpage->zip.data;
  4224. }
  4225. page_type = fil_page_get_type(frame);
  4226. i_s_innodb_set_page_type(page_info, page_type, frame);
  4227. } else {
  4228. page_info->page_type = I_S_PAGE_TYPE_UNKNOWN;
  4229. }
  4230. }
  4231. /*******************************************************************//**
  4232. This is the function that goes through each block of the buffer pool
  4233. and fetch information to information schema tables: INNODB_BUFFER_PAGE.
  4234. @return 0 on success, 1 on failure */
  4235. static
  4236. int
  4237. i_s_innodb_fill_buffer_pool(
  4238. /*========================*/
  4239. THD* thd, /*!< in: thread */
  4240. TABLE_LIST* tables, /*!< in/out: tables to fill */
  4241. buf_pool_t* buf_pool, /*!< in: buffer pool to scan */
  4242. const ulint pool_id) /*!< in: buffer pool id */
  4243. {
  4244. int status = 0;
  4245. mem_heap_t* heap;
  4246. DBUG_ENTER("i_s_innodb_fill_buffer_pool");
  4247. RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
  4248. heap = mem_heap_create(10000);
  4249. /* Go through each chunk of buffer pool. Currently, we only
  4250. have one single chunk for each buffer pool */
  4251. for (ulint n = 0; n < buf_pool->n_chunks; n++) {
  4252. const buf_block_t* block;
  4253. ulint n_blocks;
  4254. buf_page_info_t* info_buffer;
  4255. ulint num_page;
  4256. ulint mem_size;
  4257. ulint chunk_size;
  4258. ulint num_to_process = 0;
  4259. ulint block_id = 0;
  4260. /* Get buffer block of the nth chunk */
  4261. block = buf_get_nth_chunk_block(buf_pool, n, &chunk_size);
  4262. num_page = 0;
  4263. while (chunk_size > 0) {
  4264. /* we cache maximum MAX_BUF_INFO_CACHED number of
  4265. buffer page info */
  4266. num_to_process = ut_min(chunk_size,
  4267. MAX_BUF_INFO_CACHED);
  4268. mem_size = num_to_process * sizeof(buf_page_info_t);
  4269. /* For each chunk, we'll pre-allocate information
  4270. structures to cache the page information read from
  4271. the buffer pool. Doing so before obtain any mutex */
  4272. info_buffer = (buf_page_info_t*) mem_heap_zalloc(
  4273. heap, mem_size);
  4274. /* Obtain appropriate mutexes. Since this is diagnostic
  4275. buffer pool info printout, we are not required to
  4276. preserve the overall consistency, so we can
  4277. release mutex periodically */
  4278. buf_pool_mutex_enter(buf_pool);
  4279. /* GO through each block in the chunk */
  4280. for (n_blocks = num_to_process; n_blocks--; block++) {
  4281. i_s_innodb_buffer_page_get_info(
  4282. &block->page, pool_id, block_id,
  4283. info_buffer + num_page);
  4284. block_id++;
  4285. num_page++;
  4286. }
  4287. buf_pool_mutex_exit(buf_pool);
  4288. /* Fill in information schema table with information
  4289. just collected from the buffer chunk scan */
  4290. status = i_s_innodb_buffer_page_fill(
  4291. thd, tables, info_buffer,
  4292. num_page);
  4293. /* If something goes wrong, break and return */
  4294. if (status) {
  4295. break;
  4296. }
  4297. mem_heap_empty(heap);
  4298. chunk_size -= num_to_process;
  4299. num_page = 0;
  4300. }
  4301. }
  4302. mem_heap_free(heap);
  4303. DBUG_RETURN(status);
  4304. }
  4305. /*******************************************************************//**
  4306. Fill page information for pages in InnoDB buffer pool to the
  4307. dynamic table INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
  4308. @return 0 on success, 1 on failure */
  4309. static
  4310. int
  4311. i_s_innodb_buffer_page_fill_table(
  4312. /*==============================*/
  4313. THD* thd, /*!< in: thread */
  4314. TABLE_LIST* tables, /*!< in/out: tables to fill */
  4315. Item* ) /*!< in: condition (ignored) */
  4316. {
  4317. int status = 0;
  4318. DBUG_ENTER("i_s_innodb_buffer_page_fill_table");
  4319. /* deny access to user without PROCESS privilege */
  4320. if (check_global_access(thd, PROCESS_ACL)) {
  4321. DBUG_RETURN(0);
  4322. }
  4323. /* Walk through each buffer pool */
  4324. for (ulint i = 0; i < srv_buf_pool_instances; i++) {
  4325. buf_pool_t* buf_pool;
  4326. buf_pool = buf_pool_from_array(i);
  4327. /* Fetch information from pages in this buffer pool,
  4328. and fill the corresponding I_S table */
  4329. status = i_s_innodb_fill_buffer_pool(thd, tables, buf_pool, i);
  4330. /* If something wrong, break and return */
  4331. if (status) {
  4332. break;
  4333. }
  4334. }
  4335. DBUG_RETURN(status);
  4336. }
  4337. /*******************************************************************//**
  4338. Bind the dynamic table INFORMATION_SCHEMA.INNODB_BUFFER_PAGE.
  4339. @return 0 on success, 1 on failure */
  4340. static
  4341. int
  4342. i_s_innodb_buffer_page_init(
  4343. /*========================*/
  4344. void* p) /*!< in/out: table schema object */
  4345. {
  4346. ST_SCHEMA_TABLE* schema;
  4347. DBUG_ENTER("i_s_innodb_buffer_page_init");
  4348. schema = reinterpret_cast<ST_SCHEMA_TABLE*>(p);
  4349. schema->fields_info = i_s_innodb_buffer_page_fields_info;
  4350. schema->fill_table = i_s_innodb_buffer_page_fill_table;
  4351. DBUG_RETURN(0);
  4352. }
  4353. UNIV_INTERN struct st_maria_plugin i_s_innodb_buffer_page =
  4354. {
  4355. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  4356. /* int */
  4357. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  4358. /* pointer to type-specific plugin descriptor */
  4359. /* void* */
  4360. STRUCT_FLD(info, &i_s_info),
  4361. /* plugin name */
  4362. /* const char* */
  4363. STRUCT_FLD(name, "INNODB_BUFFER_PAGE"),
  4364. /* plugin author (for SHOW PLUGINS) */
  4365. /* const char* */
  4366. STRUCT_FLD(author, plugin_author),
  4367. /* general descriptive text (for SHOW PLUGINS) */
  4368. /* const char* */
  4369. STRUCT_FLD(descr, "InnoDB Buffer Page Information"),
  4370. /* the plugin license (PLUGIN_LICENSE_XXX) */
  4371. /* int */
  4372. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  4373. /* the function to invoke when plugin is loaded */
  4374. /* int (*)(void*); */
  4375. STRUCT_FLD(init, i_s_innodb_buffer_page_init),
  4376. /* the function to invoke when plugin is unloaded */
  4377. /* int (*)(void*); */
  4378. STRUCT_FLD(deinit, i_s_common_deinit),
  4379. /* plugin version (for SHOW PLUGINS) */
  4380. /* unsigned int */
  4381. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  4382. /* struct st_mysql_show_var* */
  4383. STRUCT_FLD(status_vars, NULL),
  4384. /* struct st_mysql_sys_var** */
  4385. STRUCT_FLD(system_vars, NULL),
  4386. /* Maria extension */
  4387. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  4388. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  4389. };
  4390. static ST_FIELD_INFO i_s_innodb_buf_page_lru_fields_info[] =
  4391. {
  4392. #define IDX_BUF_LRU_POOL_ID 0
  4393. {STRUCT_FLD(field_name, "POOL_ID"),
  4394. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  4395. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  4396. STRUCT_FLD(value, 0),
  4397. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  4398. STRUCT_FLD(old_name, ""),
  4399. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4400. #define IDX_BUF_LRU_POS 1
  4401. {STRUCT_FLD(field_name, "LRU_POSITION"),
  4402. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  4403. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  4404. STRUCT_FLD(value, 0),
  4405. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  4406. STRUCT_FLD(old_name, ""),
  4407. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4408. #define IDX_BUF_LRU_PAGE_SPACE 2
  4409. {STRUCT_FLD(field_name, "SPACE"),
  4410. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  4411. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  4412. STRUCT_FLD(value, 0),
  4413. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  4414. STRUCT_FLD(old_name, ""),
  4415. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4416. #define IDX_BUF_LRU_PAGE_NUM 3
  4417. {STRUCT_FLD(field_name, "PAGE_NUMBER"),
  4418. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  4419. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  4420. STRUCT_FLD(value, 0),
  4421. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  4422. STRUCT_FLD(old_name, ""),
  4423. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4424. #define IDX_BUF_LRU_PAGE_TYPE 4
  4425. {STRUCT_FLD(field_name, "PAGE_TYPE"),
  4426. STRUCT_FLD(field_length, 64),
  4427. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  4428. STRUCT_FLD(value, 0),
  4429. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  4430. STRUCT_FLD(old_name, ""),
  4431. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4432. #define IDX_BUF_LRU_PAGE_FLUSH_TYPE 5
  4433. {STRUCT_FLD(field_name, "FLUSH_TYPE"),
  4434. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  4435. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  4436. STRUCT_FLD(value, 0),
  4437. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  4438. STRUCT_FLD(old_name, ""),
  4439. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4440. #define IDX_BUF_LRU_PAGE_FIX_COUNT 6
  4441. {STRUCT_FLD(field_name, "FIX_COUNT"),
  4442. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  4443. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  4444. STRUCT_FLD(value, 0),
  4445. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  4446. STRUCT_FLD(old_name, ""),
  4447. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4448. #define IDX_BUF_LRU_PAGE_HASHED 7
  4449. {STRUCT_FLD(field_name, "IS_HASHED"),
  4450. STRUCT_FLD(field_length, 3),
  4451. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  4452. STRUCT_FLD(value, 0),
  4453. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  4454. STRUCT_FLD(old_name, ""),
  4455. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4456. #define IDX_BUF_LRU_PAGE_NEWEST_MOD 8
  4457. {STRUCT_FLD(field_name, "NEWEST_MODIFICATION"),
  4458. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  4459. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  4460. STRUCT_FLD(value, 0),
  4461. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  4462. STRUCT_FLD(old_name, ""),
  4463. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4464. #define IDX_BUF_LRU_PAGE_OLDEST_MOD 9
  4465. {STRUCT_FLD(field_name, "OLDEST_MODIFICATION"),
  4466. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  4467. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  4468. STRUCT_FLD(value, 0),
  4469. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  4470. STRUCT_FLD(old_name, ""),
  4471. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4472. #define IDX_BUF_LRU_PAGE_ACCESS_TIME 10
  4473. {STRUCT_FLD(field_name, "ACCESS_TIME"),
  4474. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  4475. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  4476. STRUCT_FLD(value, 0),
  4477. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  4478. STRUCT_FLD(old_name, ""),
  4479. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4480. #define IDX_BUF_LRU_PAGE_TABLE_NAME 11
  4481. {STRUCT_FLD(field_name, "TABLE_NAME"),
  4482. STRUCT_FLD(field_length, 1024),
  4483. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  4484. STRUCT_FLD(value, 0),
  4485. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  4486. STRUCT_FLD(old_name, ""),
  4487. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4488. #define IDX_BUF_LRU_PAGE_INDEX_NAME 12
  4489. {STRUCT_FLD(field_name, "INDEX_NAME"),
  4490. STRUCT_FLD(field_length, 1024),
  4491. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  4492. STRUCT_FLD(value, 0),
  4493. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  4494. STRUCT_FLD(old_name, ""),
  4495. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4496. #define IDX_BUF_LRU_PAGE_NUM_RECS 13
  4497. {STRUCT_FLD(field_name, "NUMBER_RECORDS"),
  4498. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  4499. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  4500. STRUCT_FLD(value, 0),
  4501. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  4502. STRUCT_FLD(old_name, ""),
  4503. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4504. #define IDX_BUF_LRU_PAGE_DATA_SIZE 14
  4505. {STRUCT_FLD(field_name, "DATA_SIZE"),
  4506. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  4507. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  4508. STRUCT_FLD(value, 0),
  4509. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  4510. STRUCT_FLD(old_name, ""),
  4511. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4512. #define IDX_BUF_LRU_PAGE_ZIP_SIZE 15
  4513. {STRUCT_FLD(field_name, "COMPRESSED_SIZE"),
  4514. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  4515. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  4516. STRUCT_FLD(value, 0),
  4517. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  4518. STRUCT_FLD(old_name, ""),
  4519. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4520. #define IDX_BUF_LRU_PAGE_STATE 16
  4521. {STRUCT_FLD(field_name, "COMPRESSED"),
  4522. STRUCT_FLD(field_length, 3),
  4523. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  4524. STRUCT_FLD(value, 0),
  4525. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  4526. STRUCT_FLD(old_name, ""),
  4527. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4528. #define IDX_BUF_LRU_PAGE_IO_FIX 17
  4529. {STRUCT_FLD(field_name, "IO_FIX"),
  4530. STRUCT_FLD(field_length, 64),
  4531. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  4532. STRUCT_FLD(value, 0),
  4533. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  4534. STRUCT_FLD(old_name, ""),
  4535. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4536. #define IDX_BUF_LRU_PAGE_IS_OLD 18
  4537. {STRUCT_FLD(field_name, "IS_OLD"),
  4538. STRUCT_FLD(field_length, 3),
  4539. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  4540. STRUCT_FLD(value, 0),
  4541. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  4542. STRUCT_FLD(old_name, ""),
  4543. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4544. #define IDX_BUF_LRU_PAGE_FREE_CLOCK 19
  4545. {STRUCT_FLD(field_name, "FREE_PAGE_CLOCK"),
  4546. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  4547. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  4548. STRUCT_FLD(value, 0),
  4549. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  4550. STRUCT_FLD(old_name, ""),
  4551. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4552. END_OF_ST_FIELD_INFO
  4553. };
  4554. /*******************************************************************//**
  4555. Fill Information Schema table INNODB_BUFFER_PAGE_LRU with information
  4556. cached in the buf_page_info_t array
  4557. @return 0 on success, 1 on failure */
  4558. static
  4559. int
  4560. i_s_innodb_buf_page_lru_fill(
  4561. /*=========================*/
  4562. THD* thd, /*!< in: thread */
  4563. TABLE_LIST* tables, /*!< in/out: tables to fill */
  4564. const buf_page_info_t* info_array, /*!< in: array cached page
  4565. info */
  4566. ulint num_page) /*!< in: number of page info
  4567. cached */
  4568. {
  4569. DBUG_ENTER("i_s_innodb_buf_page_lru_fill");
  4570. TABLE* table = tables->table;
  4571. Field** fields = table->field;
  4572. /* Iterate through the cached array and fill the I_S table rows */
  4573. for (ulint i = 0; i < num_page; i++) {
  4574. const buf_page_info_t* page_info;
  4575. char table_name[MAX_FULL_NAME_LEN + 1];
  4576. const char* table_name_end = NULL;
  4577. const char* state_str;
  4578. enum buf_page_state state;
  4579. state_str = NULL;
  4580. page_info = info_array + i;
  4581. OK(fields[IDX_BUF_LRU_POOL_ID]->store(
  4582. page_info->pool_id, true));
  4583. OK(fields[IDX_BUF_LRU_POS]->store(
  4584. page_info->block_id, true));
  4585. OK(fields[IDX_BUF_LRU_PAGE_SPACE]->store(
  4586. page_info->space_id, true));
  4587. OK(fields[IDX_BUF_LRU_PAGE_NUM]->store(
  4588. page_info->page_num, true));
  4589. OK(field_store_string(
  4590. fields[IDX_BUF_LRU_PAGE_TYPE],
  4591. i_s_page_type[page_info->page_type].type_str));
  4592. OK(fields[IDX_BUF_LRU_PAGE_FLUSH_TYPE]->store(
  4593. page_info->flush_type, true));
  4594. OK(fields[IDX_BUF_LRU_PAGE_FIX_COUNT]->store(
  4595. page_info->fix_count, true));
  4596. OK(field_store_string(fields[IDX_BUF_LRU_PAGE_HASHED],
  4597. page_info->hashed ? "YES" : "NO"));
  4598. OK(fields[IDX_BUF_LRU_PAGE_NEWEST_MOD]->store(
  4599. page_info->newest_mod, true));
  4600. OK(fields[IDX_BUF_LRU_PAGE_OLDEST_MOD]->store(
  4601. page_info->oldest_mod, true));
  4602. OK(fields[IDX_BUF_LRU_PAGE_ACCESS_TIME]->store(
  4603. page_info->access_time, true));
  4604. fields[IDX_BUF_LRU_PAGE_TABLE_NAME]->set_null();
  4605. fields[IDX_BUF_LRU_PAGE_INDEX_NAME]->set_null();
  4606. /* If this is an index page, fetch the index name
  4607. and table name */
  4608. if (page_info->page_type == I_S_PAGE_TYPE_INDEX) {
  4609. bool ret = false;
  4610. mutex_enter(&dict_sys->mutex);
  4611. const dict_index_t* index =
  4612. dict_index_get_if_in_cache_low(
  4613. page_info->index_id);
  4614. if (index) {
  4615. table_name_end = innobase_convert_name(
  4616. table_name, sizeof(table_name),
  4617. index->table_name,
  4618. strlen(index->table_name),
  4619. thd, TRUE);
  4620. ret = fields[IDX_BUF_LRU_PAGE_TABLE_NAME]
  4621. ->store(table_name,
  4622. static_cast<uint>(
  4623. table_name_end
  4624. - table_name),
  4625. system_charset_info)
  4626. || field_store_index_name(
  4627. fields
  4628. [IDX_BUF_LRU_PAGE_INDEX_NAME],
  4629. index->name);
  4630. }
  4631. mutex_exit(&dict_sys->mutex);
  4632. OK(ret);
  4633. if (index) {
  4634. fields[IDX_BUF_LRU_PAGE_TABLE_NAME]
  4635. ->set_notnull();
  4636. }
  4637. }
  4638. OK(fields[IDX_BUF_LRU_PAGE_NUM_RECS]->store(
  4639. page_info->num_recs, true));
  4640. OK(fields[IDX_BUF_LRU_PAGE_DATA_SIZE]->store(
  4641. page_info->data_size, true));
  4642. OK(fields[IDX_BUF_LRU_PAGE_ZIP_SIZE]->store(
  4643. page_info->zip_ssize
  4644. ? 512 << page_info->zip_ssize : 0, true));
  4645. state = static_cast<enum buf_page_state>(page_info->page_state);
  4646. switch (state) {
  4647. /* Compressed page */
  4648. case BUF_BLOCK_ZIP_PAGE:
  4649. case BUF_BLOCK_ZIP_DIRTY:
  4650. state_str = "YES";
  4651. break;
  4652. /* Uncompressed page */
  4653. case BUF_BLOCK_FILE_PAGE:
  4654. state_str = "NO";
  4655. break;
  4656. /* We should not see following states */
  4657. case BUF_BLOCK_POOL_WATCH:
  4658. case BUF_BLOCK_READY_FOR_USE:
  4659. case BUF_BLOCK_NOT_USED:
  4660. case BUF_BLOCK_MEMORY:
  4661. case BUF_BLOCK_REMOVE_HASH:
  4662. state_str = NULL;
  4663. break;
  4664. };
  4665. OK(field_store_string(fields[IDX_BUF_LRU_PAGE_STATE],
  4666. state_str));
  4667. switch (page_info->io_fix) {
  4668. case BUF_IO_NONE:
  4669. state_str = "IO_NONE";
  4670. break;
  4671. case BUF_IO_READ:
  4672. state_str = "IO_READ";
  4673. break;
  4674. case BUF_IO_WRITE:
  4675. state_str = "IO_WRITE";
  4676. break;
  4677. case BUF_IO_PIN:
  4678. state_str = "IO_PIN";
  4679. break;
  4680. }
  4681. OK(field_store_string(fields[IDX_BUF_LRU_PAGE_IO_FIX],
  4682. state_str));
  4683. OK(field_store_string(fields[IDX_BUF_LRU_PAGE_IS_OLD],
  4684. page_info->is_old ? "YES" : "NO"));
  4685. OK(fields[IDX_BUF_LRU_PAGE_FREE_CLOCK]->store(
  4686. page_info->freed_page_clock, true));
  4687. OK(schema_table_store_record(thd, table));
  4688. }
  4689. DBUG_RETURN(0);
  4690. }
  4691. /*******************************************************************//**
  4692. This is the function that goes through buffer pool's LRU list
  4693. and fetch information to INFORMATION_SCHEMA.INNODB_BUFFER_PAGE_LRU.
  4694. @return 0 on success, 1 on failure */
  4695. static
  4696. int
  4697. i_s_innodb_fill_buffer_lru(
  4698. /*=======================*/
  4699. THD* thd, /*!< in: thread */
  4700. TABLE_LIST* tables, /*!< in/out: tables to fill */
  4701. buf_pool_t* buf_pool, /*!< in: buffer pool to scan */
  4702. const ulint pool_id) /*!< in: buffer pool id */
  4703. {
  4704. int status = 0;
  4705. buf_page_info_t* info_buffer;
  4706. ulint lru_pos = 0;
  4707. const buf_page_t* bpage;
  4708. ulint lru_len;
  4709. DBUG_ENTER("i_s_innodb_fill_buffer_lru");
  4710. RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
  4711. /* Obtain buf_pool mutex before allocate info_buffer, since
  4712. UT_LIST_GET_LEN(buf_pool->LRU) could change */
  4713. buf_pool_mutex_enter(buf_pool);
  4714. lru_len = UT_LIST_GET_LEN(buf_pool->LRU);
  4715. /* Print error message if malloc fail */
  4716. info_buffer = (buf_page_info_t*) my_malloc(
  4717. lru_len * sizeof *info_buffer, MYF(MY_WME));
  4718. if (!info_buffer) {
  4719. status = 1;
  4720. goto exit;
  4721. }
  4722. memset(info_buffer, 0, lru_len * sizeof *info_buffer);
  4723. /* Walk through Pool's LRU list and print the buffer page
  4724. information */
  4725. bpage = UT_LIST_GET_LAST(buf_pool->LRU);
  4726. while (bpage != NULL) {
  4727. /* Use the same function that collect buffer info for
  4728. INNODB_BUFFER_PAGE to get buffer page info */
  4729. i_s_innodb_buffer_page_get_info(bpage, pool_id, lru_pos,
  4730. (info_buffer + lru_pos));
  4731. bpage = UT_LIST_GET_PREV(LRU, bpage);
  4732. lru_pos++;
  4733. }
  4734. ut_ad(lru_pos == lru_len);
  4735. ut_ad(lru_pos == UT_LIST_GET_LEN(buf_pool->LRU));
  4736. exit:
  4737. buf_pool_mutex_exit(buf_pool);
  4738. if (info_buffer) {
  4739. status = i_s_innodb_buf_page_lru_fill(
  4740. thd, tables, info_buffer, lru_len);
  4741. my_free(info_buffer);
  4742. }
  4743. DBUG_RETURN(status);
  4744. }
  4745. /*******************************************************************//**
  4746. Fill page information for pages in InnoDB buffer pool to the
  4747. dynamic table INFORMATION_SCHEMA.INNODB_BUFFER_PAGE_LRU
  4748. @return 0 on success, 1 on failure */
  4749. static
  4750. int
  4751. i_s_innodb_buf_page_lru_fill_table(
  4752. /*===============================*/
  4753. THD* thd, /*!< in: thread */
  4754. TABLE_LIST* tables, /*!< in/out: tables to fill */
  4755. Item* ) /*!< in: condition (ignored) */
  4756. {
  4757. int status = 0;
  4758. DBUG_ENTER("i_s_innodb_buf_page_lru_fill_table");
  4759. /* deny access to any users that do not hold PROCESS_ACL */
  4760. if (check_global_access(thd, PROCESS_ACL)) {
  4761. DBUG_RETURN(0);
  4762. }
  4763. /* Walk through each buffer pool */
  4764. for (ulint i = 0; i < srv_buf_pool_instances; i++) {
  4765. buf_pool_t* buf_pool;
  4766. buf_pool = buf_pool_from_array(i);
  4767. /* Fetch information from pages in this buffer pool's LRU list,
  4768. and fill the corresponding I_S table */
  4769. status = i_s_innodb_fill_buffer_lru(thd, tables, buf_pool, i);
  4770. /* If something wrong, break and return */
  4771. if (status) {
  4772. break;
  4773. }
  4774. }
  4775. DBUG_RETURN(status);
  4776. }
  4777. /*******************************************************************//**
  4778. Bind the dynamic table INFORMATION_SCHEMA.INNODB_BUFFER_PAGE_LRU.
  4779. @return 0 on success, 1 on failure */
  4780. static
  4781. int
  4782. i_s_innodb_buffer_page_lru_init(
  4783. /*============================*/
  4784. void* p) /*!< in/out: table schema object */
  4785. {
  4786. ST_SCHEMA_TABLE* schema;
  4787. DBUG_ENTER("i_s_innodb_buffer_page_lru_init");
  4788. schema = reinterpret_cast<ST_SCHEMA_TABLE*>(p);
  4789. schema->fields_info = i_s_innodb_buf_page_lru_fields_info;
  4790. schema->fill_table = i_s_innodb_buf_page_lru_fill_table;
  4791. DBUG_RETURN(0);
  4792. }
  4793. UNIV_INTERN struct st_maria_plugin i_s_innodb_buffer_page_lru =
  4794. {
  4795. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  4796. /* int */
  4797. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  4798. /* pointer to type-specific plugin descriptor */
  4799. /* void* */
  4800. STRUCT_FLD(info, &i_s_info),
  4801. /* plugin name */
  4802. /* const char* */
  4803. STRUCT_FLD(name, "INNODB_BUFFER_PAGE_LRU"),
  4804. /* plugin author (for SHOW PLUGINS) */
  4805. /* const char* */
  4806. STRUCT_FLD(author, plugin_author),
  4807. /* general descriptive text (for SHOW PLUGINS) */
  4808. /* const char* */
  4809. STRUCT_FLD(descr, "InnoDB Buffer Page in LRU"),
  4810. /* the plugin license (PLUGIN_LICENSE_XXX) */
  4811. /* int */
  4812. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  4813. /* the function to invoke when plugin is loaded */
  4814. /* int (*)(void*); */
  4815. STRUCT_FLD(init, i_s_innodb_buffer_page_lru_init),
  4816. /* the function to invoke when plugin is unloaded */
  4817. /* int (*)(void*); */
  4818. STRUCT_FLD(deinit, i_s_common_deinit),
  4819. /* plugin version (for SHOW PLUGINS) */
  4820. /* unsigned int */
  4821. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  4822. /* struct st_mysql_show_var* */
  4823. STRUCT_FLD(status_vars, NULL),
  4824. /* struct st_mysql_sys_var** */
  4825. STRUCT_FLD(system_vars, NULL),
  4826. /* Maria extension */
  4827. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  4828. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  4829. };
  4830. /*******************************************************************//**
  4831. Unbind a dynamic INFORMATION_SCHEMA table.
  4832. @return 0 on success */
  4833. static
  4834. int
  4835. i_s_common_deinit(
  4836. /*==============*/
  4837. void* p) /*!< in/out: table schema object */
  4838. {
  4839. DBUG_ENTER("i_s_common_deinit");
  4840. /* Do nothing */
  4841. DBUG_RETURN(0);
  4842. }
  4843. /** SYS_TABLES ***************************************************/
  4844. /* Fields of the dynamic table INFORMATION_SCHEMA.SYS_TABLES */
  4845. static ST_FIELD_INFO innodb_sys_tables_fields_info[] =
  4846. {
  4847. #define SYS_TABLES_ID 0
  4848. {STRUCT_FLD(field_name, "TABLE_ID"),
  4849. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  4850. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  4851. STRUCT_FLD(value, 0),
  4852. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  4853. STRUCT_FLD(old_name, ""),
  4854. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4855. #define SYS_TABLES_NAME 1
  4856. {STRUCT_FLD(field_name, "NAME"),
  4857. STRUCT_FLD(field_length, MAX_FULL_NAME_LEN + 1),
  4858. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  4859. STRUCT_FLD(value, 0),
  4860. STRUCT_FLD(field_flags, 0),
  4861. STRUCT_FLD(old_name, ""),
  4862. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4863. #define SYS_TABLES_FLAG 2
  4864. {STRUCT_FLD(field_name, "FLAG"),
  4865. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  4866. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  4867. STRUCT_FLD(value, 0),
  4868. STRUCT_FLD(field_flags, 0),
  4869. STRUCT_FLD(old_name, ""),
  4870. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4871. #define SYS_TABLES_NUM_COLUMN 3
  4872. {STRUCT_FLD(field_name, "N_COLS"),
  4873. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  4874. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  4875. STRUCT_FLD(value, 0),
  4876. STRUCT_FLD(field_flags, 0),
  4877. STRUCT_FLD(old_name, ""),
  4878. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4879. #define SYS_TABLES_SPACE 4
  4880. {STRUCT_FLD(field_name, "SPACE"),
  4881. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  4882. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  4883. STRUCT_FLD(value, 0),
  4884. STRUCT_FLD(field_flags, 0),
  4885. STRUCT_FLD(old_name, ""),
  4886. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4887. #define SYS_TABLES_FILE_FORMAT 5
  4888. {STRUCT_FLD(field_name, "FILE_FORMAT"),
  4889. STRUCT_FLD(field_length, 10),
  4890. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  4891. STRUCT_FLD(value, 0),
  4892. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  4893. STRUCT_FLD(old_name, ""),
  4894. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4895. #define SYS_TABLES_ROW_FORMAT 6
  4896. {STRUCT_FLD(field_name, "ROW_FORMAT"),
  4897. STRUCT_FLD(field_length, 12),
  4898. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  4899. STRUCT_FLD(value, 0),
  4900. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  4901. STRUCT_FLD(old_name, ""),
  4902. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4903. #define SYS_TABLES_ZIP_PAGE_SIZE 7
  4904. {STRUCT_FLD(field_name, "ZIP_PAGE_SIZE"),
  4905. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  4906. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  4907. STRUCT_FLD(value, 0),
  4908. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  4909. STRUCT_FLD(old_name, ""),
  4910. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  4911. END_OF_ST_FIELD_INFO
  4912. };
  4913. /**********************************************************************//**
  4914. Populate information_schema.innodb_sys_tables table with information
  4915. from SYS_TABLES.
  4916. @return 0 on success */
  4917. static
  4918. int
  4919. i_s_dict_fill_sys_tables(
  4920. /*=====================*/
  4921. THD* thd, /*!< in: thread */
  4922. dict_table_t* table, /*!< in: table */
  4923. TABLE* table_to_fill) /*!< in/out: fill this table */
  4924. {
  4925. Field** fields;
  4926. ulint compact = DICT_TF_GET_COMPACT(table->flags);
  4927. ulint atomic_blobs = DICT_TF_HAS_ATOMIC_BLOBS(table->flags);
  4928. ulint zip_size = dict_tf_get_zip_size(table->flags);
  4929. const char* file_format;
  4930. const char* row_format;
  4931. file_format = trx_sys_file_format_id_to_name(atomic_blobs);
  4932. if (!compact) {
  4933. row_format = "Redundant";
  4934. } else if (!atomic_blobs) {
  4935. row_format = "Compact";
  4936. } else if DICT_TF_GET_ZIP_SSIZE(table->flags) {
  4937. row_format = "Compressed";
  4938. } else {
  4939. row_format = "Dynamic";
  4940. }
  4941. DBUG_ENTER("i_s_dict_fill_sys_tables");
  4942. fields = table_to_fill->field;
  4943. OK(fields[SYS_TABLES_ID]->store(longlong(table->id), TRUE));
  4944. OK(field_store_string(fields[SYS_TABLES_NAME], table->name));
  4945. OK(fields[SYS_TABLES_FLAG]->store(table->flags));
  4946. OK(fields[SYS_TABLES_NUM_COLUMN]->store(table->n_cols));
  4947. OK(fields[SYS_TABLES_SPACE]->store(table->space));
  4948. OK(field_store_string(fields[SYS_TABLES_FILE_FORMAT], file_format));
  4949. OK(field_store_string(fields[SYS_TABLES_ROW_FORMAT], row_format));
  4950. OK(fields[SYS_TABLES_ZIP_PAGE_SIZE]->store(
  4951. static_cast<double>(zip_size)));
  4952. OK(schema_table_store_record(thd, table_to_fill));
  4953. DBUG_RETURN(0);
  4954. }
  4955. /*******************************************************************//**
  4956. Function to go through each record in SYS_TABLES table, and fill the
  4957. information_schema.innodb_sys_tables table with related table information
  4958. @return 0 on success */
  4959. static
  4960. int
  4961. i_s_sys_tables_fill_table(
  4962. /*======================*/
  4963. THD* thd, /*!< in: thread */
  4964. TABLE_LIST* tables, /*!< in/out: tables to fill */
  4965. Item* ) /*!< in: condition (not used) */
  4966. {
  4967. btr_pcur_t pcur;
  4968. const rec_t* rec;
  4969. mem_heap_t* heap;
  4970. mtr_t mtr;
  4971. DBUG_ENTER("i_s_sys_tables_fill_table");
  4972. RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
  4973. /* deny access to user without PROCESS_ACL privilege */
  4974. if (check_global_access(thd, PROCESS_ACL)) {
  4975. DBUG_RETURN(0);
  4976. }
  4977. heap = mem_heap_create(1000);
  4978. mutex_enter(&(dict_sys->mutex));
  4979. mtr_start(&mtr);
  4980. rec = dict_startscan_system(&pcur, &mtr, SYS_TABLES);
  4981. while (rec) {
  4982. const char* err_msg;
  4983. dict_table_t* table_rec;
  4984. /* Create and populate a dict_table_t structure with
  4985. information from SYS_TABLES row */
  4986. err_msg = dict_process_sys_tables_rec_and_mtr_commit(
  4987. heap, rec, &table_rec,
  4988. DICT_TABLE_LOAD_FROM_RECORD, &mtr);
  4989. mutex_exit(&dict_sys->mutex);
  4990. if (!err_msg) {
  4991. i_s_dict_fill_sys_tables(thd, table_rec, tables->table);
  4992. } else {
  4993. push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
  4994. ER_CANT_FIND_SYSTEM_REC, "%s",
  4995. err_msg);
  4996. }
  4997. /* Since dict_process_sys_tables_rec_and_mtr_commit()
  4998. is called with DICT_TABLE_LOAD_FROM_RECORD, the table_rec
  4999. is created in dict_process_sys_tables_rec(), we will
  5000. need to free it */
  5001. if (table_rec) {
  5002. dict_mem_table_free(table_rec);
  5003. }
  5004. mem_heap_empty(heap);
  5005. /* Get the next record */
  5006. mutex_enter(&dict_sys->mutex);
  5007. mtr_start(&mtr);
  5008. rec = dict_getnext_system(&pcur, &mtr);
  5009. }
  5010. mtr_commit(&mtr);
  5011. mutex_exit(&dict_sys->mutex);
  5012. mem_heap_free(heap);
  5013. DBUG_RETURN(0);
  5014. }
  5015. /*******************************************************************//**
  5016. Bind the dynamic table INFORMATION_SCHEMA.innodb_sys_tables
  5017. @return 0 on success */
  5018. static
  5019. int
  5020. innodb_sys_tables_init(
  5021. /*===================*/
  5022. void* p) /*!< in/out: table schema object */
  5023. {
  5024. ST_SCHEMA_TABLE* schema;
  5025. DBUG_ENTER("innodb_sys_tables_init");
  5026. schema = (ST_SCHEMA_TABLE*) p;
  5027. schema->fields_info = innodb_sys_tables_fields_info;
  5028. schema->fill_table = i_s_sys_tables_fill_table;
  5029. DBUG_RETURN(0);
  5030. }
  5031. UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_tables =
  5032. {
  5033. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  5034. /* int */
  5035. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  5036. /* pointer to type-specific plugin descriptor */
  5037. /* void* */
  5038. STRUCT_FLD(info, &i_s_info),
  5039. /* plugin name */
  5040. /* const char* */
  5041. STRUCT_FLD(name, "INNODB_SYS_TABLES"),
  5042. /* plugin author (for SHOW PLUGINS) */
  5043. /* const char* */
  5044. STRUCT_FLD(author, plugin_author),
  5045. /* general descriptive text (for SHOW PLUGINS) */
  5046. /* const char* */
  5047. STRUCT_FLD(descr, "InnoDB SYS_TABLES"),
  5048. /* the plugin license (PLUGIN_LICENSE_XXX) */
  5049. /* int */
  5050. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  5051. /* the function to invoke when plugin is loaded */
  5052. /* int (*)(void*); */
  5053. STRUCT_FLD(init, innodb_sys_tables_init),
  5054. /* the function to invoke when plugin is unloaded */
  5055. /* int (*)(void*); */
  5056. STRUCT_FLD(deinit, i_s_common_deinit),
  5057. /* plugin version (for SHOW PLUGINS) */
  5058. /* unsigned int */
  5059. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  5060. /* struct st_mysql_show_var* */
  5061. STRUCT_FLD(status_vars, NULL),
  5062. /* struct st_mysql_sys_var** */
  5063. STRUCT_FLD(system_vars, NULL),
  5064. /* Maria extension */
  5065. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  5066. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  5067. };
  5068. /** SYS_TABLESTATS ***********************************************/
  5069. /* Fields of the dynamic table INFORMATION_SCHEMA.SYS_TABLESTATS */
  5070. static ST_FIELD_INFO innodb_sys_tablestats_fields_info[] =
  5071. {
  5072. #define SYS_TABLESTATS_ID 0
  5073. {STRUCT_FLD(field_name, "TABLE_ID"),
  5074. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  5075. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  5076. STRUCT_FLD(value, 0),
  5077. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  5078. STRUCT_FLD(old_name, ""),
  5079. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5080. #define SYS_TABLESTATS_NAME 1
  5081. {STRUCT_FLD(field_name, "NAME"),
  5082. STRUCT_FLD(field_length, NAME_LEN + 1),
  5083. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  5084. STRUCT_FLD(value, 0),
  5085. STRUCT_FLD(field_flags, 0),
  5086. STRUCT_FLD(old_name, ""),
  5087. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5088. #define SYS_TABLESTATS_INIT 2
  5089. {STRUCT_FLD(field_name, "STATS_INITIALIZED"),
  5090. STRUCT_FLD(field_length, NAME_LEN + 1),
  5091. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  5092. STRUCT_FLD(value, 0),
  5093. STRUCT_FLD(field_flags, 0),
  5094. STRUCT_FLD(old_name, ""),
  5095. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5096. #define SYS_TABLESTATS_NROW 3
  5097. {STRUCT_FLD(field_name, "NUM_ROWS"),
  5098. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  5099. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  5100. STRUCT_FLD(value, 0),
  5101. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  5102. STRUCT_FLD(old_name, ""),
  5103. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5104. #define SYS_TABLESTATS_CLUST_SIZE 4
  5105. {STRUCT_FLD(field_name, "CLUST_INDEX_SIZE"),
  5106. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  5107. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  5108. STRUCT_FLD(value, 0),
  5109. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  5110. STRUCT_FLD(old_name, ""),
  5111. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5112. #define SYS_TABLESTATS_INDEX_SIZE 5
  5113. {STRUCT_FLD(field_name, "OTHER_INDEX_SIZE"),
  5114. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  5115. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  5116. STRUCT_FLD(value, 0),
  5117. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  5118. STRUCT_FLD(old_name, ""),
  5119. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5120. #define SYS_TABLESTATS_MODIFIED 6
  5121. {STRUCT_FLD(field_name, "MODIFIED_COUNTER"),
  5122. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  5123. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  5124. STRUCT_FLD(value, 0),
  5125. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  5126. STRUCT_FLD(old_name, ""),
  5127. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5128. #define SYS_TABLESTATS_AUTONINC 7
  5129. {STRUCT_FLD(field_name, "AUTOINC"),
  5130. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  5131. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  5132. STRUCT_FLD(value, 0),
  5133. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  5134. STRUCT_FLD(old_name, ""),
  5135. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5136. #define SYS_TABLESTATS_TABLE_REF_COUNT 8
  5137. {STRUCT_FLD(field_name, "REF_COUNT"),
  5138. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  5139. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  5140. STRUCT_FLD(value, 0),
  5141. STRUCT_FLD(field_flags, 0),
  5142. STRUCT_FLD(old_name, ""),
  5143. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5144. END_OF_ST_FIELD_INFO
  5145. };
  5146. /**********************************************************************//**
  5147. Populate information_schema.innodb_sys_tablestats table with information
  5148. from SYS_TABLES.
  5149. @return 0 on success */
  5150. static
  5151. int
  5152. i_s_dict_fill_sys_tablestats(
  5153. /*=========================*/
  5154. THD* thd, /*!< in: thread */
  5155. dict_table_t* table, /*!< in: table */
  5156. TABLE* table_to_fill) /*!< in/out: fill this table */
  5157. {
  5158. Field** fields;
  5159. DBUG_ENTER("i_s_dict_fill_sys_tablestats");
  5160. fields = table_to_fill->field;
  5161. OK(fields[SYS_TABLESTATS_ID]->store(longlong(table->id), TRUE));
  5162. OK(field_store_string(fields[SYS_TABLESTATS_NAME], table->name));
  5163. dict_table_stats_lock(table, RW_S_LATCH);
  5164. if (table->stat_initialized) {
  5165. OK(field_store_string(fields[SYS_TABLESTATS_INIT],
  5166. "Initialized"));
  5167. OK(fields[SYS_TABLESTATS_NROW]->store(table->stat_n_rows,
  5168. TRUE));
  5169. OK(fields[SYS_TABLESTATS_CLUST_SIZE]->store(
  5170. static_cast<double>(table->stat_clustered_index_size)));
  5171. OK(fields[SYS_TABLESTATS_INDEX_SIZE]->store(
  5172. static_cast<double>(table->stat_sum_of_other_index_sizes)));
  5173. OK(fields[SYS_TABLESTATS_MODIFIED]->store(
  5174. static_cast<double>(table->stat_modified_counter)));
  5175. } else {
  5176. OK(field_store_string(fields[SYS_TABLESTATS_INIT],
  5177. "Uninitialized"));
  5178. OK(fields[SYS_TABLESTATS_NROW]->store(0, TRUE));
  5179. OK(fields[SYS_TABLESTATS_CLUST_SIZE]->store(0));
  5180. OK(fields[SYS_TABLESTATS_INDEX_SIZE]->store(0));
  5181. OK(fields[SYS_TABLESTATS_MODIFIED]->store(0));
  5182. }
  5183. dict_table_stats_unlock(table, RW_S_LATCH);
  5184. OK(fields[SYS_TABLESTATS_AUTONINC]->store(table->autoinc, TRUE));
  5185. OK(fields[SYS_TABLESTATS_TABLE_REF_COUNT]->store(
  5186. static_cast<double>(table->n_ref_count)));
  5187. OK(schema_table_store_record(thd, table_to_fill));
  5188. DBUG_RETURN(0);
  5189. }
  5190. /*******************************************************************//**
  5191. Function to go through each record in SYS_TABLES table, and fill the
  5192. information_schema.innodb_sys_tablestats table with table statistics
  5193. related information
  5194. @return 0 on success */
  5195. static
  5196. int
  5197. i_s_sys_tables_fill_table_stats(
  5198. /*============================*/
  5199. THD* thd, /*!< in: thread */
  5200. TABLE_LIST* tables, /*!< in/out: tables to fill */
  5201. Item* ) /*!< in: condition (not used) */
  5202. {
  5203. btr_pcur_t pcur;
  5204. const rec_t* rec;
  5205. mem_heap_t* heap;
  5206. mtr_t mtr;
  5207. DBUG_ENTER("i_s_sys_tables_fill_table_stats");
  5208. RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
  5209. /* deny access to user without PROCESS_ACL privilege */
  5210. if (check_global_access(thd, PROCESS_ACL)) {
  5211. DBUG_RETURN(0);
  5212. }
  5213. heap = mem_heap_create(1000);
  5214. rw_lock_s_lock(&dict_operation_lock);
  5215. mutex_enter(&dict_sys->mutex);
  5216. mtr_start(&mtr);
  5217. rec = dict_startscan_system(&pcur, &mtr, SYS_TABLES);
  5218. while (rec) {
  5219. const char* err_msg;
  5220. dict_table_t* table_rec;
  5221. /* Fetch the dict_table_t structure corresponding to
  5222. this SYS_TABLES record */
  5223. err_msg = dict_process_sys_tables_rec_and_mtr_commit(
  5224. heap, rec, &table_rec,
  5225. DICT_TABLE_LOAD_FROM_CACHE, &mtr);
  5226. mutex_exit(&dict_sys->mutex);
  5227. if (!err_msg) {
  5228. i_s_dict_fill_sys_tablestats(thd, table_rec,
  5229. tables->table);
  5230. } else {
  5231. push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
  5232. ER_CANT_FIND_SYSTEM_REC, "%s",
  5233. err_msg);
  5234. }
  5235. rw_lock_s_unlock(&dict_operation_lock);
  5236. mem_heap_empty(heap);
  5237. /* Get the next record */
  5238. rw_lock_s_lock(&dict_operation_lock);
  5239. mutex_enter(&dict_sys->mutex);
  5240. mtr_start(&mtr);
  5241. rec = dict_getnext_system(&pcur, &mtr);
  5242. }
  5243. mtr_commit(&mtr);
  5244. mutex_exit(&dict_sys->mutex);
  5245. rw_lock_s_unlock(&dict_operation_lock);
  5246. mem_heap_free(heap);
  5247. DBUG_RETURN(0);
  5248. }
  5249. /*******************************************************************//**
  5250. Bind the dynamic table INFORMATION_SCHEMA.innodb_sys_tablestats
  5251. @return 0 on success */
  5252. static
  5253. int
  5254. innodb_sys_tablestats_init(
  5255. /*=======================*/
  5256. void* p) /*!< in/out: table schema object */
  5257. {
  5258. ST_SCHEMA_TABLE* schema;
  5259. DBUG_ENTER("innodb_sys_tablestats_init");
  5260. schema = (ST_SCHEMA_TABLE*) p;
  5261. schema->fields_info = innodb_sys_tablestats_fields_info;
  5262. schema->fill_table = i_s_sys_tables_fill_table_stats;
  5263. DBUG_RETURN(0);
  5264. }
  5265. UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_tablestats =
  5266. {
  5267. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  5268. /* int */
  5269. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  5270. /* pointer to type-specific plugin descriptor */
  5271. /* void* */
  5272. STRUCT_FLD(info, &i_s_info),
  5273. /* plugin name */
  5274. /* const char* */
  5275. STRUCT_FLD(name, "INNODB_SYS_TABLESTATS"),
  5276. /* plugin author (for SHOW PLUGINS) */
  5277. /* const char* */
  5278. STRUCT_FLD(author, plugin_author),
  5279. /* general descriptive text (for SHOW PLUGINS) */
  5280. /* const char* */
  5281. STRUCT_FLD(descr, "InnoDB SYS_TABLESTATS"),
  5282. /* the plugin license (PLUGIN_LICENSE_XXX) */
  5283. /* int */
  5284. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  5285. /* the function to invoke when plugin is loaded */
  5286. /* int (*)(void*); */
  5287. STRUCT_FLD(init, innodb_sys_tablestats_init),
  5288. /* the function to invoke when plugin is unloaded */
  5289. /* int (*)(void*); */
  5290. STRUCT_FLD(deinit, i_s_common_deinit),
  5291. /* plugin version (for SHOW PLUGINS) */
  5292. /* unsigned int */
  5293. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  5294. /* struct st_mysql_show_var* */
  5295. STRUCT_FLD(status_vars, NULL),
  5296. /* struct st_mysql_sys_var** */
  5297. STRUCT_FLD(system_vars, NULL),
  5298. /* Maria extension */
  5299. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  5300. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  5301. };
  5302. /** SYS_INDEXES **************************************************/
  5303. /* Fields of the dynamic table INFORMATION_SCHEMA.SYS_INDEXES */
  5304. static ST_FIELD_INFO innodb_sysindex_fields_info[] =
  5305. {
  5306. #define SYS_INDEX_ID 0
  5307. {STRUCT_FLD(field_name, "INDEX_ID"),
  5308. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  5309. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  5310. STRUCT_FLD(value, 0),
  5311. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  5312. STRUCT_FLD(old_name, ""),
  5313. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5314. #define SYS_INDEX_NAME 1
  5315. {STRUCT_FLD(field_name, "NAME"),
  5316. STRUCT_FLD(field_length, NAME_LEN + 1),
  5317. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  5318. STRUCT_FLD(value, 0),
  5319. STRUCT_FLD(field_flags, 0),
  5320. STRUCT_FLD(old_name, ""),
  5321. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5322. #define SYS_INDEX_TABLE_ID 2
  5323. {STRUCT_FLD(field_name, "TABLE_ID"),
  5324. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  5325. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  5326. STRUCT_FLD(value, 0),
  5327. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  5328. STRUCT_FLD(old_name, ""),
  5329. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5330. #define SYS_INDEX_TYPE 3
  5331. {STRUCT_FLD(field_name, "TYPE"),
  5332. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  5333. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  5334. STRUCT_FLD(value, 0),
  5335. STRUCT_FLD(field_flags, 0),
  5336. STRUCT_FLD(old_name, ""),
  5337. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5338. #define SYS_INDEX_NUM_FIELDS 4
  5339. {STRUCT_FLD(field_name, "N_FIELDS"),
  5340. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  5341. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  5342. STRUCT_FLD(value, 0),
  5343. STRUCT_FLD(field_flags, 0),
  5344. STRUCT_FLD(old_name, ""),
  5345. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5346. #define SYS_INDEX_PAGE_NO 5
  5347. {STRUCT_FLD(field_name, "PAGE_NO"),
  5348. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  5349. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  5350. STRUCT_FLD(value, 0),
  5351. STRUCT_FLD(field_flags, 0),
  5352. STRUCT_FLD(old_name, ""),
  5353. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5354. #define SYS_INDEX_SPACE 6
  5355. {STRUCT_FLD(field_name, "SPACE"),
  5356. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  5357. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  5358. STRUCT_FLD(value, 0),
  5359. STRUCT_FLD(field_flags, 0),
  5360. STRUCT_FLD(old_name, ""),
  5361. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5362. END_OF_ST_FIELD_INFO
  5363. };
  5364. /**********************************************************************//**
  5365. Function to populate the information_schema.innodb_sys_indexes table with
  5366. collected index information
  5367. @return 0 on success */
  5368. static
  5369. int
  5370. i_s_dict_fill_sys_indexes(
  5371. /*======================*/
  5372. THD* thd, /*!< in: thread */
  5373. table_id_t table_id, /*!< in: table id */
  5374. dict_index_t* index, /*!< in: populated dict_index_t
  5375. struct with index info */
  5376. TABLE* table_to_fill) /*!< in/out: fill this table */
  5377. {
  5378. Field** fields;
  5379. DBUG_ENTER("i_s_dict_fill_sys_indexes");
  5380. fields = table_to_fill->field;
  5381. OK(field_store_index_name(fields[SYS_INDEX_NAME], index->name));
  5382. OK(fields[SYS_INDEX_ID]->store(longlong(index->id), TRUE));
  5383. OK(fields[SYS_INDEX_TABLE_ID]->store(longlong(table_id), TRUE));
  5384. OK(fields[SYS_INDEX_TYPE]->store(index->type));
  5385. OK(fields[SYS_INDEX_NUM_FIELDS]->store(index->n_fields));
  5386. /* FIL_NULL is ULINT32_UNDEFINED */
  5387. if (index->page == FIL_NULL) {
  5388. OK(fields[SYS_INDEX_PAGE_NO]->store(-1));
  5389. } else {
  5390. OK(fields[SYS_INDEX_PAGE_NO]->store(index->page));
  5391. }
  5392. OK(fields[SYS_INDEX_SPACE]->store(index->space));
  5393. OK(schema_table_store_record(thd, table_to_fill));
  5394. DBUG_RETURN(0);
  5395. }
  5396. /*******************************************************************//**
  5397. Function to go through each record in SYS_INDEXES table, and fill the
  5398. information_schema.innodb_sys_indexes table with related index information
  5399. @return 0 on success */
  5400. static
  5401. int
  5402. i_s_sys_indexes_fill_table(
  5403. /*=======================*/
  5404. THD* thd, /*!< in: thread */
  5405. TABLE_LIST* tables, /*!< in/out: tables to fill */
  5406. Item* ) /*!< in: condition (not used) */
  5407. {
  5408. btr_pcur_t pcur;
  5409. const rec_t* rec;
  5410. mem_heap_t* heap;
  5411. mtr_t mtr;
  5412. DBUG_ENTER("i_s_sys_indexes_fill_table");
  5413. RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
  5414. /* deny access to user without PROCESS_ACL privilege */
  5415. if (check_global_access(thd, PROCESS_ACL)) {
  5416. DBUG_RETURN(0);
  5417. }
  5418. heap = mem_heap_create(1000);
  5419. mutex_enter(&dict_sys->mutex);
  5420. mtr_start(&mtr);
  5421. /* Start scan the SYS_INDEXES table */
  5422. rec = dict_startscan_system(&pcur, &mtr, SYS_INDEXES);
  5423. /* Process each record in the table */
  5424. while (rec) {
  5425. const char* err_msg;
  5426. table_id_t table_id;
  5427. dict_index_t index_rec;
  5428. /* Populate a dict_index_t structure with information from
  5429. a SYS_INDEXES row */
  5430. err_msg = dict_process_sys_indexes_rec(heap, rec, &index_rec,
  5431. &table_id);
  5432. mtr_commit(&mtr);
  5433. mutex_exit(&dict_sys->mutex);
  5434. if (!err_msg) {
  5435. i_s_dict_fill_sys_indexes(thd, table_id, &index_rec,
  5436. tables->table);
  5437. } else {
  5438. push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
  5439. ER_CANT_FIND_SYSTEM_REC, "%s",
  5440. err_msg);
  5441. }
  5442. mem_heap_empty(heap);
  5443. /* Get the next record */
  5444. mutex_enter(&dict_sys->mutex);
  5445. mtr_start(&mtr);
  5446. rec = dict_getnext_system(&pcur, &mtr);
  5447. }
  5448. mtr_commit(&mtr);
  5449. mutex_exit(&dict_sys->mutex);
  5450. mem_heap_free(heap);
  5451. DBUG_RETURN(0);
  5452. }
  5453. /*******************************************************************//**
  5454. Bind the dynamic table INFORMATION_SCHEMA.innodb_sys_indexes
  5455. @return 0 on success */
  5456. static
  5457. int
  5458. innodb_sys_indexes_init(
  5459. /*====================*/
  5460. void* p) /*!< in/out: table schema object */
  5461. {
  5462. ST_SCHEMA_TABLE* schema;
  5463. DBUG_ENTER("innodb_sys_indexes_init");
  5464. schema = (ST_SCHEMA_TABLE*) p;
  5465. schema->fields_info = innodb_sysindex_fields_info;
  5466. schema->fill_table = i_s_sys_indexes_fill_table;
  5467. DBUG_RETURN(0);
  5468. }
  5469. UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_indexes =
  5470. {
  5471. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  5472. /* int */
  5473. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  5474. /* pointer to type-specific plugin descriptor */
  5475. /* void* */
  5476. STRUCT_FLD(info, &i_s_info),
  5477. /* plugin name */
  5478. /* const char* */
  5479. STRUCT_FLD(name, "INNODB_SYS_INDEXES"),
  5480. /* plugin author (for SHOW PLUGINS) */
  5481. /* const char* */
  5482. STRUCT_FLD(author, plugin_author),
  5483. /* general descriptive text (for SHOW PLUGINS) */
  5484. /* const char* */
  5485. STRUCT_FLD(descr, "InnoDB SYS_INDEXES"),
  5486. /* the plugin license (PLUGIN_LICENSE_XXX) */
  5487. /* int */
  5488. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  5489. /* the function to invoke when plugin is loaded */
  5490. /* int (*)(void*); */
  5491. STRUCT_FLD(init, innodb_sys_indexes_init),
  5492. /* the function to invoke when plugin is unloaded */
  5493. /* int (*)(void*); */
  5494. STRUCT_FLD(deinit, i_s_common_deinit),
  5495. /* plugin version (for SHOW PLUGINS) */
  5496. /* unsigned int */
  5497. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  5498. /* struct st_mysql_show_var* */
  5499. STRUCT_FLD(status_vars, NULL),
  5500. /* struct st_mysql_sys_var** */
  5501. STRUCT_FLD(system_vars, NULL),
  5502. /* Maria extension */
  5503. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  5504. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  5505. };
  5506. /** SYS_COLUMNS **************************************************/
  5507. /* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_SYS_COLUMNS */
  5508. static ST_FIELD_INFO innodb_sys_columns_fields_info[] =
  5509. {
  5510. #define SYS_COLUMN_TABLE_ID 0
  5511. {STRUCT_FLD(field_name, "TABLE_ID"),
  5512. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  5513. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  5514. STRUCT_FLD(value, 0),
  5515. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  5516. STRUCT_FLD(old_name, ""),
  5517. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5518. #define SYS_COLUMN_NAME 1
  5519. {STRUCT_FLD(field_name, "NAME"),
  5520. STRUCT_FLD(field_length, NAME_LEN + 1),
  5521. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  5522. STRUCT_FLD(value, 0),
  5523. STRUCT_FLD(field_flags, 0),
  5524. STRUCT_FLD(old_name, ""),
  5525. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5526. #define SYS_COLUMN_POSITION 2
  5527. {STRUCT_FLD(field_name, "POS"),
  5528. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  5529. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  5530. STRUCT_FLD(value, 0),
  5531. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  5532. STRUCT_FLD(old_name, ""),
  5533. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5534. #define SYS_COLUMN_MTYPE 3
  5535. {STRUCT_FLD(field_name, "MTYPE"),
  5536. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  5537. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  5538. STRUCT_FLD(value, 0),
  5539. STRUCT_FLD(field_flags, 0),
  5540. STRUCT_FLD(old_name, ""),
  5541. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5542. #define SYS_COLUMN__PRTYPE 4
  5543. {STRUCT_FLD(field_name, "PRTYPE"),
  5544. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  5545. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  5546. STRUCT_FLD(value, 0),
  5547. STRUCT_FLD(field_flags, 0),
  5548. STRUCT_FLD(old_name, ""),
  5549. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5550. #define SYS_COLUMN_COLUMN_LEN 5
  5551. {STRUCT_FLD(field_name, "LEN"),
  5552. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  5553. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  5554. STRUCT_FLD(value, 0),
  5555. STRUCT_FLD(field_flags, 0),
  5556. STRUCT_FLD(old_name, ""),
  5557. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5558. END_OF_ST_FIELD_INFO
  5559. };
  5560. /**********************************************************************//**
  5561. Function to populate the information_schema.innodb_sys_columns with
  5562. related column information
  5563. @return 0 on success */
  5564. static
  5565. int
  5566. i_s_dict_fill_sys_columns(
  5567. /*======================*/
  5568. THD* thd, /*!< in: thread */
  5569. table_id_t table_id, /*!< in: table ID */
  5570. const char* col_name, /*!< in: column name */
  5571. dict_col_t* column, /*!< in: dict_col_t struct holding
  5572. more column information */
  5573. TABLE* table_to_fill) /*!< in/out: fill this table */
  5574. {
  5575. Field** fields;
  5576. DBUG_ENTER("i_s_dict_fill_sys_columns");
  5577. fields = table_to_fill->field;
  5578. OK(fields[SYS_COLUMN_TABLE_ID]->store(longlong(table_id), TRUE));
  5579. OK(field_store_string(fields[SYS_COLUMN_NAME], col_name));
  5580. OK(fields[SYS_COLUMN_POSITION]->store(column->ind));
  5581. OK(fields[SYS_COLUMN_MTYPE]->store(column->mtype));
  5582. OK(fields[SYS_COLUMN__PRTYPE]->store(column->prtype));
  5583. OK(fields[SYS_COLUMN_COLUMN_LEN]->store(column->len));
  5584. OK(schema_table_store_record(thd, table_to_fill));
  5585. DBUG_RETURN(0);
  5586. }
  5587. /*******************************************************************//**
  5588. Function to fill information_schema.innodb_sys_columns with information
  5589. collected by scanning SYS_COLUMNS table.
  5590. @return 0 on success */
  5591. static
  5592. int
  5593. i_s_sys_columns_fill_table(
  5594. /*=======================*/
  5595. THD* thd, /*!< in: thread */
  5596. TABLE_LIST* tables, /*!< in/out: tables to fill */
  5597. Item* ) /*!< in: condition (not used) */
  5598. {
  5599. btr_pcur_t pcur;
  5600. const rec_t* rec;
  5601. const char* col_name;
  5602. mem_heap_t* heap;
  5603. mtr_t mtr;
  5604. DBUG_ENTER("i_s_sys_columns_fill_table");
  5605. RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
  5606. /* deny access to user without PROCESS_ACL privilege */
  5607. if (check_global_access(thd, PROCESS_ACL)) {
  5608. DBUG_RETURN(0);
  5609. }
  5610. heap = mem_heap_create(1000);
  5611. mutex_enter(&dict_sys->mutex);
  5612. mtr_start(&mtr);
  5613. rec = dict_startscan_system(&pcur, &mtr, SYS_COLUMNS);
  5614. while (rec) {
  5615. const char* err_msg;
  5616. dict_col_t column_rec;
  5617. table_id_t table_id;
  5618. /* populate a dict_col_t structure with information from
  5619. a SYS_COLUMNS row */
  5620. err_msg = dict_process_sys_columns_rec(heap, rec, &column_rec,
  5621. &table_id, &col_name);
  5622. mtr_commit(&mtr);
  5623. mutex_exit(&dict_sys->mutex);
  5624. if (!err_msg) {
  5625. i_s_dict_fill_sys_columns(thd, table_id, col_name,
  5626. &column_rec,
  5627. tables->table);
  5628. } else {
  5629. push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
  5630. ER_CANT_FIND_SYSTEM_REC, "%s",
  5631. err_msg);
  5632. }
  5633. mem_heap_empty(heap);
  5634. /* Get the next record */
  5635. mutex_enter(&dict_sys->mutex);
  5636. mtr_start(&mtr);
  5637. rec = dict_getnext_system(&pcur, &mtr);
  5638. }
  5639. mtr_commit(&mtr);
  5640. mutex_exit(&dict_sys->mutex);
  5641. mem_heap_free(heap);
  5642. DBUG_RETURN(0);
  5643. }
  5644. /*******************************************************************//**
  5645. Bind the dynamic table INFORMATION_SCHEMA.innodb_sys_columns
  5646. @return 0 on success */
  5647. static
  5648. int
  5649. innodb_sys_columns_init(
  5650. /*====================*/
  5651. void* p) /*!< in/out: table schema object */
  5652. {
  5653. ST_SCHEMA_TABLE* schema;
  5654. DBUG_ENTER("innodb_sys_columns_init");
  5655. schema = (ST_SCHEMA_TABLE*) p;
  5656. schema->fields_info = innodb_sys_columns_fields_info;
  5657. schema->fill_table = i_s_sys_columns_fill_table;
  5658. DBUG_RETURN(0);
  5659. }
  5660. UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_columns =
  5661. {
  5662. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  5663. /* int */
  5664. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  5665. /* pointer to type-specific plugin descriptor */
  5666. /* void* */
  5667. STRUCT_FLD(info, &i_s_info),
  5668. /* plugin name */
  5669. /* const char* */
  5670. STRUCT_FLD(name, "INNODB_SYS_COLUMNS"),
  5671. /* plugin author (for SHOW PLUGINS) */
  5672. /* const char* */
  5673. STRUCT_FLD(author, plugin_author),
  5674. /* general descriptive text (for SHOW PLUGINS) */
  5675. /* const char* */
  5676. STRUCT_FLD(descr, "InnoDB SYS_COLUMNS"),
  5677. /* the plugin license (PLUGIN_LICENSE_XXX) */
  5678. /* int */
  5679. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  5680. /* the function to invoke when plugin is loaded */
  5681. /* int (*)(void*); */
  5682. STRUCT_FLD(init, innodb_sys_columns_init),
  5683. /* the function to invoke when plugin is unloaded */
  5684. /* int (*)(void*); */
  5685. STRUCT_FLD(deinit, i_s_common_deinit),
  5686. /* plugin version (for SHOW PLUGINS) */
  5687. /* unsigned int */
  5688. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  5689. /* struct st_mysql_show_var* */
  5690. STRUCT_FLD(status_vars, NULL),
  5691. /* struct st_mysql_sys_var** */
  5692. STRUCT_FLD(system_vars, NULL),
  5693. /* Maria extension */
  5694. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  5695. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  5696. };
  5697. /** SYS_FIELDS ***************************************************/
  5698. /* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_SYS_FIELDS */
  5699. static ST_FIELD_INFO innodb_sys_fields_fields_info[] =
  5700. {
  5701. #define SYS_FIELD_INDEX_ID 0
  5702. {STRUCT_FLD(field_name, "INDEX_ID"),
  5703. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  5704. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  5705. STRUCT_FLD(value, 0),
  5706. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  5707. STRUCT_FLD(old_name, ""),
  5708. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5709. #define SYS_FIELD_NAME 1
  5710. {STRUCT_FLD(field_name, "NAME"),
  5711. STRUCT_FLD(field_length, NAME_LEN + 1),
  5712. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  5713. STRUCT_FLD(value, 0),
  5714. STRUCT_FLD(field_flags, 0),
  5715. STRUCT_FLD(old_name, ""),
  5716. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5717. #define SYS_FIELD_POS 2
  5718. {STRUCT_FLD(field_name, "POS"),
  5719. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  5720. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  5721. STRUCT_FLD(value, 0),
  5722. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  5723. STRUCT_FLD(old_name, ""),
  5724. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5725. END_OF_ST_FIELD_INFO
  5726. };
  5727. /**********************************************************************//**
  5728. Function to fill information_schema.innodb_sys_fields with information
  5729. collected by scanning SYS_FIELDS table.
  5730. @return 0 on success */
  5731. static
  5732. int
  5733. i_s_dict_fill_sys_fields(
  5734. /*=====================*/
  5735. THD* thd, /*!< in: thread */
  5736. index_id_t index_id, /*!< in: index id for the field */
  5737. dict_field_t* field, /*!< in: table */
  5738. ulint pos, /*!< in: Field position */
  5739. TABLE* table_to_fill) /*!< in/out: fill this table */
  5740. {
  5741. Field** fields;
  5742. DBUG_ENTER("i_s_dict_fill_sys_fields");
  5743. fields = table_to_fill->field;
  5744. OK(fields[SYS_FIELD_INDEX_ID]->store(longlong(index_id), TRUE));
  5745. OK(field_store_string(fields[SYS_FIELD_NAME], field->name));
  5746. OK(fields[SYS_FIELD_POS]->store(static_cast<double>(pos)));
  5747. OK(schema_table_store_record(thd, table_to_fill));
  5748. DBUG_RETURN(0);
  5749. }
  5750. /*******************************************************************//**
  5751. Function to go through each record in SYS_FIELDS table, and fill the
  5752. information_schema.innodb_sys_fields table with related index field
  5753. information
  5754. @return 0 on success */
  5755. static
  5756. int
  5757. i_s_sys_fields_fill_table(
  5758. /*======================*/
  5759. THD* thd, /*!< in: thread */
  5760. TABLE_LIST* tables, /*!< in/out: tables to fill */
  5761. Item* ) /*!< in: condition (not used) */
  5762. {
  5763. btr_pcur_t pcur;
  5764. const rec_t* rec;
  5765. mem_heap_t* heap;
  5766. index_id_t last_id;
  5767. mtr_t mtr;
  5768. DBUG_ENTER("i_s_sys_fields_fill_table");
  5769. RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
  5770. /* deny access to user without PROCESS_ACL privilege */
  5771. if (check_global_access(thd, PROCESS_ACL)) {
  5772. DBUG_RETURN(0);
  5773. }
  5774. heap = mem_heap_create(1000);
  5775. mutex_enter(&dict_sys->mutex);
  5776. mtr_start(&mtr);
  5777. /* will save last index id so that we know whether we move to
  5778. the next index. This is used to calculate prefix length */
  5779. last_id = 0;
  5780. rec = dict_startscan_system(&pcur, &mtr, SYS_FIELDS);
  5781. while (rec) {
  5782. ulint pos;
  5783. const char* err_msg;
  5784. index_id_t index_id;
  5785. dict_field_t field_rec;
  5786. /* Populate a dict_field_t structure with information from
  5787. a SYS_FIELDS row */
  5788. err_msg = dict_process_sys_fields_rec(heap, rec, &field_rec,
  5789. &pos, &index_id, last_id);
  5790. mtr_commit(&mtr);
  5791. mutex_exit(&dict_sys->mutex);
  5792. if (!err_msg) {
  5793. i_s_dict_fill_sys_fields(thd, index_id, &field_rec,
  5794. pos, tables->table);
  5795. last_id = index_id;
  5796. } else {
  5797. push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
  5798. ER_CANT_FIND_SYSTEM_REC, "%s",
  5799. err_msg);
  5800. }
  5801. mem_heap_empty(heap);
  5802. /* Get the next record */
  5803. mutex_enter(&dict_sys->mutex);
  5804. mtr_start(&mtr);
  5805. rec = dict_getnext_system(&pcur, &mtr);
  5806. }
  5807. mtr_commit(&mtr);
  5808. mutex_exit(&dict_sys->mutex);
  5809. mem_heap_free(heap);
  5810. DBUG_RETURN(0);
  5811. }
  5812. /*******************************************************************//**
  5813. Bind the dynamic table INFORMATION_SCHEMA.innodb_sys_fields
  5814. @return 0 on success */
  5815. static
  5816. int
  5817. innodb_sys_fields_init(
  5818. /*===================*/
  5819. void* p) /*!< in/out: table schema object */
  5820. {
  5821. ST_SCHEMA_TABLE* schema;
  5822. DBUG_ENTER("innodb_sys_field_init");
  5823. schema = (ST_SCHEMA_TABLE*) p;
  5824. schema->fields_info = innodb_sys_fields_fields_info;
  5825. schema->fill_table = i_s_sys_fields_fill_table;
  5826. DBUG_RETURN(0);
  5827. }
  5828. UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_fields =
  5829. {
  5830. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  5831. /* int */
  5832. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  5833. /* pointer to type-specific plugin descriptor */
  5834. /* void* */
  5835. STRUCT_FLD(info, &i_s_info),
  5836. /* plugin name */
  5837. /* const char* */
  5838. STRUCT_FLD(name, "INNODB_SYS_FIELDS"),
  5839. /* plugin author (for SHOW PLUGINS) */
  5840. /* const char* */
  5841. STRUCT_FLD(author, plugin_author),
  5842. /* general descriptive text (for SHOW PLUGINS) */
  5843. /* const char* */
  5844. STRUCT_FLD(descr, "InnoDB SYS_FIELDS"),
  5845. /* the plugin license (PLUGIN_LICENSE_XXX) */
  5846. /* int */
  5847. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  5848. /* the function to invoke when plugin is loaded */
  5849. /* int (*)(void*); */
  5850. STRUCT_FLD(init, innodb_sys_fields_init),
  5851. /* the function to invoke when plugin is unloaded */
  5852. /* int (*)(void*); */
  5853. STRUCT_FLD(deinit, i_s_common_deinit),
  5854. /* plugin version (for SHOW PLUGINS) */
  5855. /* unsigned int */
  5856. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  5857. /* struct st_mysql_show_var* */
  5858. STRUCT_FLD(status_vars, NULL),
  5859. /* struct st_mysql_sys_var** */
  5860. STRUCT_FLD(system_vars, NULL),
  5861. /* Maria extension */
  5862. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  5863. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  5864. };
  5865. /** SYS_FOREIGN ********************************************/
  5866. /* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_SYS_FOREIGN */
  5867. static ST_FIELD_INFO innodb_sys_foreign_fields_info[] =
  5868. {
  5869. #define SYS_FOREIGN_ID 0
  5870. {STRUCT_FLD(field_name, "ID"),
  5871. STRUCT_FLD(field_length, NAME_LEN + 1),
  5872. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  5873. STRUCT_FLD(value, 0),
  5874. STRUCT_FLD(field_flags, 0),
  5875. STRUCT_FLD(old_name, ""),
  5876. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5877. #define SYS_FOREIGN_FOR_NAME 1
  5878. {STRUCT_FLD(field_name, "FOR_NAME"),
  5879. STRUCT_FLD(field_length, NAME_LEN + 1),
  5880. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  5881. STRUCT_FLD(value, 0),
  5882. STRUCT_FLD(field_flags, 0),
  5883. STRUCT_FLD(old_name, ""),
  5884. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5885. #define SYS_FOREIGN_REF_NAME 2
  5886. {STRUCT_FLD(field_name, "REF_NAME"),
  5887. STRUCT_FLD(field_length, NAME_LEN + 1),
  5888. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  5889. STRUCT_FLD(value, 0),
  5890. STRUCT_FLD(field_flags, 0),
  5891. STRUCT_FLD(old_name, ""),
  5892. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5893. #define SYS_FOREIGN_NUM_COL 3
  5894. {STRUCT_FLD(field_name, "N_COLS"),
  5895. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  5896. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  5897. STRUCT_FLD(value, 0),
  5898. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  5899. STRUCT_FLD(old_name, ""),
  5900. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5901. #define SYS_FOREIGN_TYPE 4
  5902. {STRUCT_FLD(field_name, "TYPE"),
  5903. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  5904. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  5905. STRUCT_FLD(value, 0),
  5906. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  5907. STRUCT_FLD(old_name, ""),
  5908. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  5909. END_OF_ST_FIELD_INFO
  5910. };
  5911. /**********************************************************************//**
  5912. Function to fill information_schema.innodb_sys_foreign with information
  5913. collected by scanning SYS_FOREIGN table.
  5914. @return 0 on success */
  5915. static
  5916. int
  5917. i_s_dict_fill_sys_foreign(
  5918. /*======================*/
  5919. THD* thd, /*!< in: thread */
  5920. dict_foreign_t* foreign, /*!< in: table */
  5921. TABLE* table_to_fill) /*!< in/out: fill this table */
  5922. {
  5923. Field** fields;
  5924. DBUG_ENTER("i_s_dict_fill_sys_foreign");
  5925. fields = table_to_fill->field;
  5926. OK(field_store_string(fields[SYS_FOREIGN_ID], foreign->id));
  5927. OK(field_store_string(fields[SYS_FOREIGN_FOR_NAME],
  5928. foreign->foreign_table_name));
  5929. OK(field_store_string(fields[SYS_FOREIGN_REF_NAME],
  5930. foreign->referenced_table_name));
  5931. OK(fields[SYS_FOREIGN_NUM_COL]->store(foreign->n_fields));
  5932. OK(fields[SYS_FOREIGN_TYPE]->store(foreign->type));
  5933. OK(schema_table_store_record(thd, table_to_fill));
  5934. DBUG_RETURN(0);
  5935. }
  5936. /*******************************************************************//**
  5937. Function to populate INFORMATION_SCHEMA.innodb_sys_foreign table. Loop
  5938. through each record in SYS_FOREIGN, and extract the foreign key
  5939. information.
  5940. @return 0 on success */
  5941. static
  5942. int
  5943. i_s_sys_foreign_fill_table(
  5944. /*=======================*/
  5945. THD* thd, /*!< in: thread */
  5946. TABLE_LIST* tables, /*!< in/out: tables to fill */
  5947. Item* ) /*!< in: condition (not used) */
  5948. {
  5949. btr_pcur_t pcur;
  5950. const rec_t* rec;
  5951. mem_heap_t* heap;
  5952. mtr_t mtr;
  5953. DBUG_ENTER("i_s_sys_foreign_fill_table");
  5954. RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
  5955. /* deny access to user without PROCESS_ACL privilege */
  5956. if (check_global_access(thd, PROCESS_ACL)) {
  5957. DBUG_RETURN(0);
  5958. }
  5959. heap = mem_heap_create(1000);
  5960. mutex_enter(&dict_sys->mutex);
  5961. mtr_start(&mtr);
  5962. rec = dict_startscan_system(&pcur, &mtr, SYS_FOREIGN);
  5963. while (rec) {
  5964. const char* err_msg;
  5965. dict_foreign_t foreign_rec;
  5966. /* Populate a dict_foreign_t structure with information from
  5967. a SYS_FOREIGN row */
  5968. err_msg = dict_process_sys_foreign_rec(heap, rec, &foreign_rec);
  5969. mtr_commit(&mtr);
  5970. mutex_exit(&dict_sys->mutex);
  5971. if (!err_msg) {
  5972. i_s_dict_fill_sys_foreign(thd, &foreign_rec,
  5973. tables->table);
  5974. } else {
  5975. push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
  5976. ER_CANT_FIND_SYSTEM_REC, "%s",
  5977. err_msg);
  5978. }
  5979. mem_heap_empty(heap);
  5980. /* Get the next record */
  5981. mtr_start(&mtr);
  5982. mutex_enter(&dict_sys->mutex);
  5983. rec = dict_getnext_system(&pcur, &mtr);
  5984. }
  5985. mtr_commit(&mtr);
  5986. mutex_exit(&dict_sys->mutex);
  5987. mem_heap_free(heap);
  5988. DBUG_RETURN(0);
  5989. }
  5990. /*******************************************************************//**
  5991. Bind the dynamic table INFORMATION_SCHEMA.innodb_sys_foreign
  5992. @return 0 on success */
  5993. static
  5994. int
  5995. innodb_sys_foreign_init(
  5996. /*====================*/
  5997. void* p) /*!< in/out: table schema object */
  5998. {
  5999. ST_SCHEMA_TABLE* schema;
  6000. DBUG_ENTER("innodb_sys_foreign_init");
  6001. schema = (ST_SCHEMA_TABLE*) p;
  6002. schema->fields_info = innodb_sys_foreign_fields_info;
  6003. schema->fill_table = i_s_sys_foreign_fill_table;
  6004. DBUG_RETURN(0);
  6005. }
  6006. UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_foreign =
  6007. {
  6008. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  6009. /* int */
  6010. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  6011. /* pointer to type-specific plugin descriptor */
  6012. /* void* */
  6013. STRUCT_FLD(info, &i_s_info),
  6014. /* plugin name */
  6015. /* const char* */
  6016. STRUCT_FLD(name, "INNODB_SYS_FOREIGN"),
  6017. /* plugin author (for SHOW PLUGINS) */
  6018. /* const char* */
  6019. STRUCT_FLD(author, plugin_author),
  6020. /* general descriptive text (for SHOW PLUGINS) */
  6021. /* const char* */
  6022. STRUCT_FLD(descr, "InnoDB SYS_FOREIGN"),
  6023. /* the plugin license (PLUGIN_LICENSE_XXX) */
  6024. /* int */
  6025. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  6026. /* the function to invoke when plugin is loaded */
  6027. /* int (*)(void*); */
  6028. STRUCT_FLD(init, innodb_sys_foreign_init),
  6029. /* the function to invoke when plugin is unloaded */
  6030. /* int (*)(void*); */
  6031. STRUCT_FLD(deinit, i_s_common_deinit),
  6032. /* plugin version (for SHOW PLUGINS) */
  6033. /* unsigned int */
  6034. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  6035. /* struct st_mysql_show_var* */
  6036. STRUCT_FLD(status_vars, NULL),
  6037. /* struct st_mysql_sys_var** */
  6038. STRUCT_FLD(system_vars, NULL),
  6039. /* Maria extension */
  6040. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  6041. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  6042. };
  6043. /** SYS_FOREIGN_COLS ********************************************/
  6044. /* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS */
  6045. static ST_FIELD_INFO innodb_sys_foreign_cols_fields_info[] =
  6046. {
  6047. #define SYS_FOREIGN_COL_ID 0
  6048. {STRUCT_FLD(field_name, "ID"),
  6049. STRUCT_FLD(field_length, NAME_LEN + 1),
  6050. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  6051. STRUCT_FLD(value, 0),
  6052. STRUCT_FLD(field_flags, 0),
  6053. STRUCT_FLD(old_name, ""),
  6054. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6055. #define SYS_FOREIGN_COL_FOR_NAME 1
  6056. {STRUCT_FLD(field_name, "FOR_COL_NAME"),
  6057. STRUCT_FLD(field_length, NAME_LEN + 1),
  6058. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  6059. STRUCT_FLD(value, 0),
  6060. STRUCT_FLD(field_flags, 0),
  6061. STRUCT_FLD(old_name, ""),
  6062. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6063. #define SYS_FOREIGN_COL_REF_NAME 2
  6064. {STRUCT_FLD(field_name, "REF_COL_NAME"),
  6065. STRUCT_FLD(field_length, NAME_LEN + 1),
  6066. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  6067. STRUCT_FLD(value, 0),
  6068. STRUCT_FLD(field_flags, 0),
  6069. STRUCT_FLD(old_name, ""),
  6070. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6071. #define SYS_FOREIGN_COL_POS 3
  6072. {STRUCT_FLD(field_name, "POS"),
  6073. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  6074. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  6075. STRUCT_FLD(value, 0),
  6076. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  6077. STRUCT_FLD(old_name, ""),
  6078. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6079. END_OF_ST_FIELD_INFO
  6080. };
  6081. /**********************************************************************//**
  6082. Function to fill information_schema.innodb_sys_foreign_cols with information
  6083. collected by scanning SYS_FOREIGN_COLS table.
  6084. @return 0 on success */
  6085. static
  6086. int
  6087. i_s_dict_fill_sys_foreign_cols(
  6088. /*==========================*/
  6089. THD* thd, /*!< in: thread */
  6090. const char* name, /*!< in: foreign key constraint name */
  6091. const char* for_col_name, /*!< in: referencing column name*/
  6092. const char* ref_col_name, /*!< in: referenced column
  6093. name */
  6094. ulint pos, /*!< in: column position */
  6095. TABLE* table_to_fill) /*!< in/out: fill this table */
  6096. {
  6097. Field** fields;
  6098. DBUG_ENTER("i_s_dict_fill_sys_foreign_cols");
  6099. fields = table_to_fill->field;
  6100. OK(field_store_string(fields[SYS_FOREIGN_COL_ID], name));
  6101. OK(field_store_string(fields[SYS_FOREIGN_COL_FOR_NAME], for_col_name));
  6102. OK(field_store_string(fields[SYS_FOREIGN_COL_REF_NAME], ref_col_name));
  6103. OK(fields[SYS_FOREIGN_COL_POS]->store(static_cast<double>(pos)));
  6104. OK(schema_table_store_record(thd, table_to_fill));
  6105. DBUG_RETURN(0);
  6106. }
  6107. /*******************************************************************//**
  6108. Function to populate INFORMATION_SCHEMA.innodb_sys_foreign_cols table. Loop
  6109. through each record in SYS_FOREIGN_COLS, and extract the foreign key column
  6110. information and fill the INFORMATION_SCHEMA.innodb_sys_foreign_cols table.
  6111. @return 0 on success */
  6112. static
  6113. int
  6114. i_s_sys_foreign_cols_fill_table(
  6115. /*============================*/
  6116. THD* thd, /*!< in: thread */
  6117. TABLE_LIST* tables, /*!< in/out: tables to fill */
  6118. Item* ) /*!< in: condition (not used) */
  6119. {
  6120. btr_pcur_t pcur;
  6121. const rec_t* rec;
  6122. mem_heap_t* heap;
  6123. mtr_t mtr;
  6124. DBUG_ENTER("i_s_sys_foreign_cols_fill_table");
  6125. RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
  6126. /* deny access to user without PROCESS_ACL privilege */
  6127. if (check_global_access(thd, PROCESS_ACL)) {
  6128. DBUG_RETURN(0);
  6129. }
  6130. heap = mem_heap_create(1000);
  6131. mutex_enter(&dict_sys->mutex);
  6132. mtr_start(&mtr);
  6133. rec = dict_startscan_system(&pcur, &mtr, SYS_FOREIGN_COLS);
  6134. while (rec) {
  6135. const char* err_msg;
  6136. const char* name;
  6137. const char* for_col_name;
  6138. const char* ref_col_name;
  6139. ulint pos;
  6140. /* Extract necessary information from a SYS_FOREIGN_COLS row */
  6141. err_msg = dict_process_sys_foreign_col_rec(
  6142. heap, rec, &name, &for_col_name, &ref_col_name, &pos);
  6143. mtr_commit(&mtr);
  6144. mutex_exit(&dict_sys->mutex);
  6145. if (!err_msg) {
  6146. i_s_dict_fill_sys_foreign_cols(
  6147. thd, name, for_col_name, ref_col_name, pos,
  6148. tables->table);
  6149. } else {
  6150. push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
  6151. ER_CANT_FIND_SYSTEM_REC, "%s",
  6152. err_msg);
  6153. }
  6154. mem_heap_empty(heap);
  6155. /* Get the next record */
  6156. mutex_enter(&dict_sys->mutex);
  6157. mtr_start(&mtr);
  6158. rec = dict_getnext_system(&pcur, &mtr);
  6159. }
  6160. mtr_commit(&mtr);
  6161. mutex_exit(&dict_sys->mutex);
  6162. mem_heap_free(heap);
  6163. DBUG_RETURN(0);
  6164. }
  6165. /*******************************************************************//**
  6166. Bind the dynamic table INFORMATION_SCHEMA.innodb_sys_foreign_cols
  6167. @return 0 on success */
  6168. static
  6169. int
  6170. innodb_sys_foreign_cols_init(
  6171. /*========================*/
  6172. void* p) /*!< in/out: table schema object */
  6173. {
  6174. ST_SCHEMA_TABLE* schema;
  6175. DBUG_ENTER("innodb_sys_foreign_cols_init");
  6176. schema = (ST_SCHEMA_TABLE*) p;
  6177. schema->fields_info = innodb_sys_foreign_cols_fields_info;
  6178. schema->fill_table = i_s_sys_foreign_cols_fill_table;
  6179. DBUG_RETURN(0);
  6180. }
  6181. UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_foreign_cols =
  6182. {
  6183. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  6184. /* int */
  6185. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  6186. /* pointer to type-specific plugin descriptor */
  6187. /* void* */
  6188. STRUCT_FLD(info, &i_s_info),
  6189. /* plugin name */
  6190. /* const char* */
  6191. STRUCT_FLD(name, "INNODB_SYS_FOREIGN_COLS"),
  6192. /* plugin author (for SHOW PLUGINS) */
  6193. /* const char* */
  6194. STRUCT_FLD(author, plugin_author),
  6195. /* general descriptive text (for SHOW PLUGINS) */
  6196. /* const char* */
  6197. STRUCT_FLD(descr, "InnoDB SYS_FOREIGN_COLS"),
  6198. /* the plugin license (PLUGIN_LICENSE_XXX) */
  6199. /* int */
  6200. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  6201. /* the function to invoke when plugin is loaded */
  6202. /* int (*)(void*); */
  6203. STRUCT_FLD(init, innodb_sys_foreign_cols_init),
  6204. /* the function to invoke when plugin is unloaded */
  6205. /* int (*)(void*); */
  6206. STRUCT_FLD(deinit, i_s_common_deinit),
  6207. /* plugin version (for SHOW PLUGINS) */
  6208. /* unsigned int */
  6209. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  6210. /* struct st_mysql_show_var* */
  6211. STRUCT_FLD(status_vars, NULL),
  6212. /* struct st_mysql_sys_var** */
  6213. STRUCT_FLD(system_vars, NULL),
  6214. /* Maria extension */
  6215. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  6216. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  6217. };
  6218. /** SYS_TABLESPACES ********************************************/
  6219. /* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES */
  6220. static ST_FIELD_INFO innodb_sys_tablespaces_fields_info[] =
  6221. {
  6222. #define SYS_TABLESPACES_SPACE 0
  6223. {STRUCT_FLD(field_name, "SPACE"),
  6224. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  6225. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  6226. STRUCT_FLD(value, 0),
  6227. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  6228. STRUCT_FLD(old_name, ""),
  6229. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6230. #define SYS_TABLESPACES_NAME 1
  6231. {STRUCT_FLD(field_name, "NAME"),
  6232. STRUCT_FLD(field_length, MAX_FULL_NAME_LEN + 1),
  6233. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  6234. STRUCT_FLD(value, 0),
  6235. STRUCT_FLD(field_flags, 0),
  6236. STRUCT_FLD(old_name, ""),
  6237. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6238. #define SYS_TABLESPACES_FLAGS 2
  6239. {STRUCT_FLD(field_name, "FLAG"),
  6240. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  6241. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  6242. STRUCT_FLD(value, 0),
  6243. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  6244. STRUCT_FLD(old_name, ""),
  6245. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6246. #define SYS_TABLESPACES_FILE_FORMAT 3
  6247. {STRUCT_FLD(field_name, "FILE_FORMAT"),
  6248. STRUCT_FLD(field_length, 10),
  6249. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  6250. STRUCT_FLD(value, 0),
  6251. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  6252. STRUCT_FLD(old_name, ""),
  6253. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6254. #define SYS_TABLESPACES_ROW_FORMAT 4
  6255. {STRUCT_FLD(field_name, "ROW_FORMAT"),
  6256. STRUCT_FLD(field_length, 22),
  6257. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  6258. STRUCT_FLD(value, 0),
  6259. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  6260. STRUCT_FLD(old_name, ""),
  6261. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6262. #define SYS_TABLESPACES_PAGE_SIZE 5
  6263. {STRUCT_FLD(field_name, "PAGE_SIZE"),
  6264. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  6265. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  6266. STRUCT_FLD(value, 0),
  6267. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  6268. STRUCT_FLD(old_name, ""),
  6269. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6270. #define SYS_TABLESPACES_ZIP_PAGE_SIZE 6
  6271. {STRUCT_FLD(field_name, "ZIP_PAGE_SIZE"),
  6272. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  6273. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  6274. STRUCT_FLD(value, 0),
  6275. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  6276. STRUCT_FLD(old_name, ""),
  6277. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6278. END_OF_ST_FIELD_INFO
  6279. };
  6280. /**********************************************************************//**
  6281. Function to fill INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES with information
  6282. collected by scanning SYS_TABLESPACESS table.
  6283. @return 0 on success */
  6284. static
  6285. int
  6286. i_s_dict_fill_sys_tablespaces(
  6287. /*==========================*/
  6288. THD* thd, /*!< in: thread */
  6289. ulint space, /*!< in: space ID */
  6290. const char* name, /*!< in: tablespace name */
  6291. ulint flags, /*!< in: tablespace flags */
  6292. TABLE* table_to_fill) /*!< in/out: fill this table */
  6293. {
  6294. Field** fields;
  6295. ulint atomic_blobs = FSP_FLAGS_HAS_ATOMIC_BLOBS(flags);
  6296. const char* file_format;
  6297. const char* row_format;
  6298. DBUG_ENTER("i_s_dict_fill_sys_tablespaces");
  6299. file_format = trx_sys_file_format_id_to_name(atomic_blobs);
  6300. if (!atomic_blobs) {
  6301. row_format = "Compact or Redundant";
  6302. } else if DICT_TF_GET_ZIP_SSIZE(flags) {
  6303. row_format = "Compressed";
  6304. } else {
  6305. row_format = "Dynamic";
  6306. }
  6307. fields = table_to_fill->field;
  6308. OK(fields[SYS_TABLESPACES_SPACE]->store(space, true));
  6309. OK(field_store_string(fields[SYS_TABLESPACES_NAME], name));
  6310. OK(fields[SYS_TABLESPACES_FLAGS]->store(flags, true));
  6311. OK(field_store_string(fields[SYS_TABLESPACES_FILE_FORMAT],
  6312. file_format));
  6313. OK(field_store_string(fields[SYS_TABLESPACES_ROW_FORMAT],
  6314. row_format));
  6315. ulint cflags = fsp_flags_is_valid(flags, space)
  6316. ? flags : fsp_flags_convert_from_101(flags);
  6317. if (cflags != ULINT_UNDEFINED) {
  6318. OK(fields[SYS_TABLESPACES_PAGE_SIZE]->store(
  6319. fsp_flags_get_page_size(cflags), true));
  6320. OK(fields[SYS_TABLESPACES_ZIP_PAGE_SIZE]->store(
  6321. fsp_flags_get_zip_size(cflags), true));
  6322. } else {
  6323. fields[SYS_TABLESPACES_PAGE_SIZE]->set_null();
  6324. fields[SYS_TABLESPACES_ZIP_PAGE_SIZE]->set_null();
  6325. }
  6326. OK(schema_table_store_record(thd, table_to_fill));
  6327. DBUG_RETURN(0);
  6328. }
  6329. /*******************************************************************//**
  6330. Function to populate INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES table.
  6331. Loop through each record in SYS_TABLESPACES, and extract the column
  6332. information and fill the INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES table.
  6333. @return 0 on success */
  6334. static
  6335. int
  6336. i_s_sys_tablespaces_fill_table(
  6337. /*===========================*/
  6338. THD* thd, /*!< in: thread */
  6339. TABLE_LIST* tables, /*!< in/out: tables to fill */
  6340. Item* ) /*!< in: condition (not used) */
  6341. {
  6342. btr_pcur_t pcur;
  6343. const rec_t* rec;
  6344. mem_heap_t* heap;
  6345. mtr_t mtr;
  6346. DBUG_ENTER("i_s_sys_tablespaces_fill_table");
  6347. RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
  6348. /* deny access to user without PROCESS_ACL privilege */
  6349. if (check_global_access(thd, PROCESS_ACL)) {
  6350. DBUG_RETURN(0);
  6351. }
  6352. heap = mem_heap_create(1000);
  6353. mutex_enter(&dict_sys->mutex);
  6354. mtr_start(&mtr);
  6355. rec = dict_startscan_system(&pcur, &mtr, SYS_TABLESPACES);
  6356. while (rec) {
  6357. const char* err_msg;
  6358. ulint space;
  6359. const char* name;
  6360. ulint flags;
  6361. /* Extract necessary information from a SYS_TABLESPACES row */
  6362. err_msg = dict_process_sys_tablespaces(
  6363. heap, rec, &space, &name, &flags);
  6364. mtr_commit(&mtr);
  6365. mutex_exit(&dict_sys->mutex);
  6366. if (!err_msg) {
  6367. i_s_dict_fill_sys_tablespaces(
  6368. thd, space, name, flags,
  6369. tables->table);
  6370. } else {
  6371. push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
  6372. ER_CANT_FIND_SYSTEM_REC, "%s",
  6373. err_msg);
  6374. }
  6375. mem_heap_empty(heap);
  6376. /* Get the next record */
  6377. mutex_enter(&dict_sys->mutex);
  6378. mtr_start(&mtr);
  6379. rec = dict_getnext_system(&pcur, &mtr);
  6380. }
  6381. mtr_commit(&mtr);
  6382. mutex_exit(&dict_sys->mutex);
  6383. mem_heap_free(heap);
  6384. DBUG_RETURN(0);
  6385. }
  6386. /*******************************************************************//**
  6387. Bind the dynamic table INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES
  6388. @return 0 on success */
  6389. static
  6390. int
  6391. innodb_sys_tablespaces_init(
  6392. /*========================*/
  6393. void* p) /*!< in/out: table schema object */
  6394. {
  6395. ST_SCHEMA_TABLE* schema;
  6396. DBUG_ENTER("innodb_sys_tablespaces_init");
  6397. schema = (ST_SCHEMA_TABLE*) p;
  6398. schema->fields_info = innodb_sys_tablespaces_fields_info;
  6399. schema->fill_table = i_s_sys_tablespaces_fill_table;
  6400. DBUG_RETURN(0);
  6401. }
  6402. UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_tablespaces =
  6403. {
  6404. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  6405. /* int */
  6406. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  6407. /* pointer to type-specific plugin descriptor */
  6408. /* void* */
  6409. STRUCT_FLD(info, &i_s_info),
  6410. /* plugin name */
  6411. /* const char* */
  6412. STRUCT_FLD(name, "INNODB_SYS_TABLESPACES"),
  6413. /* plugin author (for SHOW PLUGINS) */
  6414. /* const char* */
  6415. STRUCT_FLD(author, plugin_author),
  6416. /* general descriptive text (for SHOW PLUGINS) */
  6417. /* const char* */
  6418. STRUCT_FLD(descr, "InnoDB SYS_TABLESPACES"),
  6419. /* the plugin license (PLUGIN_LICENSE_XXX) */
  6420. /* int */
  6421. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  6422. /* the function to invoke when plugin is loaded */
  6423. /* int (*)(void*); */
  6424. STRUCT_FLD(init, innodb_sys_tablespaces_init),
  6425. /* the function to invoke when plugin is unloaded */
  6426. /* int (*)(void*); */
  6427. STRUCT_FLD(deinit, i_s_common_deinit),
  6428. /* plugin version (for SHOW PLUGINS) */
  6429. /* unsigned int */
  6430. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  6431. /* struct st_mysql_show_var* */
  6432. STRUCT_FLD(status_vars, NULL),
  6433. /* struct st_mysql_sys_var** */
  6434. STRUCT_FLD(system_vars, NULL),
  6435. /* Maria extension */
  6436. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  6437. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  6438. };
  6439. /** SYS_DATAFILES ************************************************/
  6440. /* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_SYS_DATAFILES */
  6441. static ST_FIELD_INFO innodb_sys_datafiles_fields_info[] =
  6442. {
  6443. #define SYS_DATAFILES_SPACE 0
  6444. {STRUCT_FLD(field_name, "SPACE"),
  6445. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  6446. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  6447. STRUCT_FLD(value, 0),
  6448. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  6449. STRUCT_FLD(old_name, ""),
  6450. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6451. #define SYS_DATAFILES_PATH 1
  6452. {STRUCT_FLD(field_name, "PATH"),
  6453. STRUCT_FLD(field_length, OS_FILE_MAX_PATH),
  6454. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  6455. STRUCT_FLD(value, 0),
  6456. STRUCT_FLD(field_flags, 0),
  6457. STRUCT_FLD(old_name, ""),
  6458. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6459. END_OF_ST_FIELD_INFO
  6460. };
  6461. /**********************************************************************//**
  6462. Function to fill INFORMATION_SCHEMA.INNODB_SYS_DATAFILES with information
  6463. collected by scanning SYS_DATAFILESS table.
  6464. @return 0 on success */
  6465. static
  6466. int
  6467. i_s_dict_fill_sys_datafiles(
  6468. /*========================*/
  6469. THD* thd, /*!< in: thread */
  6470. ulint space, /*!< in: space ID */
  6471. const char* path, /*!< in: absolute path */
  6472. TABLE* table_to_fill) /*!< in/out: fill this table */
  6473. {
  6474. Field** fields;
  6475. DBUG_ENTER("i_s_dict_fill_sys_datafiles");
  6476. fields = table_to_fill->field;
  6477. OK(field_store_ulint(fields[SYS_DATAFILES_SPACE], space));
  6478. OK(field_store_string(fields[SYS_DATAFILES_PATH], path));
  6479. OK(schema_table_store_record(thd, table_to_fill));
  6480. DBUG_RETURN(0);
  6481. }
  6482. /*******************************************************************//**
  6483. Function to populate INFORMATION_SCHEMA.INNODB_SYS_DATAFILES table.
  6484. Loop through each record in SYS_DATAFILES, and extract the column
  6485. information and fill the INFORMATION_SCHEMA.INNODB_SYS_DATAFILES table.
  6486. @return 0 on success */
  6487. static
  6488. int
  6489. i_s_sys_datafiles_fill_table(
  6490. /*=========================*/
  6491. THD* thd, /*!< in: thread */
  6492. TABLE_LIST* tables, /*!< in/out: tables to fill */
  6493. Item* ) /*!< in: condition (not used) */
  6494. {
  6495. btr_pcur_t pcur;
  6496. const rec_t* rec;
  6497. mem_heap_t* heap;
  6498. mtr_t mtr;
  6499. DBUG_ENTER("i_s_sys_datafiles_fill_table");
  6500. RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
  6501. /* deny access to user without PROCESS_ACL privilege */
  6502. if (check_global_access(thd, PROCESS_ACL)) {
  6503. DBUG_RETURN(0);
  6504. }
  6505. heap = mem_heap_create(1000);
  6506. mutex_enter(&dict_sys->mutex);
  6507. mtr_start(&mtr);
  6508. rec = dict_startscan_system(&pcur, &mtr, SYS_DATAFILES);
  6509. while (rec) {
  6510. const char* err_msg;
  6511. ulint space;
  6512. const char* path;
  6513. /* Extract necessary information from a SYS_DATAFILES row */
  6514. err_msg = dict_process_sys_datafiles(
  6515. heap, rec, &space, &path);
  6516. mtr_commit(&mtr);
  6517. mutex_exit(&dict_sys->mutex);
  6518. if (!err_msg) {
  6519. i_s_dict_fill_sys_datafiles(
  6520. thd, space, path, tables->table);
  6521. } else {
  6522. push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
  6523. ER_CANT_FIND_SYSTEM_REC, "%s",
  6524. err_msg);
  6525. }
  6526. mem_heap_empty(heap);
  6527. /* Get the next record */
  6528. mutex_enter(&dict_sys->mutex);
  6529. mtr_start(&mtr);
  6530. rec = dict_getnext_system(&pcur, &mtr);
  6531. }
  6532. mtr_commit(&mtr);
  6533. mutex_exit(&dict_sys->mutex);
  6534. mem_heap_free(heap);
  6535. DBUG_RETURN(0);
  6536. }
  6537. /*******************************************************************//**
  6538. Bind the dynamic table INFORMATION_SCHEMA.INNODB_SYS_DATAFILES
  6539. @return 0 on success */
  6540. static
  6541. int
  6542. innodb_sys_datafiles_init(
  6543. /*======================*/
  6544. void* p) /*!< in/out: table schema object */
  6545. {
  6546. ST_SCHEMA_TABLE* schema;
  6547. DBUG_ENTER("innodb_sys_datafiles_init");
  6548. schema = (ST_SCHEMA_TABLE*) p;
  6549. schema->fields_info = innodb_sys_datafiles_fields_info;
  6550. schema->fill_table = i_s_sys_datafiles_fill_table;
  6551. DBUG_RETURN(0);
  6552. }
  6553. UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_datafiles =
  6554. {
  6555. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  6556. /* int */
  6557. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  6558. /* pointer to type-specific plugin descriptor */
  6559. /* void* */
  6560. STRUCT_FLD(info, &i_s_info),
  6561. /* plugin name */
  6562. /* const char* */
  6563. STRUCT_FLD(name, "INNODB_SYS_DATAFILES"),
  6564. /* plugin author (for SHOW PLUGINS) */
  6565. /* const char* */
  6566. STRUCT_FLD(author, plugin_author),
  6567. /* general descriptive text (for SHOW PLUGINS) */
  6568. /* const char* */
  6569. STRUCT_FLD(descr, "InnoDB SYS_DATAFILES"),
  6570. /* the plugin license (PLUGIN_LICENSE_XXX) */
  6571. /* int */
  6572. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  6573. /* the function to invoke when plugin is loaded */
  6574. /* int (*)(void*); */
  6575. STRUCT_FLD(init, innodb_sys_datafiles_init),
  6576. /* the function to invoke when plugin is unloaded */
  6577. /* int (*)(void*); */
  6578. STRUCT_FLD(deinit, i_s_common_deinit),
  6579. /* plugin version (for SHOW PLUGINS) */
  6580. /* unsigned int */
  6581. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  6582. /* struct st_mysql_show_var* */
  6583. STRUCT_FLD(status_vars, NULL),
  6584. /* struct st_mysql_sys_var** */
  6585. STRUCT_FLD(system_vars, NULL),
  6586. /* Maria extension */
  6587. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  6588. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  6589. };
  6590. /** TABLESPACES_ENCRYPTION ********************************************/
  6591. /* Fields of the table INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION */
  6592. static ST_FIELD_INFO innodb_tablespaces_encryption_fields_info[] =
  6593. {
  6594. #define TABLESPACES_ENCRYPTION_SPACE 0
  6595. {STRUCT_FLD(field_name, "SPACE"),
  6596. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  6597. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  6598. STRUCT_FLD(value, 0),
  6599. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  6600. STRUCT_FLD(old_name, ""),
  6601. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6602. #define TABLESPACES_ENCRYPTION_NAME 1
  6603. {STRUCT_FLD(field_name, "NAME"),
  6604. STRUCT_FLD(field_length, MAX_FULL_NAME_LEN + 1),
  6605. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  6606. STRUCT_FLD(value, 0),
  6607. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  6608. STRUCT_FLD(old_name, ""),
  6609. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6610. #define TABLESPACES_ENCRYPTION_ENCRYPTION_SCHEME 2
  6611. {STRUCT_FLD(field_name, "ENCRYPTION_SCHEME"),
  6612. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  6613. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  6614. STRUCT_FLD(value, 0),
  6615. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  6616. STRUCT_FLD(old_name, ""),
  6617. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6618. #define TABLESPACES_ENCRYPTION_KEYSERVER_REQUESTS 3
  6619. {STRUCT_FLD(field_name, "KEYSERVER_REQUESTS"),
  6620. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  6621. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  6622. STRUCT_FLD(value, 0),
  6623. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  6624. STRUCT_FLD(old_name, ""),
  6625. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6626. #define TABLESPACES_ENCRYPTION_MIN_KEY_VERSION 4
  6627. {STRUCT_FLD(field_name, "MIN_KEY_VERSION"),
  6628. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  6629. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  6630. STRUCT_FLD(value, 0),
  6631. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  6632. STRUCT_FLD(old_name, ""),
  6633. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6634. #define TABLESPACES_ENCRYPTION_CURRENT_KEY_VERSION 5
  6635. {STRUCT_FLD(field_name, "CURRENT_KEY_VERSION"),
  6636. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  6637. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  6638. STRUCT_FLD(value, 0),
  6639. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  6640. STRUCT_FLD(old_name, ""),
  6641. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6642. #define TABLESPACES_ENCRYPTION_KEY_ROTATION_PAGE_NUMBER 6
  6643. {STRUCT_FLD(field_name, "KEY_ROTATION_PAGE_NUMBER"),
  6644. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  6645. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  6646. STRUCT_FLD(value, 0),
  6647. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL),
  6648. STRUCT_FLD(old_name, ""),
  6649. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6650. #define TABLESPACES_ENCRYPTION_KEY_ROTATION_MAX_PAGE_NUMBER 7
  6651. {STRUCT_FLD(field_name, "KEY_ROTATION_MAX_PAGE_NUMBER"),
  6652. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  6653. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  6654. STRUCT_FLD(value, 0),
  6655. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL),
  6656. STRUCT_FLD(old_name, ""),
  6657. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6658. #define TABLESPACES_ENCRYPTION_CURRENT_KEY_ID 8
  6659. {STRUCT_FLD(field_name, "CURRENT_KEY_ID"),
  6660. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  6661. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  6662. STRUCT_FLD(value, 0),
  6663. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  6664. STRUCT_FLD(old_name, ""),
  6665. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6666. #define TABLESPACES_ENCRYPTION_ROTATING_OR_FLUSHING 9
  6667. {STRUCT_FLD(field_name, "ROTATING_OR_FLUSHING"),
  6668. STRUCT_FLD(field_length, 1),
  6669. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  6670. STRUCT_FLD(value, 0),
  6671. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  6672. STRUCT_FLD(old_name, ""),
  6673. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6674. END_OF_ST_FIELD_INFO
  6675. };
  6676. /**********************************************************************//**
  6677. Function to fill INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION
  6678. with information collected by scanning SYS_TABLESPACES table.
  6679. @param[in] thd thread handle
  6680. @param[in] space Tablespace
  6681. @param[in] table_to_fill I_S table to fill
  6682. @return 0 on success */
  6683. static
  6684. int
  6685. i_s_dict_fill_tablespaces_encryption(
  6686. THD* thd,
  6687. fil_space_t* space,
  6688. TABLE* table_to_fill)
  6689. {
  6690. Field** fields;
  6691. struct fil_space_crypt_status_t status;
  6692. DBUG_ENTER("i_s_dict_fill_tablespaces_encryption");
  6693. fields = table_to_fill->field;
  6694. fil_space_crypt_get_status(space, &status);
  6695. /* If tablespace id does not match, we did not find
  6696. encryption information for this tablespace. */
  6697. if (!space->crypt_data || space->id != status.space) {
  6698. goto skip;
  6699. }
  6700. OK(fields[TABLESPACES_ENCRYPTION_SPACE]->store(space->id));
  6701. OK(field_store_string(fields[TABLESPACES_ENCRYPTION_NAME],
  6702. space->name));
  6703. OK(fields[TABLESPACES_ENCRYPTION_ENCRYPTION_SCHEME]->store(
  6704. status.scheme));
  6705. OK(fields[TABLESPACES_ENCRYPTION_KEYSERVER_REQUESTS]->store(
  6706. status.keyserver_requests));
  6707. OK(fields[TABLESPACES_ENCRYPTION_MIN_KEY_VERSION]->store(
  6708. status.min_key_version));
  6709. OK(fields[TABLESPACES_ENCRYPTION_CURRENT_KEY_VERSION]->store(
  6710. status.current_key_version));
  6711. OK(fields[TABLESPACES_ENCRYPTION_CURRENT_KEY_ID]->store(
  6712. status.key_id));
  6713. OK(fields[TABLESPACES_ENCRYPTION_ROTATING_OR_FLUSHING]->store(
  6714. (status.rotating || status.flushing) ? 1 : 0));
  6715. if (status.rotating) {
  6716. fields[TABLESPACES_ENCRYPTION_KEY_ROTATION_PAGE_NUMBER]->set_notnull();
  6717. OK(fields[TABLESPACES_ENCRYPTION_KEY_ROTATION_PAGE_NUMBER]->store(
  6718. status.rotate_next_page_number));
  6719. fields[TABLESPACES_ENCRYPTION_KEY_ROTATION_MAX_PAGE_NUMBER]->set_notnull();
  6720. OK(fields[TABLESPACES_ENCRYPTION_KEY_ROTATION_MAX_PAGE_NUMBER]->store(
  6721. status.rotate_max_page_number));
  6722. } else {
  6723. fields[TABLESPACES_ENCRYPTION_KEY_ROTATION_PAGE_NUMBER]
  6724. ->set_null();
  6725. fields[TABLESPACES_ENCRYPTION_KEY_ROTATION_MAX_PAGE_NUMBER]
  6726. ->set_null();
  6727. }
  6728. OK(schema_table_store_record(thd, table_to_fill));
  6729. skip:
  6730. DBUG_RETURN(0);
  6731. }
  6732. /*******************************************************************//**
  6733. Function to populate INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION table.
  6734. Loop through each record in TABLESPACES_ENCRYPTION, and extract the column
  6735. information and fill the INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION table.
  6736. @return 0 on success */
  6737. static
  6738. int
  6739. i_s_tablespaces_encryption_fill_table(
  6740. /*===========================*/
  6741. THD* thd, /*!< in: thread */
  6742. TABLE_LIST* tables, /*!< in/out: tables to fill */
  6743. Item* ) /*!< in: condition (not used) */
  6744. {
  6745. btr_pcur_t pcur;
  6746. const rec_t* rec;
  6747. mem_heap_t* heap;
  6748. mtr_t mtr;
  6749. bool found_space_0 = false;
  6750. DBUG_ENTER("i_s_tablespaces_encryption_fill_table");
  6751. RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
  6752. /* deny access to user without PROCESS_ACL privilege */
  6753. if (check_global_access(thd, SUPER_ACL)) {
  6754. DBUG_RETURN(0);
  6755. }
  6756. heap = mem_heap_create(1000);
  6757. mutex_enter(&dict_sys->mutex);
  6758. mtr_start(&mtr);
  6759. rec = dict_startscan_system(&pcur, &mtr, SYS_TABLESPACES);
  6760. while (rec) {
  6761. const char* err_msg;
  6762. ulint space_id;
  6763. const char* name;
  6764. ulint flags;
  6765. /* Extract necessary information from a SYS_TABLESPACES row */
  6766. err_msg = dict_process_sys_tablespaces(
  6767. heap, rec, &space_id, &name, &flags);
  6768. mtr_commit(&mtr);
  6769. mutex_exit(&dict_sys->mutex);
  6770. if (space_id == 0) {
  6771. found_space_0 = true;
  6772. }
  6773. fil_space_t* space = fil_space_acquire_silent(space_id);
  6774. if (!err_msg && space) {
  6775. i_s_dict_fill_tablespaces_encryption(
  6776. thd, space, tables->table);
  6777. } else {
  6778. push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
  6779. ER_CANT_FIND_SYSTEM_REC, "%s",
  6780. err_msg);
  6781. }
  6782. if (space) {
  6783. fil_space_release(space);
  6784. }
  6785. mem_heap_empty(heap);
  6786. /* Get the next record */
  6787. mutex_enter(&dict_sys->mutex);
  6788. mtr_start(&mtr);
  6789. rec = dict_getnext_system(&pcur, &mtr);
  6790. }
  6791. mtr_commit(&mtr);
  6792. mutex_exit(&dict_sys->mutex);
  6793. mem_heap_free(heap);
  6794. if (found_space_0 == false) {
  6795. /* space 0 does for what ever unknown reason not show up
  6796. * in iteration above, add it manually */
  6797. fil_space_t* space = fil_space_acquire_silent(0);
  6798. i_s_dict_fill_tablespaces_encryption(
  6799. thd, space, tables->table);
  6800. fil_space_release(space);
  6801. }
  6802. DBUG_RETURN(0);
  6803. }
  6804. /*******************************************************************//**
  6805. Bind the dynamic table INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION
  6806. @return 0 on success */
  6807. static
  6808. int
  6809. innodb_tablespaces_encryption_init(
  6810. /*========================*/
  6811. void* p) /*!< in/out: table schema object */
  6812. {
  6813. ST_SCHEMA_TABLE* schema;
  6814. DBUG_ENTER("innodb_tablespaces_encryption_init");
  6815. schema = (ST_SCHEMA_TABLE*) p;
  6816. schema->fields_info = innodb_tablespaces_encryption_fields_info;
  6817. schema->fill_table = i_s_tablespaces_encryption_fill_table;
  6818. DBUG_RETURN(0);
  6819. }
  6820. UNIV_INTERN struct st_maria_plugin i_s_innodb_tablespaces_encryption =
  6821. {
  6822. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  6823. /* int */
  6824. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  6825. /* pointer to type-specific plugin descriptor */
  6826. /* void* */
  6827. STRUCT_FLD(info, &i_s_info),
  6828. /* plugin name */
  6829. /* const char* */
  6830. STRUCT_FLD(name, "INNODB_TABLESPACES_ENCRYPTION"),
  6831. /* plugin author (for SHOW PLUGINS) */
  6832. /* const char* */
  6833. STRUCT_FLD(author, "Google Inc"),
  6834. /* general descriptive text (for SHOW PLUGINS) */
  6835. /* const char* */
  6836. STRUCT_FLD(descr, "InnoDB TABLESPACES_ENCRYPTION"),
  6837. /* the plugin license (PLUGIN_LICENSE_XXX) */
  6838. /* int */
  6839. STRUCT_FLD(license, PLUGIN_LICENSE_BSD),
  6840. /* the function to invoke when plugin is loaded */
  6841. /* int (*)(void*); */
  6842. STRUCT_FLD(init, innodb_tablespaces_encryption_init),
  6843. /* the function to invoke when plugin is unloaded */
  6844. /* int (*)(void*); */
  6845. STRUCT_FLD(deinit, i_s_common_deinit),
  6846. /* plugin version (for SHOW PLUGINS) */
  6847. /* unsigned int */
  6848. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  6849. /* struct st_mysql_show_var* */
  6850. STRUCT_FLD(status_vars, NULL),
  6851. /* struct st_mysql_sys_var** */
  6852. STRUCT_FLD(system_vars, NULL),
  6853. /* Maria extension */
  6854. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  6855. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
  6856. };
  6857. /** TABLESPACES_SCRUBBING ********************************************/
  6858. /* Fields of the table INFORMATION_SCHEMA.INNODB_TABLESPACES_SCRUBBING */
  6859. static ST_FIELD_INFO innodb_tablespaces_scrubbing_fields_info[] =
  6860. {
  6861. #define TABLESPACES_SCRUBBING_SPACE 0
  6862. {STRUCT_FLD(field_name, "SPACE"),
  6863. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  6864. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  6865. STRUCT_FLD(value, 0),
  6866. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  6867. STRUCT_FLD(old_name, ""),
  6868. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6869. #define TABLESPACES_SCRUBBING_NAME 1
  6870. {STRUCT_FLD(field_name, "NAME"),
  6871. STRUCT_FLD(field_length, MAX_FULL_NAME_LEN + 1),
  6872. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  6873. STRUCT_FLD(value, 0),
  6874. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  6875. STRUCT_FLD(old_name, ""),
  6876. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6877. #define TABLESPACES_SCRUBBING_COMPRESSED 2
  6878. {STRUCT_FLD(field_name, "COMPRESSED"),
  6879. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  6880. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  6881. STRUCT_FLD(value, 0),
  6882. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  6883. STRUCT_FLD(old_name, ""),
  6884. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6885. #define TABLESPACES_SCRUBBING_LAST_SCRUB_COMPLETED 3
  6886. {STRUCT_FLD(field_name, "LAST_SCRUB_COMPLETED"),
  6887. STRUCT_FLD(field_length, 0),
  6888. STRUCT_FLD(field_type, MYSQL_TYPE_DATETIME),
  6889. STRUCT_FLD(value, 0),
  6890. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  6891. STRUCT_FLD(old_name, ""),
  6892. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6893. #define TABLESPACES_SCRUBBING_CURRENT_SCRUB_STARTED 4
  6894. {STRUCT_FLD(field_name, "CURRENT_SCRUB_STARTED"),
  6895. STRUCT_FLD(field_length, 0),
  6896. STRUCT_FLD(field_type, MYSQL_TYPE_DATETIME),
  6897. STRUCT_FLD(value, 0),
  6898. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  6899. STRUCT_FLD(old_name, ""),
  6900. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6901. #define TABLESPACES_SCRUBBING_CURRENT_SCRUB_ACTIVE_THREADS 5
  6902. {STRUCT_FLD(field_name, "CURRENT_SCRUB_ACTIVE_THREADS"),
  6903. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  6904. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  6905. STRUCT_FLD(value, 0),
  6906. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL),
  6907. STRUCT_FLD(old_name, ""),
  6908. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6909. #define TABLESPACES_SCRUBBING_CURRENT_SCRUB_PAGE_NUMBER 6
  6910. {STRUCT_FLD(field_name, "CURRENT_SCRUB_PAGE_NUMBER"),
  6911. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  6912. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  6913. STRUCT_FLD(value, 0),
  6914. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  6915. STRUCT_FLD(old_name, ""),
  6916. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6917. #define TABLESPACES_SCRUBBING_CURRENT_SCRUB_MAX_PAGE_NUMBER 7
  6918. {STRUCT_FLD(field_name, "CURRENT_SCRUB_MAX_PAGE_NUMBER"),
  6919. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  6920. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  6921. STRUCT_FLD(value, 0),
  6922. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  6923. STRUCT_FLD(old_name, ""),
  6924. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  6925. END_OF_ST_FIELD_INFO
  6926. };
  6927. /**********************************************************************//**
  6928. Function to fill INFORMATION_SCHEMA.INNODB_TABLESPACES_SCRUBBING
  6929. with information collected by scanning SYS_TABLESPACES table and
  6930. fil_space.
  6931. @param[in] thd Thread handle
  6932. @param[in] space Tablespace
  6933. @param[in] table_to_fill I_S table
  6934. @return 0 on success */
  6935. static
  6936. int
  6937. i_s_dict_fill_tablespaces_scrubbing(
  6938. THD* thd,
  6939. fil_space_t* space,
  6940. TABLE* table_to_fill)
  6941. {
  6942. Field** fields;
  6943. struct fil_space_scrub_status_t status;
  6944. DBUG_ENTER("i_s_dict_fill_tablespaces_scrubbing");
  6945. fields = table_to_fill->field;
  6946. fil_space_get_scrub_status(space, &status);
  6947. OK(fields[TABLESPACES_SCRUBBING_SPACE]->store(space->id));
  6948. OK(field_store_string(fields[TABLESPACES_SCRUBBING_NAME],
  6949. space->name));
  6950. OK(fields[TABLESPACES_SCRUBBING_COMPRESSED]->store(
  6951. status.compressed ? 1 : 0));
  6952. if (status.last_scrub_completed == 0) {
  6953. fields[TABLESPACES_SCRUBBING_LAST_SCRUB_COMPLETED]->set_null();
  6954. } else {
  6955. fields[TABLESPACES_SCRUBBING_LAST_SCRUB_COMPLETED]
  6956. ->set_notnull();
  6957. OK(field_store_time_t(
  6958. fields[TABLESPACES_SCRUBBING_LAST_SCRUB_COMPLETED],
  6959. status.last_scrub_completed));
  6960. }
  6961. int field_numbers[] = {
  6962. TABLESPACES_SCRUBBING_CURRENT_SCRUB_STARTED,
  6963. TABLESPACES_SCRUBBING_CURRENT_SCRUB_ACTIVE_THREADS,
  6964. TABLESPACES_SCRUBBING_CURRENT_SCRUB_PAGE_NUMBER,
  6965. TABLESPACES_SCRUBBING_CURRENT_SCRUB_MAX_PAGE_NUMBER };
  6966. if (status.scrubbing) {
  6967. for (uint i = 0; i < array_elements(field_numbers); i++) {
  6968. fields[field_numbers[i]]->set_notnull();
  6969. }
  6970. OK(field_store_time_t(
  6971. fields[TABLESPACES_SCRUBBING_CURRENT_SCRUB_STARTED],
  6972. status.current_scrub_started));
  6973. OK(fields[TABLESPACES_SCRUBBING_CURRENT_SCRUB_ACTIVE_THREADS]
  6974. ->store(status.current_scrub_active_threads));
  6975. OK(fields[TABLESPACES_SCRUBBING_CURRENT_SCRUB_PAGE_NUMBER]
  6976. ->store(status.current_scrub_page_number));
  6977. OK(fields[TABLESPACES_SCRUBBING_CURRENT_SCRUB_MAX_PAGE_NUMBER]
  6978. ->store(status.current_scrub_max_page_number));
  6979. } else {
  6980. for (uint i = 0; i < array_elements(field_numbers); i++) {
  6981. fields[field_numbers[i]]->set_null();
  6982. }
  6983. }
  6984. OK(schema_table_store_record(thd, table_to_fill));
  6985. DBUG_RETURN(0);
  6986. }
  6987. /*******************************************************************//**
  6988. Function to populate INFORMATION_SCHEMA.INNODB_TABLESPACES_SCRUBBING table.
  6989. Loop through each record in TABLESPACES_SCRUBBING, and extract the column
  6990. information and fill the INFORMATION_SCHEMA.INNODB_TABLESPACES_SCRUBBING table.
  6991. @return 0 on success */
  6992. static
  6993. int
  6994. i_s_tablespaces_scrubbing_fill_table(
  6995. /*===========================*/
  6996. THD* thd, /*!< in: thread */
  6997. TABLE_LIST* tables, /*!< in/out: tables to fill */
  6998. Item* ) /*!< in: condition (not used) */
  6999. {
  7000. btr_pcur_t pcur;
  7001. const rec_t* rec;
  7002. mem_heap_t* heap;
  7003. mtr_t mtr;
  7004. bool found_space_0 = false;
  7005. DBUG_ENTER("i_s_tablespaces_scrubbing_fill_table");
  7006. RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
  7007. /* deny access to user without SUPER_ACL privilege */
  7008. if (check_global_access(thd, SUPER_ACL)) {
  7009. DBUG_RETURN(0);
  7010. }
  7011. heap = mem_heap_create(1000);
  7012. mutex_enter(&dict_sys->mutex);
  7013. mtr_start(&mtr);
  7014. rec = dict_startscan_system(&pcur, &mtr, SYS_TABLESPACES);
  7015. while (rec) {
  7016. const char* err_msg;
  7017. ulint space_id;
  7018. const char* name;
  7019. ulint flags;
  7020. /* Extract necessary information from a SYS_TABLESPACES row */
  7021. err_msg = dict_process_sys_tablespaces(
  7022. heap, rec, &space_id, &name, &flags);
  7023. mtr_commit(&mtr);
  7024. mutex_exit(&dict_sys->mutex);
  7025. if (space_id == 0) {
  7026. found_space_0 = true;
  7027. }
  7028. fil_space_t* space = fil_space_acquire_silent(space_id);
  7029. if (!err_msg && space) {
  7030. i_s_dict_fill_tablespaces_scrubbing(
  7031. thd, space, tables->table);
  7032. } else {
  7033. push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
  7034. ER_CANT_FIND_SYSTEM_REC, "%s",
  7035. err_msg);
  7036. }
  7037. if (space) {
  7038. fil_space_release(space);
  7039. }
  7040. mem_heap_empty(heap);
  7041. /* Get the next record */
  7042. mutex_enter(&dict_sys->mutex);
  7043. mtr_start(&mtr);
  7044. rec = dict_getnext_system(&pcur, &mtr);
  7045. }
  7046. mtr_commit(&mtr);
  7047. mutex_exit(&dict_sys->mutex);
  7048. mem_heap_free(heap);
  7049. if (found_space_0 == false) {
  7050. /* space 0 does for what ever unknown reason not show up
  7051. * in iteration above, add it manually */
  7052. fil_space_t* space = fil_space_acquire_silent(0);
  7053. i_s_dict_fill_tablespaces_scrubbing(
  7054. thd, space, tables->table);
  7055. fil_space_release(space);
  7056. }
  7057. DBUG_RETURN(0);
  7058. }
  7059. /*******************************************************************//**
  7060. Bind the dynamic table INFORMATION_SCHEMA.INNODB_TABLESPACES_SCRUBBING
  7061. @return 0 on success */
  7062. static
  7063. int
  7064. innodb_tablespaces_scrubbing_init(
  7065. /*========================*/
  7066. void* p) /*!< in/out: table schema object */
  7067. {
  7068. ST_SCHEMA_TABLE* schema;
  7069. DBUG_ENTER("innodb_tablespaces_scrubbing_init");
  7070. schema = (ST_SCHEMA_TABLE*) p;
  7071. schema->fields_info = innodb_tablespaces_scrubbing_fields_info;
  7072. schema->fill_table = i_s_tablespaces_scrubbing_fill_table;
  7073. DBUG_RETURN(0);
  7074. }
  7075. UNIV_INTERN struct st_maria_plugin i_s_innodb_tablespaces_scrubbing =
  7076. {
  7077. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  7078. /* int */
  7079. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  7080. /* pointer to type-specific plugin descriptor */
  7081. /* void* */
  7082. STRUCT_FLD(info, &i_s_info),
  7083. /* plugin name */
  7084. /* const char* */
  7085. STRUCT_FLD(name, "INNODB_TABLESPACES_SCRUBBING"),
  7086. /* plugin author (for SHOW PLUGINS) */
  7087. /* const char* */
  7088. STRUCT_FLD(author, "Google Inc"),
  7089. /* general descriptive text (for SHOW PLUGINS) */
  7090. /* const char* */
  7091. STRUCT_FLD(descr, "InnoDB TABLESPACES_SCRUBBING"),
  7092. /* the plugin license (PLUGIN_LICENSE_XXX) */
  7093. /* int */
  7094. STRUCT_FLD(license, PLUGIN_LICENSE_BSD),
  7095. /* the function to invoke when plugin is loaded */
  7096. /* int (*)(void*); */
  7097. STRUCT_FLD(init, innodb_tablespaces_scrubbing_init),
  7098. /* the function to invoke when plugin is unloaded */
  7099. /* int (*)(void*); */
  7100. STRUCT_FLD(deinit, i_s_common_deinit),
  7101. /* plugin version (for SHOW PLUGINS) */
  7102. /* unsigned int */
  7103. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  7104. /* struct st_mysql_show_var* */
  7105. STRUCT_FLD(status_vars, NULL),
  7106. /* struct st_mysql_sys_var** */
  7107. STRUCT_FLD(system_vars, NULL),
  7108. /* Maria extension */
  7109. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  7110. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
  7111. };
  7112. /** INNODB_MUTEXES *********************************************/
  7113. /* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_MUTEXES */
  7114. static ST_FIELD_INFO innodb_mutexes_fields_info[] =
  7115. {
  7116. #define MUTEXES_NAME 0
  7117. {STRUCT_FLD(field_name, "NAME"),
  7118. STRUCT_FLD(field_length, OS_FILE_MAX_PATH),
  7119. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  7120. STRUCT_FLD(value, 0),
  7121. STRUCT_FLD(field_flags, 0),
  7122. STRUCT_FLD(old_name, ""),
  7123. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7124. #define MUTEXES_CREATE_FILE 1
  7125. {STRUCT_FLD(field_name, "CREATE_FILE"),
  7126. STRUCT_FLD(field_length, OS_FILE_MAX_PATH),
  7127. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  7128. STRUCT_FLD(value, 0),
  7129. STRUCT_FLD(field_flags, 0),
  7130. STRUCT_FLD(old_name, ""),
  7131. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7132. #define MUTEXES_CREATE_LINE 2
  7133. {STRUCT_FLD(field_name, "CREATE_LINE"),
  7134. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  7135. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  7136. STRUCT_FLD(value, 0),
  7137. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  7138. STRUCT_FLD(old_name, ""),
  7139. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7140. #define MUTEXES_OS_WAITS 3
  7141. {STRUCT_FLD(field_name, "OS_WAITS"),
  7142. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  7143. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  7144. STRUCT_FLD(value, 0),
  7145. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  7146. STRUCT_FLD(old_name, ""),
  7147. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7148. END_OF_ST_FIELD_INFO
  7149. };
  7150. /*******************************************************************//**
  7151. Function to populate INFORMATION_SCHEMA.INNODB_MUTEXES table.
  7152. Loop through each record in mutex and rw_lock lists, and extract the column
  7153. information and fill the INFORMATION_SCHEMA.INNODB_MUTEXES table.
  7154. @return 0 on success */
  7155. static
  7156. int
  7157. i_s_innodb_mutexes_fill_table(
  7158. /*==========================*/
  7159. THD* thd, /*!< in: thread */
  7160. TABLE_LIST* tables, /*!< in/out: tables to fill */
  7161. Item* ) /*!< in: condition (not used) */
  7162. {
  7163. ib_mutex_t* mutex;
  7164. rw_lock_t* lock;
  7165. ulint block_mutex_oswait_count = 0;
  7166. ulint block_lock_oswait_count = 0;
  7167. ib_mutex_t* block_mutex = NULL;
  7168. rw_lock_t* block_lock = NULL;
  7169. Field** fields = tables->table->field;
  7170. DBUG_ENTER("i_s_innodb_mutexes_fill_table");
  7171. RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
  7172. /* deny access to user without PROCESS_ACL privilege */
  7173. if (check_global_access(thd, PROCESS_ACL)) {
  7174. DBUG_RETURN(0);
  7175. }
  7176. {
  7177. struct Locking
  7178. {
  7179. Locking() { mutex_enter(&mutex_list_mutex); }
  7180. ~Locking() { mutex_exit(&mutex_list_mutex); }
  7181. } locking;
  7182. for (mutex = UT_LIST_GET_FIRST(mutex_list); mutex != NULL;
  7183. mutex = UT_LIST_GET_NEXT(list, mutex)) {
  7184. if (mutex->count_os_wait == 0) {
  7185. continue;
  7186. }
  7187. if (buf_pool_is_block_mutex(mutex)) {
  7188. block_mutex = mutex;
  7189. block_mutex_oswait_count
  7190. += mutex->count_os_wait;
  7191. continue;
  7192. }
  7193. OK(field_store_string(fields[MUTEXES_NAME],
  7194. mutex->cmutex_name));
  7195. OK(field_store_string(
  7196. fields[MUTEXES_CREATE_FILE],
  7197. innobase_basename(mutex->cfile_name)));
  7198. OK(field_store_ulint(fields[MUTEXES_CREATE_LINE],
  7199. mutex->cline));
  7200. OK(field_store_ulint(fields[MUTEXES_OS_WAITS],
  7201. mutex->count_os_wait));
  7202. OK(schema_table_store_record(thd, tables->table));
  7203. }
  7204. if (block_mutex) {
  7205. char buf1[IO_SIZE];
  7206. my_snprintf(buf1, sizeof buf1, "combined %s",
  7207. innobase_basename(block_mutex->cfile_name));
  7208. OK(field_store_string(fields[MUTEXES_NAME],
  7209. block_mutex->cmutex_name));
  7210. OK(field_store_string(fields[MUTEXES_CREATE_FILE],
  7211. buf1));
  7212. OK(field_store_ulint(fields[MUTEXES_CREATE_LINE],
  7213. block_mutex->cline));
  7214. OK(field_store_ulint(fields[MUTEXES_OS_WAITS],
  7215. block_mutex_oswait_count));
  7216. OK(schema_table_store_record(thd, tables->table));
  7217. }
  7218. }
  7219. {
  7220. struct Locking
  7221. {
  7222. Locking() { mutex_enter(&rw_lock_list_mutex); }
  7223. ~Locking() { mutex_exit(&rw_lock_list_mutex); }
  7224. } locking;
  7225. for (lock = UT_LIST_GET_FIRST(rw_lock_list); lock != NULL;
  7226. lock = UT_LIST_GET_NEXT(list, lock)) {
  7227. if (lock->count_os_wait == 0) {
  7228. continue;
  7229. }
  7230. if (buf_pool_is_block_lock(lock)) {
  7231. block_lock = lock;
  7232. block_lock_oswait_count += lock->count_os_wait;
  7233. continue;
  7234. }
  7235. OK(field_store_string(fields[MUTEXES_NAME],
  7236. lock->lock_name));
  7237. OK(field_store_string(
  7238. fields[MUTEXES_CREATE_FILE],
  7239. innobase_basename(lock->cfile_name)));
  7240. OK(field_store_ulint(fields[MUTEXES_CREATE_LINE],
  7241. lock->cline));
  7242. OK(field_store_ulint(fields[MUTEXES_OS_WAITS],
  7243. lock->count_os_wait));
  7244. OK(schema_table_store_record(thd, tables->table));
  7245. }
  7246. if (block_lock) {
  7247. char buf1[IO_SIZE];
  7248. my_snprintf(buf1, sizeof buf1, "combined %s",
  7249. innobase_basename(block_lock->cfile_name));
  7250. OK(field_store_string(fields[MUTEXES_NAME],
  7251. block_lock->lock_name));
  7252. OK(field_store_string(fields[MUTEXES_CREATE_FILE],
  7253. buf1));
  7254. OK(field_store_ulint(fields[MUTEXES_CREATE_LINE],
  7255. block_lock->cline));
  7256. OK(field_store_ulint(fields[MUTEXES_OS_WAITS],
  7257. block_lock_oswait_count));
  7258. OK(schema_table_store_record(thd, tables->table));
  7259. }
  7260. }
  7261. DBUG_RETURN(0);
  7262. }
  7263. /*******************************************************************//**
  7264. Bind the dynamic table INFORMATION_SCHEMA.INNODB_MUTEXES
  7265. @return 0 on success */
  7266. static
  7267. int
  7268. innodb_mutexes_init(
  7269. /*================*/
  7270. void* p) /*!< in/out: table schema object */
  7271. {
  7272. ST_SCHEMA_TABLE* schema;
  7273. DBUG_ENTER("innodb_mutexes_init");
  7274. schema = (ST_SCHEMA_TABLE*) p;
  7275. schema->fields_info = innodb_mutexes_fields_info;
  7276. schema->fill_table = i_s_innodb_mutexes_fill_table;
  7277. DBUG_RETURN(0);
  7278. }
  7279. UNIV_INTERN struct st_maria_plugin i_s_innodb_mutexes =
  7280. {
  7281. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  7282. /* int */
  7283. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  7284. /* pointer to type-specific plugin descriptor */
  7285. /* void* */
  7286. STRUCT_FLD(info, &i_s_info),
  7287. /* plugin name */
  7288. /* const char* */
  7289. STRUCT_FLD(name, "INNODB_MUTEXES"),
  7290. /* plugin author (for SHOW PLUGINS) */
  7291. /* const char* */
  7292. STRUCT_FLD(author, plugin_author),
  7293. /* general descriptive text (for SHOW PLUGINS) */
  7294. /* const char* */
  7295. STRUCT_FLD(descr, "InnoDB SYS_DATAFILES"),
  7296. /* the plugin license (PLUGIN_LICENSE_XXX) */
  7297. /* int */
  7298. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  7299. /* the function to invoke when plugin is loaded */
  7300. /* int (*)(void*); */
  7301. STRUCT_FLD(init, innodb_mutexes_init),
  7302. /* the function to invoke when plugin is unloaded */
  7303. /* int (*)(void*); */
  7304. STRUCT_FLD(deinit, i_s_common_deinit),
  7305. /* plugin version (for SHOW PLUGINS) */
  7306. /* unsigned int */
  7307. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  7308. /* struct st_mysql_show_var* */
  7309. STRUCT_FLD(status_vars, NULL),
  7310. /* struct st_mysql_sys_var** */
  7311. STRUCT_FLD(system_vars, NULL),
  7312. /* Maria extension */
  7313. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  7314. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  7315. };
  7316. /** SYS_SEMAPHORE_WAITS ************************************************/
  7317. /* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_SYS_SEMAPHORE_WAITS */
  7318. static ST_FIELD_INFO innodb_sys_semaphore_waits_fields_info[] =
  7319. {
  7320. // SYS_SEMAPHORE_WAITS_THREAD_ID 0
  7321. {STRUCT_FLD(field_name, "THREAD_ID"),
  7322. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  7323. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  7324. STRUCT_FLD(value, 0),
  7325. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  7326. STRUCT_FLD(old_name, ""),
  7327. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7328. // SYS_SEMAPHORE_WAITS_OBJECT_NAME 1
  7329. {STRUCT_FLD(field_name, "OBJECT_NAME"),
  7330. STRUCT_FLD(field_length, OS_FILE_MAX_PATH),
  7331. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  7332. STRUCT_FLD(value, 0),
  7333. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  7334. STRUCT_FLD(old_name, ""),
  7335. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7336. // SYS_SEMAPHORE_WAITS_FILE 2
  7337. {STRUCT_FLD(field_name, "FILE"),
  7338. STRUCT_FLD(field_length, OS_FILE_MAX_PATH),
  7339. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  7340. STRUCT_FLD(value, 0),
  7341. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  7342. STRUCT_FLD(old_name, ""),
  7343. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7344. // SYS_SEMAPHORE_WAITS_LINE 3
  7345. {STRUCT_FLD(field_name, "LINE"),
  7346. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  7347. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  7348. STRUCT_FLD(value, 0),
  7349. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  7350. STRUCT_FLD(old_name, ""),
  7351. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7352. // SYS_SEMAPHORE_WAITS_WAIT_TIME 4
  7353. {STRUCT_FLD(field_name, "WAIT_TIME"),
  7354. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  7355. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  7356. STRUCT_FLD(value, 0),
  7357. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  7358. STRUCT_FLD(old_name, ""),
  7359. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7360. // SYS_SEMAPHORE_WAITS_WAIT_OBJECT 5
  7361. {STRUCT_FLD(field_name, "WAIT_OBJECT"),
  7362. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  7363. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  7364. STRUCT_FLD(value, 0),
  7365. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  7366. STRUCT_FLD(old_name, ""),
  7367. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7368. // SYS_SEMAPHORE_WAITS_WAIT_TYPE 6
  7369. {STRUCT_FLD(field_name, "WAIT_TYPE"),
  7370. STRUCT_FLD(field_length, 16),
  7371. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  7372. STRUCT_FLD(value, 0),
  7373. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  7374. STRUCT_FLD(old_name, ""),
  7375. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7376. // SYS_SEMAPHORE_WAITS_HOLDER_THREAD_ID 7
  7377. {STRUCT_FLD(field_name, "HOLDER_THREAD_ID"),
  7378. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  7379. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  7380. STRUCT_FLD(value, 0),
  7381. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  7382. STRUCT_FLD(old_name, ""),
  7383. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7384. // SYS_SEMAPHORE_WAITS_HOLDER_FILE 8
  7385. {STRUCT_FLD(field_name, "HOLDER_FILE"),
  7386. STRUCT_FLD(field_length, OS_FILE_MAX_PATH),
  7387. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  7388. STRUCT_FLD(value, 0),
  7389. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  7390. STRUCT_FLD(old_name, ""),
  7391. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7392. // SYS_SEMAPHORE_WAITS_HOLDER_LINE 9
  7393. {STRUCT_FLD(field_name, "HOLDER_LINE"),
  7394. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  7395. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  7396. STRUCT_FLD(value, 0),
  7397. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  7398. STRUCT_FLD(old_name, ""),
  7399. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7400. // SYS_SEMAPHORE_WAITS_CREATED_FILE 10
  7401. {STRUCT_FLD(field_name, "CREATED_FILE"),
  7402. STRUCT_FLD(field_length, OS_FILE_MAX_PATH),
  7403. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  7404. STRUCT_FLD(value, 0),
  7405. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  7406. STRUCT_FLD(old_name, ""),
  7407. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7408. // SYS_SEMAPHORE_WAITS_CREATED_LINE 11
  7409. {STRUCT_FLD(field_name, "CREATED_LINE"),
  7410. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  7411. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  7412. STRUCT_FLD(value, 0),
  7413. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  7414. STRUCT_FLD(old_name, ""),
  7415. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7416. // SYS_SEMAPHORE_WAITS_WRITER_THREAD 12
  7417. {STRUCT_FLD(field_name, "WRITER_THREAD"),
  7418. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  7419. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  7420. STRUCT_FLD(value, 0),
  7421. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  7422. STRUCT_FLD(old_name, ""),
  7423. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7424. // SYS_SEMAPHORE_WAITS_RESERVATION_MODE 13
  7425. {STRUCT_FLD(field_name, "RESERVATION_MODE"),
  7426. STRUCT_FLD(field_length, 16),
  7427. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  7428. STRUCT_FLD(value, 0),
  7429. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  7430. STRUCT_FLD(old_name, ""),
  7431. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7432. // SYS_SEMAPHORE_WAITS_READERS 14
  7433. {STRUCT_FLD(field_name, "READERS"),
  7434. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  7435. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  7436. STRUCT_FLD(value, 0),
  7437. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  7438. STRUCT_FLD(old_name, ""),
  7439. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7440. // SYS_SEMAPHORE_WAITS_WAITERS_FLAG 15
  7441. {STRUCT_FLD(field_name, "WAITERS_FLAG"),
  7442. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  7443. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  7444. STRUCT_FLD(value, 0),
  7445. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  7446. STRUCT_FLD(old_name, ""),
  7447. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7448. // SYS_SEMAPHORE_WAITS_LOCK_WORD 16
  7449. {STRUCT_FLD(field_name, "LOCK_WORD"),
  7450. STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
  7451. STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
  7452. STRUCT_FLD(value, 0),
  7453. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  7454. STRUCT_FLD(old_name, ""),
  7455. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7456. // SYS_SEMAPHORE_WAITS_LAST_READER_FILE 17
  7457. {STRUCT_FLD(field_name, "LAST_READER_FILE"),
  7458. STRUCT_FLD(field_length, OS_FILE_MAX_PATH),
  7459. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  7460. STRUCT_FLD(value, 0),
  7461. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  7462. STRUCT_FLD(old_name, ""),
  7463. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7464. // SYS_SEMAPHORE_WAITS_LAST_READER_LINE 18
  7465. {STRUCT_FLD(field_name, "LAST_READER_LINE"),
  7466. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  7467. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  7468. STRUCT_FLD(value, 0),
  7469. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  7470. STRUCT_FLD(old_name, ""),
  7471. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7472. // SYS_SEMAPHORE_WAITS_LAST_WRITER_FILE 19
  7473. {STRUCT_FLD(field_name, "LAST_WRITER_FILE"),
  7474. STRUCT_FLD(field_length, OS_FILE_MAX_PATH),
  7475. STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
  7476. STRUCT_FLD(value, 0),
  7477. STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
  7478. STRUCT_FLD(old_name, ""),
  7479. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7480. // SYS_SEMAPHORE_WAITS_LAST_WRITER_LINE 20
  7481. {STRUCT_FLD(field_name, "LAST_WRITER_LINE"),
  7482. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  7483. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  7484. STRUCT_FLD(value, 0),
  7485. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  7486. STRUCT_FLD(old_name, ""),
  7487. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7488. // SYS_SEMAPHORE_WAITS_OS_WAIT_COUNT 21
  7489. {STRUCT_FLD(field_name, "OS_WAIT_COUNT"),
  7490. STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
  7491. STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
  7492. STRUCT_FLD(value, 0),
  7493. STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
  7494. STRUCT_FLD(old_name, ""),
  7495. STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
  7496. END_OF_ST_FIELD_INFO
  7497. };
  7498. /*******************************************************************//**
  7499. Bind the dynamic table INFORMATION_SCHEMA.INNODB_SYS_SEMAPHORE_WAITS
  7500. @return 0 on success */
  7501. static
  7502. int
  7503. innodb_sys_semaphore_waits_init(
  7504. /*============================*/
  7505. void* p) /*!< in/out: table schema object */
  7506. {
  7507. ST_SCHEMA_TABLE* schema;
  7508. DBUG_ENTER("innodb_sys_semaphore_waits_init");
  7509. schema = (ST_SCHEMA_TABLE*) p;
  7510. schema->fields_info = innodb_sys_semaphore_waits_fields_info;
  7511. schema->fill_table = sync_arr_fill_sys_semphore_waits_table;
  7512. DBUG_RETURN(0);
  7513. }
  7514. UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_semaphore_waits =
  7515. {
  7516. /* the plugin type (a MYSQL_XXX_PLUGIN value) */
  7517. /* int */
  7518. STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
  7519. /* pointer to type-specific plugin descriptor */
  7520. /* void* */
  7521. STRUCT_FLD(info, &i_s_info),
  7522. /* plugin name */
  7523. /* const char* */
  7524. STRUCT_FLD(name, "INNODB_SYS_SEMAPHORE_WAITS"),
  7525. /* plugin author (for SHOW PLUGINS) */
  7526. /* const char* */
  7527. STRUCT_FLD(author, maria_plugin_author),
  7528. /* general descriptive text (for SHOW PLUGINS) */
  7529. /* const char* */
  7530. STRUCT_FLD(descr, "InnoDB SYS_SEMAPHORE_WAITS"),
  7531. /* the plugin license (PLUGIN_LICENSE_XXX) */
  7532. /* int */
  7533. STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
  7534. /* the function to invoke when plugin is loaded */
  7535. /* int (*)(void*); */
  7536. STRUCT_FLD(init, innodb_sys_semaphore_waits_init),
  7537. /* the function to invoke when plugin is unloaded */
  7538. /* int (*)(void*); */
  7539. STRUCT_FLD(deinit, i_s_common_deinit),
  7540. /* plugin version (for SHOW PLUGINS) */
  7541. /* unsigned int */
  7542. STRUCT_FLD(version, INNODB_VERSION_SHORT),
  7543. /* struct st_mysql_show_var* */
  7544. STRUCT_FLD(status_vars, NULL),
  7545. /* struct st_mysql_sys_var** */
  7546. STRUCT_FLD(system_vars, NULL),
  7547. /* Maria extension */
  7548. STRUCT_FLD(version_info, INNODB_VERSION_STR),
  7549. STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
  7550. };