mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 05:52:27 +01:00
fb2ff6daf3
------------------------------------------------------------------------ r6560 | sunny | 2010-02-04 16:11:23 +0200 (Thu, 04 Feb 2010) | 7 lines Changed paths: M /branches/zip/lock/lock0lock.c branches/zip: Remove the additional check introduced in r6534 which tries to check if the joining transaction has any other transactions waiting on its locks. This optimization results in excessive deadlocks when running Sysbench with a large number of threads. The function seems to return FALSE positives. rb://250 ------------------------------------------------------------------------ r6591 | marko | 2010-02-08 10:06:39 +0200 (Mon, 08 Feb 2010) | 3 lines Changed paths: M /branches/zip/row/row0merge.c branches/zip: row_merge_drop_index(): Remove redundant condition on SYS_INDEXES.TABLE_ID. INDEX_ID must be instance-widely unique, because SYS_FIELDS is not indexed by TABLE_ID. ------------------------------------------------------------------------ r6594 | marko | 2010-02-08 12:55:04 +0200 (Mon, 08 Feb 2010) | 2 lines Changed paths: M /branches/zip/rem/rem0rec.c branches/zip: rec_get_nth_field_offs_old(): Replace if (!cond) ut_error; tests with ut_a(cond). ------------------------------------------------------------------------ r6595 | marko | 2010-02-08 13:53:02 +0200 (Mon, 08 Feb 2010) | 1 line Changed paths: M /branches/zip/include/btr0pcur.h M /branches/zip/include/btr0pcur.ic branches/zip: btr_pcur_commit(): Unused function, remove. ------------------------------------------------------------------------ r6608 | marko | 2010-02-09 11:02:37 +0200 (Tue, 09 Feb 2010) | 1 line Changed paths: M /branches/zip/handler/handler0alter.cc branches/zip: ha_innobase::add_index(): Check for !innodb_table. ------------------------------------------------------------------------ r6609 | marko | 2010-02-09 13:45:40 +0200 (Tue, 09 Feb 2010) | 1 line Changed paths: M /branches/zip/dict/dict0dict.c branches/zip: dict_field_print_low(): Add const qualifier. ------------------------------------------------------------------------ r6610 | marko | 2010-02-09 13:53:59 +0200 (Tue, 09 Feb 2010) | 17 lines Changed paths: M /branches/zip/dict/dict0boot.c M /branches/zip/include/dict0boot.h M /branches/zip/row/row0merge.c M /branches/zip/row/row0mysql.c branches/zip: When dropping temporary indexes and tables at startup, first load them to the data dictionary cache and use the normal routines for dropping tables or indexes. This should reduce the risk of bugs and also make the code compatible with the upcoming TablespaceDictionary implementation. DICT_SYS_INDEXES_NAME_FIELD: The clustered index position of SYS_INDEXES.NAME. row_merge_drop_temp_indexes(): Scan SYS_INDEXES for tables containing temporary indexes, and load the tables as needed. Invoke row_merge_drop_index() to drop the indexes. row_mysql_drop_temp_tables(): Scan SYS_TABLES for temporary tables, load them with dict_load_table() and drop them with row_drop_table_for_mysql(). rb://251, not yet reviewed ------------------------------------------------------------------------ r6611 | marko | 2010-02-09 14:28:25 +0200 (Tue, 09 Feb 2010) | 11 lines Changed paths: M /branches/zip/include/log0recv.h M /branches/zip/log/log0recv.c M /branches/zip/srv/srv0start.c branches/zip: Roll back dictionary transaction(s) before scanning *.ibd files innobase_start_or_create_for_mysql(): Roll back data dictionary transactions before scanning the *.ibd files. Then, data dictionary records can be loaded to the cache before opening the *.ibd files. recv_recovery_rollback_active(): Refactored from recv_recovery_from_checkpoint_finish(). rb://235, committing without review, because this is needed for TablespaceDictionary. ------------------------------------------------------------------------ r6612 | marko | 2010-02-09 14:32:39 +0200 (Tue, 09 Feb 2010) | 3 lines Changed paths: M /branches/zip/log/log0recv.c branches/zip: recv_recovery_rollback_active(): Drop the temporary tables and indexes after enabling sync order checks. This should not make any difference. This could have been done in r6611. ------------------------------------------------------------------------ r6614 | inaam | 2010-02-09 20:26:23 +0200 (Tue, 09 Feb 2010) | 7 lines Changed paths: M /branches/zip/srv/srv0srv.c branches/plugin rb://242 Let the master thread sleep if the amount of work to be done is calibrated as taking less than a second. Approved by: Heikki ------------------------------------------------------------------------ r6631 | marko | 2010-02-10 09:19:52 +0200 (Wed, 10 Feb 2010) | 1 line Changed paths: M /branches/zip/ChangeLog branches/zip: Document r6614 in ChangeLog. ------------------------------------------------------------------------ r6633 | marko | 2010-02-10 10:40:55 +0200 (Wed, 10 Feb 2010) | 31 lines Changed paths: M /branches/zip/ChangeLog M /branches/zip/buf/buf0buf.c M /branches/zip/lock/lock0lock.c branches/zip: Merge revisions 6538:6613 from branches/5.1: ------------------------------------------------------------------------ r6545 | jyang | 2010-02-03 03:57:32 +0200 (Wed, 03 Feb 2010) | 8 lines Changed paths: M /branches/5.1/lock/lock0lock.c branches/5.1: Fix bug #49001, "SHOW INNODB STATUS deadlock info incorrect when deadlock detection aborts". Print the correct lock owner when recursive function lock_deadlock_recursive() exceeds its maximum depth LOCK_MAX_DEPTH_IN_DEADLOCK_CHECK. rb://217, approved by Marko. ------------------------------------------------------------------------ r6613 | inaam | 2010-02-09 20:23:09 +0200 (Tue, 09 Feb 2010) | 11 lines Changed paths: M /branches/5.1/buf/buf0buf.c M /branches/5.1/buf/buf0rea.c M /branches/5.1/include/buf0rea.h branches/5.1: Fix Bug #38901 InnoDB logs error repeatedly when trying to load page into buffer pool In buf_page_get_gen() if we are unable to read a page (because of corruption or some other reason) we keep on retrying. This fills up error log with millions of entries in no time and we'd eventually run out of disk space. This patch limits the number of attempts that we make (currently set to 100) and after that we abort with a message. rb://241 Approved by: Heikki ------------------------------------------------------------------------ ------------------------------------------------------------------------ r6635 | marko | 2010-02-10 11:07:05 +0200 (Wed, 10 Feb 2010) | 4 lines Changed paths: M /branches/zip/row/row0sel.c branches/zip: Clean up after r6559. Now that btr_pcur_open_with_no_init() is a macro, do not mix preprocessor directives in the macro invocation, because it is implementation-defined whether that is going to work. ------------------------------------------------------------------------ r6639 | marko | 2010-02-10 13:11:04 +0200 (Wed, 10 Feb 2010) | 1 line Changed paths: M /branches/zip/include/trx0rseg.h M /branches/zip/trx/trx0rseg.c branches/zip: trx_rseg_create(): Unused function, remove. ------------------------------------------------------------------------ r6660 | marko | 2010-02-11 11:21:11 +0200 (Thu, 11 Feb 2010) | 7 lines Changed paths: M /branches/zip/row/row0umod.c branches/zip: Clarify the rollback of INSERT by UPDATE of delete-marked rec. row_undo_mod_remove_clust_low(): Augment the function comment. row_undo_mod_remove_clust_low(), row_undo_mod_del_mark_or_remove_sec_low(), row_undo_mod_del_mark_or_remove_sec(), row_undo_mod_upd_del_sec(): Add ut_ad(node->rec_type == TRX_UNDO_UPD_DEL_REC); ------------------------------------------------------------------------ r6672 | marko | 2010-02-11 13:01:18 +0200 (Thu, 11 Feb 2010) | 1 line Changed paths: M /branches/zip/include/que0que.h M /branches/zip/include/que0que.ic M /branches/zip/row/row0umod.c branches/zip: Introduce thr_is_recv(). ------------------------------------------------------------------------ r6673 | marko | 2010-02-11 13:09:48 +0200 (Thu, 11 Feb 2010) | 9 lines Changed paths: M /branches/zip/btr/btr0cur.c M /branches/zip/include/trx0types.h M /branches/zip/row/row0umod.c branches/zip: Relax a debug assertion about a missing BLOB. (Issue #452) When rolling back an incomplete transaction in purge, tolerate missing BLOBs also in update undo, when undoing an INSERT by updating a delete-marked record, and the delete-marked record is no longer needed. Previously, we only tolerated missing BLOBs in insert undo. This merely fixes a debug assertion; the code performed correctly without UNIV_DEBUG. rb://249 approved by Sunny Bains. ------------------------------------------------------------------------ r6674 | inaam | 2010-02-11 17:54:44 +0200 (Thu, 11 Feb 2010) | 16 lines Changed paths: M /branches/zip/include/mem0mem.h M /branches/zip/include/mem0mem.ic M /branches/zip/mem/mem0mem.c branches/zip bug# 49535 This is a backport of r4924. mem_heap_get_size() scans all allocated blocks to calculate the total size of the heap. This patch introduces a new, total_size, field in mem_block_info_struct. This field is valid only for base block (i.e.: the first block allocated for the heap) and is set to ULINT_UNDEFINED in other blocks. This considerably improves the performance of redo scan during recovery. rb://108 issue#216 Approved by: Heikki ------------------------------------------------------------------------ r6675 | marko | 2010-02-11 22:41:11 +0200 (Thu, 11 Feb 2010) | 1 line Changed paths: M /branches/zip/row/row0umod.c branches/zip: Remove bogus debug assertions introduced in r6660. ------------------------------------------------------------------------ r6707 | inaam | 2010-02-12 19:22:35 +0200 (Fri, 12 Feb 2010) | 4 lines Changed paths: M /branches/zip/ChangeLog branches/zip ChangeLog entry for r6674. ------------------------------------------------------------------------ r6712 | marko | 2010-02-16 10:05:36 +0200 (Tue, 16 Feb 2010) | 2 lines Changed paths: M /branches/zip/trx/trx0trx.c branches/zip: trx_lists_init_at_db_start(): Assert that the kernel_mutex is held by the caller. ------------------------------------------------------------------------ r6713 | sunny | 2010-02-16 10:12:17 +0200 (Tue, 16 Feb 2010) | 7 lines Changed paths: M /branches/zip/include/trx0trx.h branches/zip: Change the bit fields back to ulint. Bit fields were causing problems with concurrency on SMP systems because of word packing issues. The number of trx_t's in a system is not sufficient enough to require that we try and save a few bytes in the data structure. See rb://255 for details. ------------------------------------------------------------------------ r6714 | sunny | 2010-02-16 10:12:25 +0200 (Tue, 16 Feb 2010) | 2 lines Changed paths: M /branches/zip/include/trx0trx.h branches/zip: Update the comments and fix the whitespace issues. See rb://255 Approved by: Marko ------------------------------------------------------------------------ r6715 | sunny | 2010-02-16 10:14:21 +0200 (Tue, 16 Feb 2010) | 1 line Changed paths: M /branches/zip/include/trx0trx.h branches/zip: Fix comment. Non functional change. ------------------------------------------------------------------------ r6717 | marko | 2010-02-16 14:53:20 +0200 (Tue, 16 Feb 2010) | 2 lines Changed paths: M /branches/zip/include/log0log.ic branches/zip: log_reserve_and_write_fast(): Correct a race condition in UNIV_LOG_LSN_DEBUG. This could have caused Issue #440. ------------------------------------------------------------------------ r6718 | marko | 2010-02-16 15:06:16 +0200 (Tue, 16 Feb 2010) | 1 line Changed paths: M /branches/zip/include/trx0trx.h branches/zip: Fix a comment. ------------------------------------------------------------------------ r6723 | marko | 2010-02-17 11:48:34 +0200 (Wed, 17 Feb 2010) | 3 lines Changed paths: M /branches/zip/lock/lock0lock.c branches/zip: lock_table_other_has_incompatible(): Return an incompatible lock or NULL instead of TRUE or FALSE. Approved by Sunny over IM. ------------------------------------------------------------------------ r6724 | marko | 2010-02-17 15:52:05 +0200 (Wed, 17 Feb 2010) | 11 lines Changed paths: M /branches/zip/os/os0file.c branches/zip: Merge revisions 6613:6669 from branches/5.1: ------------------------------------------------------------------------ r6669 | jyang | 2010-02-11 12:24:19 +0200 (Thu, 11 Feb 2010) | 7 lines branches/5.1: Fix bug #50691, AIX implementation of readdir_r causes InnoDB errors. readdir_r() returns an non-NULL value in the case of reaching the end of a directory. It should not be treated as an error return. rb://238 approved by Marko ------------------------------------------------------------------------ ------------------------------------------------------------------------ r6726 | marko | 2010-02-17 18:49:21 +0200 (Wed, 17 Feb 2010) | 3 lines Changed paths: M /branches/zip/include/fil0fil.h branches/zip: FIL_PAGE_FILE_FLUSH_LSN: Note that the field is only valid for the first page of each ibdata* file, not *.ibd files. Suggested by Heikki, in connection with the LSN warning noted in Issue #341. ------------------------------------------------------------------------ r6727 | marko | 2010-02-17 18:50:20 +0200 (Wed, 17 Feb 2010) | 2 lines Changed paths: M /branches/zip/fsp/fsp0fsp.c branches/zip: fsp_init_file_page_low(): Declare the page uninitialized for Valgrind. ------------------------------------------------------------------------ r6728 | marko | 2010-02-17 18:54:04 +0200 (Wed, 17 Feb 2010) | 3 lines Changed paths: M /branches/zip/fsp/fsp0fsp.c M /branches/zip/include/univ.i branches/zip: Remove UNIV_BASIC_LOG_DEBUG. This fixes the FILE_FLUSH_LSN printouts mentioned in Issue #341. Suggested by Heikki. ------------------------------------------------------------------------ r6740 | sunny | 2010-02-18 13:44:31 +0200 (Thu, 18 Feb 2010) | 6 lines Changed paths: M /branches/zip/lock/lock0lock.c branches/zip: Don't print the entire lock bit set if the block was not found in the buffer pool. Only print the bits that are set and that information is in the lock and not in the block. See rb://256 approved by Marko. ------------------------------------------------------------------------ r6749 | vasil | 2010-02-20 18:45:41 +0200 (Sat, 20 Feb 2010) | 5 lines Changed paths: M /branches/embedded-1.0/btr/btr0btr.c M /branches/embedded-1.0/btr/btr0cur.c M /branches/embedded-1.0/btr/btr0pcur.c M /branches/embedded-1.0/buf/buf0buf.c M /branches/embedded-1.0/buf/buf0flu.c M /branches/embedded-1.0/buf/buf0lru.c M /branches/embedded-1.0/dict/dict0boot.c M /branches/embedded-1.0/dict/dict0crea.c M /branches/embedded-1.0/dict/dict0dict.c M /branches/embedded-1.0/dict/dict0load.c M /branches/embedded-1.0/fil/fil0fil.c M /branches/embedded-1.0/fsp/fsp0fsp.c M /branches/embedded-1.0/ibuf/ibuf0ibuf.c M /branches/embedded-1.0/include/btr0btr.h M /branches/embedded-1.0/include/btr0cur.h M /branches/embedded-1.0/include/btr0pcur.h M /branches/embedded-1.0/include/btr0pcur.ic M /branches/embedded-1.0/include/buf0buf.h M /branches/embedded-1.0/include/buf0buf.ic M /branches/embedded-1.0/include/dict0boot.h M /branches/embedded-1.0/include/fil0fil.h M /branches/embedded-1.0/include/lock0lock.h M /branches/embedded-1.0/include/log0log.h M /branches/embedded-1.0/include/log0log.ic M /branches/embedded-1.0/include/log0recv.h M /branches/embedded-1.0/include/mem0dbg.h M /branches/embedded-1.0/include/mem0dbg.ic M /branches/embedded-1.0/include/mem0mem.h M /branches/embedded-1.0/include/mem0mem.ic M /branches/embedded-1.0/include/os0file.h M /branches/embedded-1.0/include/os0sync.h M /branches/embedded-1.0/include/os0sync.ic M /branches/embedded-1.0/include/os0thread.h M /branches/embedded-1.0/include/que0que.h M /branches/embedded-1.0/include/que0que.ic M /branches/embedded-1.0/include/row0merge.h M /branches/embedded-1.0/include/row0prebuilt.h M /branches/embedded-1.0/include/srv0srv.h M /branches/embedded-1.0/include/sync0sync.h M /branches/embedded-1.0/include/trx0rseg.h M /branches/embedded-1.0/include/trx0sys.h M /branches/embedded-1.0/include/trx0trx.h M /branches/embedded-1.0/include/trx0types.h M /branches/embedded-1.0/include/trx0undo.h M /branches/embedded-1.0/include/trx0xa.h M /branches/embedded-1.0/include/univ.i M /branches/embedded-1.0/include/ut0vec.h M /branches/embedded-1.0/include/ut0vec.ic M /branches/embedded-1.0/lock/lock0lock.c M /branches/embedded-1.0/log/log0log.c M /branches/embedded-1.0/log/log0recv.c M /branches/embedded-1.0/mem/mem0mem.c M /branches/embedded-1.0/os/os0file.c M /branches/embedded-1.0/os/os0thread.c M /branches/embedded-1.0/page/page0page.c M /branches/embedded-1.0/rem/rem0rec.c M /branches/embedded-1.0/row/row0ins.c M /branches/embedded-1.0/row/row0merge.c M /branches/embedded-1.0/row/row0prebuilt.c M /branches/embedded-1.0/row/row0sel.c M /branches/embedded-1.0/row/row0umod.c M /branches/embedded-1.0/row/row0undo.c M /branches/embedded-1.0/row/row0upd.c M /branches/embedded-1.0/srv/srv0srv.c M /branches/embedded-1.0/srv/srv0start.c M /branches/embedded-1.0/sync/sync0sync.c M /branches/embedded-1.0/trx/trx0sys.c M /branches/embedded-1.0/trx/trx0trx.c M /branches/embedded-1.0/trx/trx0undo.c M /branches/embedded-1.0/ut/ut0mem.c M /branches/innodb+/btr/btr0btr.c M /branches/innodb+/btr/btr0cur.c M /branches/innodb+/btr/btr0pcur.c M /branches/innodb+/buf/buf0buf.c M /branches/innodb+/buf/buf0lru.c M /branches/innodb+/dict/dict0crea.c M /branches/innodb+/dict/dict0dict.c M /branches/innodb+/dict/dict0load.c M /branches/innodb+/handler/ha_innodb.cc M /branches/innodb+/handler/ha_innodb.h M /branches/innodb+/handler/handler0alter.cc M /branches/innodb+/include/btr0btr.h M /branches/innodb+/include/btr0cur.h M /branches/innodb+/include/btr0pcur.h M /branches/innodb+/include/btr0pcur.ic M /branches/innodb+/include/buf0buf.h M /branches/innodb+/include/log0log.h M /branches/innodb+/include/mem0dbg.h M /branches/innodb+/include/mem0dbg.ic M /branches/innodb+/include/os0file.h M /branches/innodb+/include/row0mysql.h M /branches/innodb+/include/srv0srv.h M /branches/innodb+/include/sync0sync.h M /branches/innodb+/include/trx0trx.h M /branches/innodb+/lock/lock0lock.c M /branches/innodb+/log/log0log.c M /branches/innodb+/log/log0recv.c M /branches/innodb+/mem/mem0dbg.c M /branches/innodb+/os/os0file.c M /branches/innodb+/page/page0page.c M /branches/innodb+/row/row0ins.c M /branches/innodb+/row/row0mysql.c M /branches/innodb+/row/row0sel.c M /branches/innodb+/srv/srv0srv.c M /branches/innodb+/srv/srv0start.c M /branches/innodb+/sync/sync0sync.c M /branches/innodb+_metrics_table/btr/btr0btr.c M /branches/innodb+_metrics_table/buf/buf0buf.c M /branches/innodb+_metrics_table/buf/buf0flu.c M /branches/innodb+_metrics_table/dict/dict0crea.c M /branches/innodb+_metrics_table/dict/dict0dict.c M /branches/innodb+_metrics_table/dict/dict0load.c M /branches/innodb+_metrics_table/handler/ha_innodb.cc M /branches/innodb+_metrics_table/handler/ha_innodb.h M /branches/innodb+_metrics_table/handler/handler0alter.cc M /branches/innodb+_metrics_table/handler/i_s.cc M /branches/innodb+_metrics_table/handler/i_s.h M /branches/innodb+_metrics_table/include/mem0dbg.h M /branches/innodb+_metrics_table/include/mem0dbg.ic M /branches/innodb+_metrics_table/include/srv0mon.h M /branches/innodb+_metrics_table/include/srv0mon.ic M /branches/innodb+_metrics_table/include/srv0srv.h M /branches/innodb+_metrics_table/lock/lock0lock.c M /branches/innodb+_metrics_table/log/log0log.c M /branches/innodb+_metrics_table/mem/mem0dbg.c M /branches/innodb+_metrics_table/os/os0file.c M /branches/innodb+_metrics_table/page/page0zip.c M /branches/innodb+_metrics_table/row/row0mysql.c M /branches/innodb+_metrics_table/row/row0purge.c M /branches/innodb+_metrics_table/row/row0sel.c M /branches/innodb+_metrics_table/srv/srv0mon.c M /branches/innodb+_metrics_table/srv/srv0srv.c M /branches/innodb+_metrics_table/sync/sync0sync.c M /branches/innodb+_metrics_table/trx/trx0roll.c M /branches/innodb+_metrics_table/trx/trx0trx.c M /branches/innodb+_persistent_stats/btr/btr0btr.c M /branches/innodb+_persistent_stats/buf/buf0buf.c M /branches/innodb+_persistent_stats/data/data0type.c M /branches/innodb+_persistent_stats/dict/dict0boot.c M /branches/innodb+_persistent_stats/dict/dict0crea.c M /branches/innodb+_persistent_stats/dict/dict0dict.c M /branches/innodb+_persistent_stats/dict/dict0load.c M /branches/innodb+_persistent_stats/dict/dict0mem.c M /branches/innodb+_persistent_stats/fil/fil0fil.c M /branches/innodb+_persistent_stats/fsp/fsp0fsp.c M /branches/innodb+_persistent_stats/handler/ha_innodb.cc M /branches/innodb+_persistent_stats/handler/ha_innodb.h M /branches/innodb+_persistent_stats/handler/handler0alter.cc M /branches/innodb+_persistent_stats/ibuf/ibuf0ibuf.c M /branches/innodb+_persistent_stats/include/btr0pcur.h M /branches/innodb+_persistent_stats/include/btr0pcur.ic M /branches/innodb+_persistent_stats/include/db0err.h M /branches/innodb+_persistent_stats/include/dict0dict.h M /branches/innodb+_persistent_stats/include/dict0mem.h M /branches/innodb+_persistent_stats/include/ha_prototypes.h M /branches/innodb+_persistent_stats/include/lock0lock.h M /branches/innodb+_persistent_stats/include/log0log.h M /branches/innodb+_persistent_stats/include/log0recv.h M /branches/innodb+_persistent_stats/include/mem0dbg.h M /branches/innodb+_persistent_stats/include/mem0dbg.ic M /branches/innodb+_persistent_stats/include/os0file.h M /branches/innodb+_persistent_stats/include/pars0pars.h M /branches/innodb+_persistent_stats/include/srv0srv.h M /branches/innodb+_persistent_stats/include/sync0sync.h M /branches/innodb+_persistent_stats/include/trx0sys.h M /branches/innodb+_persistent_stats/include/trx0trx.h M /branches/innodb+_persistent_stats/include/ut0lst.h M /branches/innodb+_persistent_stats/include/ut0ut.h M /branches/innodb+_persistent_stats/lock/lock0lock.c M /branches/innodb+_persistent_stats/log/log0log.c M /branches/innodb+_persistent_stats/log/log0recv.c M /branches/innodb+_persistent_stats/mem/mem0dbg.c M /branches/innodb+_persistent_stats/os/os0file.c M /branches/innodb+_persistent_stats/page/page0page.c M /branches/innodb+_persistent_stats/pars/pars0pars.c M /branches/innodb+_persistent_stats/row/row0merge.c M /branches/innodb+_persistent_stats/row/row0mysql.c M /branches/innodb+_persistent_stats/row/row0sel.c M /branches/innodb+_persistent_stats/row/row0umod.c M /branches/innodb+_persistent_stats/row/row0upd.c M /branches/innodb+_persistent_stats/srv/srv0srv.c M /branches/innodb+_persistent_stats/srv/srv0start.c M /branches/innodb+_persistent_stats/sync/sync0sync.c M /branches/innodb+_persistent_stats/trx/trx0i_s.c M /branches/innodb+_persistent_stats/trx/trx0sys.c M /branches/innodb+_persistent_stats/trx/trx0trx.c M /branches/innodb+_persistent_stats/ut/ut0ut.c M /branches/innofts+/handler/ha_innodb.cc M /branches/innofts+/handler/i_s.cc M /branches/innofts+/handler/i_s.h M /branches/innofts+/include/fut0fut.h M /branches/performance_schema/btr/btr0sea.c M /branches/performance_schema/buf/buf0buf.c M /branches/performance_schema/dict/dict0dict.c M /branches/performance_schema/fil/fil0fil.c M /branches/performance_schema/handler/ha_innodb.cc M /branches/performance_schema/include/srv0srv.h M /branches/performance_schema/include/sync0rw.h M /branches/performance_schema/include/sync0rw.ic M /branches/performance_schema/include/sync0sync.h M /branches/performance_schema/include/sync0sync.ic M /branches/performance_schema/include/sync0types.h M /branches/performance_schema/log/log0log.c M /branches/performance_schema/srv/srv0srv.c M /branches/performance_schema/sync/sync0rw.c M /branches/performance_schema/trx/trx0i_s.c M /branches/performance_schema/trx/trx0purge.c M /branches/plugin-2.0/buf/buf0buf.c M /branches/plugin-2.0/buf/buf0lru.c M /branches/plugin-2.0/dict/dict0boot.c M /branches/plugin-2.0/dict/dict0crea.c M /branches/plugin-2.0/dict/dict0dict.c M /branches/plugin-2.0/dict/dict0load.c M /branches/plugin-2.0/dict/dict0mem.c M /branches/plugin-2.0/fil/fil0fil.c M /branches/plugin-2.0/fsp/fsp0fsp.c M /branches/plugin-2.0/handler/ha_innodb.cc M /branches/plugin-2.0/handler/ha_innodb.h M /branches/plugin-2.0/handler/handler0alter.cc M /branches/plugin-2.0/ibuf/ibuf0ibuf.c M /branches/plugin-2.0/include/dict0mem.h M /branches/plugin-2.0/include/ha_prototypes.h M /branches/plugin-2.0/include/lock0lock.h M /branches/plugin-2.0/include/log0log.h M /branches/plugin-2.0/include/log0recv.h M /branches/plugin-2.0/include/mem0dbg.h M /branches/plugin-2.0/include/mem0dbg.ic M /branches/plugin-2.0/include/os0file.h M /branches/plugin-2.0/include/row0mysql.h M /branches/plugin-2.0/include/srv0srv.h M /branches/plugin-2.0/include/sync0sync.h M /branches/plugin-2.0/include/trx0sys.h M /branches/plugin-2.0/include/trx0trx.h M /branches/plugin-2.0/lock/lock0lock.c M /branches/plugin-2.0/log/log0log.c M /branches/plugin-2.0/log/log0recv.c M /branches/plugin-2.0/mem/mem0dbg.c M /branches/plugin-2.0/os/os0file.c M /branches/plugin-2.0/page/page0page.c M /branches/plugin-2.0/row/row0merge.c M /branches/plugin-2.0/row/row0mysql.c M /branches/plugin-2.0/row/row0sel.c M /branches/plugin-2.0/row/row0umod.c M /branches/plugin-2.0/row/row0upd.c M /branches/plugin-2.0/srv/srv0srv.c M /branches/plugin-2.0/srv/srv0start.c M /branches/plugin-2.0/sync/sync0sync.c M /branches/plugin-2.0/trx/trx0i_s.c M /branches/plugin-2.0/trx/trx0sys.c M /branches/plugin-2.0/trx/trx0trx.c M /branches/zip/btr/btr0btr.c M /branches/zip/btr/btr0cur.c M /branches/zip/btr/btr0pcur.c M /branches/zip/buf/buf0buf.c M /branches/zip/buf/buf0lru.c M /branches/zip/dict/dict0boot.c M /branches/zip/dict/dict0crea.c M /branches/zip/dict/dict0dict.c M /branches/zip/dict/dict0load.c M /branches/zip/fsp/fsp0fsp.c M /branches/zip/handler/ha_innodb.cc M /branches/zip/handler/ha_innodb.h M /branches/zip/handler/handler0alter.cc M /branches/zip/include/btr0btr.h M /branches/zip/include/btr0cur.h M /branches/zip/include/btr0pcur.h M /branches/zip/include/btr0pcur.ic M /branches/zip/include/buf0buf.h M /branches/zip/include/dict0boot.h M /branches/zip/include/fil0fil.h M /branches/zip/include/log0log.h M /branches/zip/include/log0log.ic M /branches/zip/include/log0recv.h M /branches/zip/include/mem0dbg.h M /branches/zip/include/mem0dbg.ic M /branches/zip/include/mem0mem.h M /branches/zip/include/mem0mem.ic M /branches/zip/include/os0file.h M /branches/zip/include/que0que.h M /branches/zip/include/que0que.ic M /branches/zip/include/row0mysql.h M /branches/zip/include/srv0srv.h M /branches/zip/include/sync0sync.h M /branches/zip/include/trx0rseg.h M /branches/zip/include/trx0trx.h M /branches/zip/include/trx0types.h M /branches/zip/include/univ.i M /branches/zip/lock/lock0lock.c M /branches/zip/log/log0log.c M /branches/zip/log/log0recv.c M /branches/zip/mem/mem0dbg.c M /branches/zip/mem/mem0mem.c M /branches/zip/os/os0file.c M /branches/zip/page/page0page.c M /branches/zip/rem/rem0rec.c M /branches/zip/row/row0ins.c M /branches/zip/row/row0merge.c M /branches/zip/row/row0mysql.c M /branches/zip/row/row0sel.c M /branches/zip/row/row0umod.c M /branches/zip/srv/srv0srv.c M /branches/zip/srv/srv0start.c M /branches/zip/sync/sync0sync.c M /branches/zip/trx/trx0rseg.c M /branches/zip/trx/trx0trx.c Non-functional change: update copyright year to 2010 of the files that have been modified after 2010-01-01 according to svn. for f in $(svn log -v -r{2010-01-01}:HEAD |grep "^ M " |cut -b 16- |sort -u) ; do sed -i "" -E 's/(Copyright \(c\) [0-9]{4},) [0-9]{4}, (.*Innobase Oy.+All Rights Reserved)/\1 2010, \2/' $f ; done ------------------------------------------------------------------------ r6750 | marko | 2010-02-22 08:57:23 +0200 (Mon, 22 Feb 2010) | 2 lines Changed paths: M /branches/zip/include/row0sel.h M /branches/zip/row/row0sel.c branches/zip: row_fetch_store_uint4(): Remove unused function. This was added to trunk in r435. ------------------------------------------------------------------------ r6754 | marko | 2010-02-24 10:56:43 +0200 (Wed, 24 Feb 2010) | 17 lines Changed paths: M /branches/zip/row/row0merge.c branches/zip: Allocate the merge sort buffers from a heap, not stack. The merge sort can use up to 48KiB of buffers when merging blocks. That can cause a stack overflow, especially on 64-bit systems when not building with inlined functions. This was reported as Issue #462. row_merge_dup_report(): Allocate buf and offsets from a heap. row_merge_heap_create(): Allocate space for buf[3] too. Fix bogus sizeof arithmetics that happened to work, because sizeof(ulint)==sizeof(void*). row_merge_blocks(), row_merge_blocks_copy(): Allocate buf[3] from heap. row_merge_insert_index_tuples(): Allocate buf from graph_heap. rb://258 approved and tested by Sunny Bains ------------------------------------------------------------------------ r6767 | calvin | 2010-03-01 18:16:10 +0200 (Mon, 01 Mar 2010) | 3 lines Changed paths: M /branches/zip/srv/srv0srv.c branches/zip: fix bug#51587 Non-functional change. ------------------------------------------------------------------------ r6768 | vasil | 2010-03-02 18:20:48 +0200 (Tue, 02 Mar 2010) | 5 lines Changed paths: M /branches/zip/include/btr0btr.h M /branches/zip/include/btr0btr.ic branches/zip: Add a NOTE to the comment of btr_node_ptr_get_child_page_no() to prevent mysterious bugs. ------------------------------------------------------------------------ r6770 | marko | 2010-03-03 12:52:55 +0200 (Wed, 03 Mar 2010) | 12 lines Changed paths: M /branches/zip/handler/handler0alter.cc M /branches/zip/mysql-test/innodb-index.result M /branches/zip/mysql-test/innodb-index.test M /branches/zip/mysql-test/innodb.result M /branches/zip/mysql-test/innodb.test branches/zip: Disallow duplicate index name when creating an index. This should fix Mantis Issue #461. innodb.test, innodb.result, innodb-index.test, innodb-index.result: Adjust the test result and mention that the introduced restriction has been reported as MySQL Bug #51451. innobase_check_index_keys(): Add a parameter for the InnoDB table and check that no duplicate index name is added. Report errors by my_error() instead of sql_print_error(). rb://260 approved by Sunny Bains ------------------------------------------------------------------------ r6771 | marko | 2010-03-03 14:52:43 +0200 (Wed, 03 Mar 2010) | 1 line Changed paths: M /branches/zip/ChangeLog Document r6770. ------------------------------------------------------------------------ r6773 | marko | 2010-03-03 15:31:54 +0200 (Wed, 03 Mar 2010) | 2 lines Changed paths: M /branches/zip/row/row0row.c branches/zip: row_raw_format(): Silence a GCC 4.4.2 warning of possibly uninitialized variable format_in_hex. ------------------------------------------------------------------------
724 lines
28 KiB
C
724 lines
28 KiB
C
/*****************************************************************************
|
|
|
|
Copyright (c) 1995, 2010, Innobase Oy. All Rights Reserved.
|
|
|
|
This program is free software; you can redistribute it and/or modify it under
|
|
the terms of the GNU General Public License as published by the Free Software
|
|
Foundation; version 2 of the License.
|
|
|
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License along with
|
|
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
|
Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*****************************************************************************/
|
|
|
|
/**************************************************//**
|
|
@file include/fil0fil.h
|
|
The low-level file system
|
|
|
|
Created 10/25/1995 Heikki Tuuri
|
|
*******************************************************/
|
|
|
|
#ifndef fil0fil_h
|
|
#define fil0fil_h
|
|
|
|
#include "dict0types.h"
|
|
#include "ut0byte.h"
|
|
#include "os0file.h"
|
|
#ifndef UNIV_HOTBACKUP
|
|
#include "sync0rw.h"
|
|
#include "ibuf0types.h"
|
|
#endif /* !UNIV_HOTBACKUP */
|
|
|
|
/** When mysqld is run, the default directory "." is the mysqld datadir,
|
|
but in the MySQL Embedded Server Library and ibbackup it is not the default
|
|
directory, and we must set the base file path explicitly */
|
|
extern const char* fil_path_to_mysql_datadir;
|
|
|
|
/** Initial size of a single-table tablespace in pages */
|
|
#define FIL_IBD_FILE_INITIAL_SIZE 4
|
|
|
|
/** 'null' (undefined) page offset in the context of file spaces */
|
|
#define FIL_NULL ULINT32_UNDEFINED
|
|
|
|
/* Space address data type; this is intended to be used when
|
|
addresses accurate to a byte are stored in file pages. If the page part
|
|
of the address is FIL_NULL, the address is considered undefined. */
|
|
|
|
typedef byte fil_faddr_t; /*!< 'type' definition in C: an address
|
|
stored in a file page is a string of bytes */
|
|
#define FIL_ADDR_PAGE 0 /* first in address is the page offset */
|
|
#define FIL_ADDR_BYTE 4 /* then comes 2-byte byte offset within page*/
|
|
|
|
#define FIL_ADDR_SIZE 6 /* address size is 6 bytes */
|
|
|
|
/** A struct for storing a space address FIL_ADDR, when it is used
|
|
in C program data structures. */
|
|
|
|
typedef struct fil_addr_struct fil_addr_t;
|
|
/** File space address */
|
|
struct fil_addr_struct{
|
|
ulint page; /*!< page number within a space */
|
|
ulint boffset; /*!< byte offset within the page */
|
|
};
|
|
|
|
/** The null file address */
|
|
extern fil_addr_t fil_addr_null;
|
|
|
|
/** The byte offsets on a file page for various variables @{ */
|
|
#define FIL_PAGE_SPACE_OR_CHKSUM 0 /*!< in < MySQL-4.0.14 space id the
|
|
page belongs to (== 0) but in later
|
|
versions the 'new' checksum of the
|
|
page */
|
|
#define FIL_PAGE_OFFSET 4 /*!< page offset inside space */
|
|
#define FIL_PAGE_PREV 8 /*!< if there is a 'natural'
|
|
predecessor of the page, its
|
|
offset. Otherwise FIL_NULL.
|
|
This field is not set on BLOB
|
|
pages, which are stored as a
|
|
singly-linked list. See also
|
|
FIL_PAGE_NEXT. */
|
|
#define FIL_PAGE_NEXT 12 /*!< if there is a 'natural' successor
|
|
of the page, its offset.
|
|
Otherwise FIL_NULL.
|
|
B-tree index pages
|
|
(FIL_PAGE_TYPE contains FIL_PAGE_INDEX)
|
|
on the same PAGE_LEVEL are maintained
|
|
as a doubly linked list via
|
|
FIL_PAGE_PREV and FIL_PAGE_NEXT
|
|
in the collation order of the
|
|
smallest user record on each page. */
|
|
#define FIL_PAGE_LSN 16 /*!< lsn of the end of the newest
|
|
modification log record to the page */
|
|
#define FIL_PAGE_TYPE 24 /*!< file page type: FIL_PAGE_INDEX,...,
|
|
2 bytes.
|
|
|
|
The contents of this field can only
|
|
be trusted in the following case:
|
|
if the page is an uncompressed
|
|
B-tree index page, then it is
|
|
guaranteed that the value is
|
|
FIL_PAGE_INDEX.
|
|
The opposite does not hold.
|
|
|
|
In tablespaces created by
|
|
MySQL/InnoDB 5.1.7 or later, the
|
|
contents of this field is valid
|
|
for all uncompressed pages. */
|
|
#define FIL_PAGE_FILE_FLUSH_LSN 26 /*!< this is only defined for the
|
|
first page in a system tablespace
|
|
data file (ibdata*, not *.ibd):
|
|
the file has been flushed to disk
|
|
at least up to this lsn */
|
|
#define FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID 34 /*!< starting from 4.1.x this
|
|
contains the space id of the page */
|
|
#define FIL_PAGE_DATA 38 /*!< start of the data on the page */
|
|
/* @} */
|
|
/** File page trailer @{ */
|
|
#define FIL_PAGE_END_LSN_OLD_CHKSUM 8 /*!< the low 4 bytes of this are used
|
|
to store the page checksum, the
|
|
last 4 bytes should be identical
|
|
to the last 4 bytes of FIL_PAGE_LSN */
|
|
#define FIL_PAGE_DATA_END 8 /*!< size of the page trailer */
|
|
/* @} */
|
|
|
|
/** File page types (values of FIL_PAGE_TYPE) @{ */
|
|
#define FIL_PAGE_INDEX 17855 /*!< B-tree node */
|
|
#define FIL_PAGE_UNDO_LOG 2 /*!< Undo log page */
|
|
#define FIL_PAGE_INODE 3 /*!< Index node */
|
|
#define FIL_PAGE_IBUF_FREE_LIST 4 /*!< Insert buffer free list */
|
|
/* File page types introduced in MySQL/InnoDB 5.1.7 */
|
|
#define FIL_PAGE_TYPE_ALLOCATED 0 /*!< Freshly allocated page */
|
|
#define FIL_PAGE_IBUF_BITMAP 5 /*!< Insert buffer bitmap */
|
|
#define FIL_PAGE_TYPE_SYS 6 /*!< System page */
|
|
#define FIL_PAGE_TYPE_TRX_SYS 7 /*!< Transaction system data */
|
|
#define FIL_PAGE_TYPE_FSP_HDR 8 /*!< File space header */
|
|
#define FIL_PAGE_TYPE_XDES 9 /*!< Extent descriptor page */
|
|
#define FIL_PAGE_TYPE_BLOB 10 /*!< Uncompressed BLOB page */
|
|
#define FIL_PAGE_TYPE_ZBLOB 11 /*!< First compressed BLOB page */
|
|
#define FIL_PAGE_TYPE_ZBLOB2 12 /*!< Subsequent compressed BLOB page */
|
|
/* @} */
|
|
|
|
/** Space types @{ */
|
|
#define FIL_TABLESPACE 501 /*!< tablespace */
|
|
#define FIL_LOG 502 /*!< redo log */
|
|
/* @} */
|
|
|
|
/** The number of fsyncs done to the log */
|
|
extern ulint fil_n_log_flushes;
|
|
|
|
/** Number of pending redo log flushes */
|
|
extern ulint fil_n_pending_log_flushes;
|
|
/** Number of pending tablespace flushes */
|
|
extern ulint fil_n_pending_tablespace_flushes;
|
|
|
|
|
|
#ifndef UNIV_HOTBACKUP
|
|
/*******************************************************************//**
|
|
Returns the version number of a tablespace, -1 if not found.
|
|
@return version number, -1 if the tablespace does not exist in the
|
|
memory cache */
|
|
UNIV_INTERN
|
|
ib_int64_t
|
|
fil_space_get_version(
|
|
/*==================*/
|
|
ulint id); /*!< in: space id */
|
|
/*******************************************************************//**
|
|
Returns the latch of a file space.
|
|
@return latch protecting storage allocation */
|
|
UNIV_INTERN
|
|
rw_lock_t*
|
|
fil_space_get_latch(
|
|
/*================*/
|
|
ulint id, /*!< in: space id */
|
|
ulint* zip_size);/*!< out: compressed page size, or
|
|
0 for uncompressed tablespaces */
|
|
/*******************************************************************//**
|
|
Returns the type of a file space.
|
|
@return FIL_TABLESPACE or FIL_LOG */
|
|
UNIV_INTERN
|
|
ulint
|
|
fil_space_get_type(
|
|
/*===============*/
|
|
ulint id); /*!< in: space id */
|
|
#endif /* !UNIV_HOTBACKUP */
|
|
/*******************************************************************//**
|
|
Appends a new file to the chain of files of a space. File must be closed. */
|
|
UNIV_INTERN
|
|
void
|
|
fil_node_create(
|
|
/*============*/
|
|
const char* name, /*!< in: file name (file must be closed) */
|
|
ulint size, /*!< in: file size in database blocks, rounded
|
|
downwards to an integer */
|
|
ulint id, /*!< in: space id where to append */
|
|
ibool is_raw);/*!< in: TRUE if a raw device or
|
|
a raw disk partition */
|
|
#ifdef UNIV_LOG_ARCHIVE
|
|
/****************************************************************//**
|
|
Drops files from the start of a file space, so that its size is cut by
|
|
the amount given. */
|
|
UNIV_INTERN
|
|
void
|
|
fil_space_truncate_start(
|
|
/*=====================*/
|
|
ulint id, /*!< in: space id */
|
|
ulint trunc_len); /*!< in: truncate by this much; it is an error
|
|
if this does not equal to the combined size of
|
|
some initial files in the space */
|
|
#endif /* UNIV_LOG_ARCHIVE */
|
|
/*******************************************************************//**
|
|
Creates a space memory object and puts it to the 'fil system' hash table. If
|
|
there is an error, prints an error message to the .err log.
|
|
@return TRUE if success */
|
|
UNIV_INTERN
|
|
ibool
|
|
fil_space_create(
|
|
/*=============*/
|
|
const char* name, /*!< in: space name */
|
|
ulint id, /*!< in: space id */
|
|
ulint zip_size,/*!< in: compressed page size, or
|
|
0 for uncompressed tablespaces */
|
|
ulint purpose);/*!< in: FIL_TABLESPACE, or FIL_LOG if log */
|
|
/*******************************************************************//**
|
|
Returns the size of the space in pages. The tablespace must be cached in the
|
|
memory cache.
|
|
@return space size, 0 if space not found */
|
|
UNIV_INTERN
|
|
ulint
|
|
fil_space_get_size(
|
|
/*===============*/
|
|
ulint id); /*!< in: space id */
|
|
/*******************************************************************//**
|
|
Returns the flags of the space. The tablespace must be cached
|
|
in the memory cache.
|
|
@return flags, ULINT_UNDEFINED if space not found */
|
|
UNIV_INTERN
|
|
ulint
|
|
fil_space_get_flags(
|
|
/*================*/
|
|
ulint id); /*!< in: space id */
|
|
/*******************************************************************//**
|
|
Returns the compressed page size of the space, or 0 if the space
|
|
is not compressed. The tablespace must be cached in the memory cache.
|
|
@return compressed page size, ULINT_UNDEFINED if space not found */
|
|
UNIV_INTERN
|
|
ulint
|
|
fil_space_get_zip_size(
|
|
/*===================*/
|
|
ulint id); /*!< in: space id */
|
|
/*******************************************************************//**
|
|
Checks if the pair space, page_no refers to an existing page in a tablespace
|
|
file space. The tablespace must be cached in the memory cache.
|
|
@return TRUE if the address is meaningful */
|
|
UNIV_INTERN
|
|
ibool
|
|
fil_check_adress_in_tablespace(
|
|
/*===========================*/
|
|
ulint id, /*!< in: space id */
|
|
ulint page_no);/*!< in: page number */
|
|
/****************************************************************//**
|
|
Initializes the tablespace memory cache. */
|
|
UNIV_INTERN
|
|
void
|
|
fil_init(
|
|
/*=====*/
|
|
ulint hash_size, /*!< in: hash table size */
|
|
ulint max_n_open); /*!< in: max number of open files */
|
|
/*******************************************************************//**
|
|
Initializes the tablespace memory cache. */
|
|
UNIV_INTERN
|
|
void
|
|
fil_close(void);
|
|
/*===========*/
|
|
/*******************************************************************//**
|
|
Opens all log files and system tablespace data files. They stay open until the
|
|
database server shutdown. This should be called at a server startup after the
|
|
space objects for the log and the system tablespace have been created. The
|
|
purpose of this operation is to make sure we never run out of file descriptors
|
|
if we need to read from the insert buffer or to write to the log. */
|
|
UNIV_INTERN
|
|
void
|
|
fil_open_log_and_system_tablespace_files(void);
|
|
/*==========================================*/
|
|
/*******************************************************************//**
|
|
Closes all open files. There must not be any pending i/o's or not flushed
|
|
modifications in the files. */
|
|
UNIV_INTERN
|
|
void
|
|
fil_close_all_files(void);
|
|
/*=====================*/
|
|
/*******************************************************************//**
|
|
Sets the max tablespace id counter if the given number is bigger than the
|
|
previous value. */
|
|
UNIV_INTERN
|
|
void
|
|
fil_set_max_space_id_if_bigger(
|
|
/*===========================*/
|
|
ulint max_id);/*!< in: maximum known id */
|
|
#ifndef UNIV_HOTBACKUP
|
|
/****************************************************************//**
|
|
Writes the flushed lsn and the latest archived log number to the page
|
|
header of the first page of each data file in the system tablespace.
|
|
@return DB_SUCCESS or error number */
|
|
UNIV_INTERN
|
|
ulint
|
|
fil_write_flushed_lsn_to_data_files(
|
|
/*================================*/
|
|
ib_uint64_t lsn, /*!< in: lsn to write */
|
|
ulint arch_log_no); /*!< in: latest archived log
|
|
file number */
|
|
/*******************************************************************//**
|
|
Reads the flushed lsn and arch no fields from a data file at database
|
|
startup. */
|
|
UNIV_INTERN
|
|
void
|
|
fil_read_flushed_lsn_and_arch_log_no(
|
|
/*=================================*/
|
|
os_file_t data_file, /*!< in: open data file */
|
|
ibool one_read_already, /*!< in: TRUE if min and max
|
|
parameters below already
|
|
contain sensible data */
|
|
#ifdef UNIV_LOG_ARCHIVE
|
|
ulint* min_arch_log_no, /*!< in/out: */
|
|
ulint* max_arch_log_no, /*!< in/out: */
|
|
#endif /* UNIV_LOG_ARCHIVE */
|
|
ib_uint64_t* min_flushed_lsn, /*!< in/out: */
|
|
ib_uint64_t* max_flushed_lsn); /*!< in/out: */
|
|
/*******************************************************************//**
|
|
Increments the count of pending insert buffer page merges, if space is not
|
|
being deleted.
|
|
@return TRUE if being deleted, and ibuf merges should be skipped */
|
|
UNIV_INTERN
|
|
ibool
|
|
fil_inc_pending_ibuf_merges(
|
|
/*========================*/
|
|
ulint id); /*!< in: space id */
|
|
/*******************************************************************//**
|
|
Decrements the count of pending insert buffer page merges. */
|
|
UNIV_INTERN
|
|
void
|
|
fil_decr_pending_ibuf_merges(
|
|
/*=========================*/
|
|
ulint id); /*!< in: space id */
|
|
#endif /* !UNIV_HOTBACKUP */
|
|
/*******************************************************************//**
|
|
Parses the body of a log record written about an .ibd file operation. That is,
|
|
the log record part after the standard (type, space id, page no) header of the
|
|
log record.
|
|
|
|
If desired, also replays the delete or rename operation if the .ibd file
|
|
exists and the space id in it matches. Replays the create operation if a file
|
|
at that path does not exist yet. If the database directory for the file to be
|
|
created does not exist, then we create the directory, too.
|
|
|
|
Note that ibbackup --apply-log sets fil_path_to_mysql_datadir to point to the
|
|
datadir that we should use in replaying the file operations.
|
|
@return end of log record, or NULL if the record was not completely
|
|
contained between ptr and end_ptr */
|
|
UNIV_INTERN
|
|
byte*
|
|
fil_op_log_parse_or_replay(
|
|
/*=======================*/
|
|
byte* ptr, /*!< in: buffer containing the log record body,
|
|
or an initial segment of it, if the record does
|
|
not fir completely between ptr and end_ptr */
|
|
byte* end_ptr, /*!< in: buffer end */
|
|
ulint type, /*!< in: the type of this log record */
|
|
ulint space_id, /*!< in: the space id of the tablespace in
|
|
question, or 0 if the log record should
|
|
only be parsed but not replayed */
|
|
ulint log_flags); /*!< in: redo log flags
|
|
(stored in the page number parameter) */
|
|
/*******************************************************************//**
|
|
Deletes a single-table tablespace. The tablespace must be cached in the
|
|
memory cache.
|
|
@return TRUE if success */
|
|
UNIV_INTERN
|
|
ibool
|
|
fil_delete_tablespace(
|
|
/*==================*/
|
|
ulint id); /*!< in: space id */
|
|
#ifndef UNIV_HOTBACKUP
|
|
/*******************************************************************//**
|
|
Discards a single-table tablespace. The tablespace must be cached in the
|
|
memory cache. Discarding is like deleting a tablespace, but
|
|
1) we do not drop the table from the data dictionary;
|
|
2) we remove all insert buffer entries for the tablespace immediately; in DROP
|
|
TABLE they are only removed gradually in the background;
|
|
3) when the user does IMPORT TABLESPACE, the tablespace will have the same id
|
|
as it originally had.
|
|
@return TRUE if success */
|
|
UNIV_INTERN
|
|
ibool
|
|
fil_discard_tablespace(
|
|
/*===================*/
|
|
ulint id); /*!< in: space id */
|
|
#endif /* !UNIV_HOTBACKUP */
|
|
/*******************************************************************//**
|
|
Renames a single-table tablespace. The tablespace must be cached in the
|
|
tablespace memory cache.
|
|
@return TRUE if success */
|
|
UNIV_INTERN
|
|
ibool
|
|
fil_rename_tablespace(
|
|
/*==================*/
|
|
const char* old_name, /*!< in: old table name in the standard
|
|
databasename/tablename format of
|
|
InnoDB, or NULL if we do the rename
|
|
based on the space id only */
|
|
ulint id, /*!< in: space id */
|
|
const char* new_name); /*!< in: new table name in the standard
|
|
databasename/tablename format
|
|
of InnoDB */
|
|
|
|
/*******************************************************************//**
|
|
Creates a new single-table tablespace to a database directory of MySQL.
|
|
Database directories are under the 'datadir' of MySQL. The datadir is the
|
|
directory of a running mysqld program. We can refer to it by simply the
|
|
path '.'. Tables created with CREATE TEMPORARY TABLE we place in the temp
|
|
dir of the mysqld server.
|
|
@return DB_SUCCESS or error code */
|
|
UNIV_INTERN
|
|
ulint
|
|
fil_create_new_single_table_tablespace(
|
|
/*===================================*/
|
|
ulint* space_id, /*!< in/out: space id; if this is != 0,
|
|
then this is an input parameter,
|
|
otherwise output */
|
|
const char* tablename, /*!< in: the table name in the usual
|
|
databasename/tablename format
|
|
of InnoDB, or a dir path to a temp
|
|
table */
|
|
ibool is_temp, /*!< in: TRUE if a table created with
|
|
CREATE TEMPORARY TABLE */
|
|
ulint flags, /*!< in: tablespace flags */
|
|
ulint size); /*!< in: the initial size of the
|
|
tablespace file in pages,
|
|
must be >= FIL_IBD_FILE_INITIAL_SIZE */
|
|
#ifndef UNIV_HOTBACKUP
|
|
/********************************************************************//**
|
|
Tries to open a single-table tablespace and optionally checks the space id is
|
|
right in it. If does not succeed, prints an error message to the .err log. This
|
|
function is used to open a tablespace when we start up mysqld, and also in
|
|
IMPORT TABLESPACE.
|
|
NOTE that we assume this operation is used either at the database startup
|
|
or under the protection of the dictionary mutex, so that two users cannot
|
|
race here. This operation does not leave the file associated with the
|
|
tablespace open, but closes it after we have looked at the space id in it.
|
|
@return TRUE if success */
|
|
UNIV_INTERN
|
|
ibool
|
|
fil_open_single_table_tablespace(
|
|
/*=============================*/
|
|
ibool check_space_id, /*!< in: should we check that the space
|
|
id in the file is right; we assume
|
|
that this function runs much faster
|
|
if no check is made, since accessing
|
|
the file inode probably is much
|
|
faster (the OS caches them) than
|
|
accessing the first page of the file */
|
|
ulint id, /*!< in: space id */
|
|
ulint flags, /*!< in: tablespace flags */
|
|
const char* name); /*!< in: table name in the
|
|
databasename/tablename format */
|
|
/********************************************************************//**
|
|
It is possible, though very improbable, that the lsn's in the tablespace to be
|
|
imported have risen above the current system lsn, if a lengthy purge, ibuf
|
|
merge, or rollback was performed on a backup taken with ibbackup. If that is
|
|
the case, reset page lsn's in the file. We assume that mysqld was shut down
|
|
after it performed these cleanup operations on the .ibd file, so that it at
|
|
the shutdown stamped the latest lsn to the FIL_PAGE_FILE_FLUSH_LSN in the
|
|
first page of the .ibd file, and we can determine whether we need to reset the
|
|
lsn's just by looking at that flush lsn.
|
|
@return TRUE if success */
|
|
UNIV_INTERN
|
|
ibool
|
|
fil_reset_too_high_lsns(
|
|
/*====================*/
|
|
const char* name, /*!< in: table name in the
|
|
databasename/tablename format */
|
|
ib_uint64_t current_lsn); /*!< in: reset lsn's if the lsn stamped
|
|
to FIL_PAGE_FILE_FLUSH_LSN in the
|
|
first page is too high */
|
|
#endif /* !UNIV_HOTBACKUP */
|
|
/********************************************************************//**
|
|
At the server startup, if we need crash recovery, scans the database
|
|
directories under the MySQL datadir, looking for .ibd files. Those files are
|
|
single-table tablespaces. We need to know the space id in each of them so that
|
|
we know into which file we should look to check the contents of a page stored
|
|
in the doublewrite buffer, also to know where to apply log records where the
|
|
space id is != 0.
|
|
@return DB_SUCCESS or error number */
|
|
UNIV_INTERN
|
|
ulint
|
|
fil_load_single_table_tablespaces(void);
|
|
/*===================================*/
|
|
/********************************************************************//**
|
|
If we need crash recovery, and we have called
|
|
fil_load_single_table_tablespaces() and dict_load_single_table_tablespaces(),
|
|
we can call this function to print an error message of orphaned .ibd files
|
|
for which there is not a data dictionary entry with a matching table name
|
|
and space id. */
|
|
UNIV_INTERN
|
|
void
|
|
fil_print_orphaned_tablespaces(void);
|
|
/*================================*/
|
|
/*******************************************************************//**
|
|
Returns TRUE if a single-table tablespace does not exist in the memory cache,
|
|
or is being deleted there.
|
|
@return TRUE if does not exist or is being\ deleted */
|
|
UNIV_INTERN
|
|
ibool
|
|
fil_tablespace_deleted_or_being_deleted_in_mem(
|
|
/*===========================================*/
|
|
ulint id, /*!< in: space id */
|
|
ib_int64_t version);/*!< in: tablespace_version should be this; if
|
|
you pass -1 as the value of this, then this
|
|
parameter is ignored */
|
|
/*******************************************************************//**
|
|
Returns TRUE if a single-table tablespace exists in the memory cache.
|
|
@return TRUE if exists */
|
|
UNIV_INTERN
|
|
ibool
|
|
fil_tablespace_exists_in_mem(
|
|
/*=========================*/
|
|
ulint id); /*!< in: space id */
|
|
#ifndef UNIV_HOTBACKUP
|
|
/*******************************************************************//**
|
|
Returns TRUE if a matching tablespace exists in the InnoDB tablespace memory
|
|
cache. Note that if we have not done a crash recovery at the database startup,
|
|
there may be many tablespaces which are not yet in the memory cache.
|
|
@return TRUE if a matching tablespace exists in the memory cache */
|
|
UNIV_INTERN
|
|
ibool
|
|
fil_space_for_table_exists_in_mem(
|
|
/*==============================*/
|
|
ulint id, /*!< in: space id */
|
|
const char* name, /*!< in: table name in the standard
|
|
'databasename/tablename' format or
|
|
the dir path to a temp table */
|
|
ibool is_temp, /*!< in: TRUE if created with CREATE
|
|
TEMPORARY TABLE */
|
|
ibool mark_space, /*!< in: in crash recovery, at database
|
|
startup we mark all spaces which have
|
|
an associated table in the InnoDB
|
|
data dictionary, so that
|
|
we can print a warning about orphaned
|
|
tablespaces */
|
|
ibool print_error_if_does_not_exist);
|
|
/*!< in: print detailed error
|
|
information to the .err log if a
|
|
matching tablespace is not found from
|
|
memory */
|
|
#else /* !UNIV_HOTBACKUP */
|
|
/********************************************************************//**
|
|
Extends all tablespaces to the size stored in the space header. During the
|
|
ibbackup --apply-log phase we extended the spaces on-demand so that log records
|
|
could be appllied, but that may have left spaces still too small compared to
|
|
the size stored in the space header. */
|
|
UNIV_INTERN
|
|
void
|
|
fil_extend_tablespaces_to_stored_len(void);
|
|
/*======================================*/
|
|
#endif /* !UNIV_HOTBACKUP */
|
|
/**********************************************************************//**
|
|
Tries to extend a data file so that it would accommodate the number of pages
|
|
given. The tablespace must be cached in the memory cache. If the space is big
|
|
enough already, does nothing.
|
|
@return TRUE if success */
|
|
UNIV_INTERN
|
|
ibool
|
|
fil_extend_space_to_desired_size(
|
|
/*=============================*/
|
|
ulint* actual_size, /*!< out: size of the space after extension;
|
|
if we ran out of disk space this may be lower
|
|
than the desired size */
|
|
ulint space_id, /*!< in: space id */
|
|
ulint size_after_extend);/*!< in: desired size in pages after the
|
|
extension; if the current space size is bigger
|
|
than this already, the function does nothing */
|
|
/*******************************************************************//**
|
|
Tries to reserve free extents in a file space.
|
|
@return TRUE if succeed */
|
|
UNIV_INTERN
|
|
ibool
|
|
fil_space_reserve_free_extents(
|
|
/*===========================*/
|
|
ulint id, /*!< in: space id */
|
|
ulint n_free_now, /*!< in: number of free extents now */
|
|
ulint n_to_reserve); /*!< in: how many one wants to reserve */
|
|
/*******************************************************************//**
|
|
Releases free extents in a file space. */
|
|
UNIV_INTERN
|
|
void
|
|
fil_space_release_free_extents(
|
|
/*===========================*/
|
|
ulint id, /*!< in: space id */
|
|
ulint n_reserved); /*!< in: how many one reserved */
|
|
/*******************************************************************//**
|
|
Gets the number of reserved extents. If the database is silent, this number
|
|
should be zero. */
|
|
UNIV_INTERN
|
|
ulint
|
|
fil_space_get_n_reserved_extents(
|
|
/*=============================*/
|
|
ulint id); /*!< in: space id */
|
|
/********************************************************************//**
|
|
Reads or writes data. This operation is asynchronous (aio).
|
|
@return DB_SUCCESS, or DB_TABLESPACE_DELETED if we are trying to do
|
|
i/o on a tablespace which does not exist */
|
|
UNIV_INTERN
|
|
ulint
|
|
fil_io(
|
|
/*===*/
|
|
ulint type, /*!< in: OS_FILE_READ or OS_FILE_WRITE,
|
|
ORed to OS_FILE_LOG, if a log i/o
|
|
and ORed to OS_AIO_SIMULATED_WAKE_LATER
|
|
if simulated aio and we want to post a
|
|
batch of i/os; NOTE that a simulated batch
|
|
may introduce hidden chances of deadlocks,
|
|
because i/os are not actually handled until
|
|
all have been posted: use with great
|
|
caution! */
|
|
ibool sync, /*!< in: TRUE if synchronous aio is desired */
|
|
ulint space_id, /*!< in: space id */
|
|
ulint zip_size, /*!< in: compressed page size in bytes;
|
|
0 for uncompressed pages */
|
|
ulint block_offset, /*!< in: offset in number of blocks */
|
|
ulint byte_offset, /*!< in: remainder of offset in bytes; in
|
|
aio this must be divisible by the OS block
|
|
size */
|
|
ulint len, /*!< in: how many bytes to read or write; this
|
|
must not cross a file boundary; in aio this
|
|
must be a block size multiple */
|
|
void* buf, /*!< in/out: buffer where to store read data
|
|
or from where to write; in aio this must be
|
|
appropriately aligned */
|
|
void* message); /*!< in: message for aio handler if non-sync
|
|
aio used, else ignored */
|
|
/**********************************************************************//**
|
|
Waits for an aio operation to complete. This function is used to write the
|
|
handler for completed requests. The aio array of pending requests is divided
|
|
into segments (see os0file.c for more info). The thread specifies which
|
|
segment it wants to wait for. */
|
|
UNIV_INTERN
|
|
void
|
|
fil_aio_wait(
|
|
/*=========*/
|
|
ulint segment); /*!< in: the number of the segment in the aio
|
|
array to wait for */
|
|
/**********************************************************************//**
|
|
Flushes to disk possible writes cached by the OS. If the space does not exist
|
|
or is being dropped, does not do anything. */
|
|
UNIV_INTERN
|
|
void
|
|
fil_flush(
|
|
/*======*/
|
|
ulint space_id); /*!< in: file space id (this can be a group of
|
|
log files or a tablespace of the database) */
|
|
/**********************************************************************//**
|
|
Flushes to disk writes in file spaces of the given type possibly cached by
|
|
the OS. */
|
|
UNIV_INTERN
|
|
void
|
|
fil_flush_file_spaces(
|
|
/*==================*/
|
|
ulint purpose); /*!< in: FIL_TABLESPACE, FIL_LOG */
|
|
/******************************************************************//**
|
|
Checks the consistency of the tablespace cache.
|
|
@return TRUE if ok */
|
|
UNIV_INTERN
|
|
ibool
|
|
fil_validate(void);
|
|
/*==============*/
|
|
/********************************************************************//**
|
|
Returns TRUE if file address is undefined.
|
|
@return TRUE if undefined */
|
|
UNIV_INTERN
|
|
ibool
|
|
fil_addr_is_null(
|
|
/*=============*/
|
|
fil_addr_t addr); /*!< in: address */
|
|
/********************************************************************//**
|
|
Get the predecessor of a file page.
|
|
@return FIL_PAGE_PREV */
|
|
UNIV_INTERN
|
|
ulint
|
|
fil_page_get_prev(
|
|
/*==============*/
|
|
const byte* page); /*!< in: file page */
|
|
/********************************************************************//**
|
|
Get the successor of a file page.
|
|
@return FIL_PAGE_NEXT */
|
|
UNIV_INTERN
|
|
ulint
|
|
fil_page_get_next(
|
|
/*==============*/
|
|
const byte* page); /*!< in: file page */
|
|
/*********************************************************************//**
|
|
Sets the file page type. */
|
|
UNIV_INTERN
|
|
void
|
|
fil_page_set_type(
|
|
/*==============*/
|
|
byte* page, /*!< in/out: file page */
|
|
ulint type); /*!< in: type */
|
|
/*********************************************************************//**
|
|
Gets the file page type.
|
|
@return type; NOTE that if the type has not been written to page, the
|
|
return value not defined */
|
|
UNIV_INTERN
|
|
ulint
|
|
fil_page_get_type(
|
|
/*==============*/
|
|
const byte* page); /*!< in: file page */
|
|
|
|
|
|
typedef struct fil_space_struct fil_space_t;
|
|
|
|
#endif
|