Commit graph

266 commits

Author SHA1 Message Date
marko
82cfb40dab branches/innodb+: Merge revisions 3544:3575 from branches/zip:
------------------------------------------------------------------------
  r3572 | marko | 2008-12-17 11:19:56 +0200 (Wed, 17 Dec 2008) | 3 lines
  Changed paths:
     M /branches/zip/ChangeLog
     M /branches/zip/btr/btr0sea.c
     M /branches/zip/buf/buf0buf.c
     M /branches/zip/buf/buf0lru.c
     M /branches/zip/ha/ha0ha.c
     M /branches/zip/ha/hash0hash.c
     M /branches/zip/include/buf0buf.h
     M /branches/zip/include/ha0ha.h
     M /branches/zip/include/ha0ha.ic
     M /branches/zip/include/hash0hash.h
     M /branches/zip/include/univ.i

  branches/zip: Introduce UNIV_AHI_DEBUG for debugging the adaptive hash
  index without enabling UNIV_DEBUG.
  ------------------------------------------------------------------------
  r3574 | marko | 2008-12-17 12:44:31 +0200 (Wed, 17 Dec 2008) | 2 lines
  Changed paths:
     M /branches/zip/ChangeLog

  branches/zip: ChangeLog: Document recent changes that were not included in
  InnoDB Plugin 1.0.2, except changes to source code comments.
  ------------------------------------------------------------------------
  r3575 | marko | 2008-12-17 14:40:58 +0200 (Wed, 17 Dec 2008) | 12 lines
  Changed paths:
     M /branches/zip/ChangeLog
     M /branches/zip/include/row0sel.h
     M /branches/zip/include/row0upd.h
     M /branches/zip/pars/pars0pars.c
     M /branches/zip/row/row0mysql.c
     M /branches/zip/row/row0sel.c
     M /branches/zip/row/row0upd.c

  branches/zip: Remove update-in-place-in-select from the internal SQL
  interpreter.  It was only used for updating the InnoDB internal data
  dictionary when renaming or dropping tables.  It could have caused
  deadlocks after acquiring latches on insert buffer bitmap pages.
  This and r3544 should fix Issue #135.

  Furthermore, the update-in-place-in-select does not account for
  compression failure.  That was not a problem yet, since the InnoDB SQL
  interpreter has so far assumed ROW_FORMAT=REDUNDANT.

  rb://63 approved by Heikki Tuuri
  ------------------------------------------------------------------------
2008-12-17 12:48:23 +00:00
marko
880a55f779 branches/innodb+: Merge revisions 3541:3544 from branches/zip:
------------------------------------------------------------------------
  r3541 | marko | 2008-12-16 12:14:58 +0200 (Tue, 16 Dec 2008) | 3 lines

  branches/zip: btr_cur_optimistic_delete(): Note that no further pages
  must be latched before calling mtr_commit(mtr) if the function returns TRUE.
  ------------------------------------------------------------------------
  r3544 | marko | 2008-12-16 15:52:36 +0200 (Tue, 16 Dec 2008) | 20 lines

  branches/zip: Do not update the free bits in the insert buffer bitmap
  when inserting or deleting from the insert buffer B-tree.  Assert that
  records in the insert buffer B-tree are never updated.  This could cure
  Issue #135.

  btr_cur_optimistic_insert(): Do not update the insert buffer bitmap
  when inserting to the insert buffer tree.

  btr_cur_optimistic_delete(): Do not update the insert buffer bitmap
  when deleting from the insert buffer tree.  This could be the cause
  of the assertion failure that was reported in Issue #135.

  btr_cur_update_alloc_zip(): Assert that the index is not the insert
  buffer.  The insert buffer will never be stored in compressed format.

  btr_cur_update_in_place(), btr_cur_optimistic_update(),
  btr_cur_pessimistic_update(): Assert that these functions are never
  invoked on the insert buffer tree.  The insert buffer only supports
  the insertion and deletion of records.
  ------------------------------------------------------------------------
2008-12-16 13:56:48 +00:00
marko
0a8380ab4a branches/innodb+: Merge revisions 3519:3541 from branches/zip:
------------------------------------------------------------------------
  r3537 | marko | 2008-12-16 10:24:03 +0200 (Tue, 16 Dec 2008) | 3 lines

  branches/zip: sync_thread_add_level(): Add a comment explaining the
  assertion about SYNC_BUF_POOL and SYNC_BUF_BLOCK.
  ------------------------------------------------------------------------
  r3540 | marko | 2008-12-16 12:13:31 +0200 (Tue, 16 Dec 2008) | 2 lines

  branches/zip: buf_page_init_for_read(): Use common code for error exit.
  ------------------------------------------------------------------------
  r3541 | marko | 2008-12-16 12:14:58 +0200 (Tue, 16 Dec 2008) | 3 lines

  branches/zip: btr_cur_optimistic_delete(): Note that no further pages
  must be latched before calling mtr_commit(mtr) if the function returns TRUE.
  ------------------------------------------------------------------------
2008-12-16 10:25:39 +00:00
marko
364910b122 branches/innodb+: Merge revisions 3498:3519 from branches/zip:
------------------------------------------------------------------------
  r3514 | marko | 2008-12-12 13:39:40 +0200 (Fri, 12 Dec 2008) | 3 lines

  branches/zip: btr_cur_search_to_nth_level(): Remove a duplicate check
  for (rw_latch != RW_NO_LATCH) around debug code.
  ------------------------------------------------------------------------

Other branches/zip revisions in that range were backported from
branches/innodb+ and were thus not merged back to branches/innodb+.
2008-12-12 14:18:52 +00:00
marko
60bbfd6d0b branches/innodb+: Clean up the buffering of purges. Instead of
traversing the index B-tree twice (first in BTR_WATCH_LEAF mode and
then in BTR_DELETE mode), let BTR_DELETE take care of checking that
the record can be purged, and either buffering or performing the
purge.

row_purge_poss_sec(): New function, to check if it is possible to
purge a secondary index record.  Refactored from
row_purge_remove_sec_if_poss_low().

row_purge_remove_sec_if_poss_nonbuffered(): Rename to
row_purge_remove_sec_if_poss_tree().  Remove the parameter mode
(always use BTR_MODIFY_TREE).  Use row_purge_poss_sec().

row_purge_remove_sec_if_poss_low(): Rename to
row_purge_remove_sec_if_poss_leaf().  Remove the parameter mode
(always use BTR_MODIFY_LEAF). Let row_search_index_entry() do all the
hard work.

btr_cur_t: Add purge_node, which will be needed by
btr_cur_search_to_nth_level() for BTR_DELETE.  Replace the flag value
BTR_CUR_ABORTED with BTR_CUR_DELETE_REF and BTR_CUR_DELETE_FAILED.

enum row_search_result, row_search_index_entry(): Replace
ROW_NOT_IN_POOL with ROW_NOT_DELETED_REF and ROW_NOT_DELETED.

btr_cur_search_to_nth_level(): Remove BTR_WATCH_LEAF.  As a side
effect, the adaptive hash index can be used in purge as well.  If
BTR_DELETE cannot be buffered, attempt btr_cur_optimistic_delete().
Either way, check row_purge_poss_sec().  Move the code to set
cursor->ibuf_count to get rid of another if (height == 0)
check. Eliminate the label loop_end.  Do not call ibuf_should_try()
twice.

ibuf_should_try(): Now that the successful calls to this function will
be halved, halve the magic constant that ibuf_flush_count will be
compared to, accordingly.

The changes regarding ibuf_should_try() were merged from branches/zip
r3515.

rb://60 approved by Heikki over IM
2008-12-12 12:59:48 +00:00
marko
bc452636db branches/innodb+: btr_cur_search_to_nth_level(): Move some code before
the only goto loop_end after the loop_end: label to improve
readability.
2008-12-12 12:28:49 +00:00
marko
7d55225783 branches/innodb+: btr_cur_search_to_nth_level(): Check for
BTR_INSERT, BTR_DELETE, and BTR_DELETE_MARK in a single switch,
and assert that at most one is specified at a time.
2008-12-12 10:08:00 +00:00
marko
efbc02a9c0 branches/innodb+: btr_cur_search_to_nth_level(): Add debug assertions
that operations on clustered indexes or on the insert buffer B-tree
must not be buffered.
2008-12-10 14:06:12 +00:00
marko
6c3a99a738 branches/innodb+: btr_cur_t: Remove leaf_in_buf_pool. The flag can be
determined from flag == BTR_CUR_ABORTED.  This flag value was previously
never tested for.  It was only assigned to, in the only place where
leaf_in_buf_pool would be set FALSE.

btr_cur_search_to_nth_level(): Do not initialize cursor->leaf_in_buf_pool.

btr_pcur_was_buffered(): Remove.  The only caller, row_search_index_entry(),
will switch (cursor->flag) and handle BTR_CUR_ABORTED as well.

row_purge_remove_sec_if_poss_low(): Remove the assertions on leaf_in_buf_pool.
2008-12-04 21:56:21 +00:00
marko
58d342c90a branches/innodb+: Revert some debugging-related changes
that were accidentally committed in r2971:

univ.i, ha_innobase::create(): Reduce the uncompressed page size from
16 to 4 kilobytes.

btr_cur_search_to_nth_level(): Print a diagnostic message when the
leaf page of a secondary index is being requested from the disk.

buf_read_ahead_random(), buf_read_ahead_linear(): Disable.
2008-11-07 12:16:36 +00:00
marko
7c37bc941f branches/innodb+: ibuf_get_volume_buffered():
Invoke ibuf_get_volume_buffered_count() as many times as
ibuf_rec_get_volume(rec), so that *n_recs will be updated as appropriate.
This fixes Issue #82: some deletes will be buffered in purge.
2008-11-06 12:41:18 +00:00
marko
4a7bd430ba branches/innodb+: Refuse to buffer deletes if that could lead to B-tree
pages becoming empty.  Remove work-arounds for empty pages.  This fixes
Issue #82.

ibuf_get_volume_buffered(): Add the output parameter n_recs, for returning
the minimum number of records on the page.

ibuf_insert_low(): Refuse to buffer IBUF_OP_DELETE if the page could
become empty.

btr_page_get_father_node_ptr(): Remove the work-around for the page
being empty.

page_zip_dir_delete(): Revert to the version from branches/zip.
Always invoke page_zip_clear_rec().
2008-10-23 10:22:46 +00:00
marko
70f1128619 branches/innodb+: Merge revisions 2835:2862 from branches/zip:
------------------------------------------------------------------------
  r2838 | vasil | 2008-10-21 12:49:27 +0300 (Tue, 21 Oct 2008) | 61 lines

  branches/zip:

  Merge 2744:2837 from branches/5.1 (skipping r2782 and r2826):

    ------------------------------------------------------------------------
    r2832 | vasil | 2008-10-21 10:08:30 +0300 (Tue, 21 Oct 2008) | 10 lines
    Changed paths:
       M /branches/5.1/handler/ha_innodb.cc

    branches/5.1:

    In ha_innobase::info():

    Replace sql_print_warning() which prints to mysqld error log with
    push_warning_printf() which sends the error message to the client.

    Suggested by: Marko, Sunny, Michael
    Objected by:  Inaam

    ------------------------------------------------------------------------
    r2837 | vasil | 2008-10-21 12:07:44 +0300 (Tue, 21 Oct 2008) | 32 lines
    Changed paths:
       M /branches/5.1/mysql-test/innodb-semi-consistent.result
       M /branches/5.1/mysql-test/innodb-semi-consistent.test
       M /branches/5.1/mysql-test/innodb.result
       M /branches/5.1/mysql-test/innodb.test

    branches/5.1:

    Merge a change from MySQL (this fixes the failing innodb and
    innodb-semi-consistent tests):

      revno: 2757
      committer: Georgi Kodinov <kgeorge@mysql.com>
      branch nick: B39812-5.1-5.1.29-rc
      timestamp: Fri 2008-10-03 15:24:19 +0300
      message:
        Bug #39812: Make statement replication default for 5.1 (to match 5.0)

        Make STMT replication default for 5.1.
        Add a default of MIXED into the config files
        Fix the tests that needed MIXED replication mode.
      modified:
        mysql-test/include/mix1.inc
        mysql-test/r/innodb-semi-consistent.result
        mysql-test/r/innodb.result
        mysql-test/r/innodb_mysql.result
        mysql-test/r/tx_isolation_func.result
        mysql-test/t/innodb-semi-consistent.test
        mysql-test/t/innodb.test
        mysql-test/t/tx_isolation_func.test
        sql/mysqld.cc
        support-files/my-huge.cnf.sh
        support-files/my-innodb-heavy-4G.cnf.sh
        support-files/my-large.cnf.sh
        support-files/my-medium.cnf.sh
        support-files/my-small.cnf.sh


    ------------------------------------------------------------------------

  ------------------------------------------------------------------------
  r2847 | marko | 2008-10-22 10:07:37 +0300 (Wed, 22 Oct 2008) | 6 lines

  branches/zip: page_zip_rec_needs_ext(): Fix a bug that was introduced
  in the fix of Mantis issue #73.  With key_block_size=16, we will also
  have to check the available space on the uncompressed page.
  Otherwise, the clustered index record can be almost 16 kilobytes in
  size, and the undo log record will not fit.
  ------------------------------------------------------------------------
  r2850 | marko | 2008-10-22 13:52:12 +0300 (Wed, 22 Oct 2008) | 2 lines

  branches/zip: ibuf_insert_to_index_page(): Discard the local variable block.
  page_cur is always positioned on block, the function parameter.
  ------------------------------------------------------------------------
  r2853 | sunny | 2008-10-23 01:52:09 +0300 (Thu, 23 Oct 2008) | 2 lines
  branches/zip: Add missing UNIV_INTERN.
  ------------------------------------------------------------------------
  r2855 | sunny | 2008-10-23 09:29:46 +0300 (Thu, 23 Oct 2008) | 36 lines

  branches/zip:

  Merge revisions 2837:2852 from branches/5.1:

    ------------------------------------------------------------------------
    r2849 | sunny | 2008-10-22 12:01:18 +0300 (Wed, 22 Oct 2008) | 8 lines
    Changed paths:
       M /branches/5.1/handler/ha_innodb.cc
       M /branches/5.1/include/row0mysql.h
       M /branches/5.1/row/row0mysql.c

    branches/5.1: Return the actual error code encountered when allocating
    a new autoinc value. The change in behavior (bug) was introduced in 5.1.22
    when we introduced the new AUTOINC locking model.

    rb://31

    Bug#40224 New AUTOINC changes mask reporting of deadlock/timeout errors

    ------------------------------------------------------------------------
    r2852 | sunny | 2008-10-23 01:42:24 +0300 (Thu, 23 Oct 2008) | 9 lines
    Changed paths:
       M /branches/5.1/handler/ha_innodb.cc
       M /branches/5.1/handler/ha_innodb.h

    branches/5.1: Backport r2724 from branches/zip

    Check column value against the col max value before updating the table's
    global autoinc counter value. This is part of simplifying the AUTOINC
    sub-system. We extract the type info from MySQL data structures at runtime.

    This fixes Bug#37788 InnoDB Plugin: AUTO_INCREMENT wrong for compressed tables

    ------------------------------------------------------------------------

  ------------------------------------------------------------------------
  r2856 | sunny | 2008-10-23 10:07:05 +0300 (Thu, 23 Oct 2008) | 1 line

  Reverting test file changes from r2855
  ------------------------------------------------------------------------
  r2857 | sunny | 2008-10-23 10:24:33 +0300 (Thu, 23 Oct 2008) | 30 lines

  branches/zip:

  Merge revisions 2852:2854 from branches/5.1:

    ------------------------------------------------------------------------
    r2854 | sunny | 2008-10-23 08:30:32 +0300 (Thu, 23 Oct 2008) | 13 lines
    Changed paths:
       M /branches/5.1/dict/dict0dict.c
       M /branches/5.1/dict/dict0mem.c
       M /branches/5.1/handler/ha_innodb.cc
       M /branches/5.1/handler/ha_innodb.h
       M /branches/5.1/include/dict0dict.h
       M /branches/5.1/include/dict0mem.h
       M /branches/5.1/row/row0mysql.c

    branches/5.1: Backport changes from branches/zip r2725

    Simplify the autoinc initialization code. This removes the
    non-determinism related to reading the table's autoinc value for the first
    time. This change has also reduced the sizeof dict_table_t by sizeof(ibool)
    bytes because we don't need the dict_table_t::autoinc_inited field anymore.

    Bug#39830 Table autoinc value not updated on first insert.
    Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info
    Bug#36411 Failed to read auto-increment value from storage engine" in 5.1.24 auto-inc
    rb://16


    ------------------------------------------------------------------------

  ------------------------------------------------------------------------
  r2858 | vasil | 2008-10-23 11:33:43 +0300 (Thu, 23 Oct 2008) | 4 lines

  branches/zip:

  Update the ChangeLog
  ------------------------------------------------------------------------
  r2861 | marko | 2008-10-23 12:27:15 +0300 (Thu, 23 Oct 2008) | 24 lines

  branches/zip: Clean up the file format stamping.

  trx_sys_file_format_max_upgrade(): Rename from
  trx_sys_file_format_max_update().  Improve the documentation.  Add a
  const qualifier to the parameter "name".  Replace the parameter
  "flags" with "format_id", because this function should deal with file
  format identifiers, not with table flags.

  trx_sys_file_format_max_write(), trx_sys_file_format_max_set(): Add a
  const qualifier to the parameter "name".

  ha_innodb.cc: Correct the spelling in some comments: "side effect".
  Remove redundant prototypes for some static callback functions.

  innodb_file_format_name_update(), innodb_file_format_check_update():
  Correct the function signature.  Use appropriate pointer type conversions.

  MYSQL_SYSVAR_STR(file_format), MYSQL_SYSVAR_STR(file_format_check):
  Remove the type conversions from the callback function pointers.  When
  the function signatures match, no type conversion is needed.  The type
  conversions would only prevent compilation warnings for any mismatch.

  Approved by Sunny in rb://25.
  ------------------------------------------------------------------------
  r2862 | marko | 2008-10-23 12:37:42 +0300 (Thu, 23 Oct 2008) | 8 lines

  branches/zip: Non-functional changes:

  ibuf_get_volume_buffered(): Declare with static linkage.
  This function is private to ibuf0ibuf.c.

  btr_cur_pessimistic_delete(): Use the cached result of
  btr_cur_get_index(cursor).
  ------------------------------------------------------------------------
2008-10-23 10:03:20 +00:00
marko
a980b544cd branches/innodb+: Merge revisions 2774:2799 from branches/zip:
------------------------------------------------------------------------
  r2781 | marko | 2008-10-13 13:40:57 +0300 (Mon, 13 Oct 2008) | 1 line

  branches/zip: page_cur_delete_rec(): Call page_zip_validate_low().
  ------------------------------------------------------------------------
  r2783 | vasil | 2008-10-13 18:34:34 +0300 (Mon, 13 Oct 2008) | 9 lines

  branches/zip:

  Remove mysql-test/patches/bug37312.diff because MySQL "fixed"
  Bug#37312 by removing the test.

  http://bugs.mysql.com/37312
  http://lists.mysql.com/commits/54462
  ------------------------------------------------------------------------
  r2784 | marko | 2008-10-13 21:35:30 +0300 (Mon, 13 Oct 2008) | 1 line

  branches/zip: Add missing NULL check to the assertion added in r2781.
  ------------------------------------------------------------------------
  r2785 | marko | 2008-10-13 22:29:12 +0300 (Mon, 13 Oct 2008) | 2 lines

  branches/zip: page_cur_delete_rec(): Remove the bogus page_zip_validate_low()
  assertion that was added in r2781 and explain why it was bogus.
  ------------------------------------------------------------------------
  r2786 | calvin | 2008-10-14 19:14:47 +0300 (Tue, 14 Oct 2008) | 7 lines

  branches/zip: fix Mantis issue #96 Problem compiling ha_innodb.cc
  on 64-bit Windows

  Change the definition of srv_replication_delay from ulint to ulong.
  ulint is 64-bit on Win64.

  Approved by:	Heikki (on IM)
  ------------------------------------------------------------------------
  r2787 | calvin | 2008-10-14 19:19:41 +0300 (Tue, 14 Oct 2008) | 7 lines

  branches/zip: fix compiler warning

  Change the definition of add_on from ulint to ullint, to eliminate
  the warning in .\btr\btr0cur.c:
  conversion from 'ullint' to 'ulint', possible loss of data

  Approved by:	Heikki (on IM)
  ------------------------------------------------------------------------
  r2793 | marko | 2008-10-15 10:00:06 +0300 (Wed, 15 Oct 2008) | 2 lines

  branches/zip: row_create_table_for_mysql(), row_create_index_for_mysql():
  Note that the dictionary object will be freed.
  ------------------------------------------------------------------------
  r2794 | marko | 2008-10-15 10:32:40 +0300 (Wed, 15 Oct 2008) | 9 lines

  branches/zip: When invoking page_zip_copy_recs(), update the lock table
  and the adaptive hash index.  This should fix Issue #95 and Issue #87.

  page_zip_copy_recs(): Copy PAGE_MAX_TRX_ID as well, to have similar behavior
  to page_copy_rec_list_start() and page_copy_rec_list_end().

  btr_root_raise_and_insert(), btr_page_split_and_insert(), btr_lift_page_up():
  Update the lock table and the adaptive hash index.
  ------------------------------------------------------------------------
  r2797 | marko | 2008-10-15 13:21:54 +0300 (Wed, 15 Oct 2008) | 3 lines

  branches/zip: Introduce UNIV_ZIP_COPY for invoking page_zip_copy_recs()
  more often in B-tree operations.
  ------------------------------------------------------------------------
  r2799 | marko | 2008-10-15 14:27:42 +0300 (Wed, 15 Oct 2008) | 25 lines

  branches/zip: When the server crashes while freeing an externally stored
  column of a compressed table, the BTR_EXTERN_LEN field in the BLOB pointer
  will be written as 0.  Tolerate this in the functions that deal with
  externally stored columns.  This fixes Issue #80 and was posted at rb://26.

  Note that the clustered index record is always deleted or purged last,
  after any secondary index records referring to it have been deleted.

  btr_free_externally_stored_field(): On an uncompressed table, zero out
  the BTR_EXTERN_LEN, so that half-deleted BLOBs can be detected after
  crash recovery.

  btr_copy_externally_stored_field_prefix(): Return 0 if the BLOB has been
  half-deleted.

  row_upd_ext_fetch(): Assert that the externally stored column exists.

  row_ext_cache_fill(): Allow btr_copy_externally_stored_field_prefix()
  to return 0.

  row_sel_sec_rec_is_for_blob(): Return FALSE if the BLOB has been half-deleted.
  This is correct, because the clustered index record would have been deleted
  or purged last, after any secondary index records referring to it had been
  deleted.
  ------------------------------------------------------------------------
2008-10-15 12:09:17 +00:00
marko
d6d6f656ee branches/innodb+: btr_cur_search_to_nth_level(): Add a TODO comment that
when encountering an empty leaf page, we should advance to the right
siblings until a non-empty page is found.  Move the initialization of
cursor->ibuf_cnt to a better place.
2008-10-15 10:18:28 +00:00
marko
f7e76f23c1 branches/innodb+: Merge revisions 2678:2774 from branches/zip. 2008-10-11 19:37:21 +00:00
marko
99d6926335 branches/innodb+: page_zip_dir_delete(): Do not clear the last record on
a secondary index leaf page, because that could break delete buffering.

btr_page_get_father_node_ptr(): Remove a TODO comment regarding this.
2008-09-30 11:21:39 +00:00
marko
7ec0b7180a branches/innodb+: btr_cur_search_to_nth_level(): Correct a merge
error.  In r2324, when changes were merged from branches/fts, the
assignment guess = NULL was accidentally removed after height--.
The assignment is in that place in branches/fts since r990.
2008-09-25 10:31:45 +00:00
marko
211417e27e branches/innodb+: Merge revisions 2660:2676 from branches/zip. 2008-09-24 09:45:19 +00:00
marko
365402d771 branches/innodb+: Non-functional change:
ibuf_rec_get_counter(): Rename from ibuf_rec_get_fake_counter().  There is
nothing fake about the counter.  Also add const qualifiers to the pointers.
2008-09-22 10:38:51 +00:00
marko
dcbd036c00 branches/innodb+: Non-functional change: Use dict_index_is_ibuf()
instead of accessing index->type directly.
2008-09-22 10:31:18 +00:00
marko
56d28f1c57 branches/innodb+: Merge 2637:2660 from branches/zip. 2008-09-22 07:57:34 +00:00
marko
93fdc0e4ac branches/innodb+: Undo another white-space change that makes the code
differ from branches/zip.
2008-09-19 13:34:12 +00:00
marko
0c4879da3d branches/innodb+: Revert some changes that make the code differ
from branches/zip.

btr_cur_optimistic_delete(): Split a too long line in the way it is
split in branches/zip.

buf_page_get_gen(): Add missing space in the function comment.

buf_print_io(): Restoer a removed space to the printout.

univ.i: Remove C++-style (or C99-style) comments.

buf0buf.h: Undo the white-space changes to the wrapper macros of
buf_page_get_gen().

ibuf_update_free_bits_low(): Revert the changes.  Restore the assertion
that this function must not be invoked on compressed pages.  The function
ibuf_update_free_bits_zip() is for compressed pages.

ibuf_insert_to_index_page(): Undo a white-space change.
2008-09-18 07:01:13 +00:00
marko
e5833be894 branches/innodb+: btr_page_get_father_node_ptr(): Add TODO comments about
accessing a freed record on a compressed page.
2008-09-18 06:56:32 +00:00
marko
8638150c6c branches/innodb+: Merge 2579:2637 from branches/zip. 2008-09-17 19:52:30 +00:00
marko
24f1b3a91e branches/innodb+: Minor cleanup.
btr0cur.c: Undo changes to white space that make the code differ from
branches/zip.

btr_cur_del_unmark_for_ibuf(): Remove this unused function.

btr_cur_set_deleted_flag_for_ibuf(): Add missing UNIV_INTERN specifier.
Correct the function comment.  Call btr_rec_set_deleted_flag() instead
of rec_set_deleted_flag_new(), so that delete buffering will actually
work on ROW_FORMAT=REDUNDANT tables.
2008-09-17 19:31:42 +00:00
sunny
d0e8003b2f branches/innodb+: Merge revisions 2460:2579 from branches/zip
The followin mysql-tests failed (and they are known to fail):
main.information_schema        	[ fail ]
main.innodb_file_per_table_basic[ fail ]
main.type_bit_innodb           	[ fail ]

Tested against : MYSQL_SERVER_VERSION  "5.1.28"
2008-08-09 00:15:46 +00:00
sunny
093fb51fb4 branches/innodb+: Fix typo in comment. 2008-06-16 03:11:30 +00:00
inaam
c5dacc2914 branches/innodb+: Merge revisions 2344:2454 from branches/zip 2008-05-14 15:43:19 +00:00
marko
0c5b8df908 branches/innodb+: Merge revisions 2340:2343 from branches/zip 2008-03-03 12:57:07 +00:00
marko
5cf58ce919 branches/innodb+: Merge revisions 2322:2340 from branches/zip 2008-03-03 10:25:27 +00:00
sunny
fceb78e698 branches/innodb+: Delete buffer port from branches/fts:r2283 2008-02-27 07:03:34 +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
36a5b2cd37 branches/zip: Merge 2263:2295 from branches/5.1. 2008-02-18 20:09:03 +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
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
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
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
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
marko
0d59bf8ee6 branches/zip: Avoid infinite page splits on compressed tables.
btr_page_get_sure_split_rec(): Remove the check if insert_size
exceeds free_space.

btr_page_split_and_insert(): If a compressed page has already been split,
avoid further splits by inserting the record to an empty page.  As a
performance optimization, avoid invoking btr_page_insert_fits() on
compressed tables.
2008-01-17 12:29:03 +00:00
marko
b060f8baad branches/zip: btr_page_get_sure_split_rec(): Return NULL when the record
is not guaranteed to fit on a compressed page, instead of letting
an assertion fail.
2008-01-16 14:14:36 +00:00
marko
e693d5170d branches/zip: Add comments about the lock and latch protection of externally
stored columns (BLOBs).

btr_copy_blob_prefix(), btr_copy_zblob_prefix(),
btr_copy_externally_stored_field_prefix_low(),
btr_copy_externally_stored_field_prefix(),
btr_copy_externally_stored_field(),
btr_rec_copy_externally_stored_field():
Note that the page containing the clustered index record that points to
the BLOB must be latched.

btr_copy_zblob_prefix(): Note that there is no latch on the page, and thus
all accesses to a given page via this function must be covered by the same
set of locks or latches.

btr_copy_zblob_prefix(): Note that the block acquired by
buf_page_get_zip() is protected by an exclusive table lock or
or by a latch on the clustered index record.
2008-01-16 10:45:14 +00:00
marko
44340b6e8e branches/zip: Add comments that clarify why the remaining calls to
row_build(), row_upd_index_replace_new_col_vals_index_pos(), and
row_upd_index_replace_new_col_vals() are safe.

btr_cur_optimistic_update(), btr_cur_pessimistic_update(): Note that
the B-tree page of the clustered index record is latched in mtr.

trx_undo_prev_version_build(): Add const qualifiers to index_rec
and rec.  Note that the page of index_rec is latched in index_mtr.

row_vers_impl_x_locked_off_kernel(), row_vers_old_has_index_entry():
Note that the stack of versions is locked by mtr and thus it is
safe to call row_build().
2008-01-14 10:04:45 +00:00
marko
1cbf67cdbf branches/zip: btr_copy_zblob_prefix(): Print d_stream->msg on decompression
failure.
2008-01-10 11:06:01 +00:00
marko
cdb5b46445 branches/zip: Implement wrappers for all operations on the buffer pool mutex.
buf_pool->mutex: Rename to buf_pool_mutex, so that the wrappers will have
to be used when changes are merged from other source trees.

buf_pool->zip_mutex: Rename to buf_pool_zip_mutex.

buf_pool_mutex_own(), buf_pool_mutex_enter(), buf_pool_mutex_exit():
Wrappers for buf_pool_mutex.
2008-01-10 09:37:13 +00:00
marko
02819f3e55 branches/zip: btr_cur_mark_extern_inherited_fields():
Add a call to rec_offs_any_extern() as an optimization.
2008-01-04 14:01:45 +00:00
vasil
1ae59d9e65 branches/zip:
Change the output format of transaction ids from 2 32bit numbers separated
by space to a single hex number.

Suggested by:	Heikki
Approved by:	Heikki
2007-12-20 14:08:16 +00:00
marko
8c852371e5 branches/zip: Add some clarifying comments.
btr_copy_blob_prefix(), btr_copy_externally_stored_field_prefix_low():
Document the return value as "number of bytes written", not "bytes written".

trx_undo_page_fetch_ext(): Explain the assertion ut_a(ext_len).

row_build_index_entry(): Explain the assertion ut_a(!ext).
2007-12-20 09:10:42 +00:00