Commit graph

1083 commits

Author SHA1 Message Date
marko
a669361818 innodb-zip.test: Now that innodb_file_per_table is a settable variable
as of r2355, remove the special startup options innodb-zip-master.opt
and set the variable in innodb-zip.test instead.
2008-03-07 14:10:08 +00:00
marko
c853494ea2 branches/zip: Make innodb_file_per_table a settable global variable.
There is one consideration: fil_init() chooses the tablespace hash size
based on the initial value of srv_file_per_table.  However, this is nothing
new: InnoDB could be started with innodb_file_per_table=0 even though
*.ibd files exist.

srv_file_per_table: Declare as my_bool instead of ibool, because
MYSQL_SYSVAR_BOOL() expects a pointer to my_bool.  Document the
variable also in srv0srv.h.

innobase_start_or_create_for_mysql(): Note why it is OK to temporarily
clear srv_file_per_table.

innobase_file_per_table: Remove.
2008-03-07 12:56:52 +00:00
marko
71d8314d4d branches/zip: fseg_print(): Enclose inside #ifdef UNIV_BTR_PRINT. 2008-03-06 12:29:16 +00:00
marko
f104c5fabe branches/zip: Implement ut_calc_align() and ut_calc_align_down() as
type-independent macros.
2008-03-05 13:17:13 +00:00
marko
30e94affc3 branches/zip: fsp_header_get_free_limit(), fsp_header_get_tablespace_size():
Remove the redundant parameter "space".
2008-03-05 12:40:29 +00:00
marko
583ce8e896 branches/zip: Fix two more bogus MSVC C4090 warnings on constness differences
(Warning C4090 is incorrectly issued when using Visual C++ .NET 2003,
bug 101661, http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=101661)

dict_table_find_equivalent_index(): Cast away constness in the mem_free()
call.  MSVC seems to think that an array of pointers to const data is
const itself.

UT_SORT_FUNCTION_BODY(): Cast away constness in the memcpy() call.
MSVC seems to think that an array of pointers to const data is const itself.
2008-03-05 09:54:48 +00:00
marko
09da651894 branches/zip: ut_is_2pow(), ut_2pow_round(), ut_2pow_remainder(): Define
as type-independent macros instead of functions.  Because ut_2pow_round()
and ut_2pow_remainder() no longer assert ut_is_2pow(m), add the assertions
to callers when needed.  Also add parentheses to assist the compiler in
common subexpression elimination.
2008-03-05 09:41:51 +00:00
marko
6227278c20 branches/zip: buf_read_ahead_random(), buf_read_ahead_linear():
Compute BUF_READ_AHEAD_RANDOM_AREA and BUF_READ_AHEAD_LINEAR_AREA
only once.  The definition of BUF_READ_AHEAD_AREA depends on
buf_pool->curr_size, which could change while this code is running.
2008-03-05 09:16:40 +00:00
marko
e32628b41c branches/zip: buf_flush_try_neighbors(): Compute buf_flush_area only
once and assign it to an auxiliary variable.
2008-03-05 08:36:16 +00:00
marko
99b93f4da1 branches/zip: Fix most MSVC (Windows) compilation warnings.
lock_get_table(), locks_row_eq_lock(), buf_page_get_mutex(): Add return
after ut_error.  On Windows, ut_error is not declared as "noreturn".

Add explicit type casts when assigning ulint to byte to get rid of
"possible loss of precision" warnings.

struct i_s_table_cache_struct: Declare rows_used, rows_allocd as ulint
instead of ullint.  32 bits should be enough.

fill_innodb_trx_from_cache(), i_s_zip_fill_low(): Cast 64-bit unsigned
integers to longlong when calling Field::store(longlong, bool is_unsigned).
Otherwise, the compiler would implicitly convert them to double and
invoke Field::store(double) instead.

recv_truncate_group(), recv_copy_group(), recv_calc_lsn_on_data_add():
Cast ib_uint64_t expressions to ulint to get rid of "possible loss of
precision" warnings.  (There should not be any loss of precision in
these cases.)

log_close(), log_checkpoint_margin(): Declare some variables as ib_uint64_t
instead of ulint, so that there won't be any potential loss of precision.

mach_write_ull(): Cast the second argument of mach_write_to_4() to ulint.

OS_FILE_FROM_FD(): Cast the return value of _get_osfhandle() to HANDLE.

row_merge_dict_table_get_index(): Cast the parameter of mem_free() to (void*)
in order to get rid of the bogus MSVC warning C4090, which has been reported
as MSVC bug 101661:
<http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=101661>

row_mysql_read_blob_ref(): To get rid of a bogus MSVC warning C4090,
drop a const qualifier.
2008-03-04 08:57:07 +00:00
marko
9d58e3ff99 branches/zip: Improve the LRU algorithm with a separate unzip_LRU list of
blocks that contains uncompressed and compressed frames.  This patch was
designed by Heikki and Inaam, implemented by Inaam, and refined and reviewed
by Marko and Sunny.

buf_buddy_n_frames, buf_buddy_min_n_frames, buf_buddy_max_n_frames: Remove.

buf_page_belongs_to_unzip_LRU(): New predicate:
bpage->zip.data && buf_page_get_state(bpage) == BUF_BLOCK_FILE_PAGE.

buf_pool_t, buf_block_t: Add the linked list unzip_LRU.  A block in the
regular LRU list is in unzip_LRU iff buf_page_belongs_to_unzip_LRU() holds.

buf_LRU_free_block(): Add a third return value to refine the case
"cannot free the block".

buf_LRU_search_and_free_block(): Update the documentation to reflect the
implementation.

buf_LRU_stat_t, buf_LRU_stat_cur, buf_LRU_stat_sum, buf_LRU_stat_arr[]:
Statistics for the unzip_LRU algorithm.

buf_LRU_stat_update(): New function: Update the statistics.  Called once
per second by srv_error_monitor_thread().

buf_LRU_validate(): Validate the unzip_LRU list as well.

buf_LRU_evict_from_unzip_LRU(): New predicate: Use the unzip_LRU before
falling back to the regular LRU?

buf_LRU_free_from_unzip_LRU_list(), buf_LRU_free_from_common_LRU_list():
Subfunctions of buf_LRU_search_and_free_block().

buf_LRU_search_and_free_block(): Reimplement.  Try to evict an uncompressed
page from the unzip_LRU list before falling back to evicting an entire block
from the common LRU list.

buf_unzip_LRU_remove_block_if_needed(): New function.

buf_unzip_LRU_add_block(): New function: Add a block to the unzip_LRU list.
2008-03-03 12:48:38 +00:00
calvin
149298b7ac branches/zip: row_raw_format_str_convert(): Rename to
innobase_raw_format(), move the definition from row0row.c to 
ha_innodb.cc. After this change, row0row.c no longer references 
system_charset_info (Mantis issue #17). Patch prepared by Vasil, 
tested by Calvin, and reviewed by Marko.
2008-02-29 23:37:15 +00:00
calvin
1ce87763d5 branches/zip: Fix the compile errors in btr/btr0cur.c for Windows
build. It is part of Mantis issue#18. Reviewed by Marko.
2008-02-29 23:32:00 +00:00
calvin
3f0a923192 branches/zip: Remove PAGE_WRITECOMBINE from VirtualAlloc() in
os_mem_alloc_large(). Otherwise the allocation fails during startup 
with error code 87 - invalid parameter. Reviewed by Marko.
2008-02-29 23:24:27 +00:00
calvin
6be1195663 branches/zip: Exclude mman.h on Windows since it is not supported on
Windows. Reviewed by Marko.
2008-02-29 23:18:46 +00:00
marko
befacd1a44 branches/zip: Update CMakeLists.txt to correspond to Makefile.am.
Add CMake-generated files and directories to svn:ignore.  This patch
is from Calvin Sun, who couldn't commit it properly on Windows.

Do "svn propset svn:eol-style native" on every text file, to fix
line format problems on Windows.
2008-02-29 21:45:22 +00:00
marko
3fd65809a7 branches/zip: buf_buddy_alloc(), buf_buddy_alloc_low(): Correct a mistake
in the function comment.  There is no value BUF_BUDDY_USE_LRU.  The mistake
was made in r1290.
2008-02-29 12:30:41 +00:00
marko
d8759fd52e branches/zip: buf_buddy_alloc_clean(): Remove, as it violates the LRU policy. 2008-02-29 08:32:14 +00:00
marko
f7595d4278 branches/zip: buf_relocate(): Document and assert that bpage must be
in one of the states BUF_BLOCK_ZIP_DIRTY or BUF_BLOCK_ZIP_PAGE.
Note that the caller will have to relocate bpage->list.
2008-02-29 08:20:17 +00:00
marko
f03b5fad7b branches/zip: Replace __attribute with __attribute. 2008-02-29 08:13:55 +00:00
marko
76247bf3b6 branches/zip: row_create_table_for_mysql(): Always roll back the transaction
when creating the table fails.
2008-02-28 11:49:37 +00:00
marko
23fed79ebb branches/zip: ha_innobase::add_index(): Always commit prebuilt->trx,
also when row_merge_create_temporary_table() fails.  Otherwise, an
assertion would fail when the client connection is closed, because
prebuilt->trx would still be holding a table lock on innodb_table.
2008-02-28 11:46:51 +00:00
marko
42db7f1780 branches/zip: os_file_set_nocache(): Clean up the function comment.
Add the function prototype to os0file.h.
2008-02-28 10:28:56 +00:00
marko
997de88df6 branches/zip: dict0dict.c: Add the #include "ha_prototypes.h" that should
have been added in r2327.
2008-02-28 08:33:19 +00:00
vasil
26402257da branches/zip:
Use innobase_strcasecmp() insteaed of strcasecmp() in i_s.cc and get rid
of strings.h (that file is not present on Windows).

Move the prototype of innobase_strcasecmp() from ha_innodb.cc and
dict0dict.c to ha_prototypes.h.

Approved by:	Heikki
2008-02-27 16:53:56 +00:00
marko
5377a7dd94 branches/zip: Add duration statistics to INFORMATION_SCHEMA.INNODB_ZIP.
buf_buddy_relocated_duration[],
page_zip_compress_duration[]
page_zip_decompress_duration[]: Record the total duration of the operations.

buf_buddy_relocate(), page_zip_compress(), page_zip_decompress():
Add ut_time_us() instrumentation.

i_s_zip_fields_info[], i_s_zip_fill_low(): Move the columns containing
cumulated statistics last.  Add relocated_usec, compressed_usec, and
decompressed_usec.
2008-02-27 14:34:44 +00:00
marko
567abed2ca branches/zip: ibuf_update_free_bits_zip(): When after==0, call
buf_page_make_young(), like ibuf_update_free_bits_if_full() does.
This difference was pointed out by Sunny.
2008-02-25 14:01:15 +00:00
marko
c9d6c5acec branches/zip: enum db_err: Use the same InnoDB error numbers as the #defines
in earlier versions of InnoDB.
2008-02-25 12:41:54 +00:00
marko
d18f396b04 Do not enable page_zip_compress_log by default. This was accidentally
set in r2318.
2008-02-22 21:03:31 +00:00
marko
287e5da3ef branches/zip: Add the column "free" to INNODB_ZIP and INNODB_ZIP_RESET
to display the external fragmentation within the buddy allocator.
2008-02-21 13:43:40 +00:00
marko
2d88188caf branches/zip: Enable excessive binary logging of page_zip_compress(),
for the purpose of comparing different compression algorithms.

PAGE_ZIP_COMPRESS_DBG: New preprocessor condition, to see if deflate()
is wrapped.

page_zip_compress_log: Log file counter.  If set to nonzero, logging
is enabled.

page_zip_compress_deflate(): Add the parameter logfile.

FILE_LOGFILE, LOGFILE: Macros for declaring and passing the parameter logfile.

page_zip_compress(): Open and close the logfile if needed.  Write the
uncompressed page and the size of the compressed data.  The data passed
to deflate() is written by the wrapper page_zip_compress_deflate().
2008-02-19 14:42:52 +00:00
marko
cdba733fb5 branches/zip: Merge 2263:2295 from branches/5.1. 2008-02-18 20:09:03 +00:00
marko
ab10478ca4 branches/zip: Remove the unused function os_thread_join(). 2008-02-18 19:14:09 +00:00
marko
ff18e182aa branches/zip: trx_undo_prev_version_build(): Remove the unnecessary
and incorrect "BLOB bug fix" that was suggested by Heikki.  Explain in
a comment why no such fix is needed.
2008-02-18 18:57:24 +00:00
marko
788650088b branches/zip: Add a UNIV_INTERN qualifier to every global function declaration
in *.h files, so that the function signatures in the *.h and *.c files fully
match each other.

ut_dulint_sort(): Add a UNIV_INTERN qualifier also to the function definition.
2008-02-18 18:38:33 +00:00
marko
409fcc594f branches/zip: Minor fixes.
lock_rec_restore_from_page_infimum(): Correct the comment of the parameter rec.

lock_sec_rec_read_check_and_lock(): Add the debug assertion
ut_ad(mode == LOCK_X || mode == LOCK_S).
2008-02-18 15:45:17 +00:00
marko
aca7dcbeaa branches/zip: Minor fixes.
buf_LRU_old_adjust_len(): Replace a constant ut_ad() with a preprocessor check.

buf_LRU_free_block(): Remove the check for the unlikely case
buf_pool->LRU_old == prev_b in order to simplify the function.
The check was implemented as part of r2306.
2008-02-18 15:43:16 +00:00
marko
a62d027d6d branches/zip: trx_undo_prev_version_build(): Remove the fix that was
suggested by Heikki, because it breaks row_vers_impl_x_locked_off_kernel();
see Mantis issue #10.

However, now that Heikki's fix has been removed, the code may break elsewhere
when it tries to dereference half-freed or completely freed externally
stored columns.
2008-02-18 15:35:00 +00:00
marko
0b23b9baf2 branches/zip: Minor improvements.
lock_update_delete(): Add the debug assertion ut_ad(page == page_align(rec)).

lock_rec_insert_check_and_lock(): Determine next_rec_heap_no before
acquiring the kernel mutex.  Require the table to be at least S-locked
in fast index creation.
2008-02-18 09:53:08 +00:00
marko
d917b27aa8 branches/zip: buf_LRU_free_block(): When freeing the uncompressed page
corresponding to a compressed page, do not flag the block as recently
used, but maintain the position of the control block on the LRU list.
2008-02-16 10:33:15 +00:00
marko
e357b22e04 branches/zip: lock0lock.c: Minor cleanup.
lock_rec_get_first(): Use a simple for loop.

lock_rec_copy(): Use mem_heap_dup().

lock_rec_find_similar_on_page(): Add const qualifier to trx.

lock_move_rec_list_end(), lock_move_rec_list_start(): Simplify the
memcmp() assertion on ROW_FORMAT=REDUNDANT records.
2008-02-15 14:16:27 +00:00
marko
be47135f4b branches/zip: lock_rec_other_has_expl_req(): Minor cleanup: add const
qualifier to parameter, and fix the formatting of a comment.
2008-02-15 13:03:12 +00:00
marko
9b9dad7bca branches/zip: buf0lru.c: Minor cleanup.
Use ut_d() in assignments to bpage->in_LRU_list instead of #ifdef UNIV_DEBUG.

buf_LRU_remove_block(): Move an assertion to a more appropriate place.
2008-02-15 11:45:37 +00:00
marko
348dd7400e branches/zip: lock_rec_add_to_queue(): Improve the debug diagnostics.
Make it easier to display the violating lock request in a debugger.
2008-02-15 11:38:21 +00:00
marko
ab8b2a144a branches/zip: buf_buddy_alloc_from(): Relax a debug assertion that fails
on i==j==BUF_BUDDY_SIZES.
2008-02-15 10:07:42 +00:00
marko
1b08adefdb branches/zip: Minor cleanup of fast index creation diagnostics.
innobase_check_index_keys(): Remove unused parameters.  Use
sql_print_error() for error message output.

ha_innobase::add_index(): When row_merge_rename_tables() fails, do not
allow row_merge_drop_table() to alter the error code returned to MySQL.
2008-02-13 20:18:00 +00:00
marko
06afa81ee1 branches/zip: Pass -prefer-non-pic only on IA-32 (x86) when building
the dynamic InnoDB plugin, ha_innodb.so.  This libtool option cannot
be used on every target platform.  For instance, the AMD64 (x86_64) ABI
mandates position-independent code (PIC) in dynamic shared objects.

Makefile.am: Use $(INNODB_CFLAGS) and $(INNODB_DYNAMIC_CFLAGS) in
target-specific CFLAGS and CXXFLAGS variable definitions.

plug.in: Instead of appending to the MySQL-wide CFLAGS, introduce
the variables INNODB_CFLAGS and INNODB_DYNAMIC_CFLAGS.  Depending on
$target_cpu, append -prefer-non-pic to INNODB_DYNAMIC_CFLAGS.
2008-02-12 22:05:01 +00:00
marko
2f11741b2c branches/zip: Makefile.am: Disable the generation of
position-independent code in the compilation of ha_innodb.so.

ha_innodb_la_CXXFLAGS, ha_innodb_la_CFLAGS: Add -prefer-non-pic.
This flag is interpreted by the ../../libtool script that acts
as a front-end to the compiler and linker.
2008-02-11 10:31:55 +00:00
marko
03e3cbc46a branches/zip: Add the necessary #include "univ.i" that was removed in the
unapproved change r2290.
2008-02-08 13:50:28 +00:00
vasil
ec691ea874 branches/zip:
Do not include univ.i in mysql_addons.h, it was included for the sole
purpose of innodb_redefine.h to work and now innodb_redefine.h has been
removed. See r2251 and r2288.
2008-02-08 13:19:56 +00:00