Commit graph

1209 commits

Author SHA1 Message Date
marko
db0d73fe6f branches/innodb+: Add posix_fadvise() caching hints to the temporary files
that are used in merge sort when creating indexes.
2008-03-03 10:27:57 +00:00
marko
5cf58ce919 branches/innodb+: Merge revisions 2322:2340 from branches/zip 2008-03-03 10:25:27 +00:00
sunny
a8824182b8 branches/innodb+: Port red-black tree code from branches/fts:r2283 2008-02-27 10:28:20 +00:00
sunny
fceb78e698 branches/innodb+: Delete buffer port from branches/fts:r2283 2008-02-27 07:03:34 +00:00
sunny
57fc43166d branches/innodb+: Merge revisions 2315:2322 from branches/zip 2008-02-27 06:50:51 +00:00
vasil
fb30a2032b branches/innodb+:
Fix Bug#25640:

Introduce an user visible parameter innodb_stats_sample (default 8,
min 1, max 1000) and use that parameter instead of the
BTR_KEY_VAL_ESTIMATE_N_PAGES macro. Remove this macro.

Approved by:	Heikki
2008-02-19 14:21:05 +00:00
marko
5ad9e41b91 branches/innodb+: Copy from branches/zip r2315. 2008-02-18 20:09:38 +00:00
marko
36a5b2cd37 branches/zip: Merge 2263:2295 from branches/5.1. 2008-02-18 20:09:03 +00:00
marko
c31fb8dad9 branches/zip: Remove the unused function os_thread_join(). 2008-02-18 19:14:09 +00:00
marko
b48d0c64e2 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
bddb5a0cca 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
9966023451 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
da54bec75b 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
6aa400bee4 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
7a41306bc5 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
060a95bea6 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
9d02d912a7 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
03adfb2fad 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
17127565dd 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
b2274cb5e1 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
7b538bb8ea 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
388af7a7bb 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
9194c3a9e6 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
775fd54ddb 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
4d1a1c2347 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
00fdbcc019 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
marko
345422f65b branches/zip: scripts/dynconfig: Correct misleading usage message.
At present, the script only accepts one command line parameter.
Append newline to some die messages, so that the Perl interpreter
will not print the file name and line number of the failing statement.
2008-02-08 12:31:13 +00:00
marko
2c521319f2 branches/zip: Remove innodb_redefine.h and all references to it. The
file has been redundant since r2278.

include/innodb_redefine.h: Remove.

include/sync0sync.h: Remove the definition of mutex_free that was added
because of innodb_redefine.h.

include/univ.i: Remove references to innodb_redefine.h.  Explain why
the C++ classes need to be renamed.

scripts/build-plugin.sh: Build InnoDB only once.  The file
innodb_redefine.h is no longer needed.
2008-02-08 12:23:17 +00:00
marko
70a539b087 branches/zip: scripts/dynconfig: Minor cleanup (spelling and formatting). 2008-02-08 12:18:06 +00:00
marko
23961f575e branches/zip: trx_sys_doublewrite_init_or_restore_pages(): Print out the
space identifier in the corruption message.
2008-02-08 10:22:47 +00:00
inaam
044e405df0 branches/zip:
srv_log_file_size is misspelled as srv_log_filen_size in r2276

reviewed by: non-functional change.
2008-02-07 20:12:11 +00:00
marko
c5c5fdc535 branches/zip: make_flex.sh, lexyy.c: Remove some GCC warnings about unused
static symbol definitions.

yy_scan_buffer, yy_scan_string, yy_scan_bytes: Leave these unused extern
function declarations alone.

yypush_buffer_state, yypop_buffer_state, yyswitch_to_buffer, yyget*, yyset*,
yylex_destroy: Add __attribute__((unused)).

This closes Mantis issue #8.
2008-02-07 10:03:54 +00:00
marko
3ab0d2d14a branches/zip: trx_undo_prev_version_build(): Remove a bogus warning
about undo_rec possibly being uninitialized.  When trx_undo_get_undo_rec()
leaves undo_rec uninitialized, both functions will return DB_MISSING_HISTORY
without dereferencing undo_rec.

This closes Mantis issue #7.
2008-02-07 09:08:28 +00:00
marko
468d425d53 branches/zip: Hide some global variables that were accidentally not hidden
in r2276.  Now the following symbols will be exported when InnoDB is built
as a dynamic plugin:

* the virtual method pointer table of class ha_innodb
* the three variables that MySQL will reference when linking at runtime:

	_mysql_plugin_declarations_
	_mysql_plugin_interface_version_
	_mysql_sizeof_struct_st_plugin_

Furthermore, the following symbols are weak globals, to allow us to access
the built-in InnoDB in the mysqld executable, in case it contains a statically
linked InnoDB:

	builtin_innobase_plugin
	innodb_hton_ptr
2008-02-06 16:11:46 +00:00
marko
fe5e0b7245 branches/zip: Make the changes to pars0grm.c that were promised in r2276.
pars/pars0grm.h: Remove.  The primary file is include/pars0grm.h.

pars/make_bison.sh: Add from trunk.  Somehow, this file was not merged
at the same time with make_flex.sh.  Add sed magic for replacing the
file name and for hiding yychars, yynerrs, yylval, and yyparse.

pars/pars0grm.c: Apply the changes made by make_bison.sh.
2008-02-06 16:01:57 +00:00
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
891074b0c4 branches/zip: Make static all declarations in the Flex-generated
lexical analyzer of the InnoDB SQL parser.
2008-02-06 13:14:42 +00:00
marko
dc7d5448a0 branches/zip: Remove unused definitions from include/trx0xa.h. 2008-02-06 08:19:56 +00:00
marko
c9087d7d90 branches/zip: Apply some fixes suggested by Heikki.
btr_cur_pessimistic_update(): Note why the externally stored columns
of a record on a latched page cannot have been purged.

trx_undo_get_undo_rec(): Clarify that the stack of versions is locked
all the way down to the purge view.

trx_undo_prev_version_build(): Set *old_vers = NULL also when the record
could have been purged already.  Add some clarifying comments.
2008-02-04 12:47:00 +00:00
marko
efc7639dac row_merge_buf_add(): Add a missing const qualifier to "ext". 2008-01-30 21:15:41 +00:00
vasil
c80d5da05e branches/zip:
Require PROCESS privileges instead of SUPER to view INFORMATION_SCHEMA tables.

Suggested by:	Sergei Golubchik <serg@mysql.com> (in a private email,
		pointed http://bugs.mysql.com/32710)
2008-01-29 09:54:46 +00:00
marko
3e4b5e287b branches/zip: Merge 2236:2263 from branches/5.1. 2008-01-28 15:54:46 +00:00
marko
993c02cf04 branches/zip: Assert in the adaptive hash that the insert buffer B-tree
is not indexed.

btr_search_update_hash_ref(), btr_search_drop_page_hash_index(),
btr_search_build_page_hash_index(), btr_search_update_hash_on_delete(),
btr_search_update_hash_node_on_insert(), btr_search_update_hash_on_insert(),
btr_search_validate():
Assert that hashed blocks do not belong to the insert buffer tree.

btr_search_move_or_delete_hash_entries():
When invoked on the insert buffer tree, assert that neither block is hashed.
2008-01-25 14:37:11 +00:00
marko
e1e958d444 branches/zip: Fast index creation: Release locks on system tables before
creating indexes.  Lock the user table inside the user transaction.

enum trx_dict_op: Remove TRX_OP_INDEX_MAY_WAIT.

ha_innobase::add_index(): Lock the user tables within prebuilt->trx.
Commit the data dictionary transaction before creating indexes.

ha_innobase::final_drop_index(): Lock the user table within prebuilt->trx.
2008-01-25 14:26:07 +00:00
marko
0a63ed9c4e branches/zip: Introduce the accessor function dict_index_is_ibuf()
for determining if an index is the insert buffer B-tree.
2008-01-25 08:13:12 +00:00
marko
aca23dda60 branches/zip: row_sel_sec_rec_is_for_clust_rec(): If the record in the
clustered index is delete-marked, return FALSE without comparing any columns.
2008-01-24 09:58:03 +00:00
marko
8958f06278 branches/zip: Introduce the page type code FIL_PAGE_TYPE_ZBLOB2 for
continuation pages containing compressed BLOBs.  The first compressed
BLOB page will be of type FIL_PAGE_TYPE_ZBLOB.
2008-01-24 08:12:02 +00:00
marko
b52a30e09d branches/zip: When storing a longer prefix of an externally stored column
to the undo log, also store the original length of the column, so that the
changes will be correctly undone in transaction rollback or when fetching
previous versions of the row.

innodb-zip.test: New file, for tests of the compression.

upd_field_t: Add orig_len, the original length of new_val.

btr_push_update_extern_fields(): Restore the original prefix of the column.
Add the parameter heap where memory will be allocated if necessary.

trx_undo_rec_get_col_val(): Add the output parameter orig_len.

trx_undo_page_report_modify_ext(): New function: Write an externally
stored column to the undo log.  This is only called from
trx_undo_page_report_modify(), and this is the only caller of
trx_undo_page_fetch_ext().

trx_undo_update_rec_get_update(): Read the original length of the column
prefix to upd_field->orig_len.
2008-01-23 13:46:45 +00:00
vasil
5ee41a15d0 branches/zip:
Include univ.i in mysql_addons.h because univ.i includes innodb_redefine.h
which is needed to rename the functions in this file with ibd_ prefix in
the dynamic InnoDB plugin. Aka the renaming magic, required for the dynamic
plugin to work.

Approved by:	Marko
2008-01-23 09:38:23 +00:00
inaam
5c087094e3 branches/zip:
Cast to  ib_uint64_t the mask for align down before doing the '~' operation on it.

Reviewed by: Heikki
2008-01-22 18:50:44 +00:00