Commit graph

28 commits

Author SHA1 Message Date
marko
1d1dc31a06 branches/zip: Introduce UNIV_INTERN, a linkage specifier for InnoDB-global
symbols.  Use it for all definitions of non-static variables and functions.

lexyy.c, make_flex.sh: Declare yylex as UNIV_INTERN, not static.  It is
referenced from pars0grm.c.

Actually, according to
	nm .libs/ha_innodb.so|grep -w '[ABCE-TVXYZ]'
the following symbols are still global:

* The vtable for class ha_innodb
* pars0grm.c: The function yyparse() and the variables yychar, yylval, yynerrs

The required changes to the Bison-generated file pars0grm.c will be addressed
in a separate commit, which will add a script similar to make_flex.sh.

The class ha_innodb is renamed from class ha_innobase by a #define.  Thus,
there will be no clash with the builtin InnoDB.  However, there will be some
overhead for invoking virtual methods of class ha_innodb.  Ideas for making
the vtable hidden are welcome.  -fvisibility=hidden is not available in GCC 3.
2008-02-06 14:17:36 +00:00
marko
f19db3bbb0 branches/zip: Fix some things to allow InnoDB to be built with smaller
UNIV_PAGE_SIZE than the default 16384.

MEM_BLOCK_STANDARD_SIZE: Cap to MEM_MAX_ALLOC_IN_BUF when UNIV_PAGE_SIZE
is less than 16384.

ha_create_func(): Invoke mem_heap_create_in_btr_search() with
ut_min(4096, MEM_MAX_ALLOC_IN_BUF) instead of 4096.  The memory
will be allocated from the buffer pool, and with UNIV_PAGE_SIZE
defined to 4096, there would not be any space for the mem_heap
data structure overhead.
2007-12-20 21:36:45 +00:00
vasil
5cbf4e3840 branches/zip:
Implement a limit on the memory used by the INNODB_TRX, INNODB_LOCKS and
INNODB_LOCK_WAITS tables. The maximum allowed memory is defined with the
macro TRX_I_S_MEM_LIMIT.

Approved by:	Marko (via IM)
2007-11-16 13:12:13 +00:00
vasil
8dba58e45b branches/zip:
Add const qualifier to the value returned by ha_storage_put().
It must not be changed as this will invalidate the hash.
2007-09-28 13:40:12 +00:00
vasil
92ff5c4790 branches/zip:
Add a type that stores chunks of data in its own storage and avoids
duplicates. Supported methods:

ha_storage_create()
Allocates new storage object.

ha_storage_put()
Copies a given data chunk into the storage and returns pointer to the
copy. If the data chunk is already present, a pointer to the existing
object is returned and the given data chunk is not copied.

ha_storage_empty()
Clears (empties) the storage from all data chunks that are stored in it.

ha_storage_free()
Destroys a storage object. Opposite to ha_storage_create().

Approved by:	Marko
2007-09-24 12:21:29 +00:00
marko
63583d80a7 branches/zip: hash_create(): Remove two unused variables. They should have
been removed in r1752.
2007-08-29 05:48:37 +00:00
vasil
617cbacd07 branches/zip: Use hash_table_clear() to initialize the array instead of
for()-loop.

Suggested by:	Sunny
Approved by:	Marko
2007-08-23 07:01:24 +00:00
marko
88df83bb3b branches/zip: Merge revisions 1402:1493 from trunk.
Remove mysql.patch, because the configuration parameter interface has changed.
2007-05-14 09:07:15 +00:00
marko
5fc003b65d branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. 2007-01-18 18:29:12 +00:00
marko
8f65d7a661 branches/zip: Merge revisions 1165:1206 from trunk. 2007-01-18 12:58:39 +00:00
marko
64ead9c309 branches/zip: Fix errors when compiling with UNIV_DEBUG and UNIV_SYNC_DEBUG.
buf0buf.ic: Remove the extern declaration of buf_dbg_counter.
It was declared static in buf0buf.c in r1025.

ha0ha.c: #include "btr0sea.h" #ifdef UNIV_SYNC_DEBUG.  Assertions on
btr_search_latch were added in r1041.
2006-11-22 13:08:38 +00:00
marko
97c15d9fe5 branches/zip: When shrinking the buffer pool, disable and purge the adaptive
hash index, because it might occupy the chunk we would like to free.

TODO: In btr_search_check_free_space_in_heap(), release the block if
btr_search_latch is not immediately available.

buf_pool_shrink(): Split from buf_pool_resize().

btr_search_disabled: New variable, similar to srv_use_adaptive_hash_indexes
that was removed earlier.

btr_search_disable(): New function: disable and purge the adaptive hash index.

btr_search_enable(): New function: enable the adaptive hash index.

ha_clear(): New function: Empty a hash table and free the memory heaps.
2006-11-21 14:40:14 +00:00
marko
a9ffc8a7fe branches/zip: ha_node_set_data(): Define a wrapper macro, and rename the
function to ha_node_set_data_func().  In this way, the #ifdef in the
callers can be removed.
2006-11-21 10:34:42 +00:00
marko
7d920dbaca branches/zip: Remove some instrumentation and reduce the output of
SHOW MUTEX STATUS in non-debug builds.  (Bug #24386)
2006-11-21 10:09:14 +00:00
marko
8e8719dabe branches/zip: Correct a bug introduced in r1014: Always assign node->block
when assigning node->data.

ha_delete(), ha_search_and_delete_if_found(), ha_remove_all_nodes_to_page():
Remove the parameter buf_block_t* block, now that it is stored within the
hash data structure in debug builds.
2006-11-14 10:42:50 +00:00
marko
51fbf7601c branches/zip: Remove the buf_block_align() calls from ha0ha.c that caused
an assertion failure in debug builds when a context switch occurred in
buf_LRU_search_and_free_block() before the call to
btr_search_drop_page_hash_index() managed to acquire the mutexes again.

ha_node_t: Add the field buf_block_t* block.

ha_search_and_update_if_found(): Rename to ha_search_and_update_if_found_func()
with added buf_block_t* parameter in debug builds.  Define the wrapper macro
ha_search_and_update_if_found() that always takes the buf_block_t* parameter.

ha_insert_for_fold(): Rename to ha_insert_for_fold_func()
with added buf_block_t* parameter in debug builds.  Define the wrapper macro
ha_insert_for_fold() that always takes the buf_block_t* parameter.
2006-11-13 21:53:09 +00:00
marko
e5eb6187b1 branches/zip: ha_delete_hash_node(): Do not call buf_block_align().
Instead, get buf_block_t* as a parameter.

Without this patch, buf_page_hash_get() would return NULL in
buf_block_align().  The function buf_LRU_search_and_free_block()
invokes buf_LRU_block_remove_hashed_page(), which removes the
hash mapping needed by buf_page_hash_get().
2006-10-30 19:46:31 +00:00
marko
bac65733cd branches/zip: Always call buf_block_align() while holding buf_pool->mutex.
This was forgotten from r977.
2006-10-30 16:18:23 +00:00
marko
6ee593b116 branches/zip: Add const qualifiers to read-only pointers.
rec_get_nth_field_offs_old(): Split from rec_get_nth_field_old().

rec_get_nth_field_old(): Reimplement as a constness-preserving macro.

dict_drop_index_tree(), dict_truncate_index_tree(): Note that rec is
an in/out parameter, as the B-tree root page number will be updated.
2006-10-26 08:52:14 +00:00
marko
f8b304727e branches/zip: ha_create(): Remove parameter in_btr_search, which was
passed as TRUE.

Enclose hash_table_t::adaptive and buf_block_t::n_pointers in
#ifdef UNIV_DEBUG.

btr_search_drop_page_hash_index(): Enclose the corruption check
(which depends on buf_block_t::n_pointers) in #ifdef UNIV_DEBUG.
2006-10-18 18:52:04 +00:00
marko
469a27ac2a branches/zip: Replace buf_frame_align() with page_align(), page_offset(),
ut_align_down(), or ut_align_offset().
2006-10-09 16:22:47 +00:00
marko
38e09b2fea branches/zip: Merge revisions 720:765 from trunk and reindent the code
as per revisions r763:765.
2006-08-29 09:30:31 +00:00
marko
5837f75150 branches/zip: Cleanup suggested by Osku.
ut_is_2pow(): New function for testing if a number is zero or a power of two.
Use this function instead of bitwise arithmetics or ut_2_power_up() where
possible.
2006-06-07 11:23:21 +00:00
marko
d30e44bc32 branches/zip: Merge revisions 465:532 from trunk. 2006-05-08 06:18:59 +00:00
marko
747c8fad44 branches/zip: Merge revisions 200:236 from trunk. 2006-02-23 19:25:29 +00:00
marko
dcfc19c47c branches/zip: Merge revisions 79:200 from trunk. 2006-02-17 14:19:39 +00:00
marko
0bf7f4bd1d branches/zip: Merge revisions 9:72 from trunk. 2005-11-29 12:30:46 +00:00
osku
2903c72469 Import 5.0 code. 2005-10-27 07:29:40 +00:00