dict_index_is_unique(): New function.
row_merge_rec_fits_to_block(), row_merge_store_rec_to_block():
Add const qualifiers to rec, offsets.
row_merge_select(): Rename to row_merge_cmp(), simplify the interface.
row_merge_sort_linked_list(): Change the return type to ibool.
Replace sec_offs1,sec_offs2 with offsets1,offsets2. Replace offset_heap
with heap. Define a func_exit label.
row_merge_block_merge(): Reduce the scope of rec_offsets.
Replace byte offsets of type dulint with block offsets of type ulint.
Avoid references to MERGE_BLOCK_SIZE.
Improve the language of some comments.
row_merge_insert_index_tuples(), row_merge_sort_linked_list_in_disk():
Make the offset a ulint.
row_merge_read(), row_merge_write(): Helper functions. Return the
status of os_file_read() and os_file_write(). TO DO: check the status
in the callers.
innobase_create_temporary_tablename(): Add static qualifier. Allocate
the memory from heap. Return a fixed identifier.
ha_innobase::add_index(): Allocate all memory from a single heap.
Simplify error handling. Use a fixed prefix for temporary table names,
because only one add_index() can be active for a given table.
mem_heap_empty_noninline(): New function, to be called from ha_innodb.cc.
row_build_index_for_mysql(): Remove the parameter new_primary.
Move more definitions from row0mysql.h to row0mysql.c. Remove the
unused definition of merge_thread.
merge_index_def_t: Replace merge_index_field_t** with merge_index_field_t*.
Use mem_heap_strdup() when copying strings.
ha_innobase::add_index(): Avoid excessive use of current_thd.
Define the merge_rec_ structures in row0merge.c instead of
row0merge.h. They are not used in the interface defined in row0merge.h.
row_merge_create_file_structure(): Rename to row_merge_file_create().
Input a pointer to a pre-allocated block of memory.
row_merge_read_clustered_index(): Replace merge_file_t** with merge_file_t*.
row_merge_sort_and_insert_thread(): Remove the declaration.
This function was never defined or called.
row_merge_is_index_usable(): Correct the formatting.
row_build_index_for_mysql(): Allocate an array of merge_file_t instead
of an array of pointers to merge_file_t.
ha_innodb.cc: Add the columns COMPRESSED, COMPRESSED_OK, DECOMPRESSED
to INFORMATION_SCHEMA.INNODB_BUDDY.
page_zip_compress_count[], page_zip_compress_ok[]: New statistic counters,
incremented in page_zip_compress().
page_zip_decompress_count[]: New statistic counter,
incremented in page_zip_decompress().
dict_truncate_index_tree(): Add the parameter space for specifying the
new tablespace identifier of a single-table tablespace that has been
recreated. When SYS_INDEXES.PAGE_NO == FIL_NULL, do not abort but
create the index tree.
fil_discard_tablespace(): Pass the return code from fil_delete_tablespace().
row_truncate_table_for_mysql(): Attempt to discard and recreate
single-table tablespaces. Reassign the tablespace identifier both in
the data dictionary (SYS_TABLES and SYS_INDEXES) and in the data
dictionary cache.
Previously, when big_rec was returned, the fields would point to
freed memory. The memory heap was allocated locally, and the data tuple
was allocated from the heap, and the big_rec would point to some fields
in the data tuple.
row_ins_clust_index_entry_by_modify(): Add parameter heap,
for the same reason.
functions.
ut_malloc_low(): Flag the block with UNIV_MEM_ALLOC(). Do not flag the
block with UNIV_MEM_FREE() in ut_free(), because it would cause bogus
Valgrind warnings in the underlying memory allocator.
mem_pool_create(): Flag the data area with UNIV_MEM_FREE().
mem_pool_fill_free_list(): Flag the area header with UNIV_MEM_ALLOC().
mem_area_alloc(): Flag the data area with UNIV_MEM_ALLOC().
mem_area_free(): Flag the data area with UNIV_MEM_FREE().
mem_heap_alloc(): Flag the buffer with UNIV_MEM_ALLOC().
mem_heap_block_free(): Flag the block with UNIV_MEM_FREE().
mem_heap_free_top(): Flag the block with UNIV_MEM_FREE().
for displaying buddy allocator statistics.
buf_buddy_used[], buf_buddy_relocated[]: Declare as global symbols.
mysql_declare_plugin(innobase): Add MYSQL_INFORMATION_SCHEMA_PLUGIN
for innobase_is_buddy ("INNODB_BUDDY").
page_zip_max_ins_size(): New function.
btr_cur_optimistic_insert(), btr_cur_optimistic_delete(),
btr_page_split_and_insert(), btr_compress(): Do not update the
ibuf free bits for non-leaf pages or pages belonging to a clustered index.
The insert buffer only covers operations on leaf pages of secondary indexes.
For pages covered by the insert buffer, limit the max_ins_size to
page_zip_max_ins_size().
buf_page_get_gen(): Merge the insert buffer after decompressing the page.
buf_page_io_complete(): Relax the assertion about ibuf_count. For
compressed-only pages, the insert buffer merge takes place
in buf_page_get_gen().
ibuf_index_page_calc_free_bits(), ibuf_index_page_calc_free_from_bits(),
ibuf_index_page_calc_free(), ibuf_update_free_bits_if_full(),
ibuf_update_free_bits_low(), ibuf_update_free_bits_for_two_pages_low(),
ibuf_set_free_bits_low(): Add the parameter zip_size. Limit the maximum
insert size to page_zip_max_ins_size().
buf_buddy_alloc() until after the block has been found not to exist
in the buffer pool.
buf_buddy_alloc(), buf_buddy_alloc_low(): Make lru an output parameter.
Improve documentation.
buf_page_init_for_read(): Simplify the code. Check buf_page_hash_get()
again if buf_buddy_alloc() released buf_pool->mutex.
frame when reading compressed pages, unless crash recovery is in progress.
buf_page_read_low(): Adapt for buf_page_init_for_read() returning
buf_page_t* instead of buf_block_t*.
but in buf_page_get_gen(). Adjust comments. This prevents
unnecessary decompression in read-ahead when the compressed block
exists in the buffer pool.
If the block does not exist in the buffer pool, read-ahead will still
allocate an uncompressed page and decompress the block.
Move buf_block_init_low() and buf_zip_decompress() earlier in the file,
because some compilers are unable to inline functions that are defined
after the invocation.
buf_page_get_gen(): Decompress the block if needed.
buf_page_init_for_read(): Do not decompress.
by adding the REC_OFFS_EXTERNAL flag to rec_offs_base(offsets)[0].
This reduces the processor usage of page_zip_write_rec() by about 40%
in one test case. The code could be sped up further by testing
rec_offs_any_extern() outside of loops that check rec_offs_nth_extern().
The vast majority of records does not contain any externally stored columns.
page_cur_insert_rec_zip_reorg(): New function: Recompress or
reorganize a compressed page.
page_cur_insert_rec_zip(): New function: insert a record to
a compressed page.
page_cur_insert_rec_low(): Only handle inserts to uncompressed pages.
trx_undo_page_report_modify(), trx_undo_report_row_operation():
Add const qualifier to the parameter rec. Remove some local variables.
trx_undo_report_row_operation(): Invoke rec_get_offsets() only once.
to tables.
dict_mem_table_add_col(): Add the parameter "heap" for temporary memory
allocation. Allow it and "name" to be NULL. These parameters are NULL
when creating dummy indexes.
dict_add_col_name(): Remove calls to ut_malloc() and ut_free().
dict_table_get_col_name(): Allow table->col_names to be NULL.
dict_table_add_system_columns(), dict_table_add_to_cache():
Add the parameter "heap".
page_zip_set_alloc(): New function, to configure zlib to use a memory heap.
btr_store_big_rec_extern_fields(): Reduce memLevel, so that a heap of
256 kilobytes will suffice. Use page_zip_set_alloc().
btr_copy_externally_stored_field_prefix_low(): Use page_zip_set_alloc().
page_zip_compress(), page_zip_decompress(): Use page_zip_set_alloc().
of HASH_DELETE().
HASH_ASSERT_VALID(), HASH_INVALIDATE(): New macros, used in HASH_DELETE()
and HASH_SEARCH().
buf_page_init_low(): Add HASH_INVALIDATE(bpage, hash);
buf_page_init(): Call buf_page_init_low() before HASH_INSERT(), so that
bpage->hash will not be invalidated.
uncompressed page frames.
buf_page_get_zip(), buf_page_release_zip(): New functions, used
by btr_copy_zblob_prefix().
btr_copy_zblob_prefix(): Do not call inflateEnd().
buf_page_get_gen(). This saves one mutex operation per block request.
buf_page_get_gen(), various macros and functions: Add parameter zip_size.
btr_node_ptr_get_child(): Add parameter index.
fil_space_get_latch(): Add optional output parameter zip_size.
fil_space_get_zip_size(): Return 0 for space id==0, because the
system tablespace is never compressed.
fsp_header_init(): Remove the parameter zip_size.
ibuf_free_excess_pages(): Remove the parameter zip_size.
trx_rseg_t, trx_undo_t: Add field zip_size.
xdes_lst_get_next(): Remove, unused.
page checksum of compressed-only blocks. Pass the compressed page frame
to fil_io() when needed.
page_zip_calc_checksum(): Skip also FIL_PAGE_LSN and FIL_PAGE_FILE_FLUSH_LSN.
buf_flush_init_for_writing(): Expect page to be non-NULL.
and to be flushed to disk.
buf_LRU_free_block(): Enable the freeing of uncompressed pages of
compressed tablespaces.
trx_doublewrite->buf_block_arr[]: Change the type from buf_block_t*
to buf_page_t*.
buf_flush_ready_for_flush(): Add debug assertion.
buf_flush_buffered_writes(), buf_flush_try_page(): Support blocks of type
BUF_BLOCK_ZIP_DIRTY.
buf_flush_post_to_doublewrite_buf(), buf_flush_write_block_low():
Change the type of the parameter from buf_block_t* to buf_page_t*.
buf_flush_init_for_writing(): Allow page to be NULL if page_zip_ is non-NULL.
UNIV_MEM_FREE(): Declare a memory area free.
UNIV_MEM_ALLOC(): Declare a memory area allocated (but uninitialized).
UNIV_MEM_DESC(): Associate a memory area with a control block.
UNIV_MEM_UNDESC(): Unassociate a control block.
trx_sys_create_doublewrite_buf(): Clear the buffer with memset().
buf_page_init(): Add a bogus UNIV_MEM_VALID(block->frame) to silence
valid warnings about InnoDB data pages containing uninitialized data.
buf_LRU_get_free_only(): Add UNIV_MEM_ALLOC(block->frame).
buf_LRU_get_free_block(): Add UNIV_MEM_DESC(block->page.zip.data, block).
buf_LRU_free_block(): Add UNIV_MEM_DESC(b->zip.data, b) when allocating
a compressed-only control block for a compressed page.
buf_LRU_block_free_non_file_page(): Replace UNIV_MEM_INVALID() with
UNIV_MEM_FREE().
buf_LRU_block_remove_hashed_page(): Add UNIV_MEM_UNDESC(bpage) when
deallocating a compressed-only control block. Add
UNIV_MEM_INVALID(block->frame). (The frame should be flagged free
by buf_LRU_block_free_non_file_page() moments later.)
buf0buddy.c: Disable some extra checks in Valgrind-instrumented builds.
Add UNIV_MEM_VALID(), UNIV_MEM_INVALID(), UNIV_MEM_FREE(), UNIV_MEM_ALLOC()
as necessary.
and add compressed-only pages to buf_pool->page_hash.
BUF_POOL_ZIP_FOLD(), BUF_POOL_ZIP_FOLD_PTR(), BUF_POOL_ZIP_FOLD_BPAGE():
Macros for computing buf_pool->zip_hash fold values. Make use of these
in buf0buddy.c.
buf0buddy.c: Replace some ptr == ut_align_down(ptr, ...) in assertions with
!ut_align_offset(ptr, ...).