Commit 0da158aa authored by unknown's avatar unknown
Browse files

Applied InnoDB 5.1 snapshot ss787.

Bugs fixed:
- Bug #20791    valgrind errors in InnoDB
  Remove Valgrind warning of Bug #20791 : in new database
  creation, we read the doublewrite buffer magic number from
  uninitialized memory; the code worked because it was extremely
  unlikely that the memory would contain the magic number
- Bug #21784    DROP TABLE crashes 5.1.12-pre if concurrent
  queries on the table
  remove update_thd() in ::store_lock()


Also includes numerous coding style fixes, etc.  See file-level
comments for details.


sql/ha_innodb.cc:
  Applied InnoDB 5.1 snapshot ss787.
  
    r755:
    Merge a patch from MySQL AB (Mats Kindal):
  
    Lock and unlock prepare_commit_mutex under the same conditions.
  
    r782:
    Fix bug #21784 of a crash in DROP TABLE with concurrent queries on the table
storage/innobase/Makefile.am:
  Applied InnoDB 5.1 snapshot ss787.
  
    r772:
    Merge changes from MySQL AB:
  
    ChangeSet
      2006/08/23 13:59:16-07:00 brian@zim.(none)
      This patch removes need for a innodb to have its own configure.
storage/innobase/btr/btr0btr.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r764:
    Split lines before an opening parenthesis, not after one.
  
    Replace some printf(...) in debug builds with fprintf(stderr, ...).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/btr/btr0cur.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r761:
    btr_cur_search_to_nth_level(): Document where cursor is left at in
    PAGE_CUR_LE searches.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/btr/btr0pcur.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/btr/btr0sea.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/buf/buf0buf.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r764:
    Split lines before an opening parenthesis, not after one.
  
    Replace some printf(...) in debug builds with fprintf(stderr, ...).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/buf/buf0flu.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r764:
    Split lines before an opening parenthesis, not after one.
  
    Replace some printf(...) in debug builds with fprintf(stderr, ...).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/buf/buf0lru.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r764:
    Split lines before an opening parenthesis, not after one.
  
    Replace some printf(...) in debug builds with fprintf(stderr, ...).
storage/innobase/buf/buf0rea.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/data/data0data.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r743:
    dfield_print_raw(): Make static.  Print at most 1000 bytes to avoid
    excessive space usage of the error log.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/data/data0type.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/dict/dict0boot.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/dict/dict0crea.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/dict/dict0dict.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r764:
    Split lines before an opening parenthesis, not after one.
  
    Replace some printf(...) in debug builds with fprintf(stderr, ...).
  
    r765:
    Split lines before binary operators, not after them.
  
    r767:
    Remove dict_col_t::aux, which was only used when copying an index definition
    to the data dictionary cache.
storage/innobase/dict/dict0load.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/dict/dict0mem.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/eval/eval0eval.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/eval/eval0proc.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/fil/fil0fil.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r764:
    Split lines before an opening parenthesis, not after one.
  
    Replace some printf(...) in debug builds with fprintf(stderr, ...).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/fsp/fsp0fsp.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r764:
    Split lines before an opening parenthesis, not after one.
  
    Replace some printf(...) in debug builds with fprintf(stderr, ...).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/fut/fut0lst.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/ha/ha0ha.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/ibuf/ibuf0ibuf.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r735:
    Remove all traces of the obsolete concept of replicate spaces.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r764:
    Split lines before an opening parenthesis, not after one.
  
    Replace some printf(...) in debug builds with fprintf(stderr, ...).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/include/btr0btr.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/btr0cur.h:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/btr0cur.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/btr0pcur.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/buf0buf.h:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/buf0buf.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/buf0flu.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/buf0rea.h:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/data0data.h:
  Applied InnoDB 5.1 snapshot ss787.
  
    r743:
    dfield_print_raw(): Make static.  Print at most 1000 bytes to avoid
    excessive space usage of the error log.
storage/innobase/include/data0data.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/data0type.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/dict0boot.h:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/dict0dict.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/dict0mem.h:
  Applied InnoDB 5.1 snapshot ss787.
  
    r767:
    Remove dict_col_t::aux, which was only used when copying an index definition
    to the data dictionary cache.
storage/innobase/include/eval0eval.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/fut0lst.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/ibuf0ibuf.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/lock0lock.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/log0log.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/log0recv.h:
  Applied InnoDB 5.1 snapshot ss787.
  
    r735:
    Remove all traces of the obsolete concept of replicate spaces.
storage/innobase/include/mach0data.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/mem0mem.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/include/mtr0log.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/mtr0mtr.h:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/os0file.h:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/page0cur.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/page0page.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r764:
    Split lines before an opening parenthesis, not after one.
  
    Replace some printf(...) in debug builds with fprintf(stderr, ...).
storage/innobase/include/que0que.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/read0read.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/rem0cmp.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/rem0rec.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/include/row0mysql.h:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/row0purge.h:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/row0row.h:
  Applied InnoDB 5.1 snapshot ss787.
  
    r777:
    Remove unused code.
  
    row_build(): Remove type==ROW_COPY_ALSO_EXTERNALS, because it is never
    passed.
storage/innobase/include/row0row.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/row0sel.h:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/row0sel.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/row0undo.h:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/row0upd.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/sync0rw.h:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/sync0rw.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/sync0sync.h:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/sync0sync.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/trx0rec.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/trx0rseg.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/include/trx0sys.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/include/trx0trx.h:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/trx0trx.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/trx0undo.h:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/trx0undo.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/trx0xa.h:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/univ.i:
  Applied InnoDB 5.1 snapshot ss787.
  
    r772:
    Merge changes from MySQL AB:
  
    ChangeSet
      2006/08/23 13:59:16-07:00 brian@zim.(none)·
      This patch removes need for a innodb to have its own configure.·
  
    univ.i: Replace ../ib_config.h with config.h.
  
    r777:
    Remove unused code.
  
    univ.i: Do not #define YYDEBUG, because it is only useful for debugging
    the grammar of the Bison-generated InnoDB SQL parser.
storage/innobase/include/ut0byte.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/include/ut0rnd.ic:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/lock/lock0lock.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r764:
    Split lines before an opening parenthesis, not after one.
  
    Replace some printf(...) in debug builds with fprintf(stderr, ...).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/log/log0log.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r764:
    Split lines before an opening parenthesis, not after one.
  
    Replace some printf(...) in debug builds with fprintf(stderr, ...).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/log/log0recv.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r735:
    Remove all traces of the obsolete concept of replicate spaces.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r764:
    Split lines before an opening parenthesis, not after one.
  
    Replace some printf(...) in debug builds with fprintf(stderr, ...).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/mem/mem0dbg.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/mem/mem0mem.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/mem/mem0pool.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/mtr/mtr0log.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/mtr/mtr0mtr.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/os/os0file.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/os/os0proc.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/os/os0sync.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/os/os0thread.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/page/page0cur.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/page/page0page.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r761:
    btr_cur_search_to_nth_level(): Document where cursor is left at in
    PAGE_CUR_LE searches.
  
    r762:
    page_validate(): Add missing space to error print, for real this time,
    following an error in r761.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r764:
    Split lines before an opening parenthesis, not after one.
  
    Replace some printf(...) in debug builds with fprintf(stderr, ...).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/pars/pars0opt.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/pars/pars0pars.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r764:
    Split lines before an opening parenthesis, not after one.
  
    Replace some printf(...) in debug builds with fprintf(stderr, ...).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/que/que0que.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/read/read0read.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/rem/rem0cmp.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r764:
    Split lines before an opening parenthesis, not after one.
  
    Replace some printf(...) in debug builds with fprintf(stderr, ...).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/rem/rem0rec.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/row/row0ins.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r764:
    Split lines before an opening parenthesis, not after one.
  
    Replace some printf(...) in debug builds with fprintf(stderr, ...).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/row/row0mysql.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r764:
    Split lines before an opening parenthesis, not after one.
  
    Replace some printf(...) in debug builds with fprintf(stderr, ...).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/row/row0purge.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/row/row0row.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
  
    r777:
    Remove unused code.
  
    row_build(): Remove type==ROW_COPY_ALSO_EXTERNALS, because it is never
    passed.
storage/innobase/row/row0sel.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r764:
    Split lines before an opening parenthesis, not after one.
  
    Replace some printf(...) in debug builds with fprintf(stderr, ...).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/row/row0uins.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/row/row0umod.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/row/row0undo.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/row/row0upd.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/row/row0vers.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/srv/srv0srv.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r741:
    srv_master_thread(): Add OS_THREAD_DUMMY_RETURN to get rid of a compiler
    warning "no return value from a function returning non-void".
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r764:
    Split lines before an opening parenthesis, not after one.
  
    Replace some printf(...) in debug builds with fprintf(stderr, ...).
  
    r765:
    Split lines before binary operators, not after them.
  
    r780:
    Add a warning comment above the place where we set srv_main_thread_op_info
    to "waiting for server activity" that mentions that this string should not
    be changed.
storage/innobase/srv/srv0start.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/sync/sync0arr.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/sync/sync0rw.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/sync/sync0sync.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/thr/thr0loc.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/trx/trx0purge.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/trx/trx0rec.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r735:
    Remove all traces of the obsolete concept of replicate spaces.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/trx/trx0roll.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/trx/trx0rseg.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/trx/trx0sys.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/trx/trx0trx.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r764:
    Split lines before an opening parenthesis, not after one.
  
    Replace some printf(...) in debug builds with fprintf(stderr, ...).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/trx/trx0undo.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/ut/ut0byte.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/ut/ut0dbg.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r764:
    Split lines before an opening parenthesis, not after one.
  
    Replace some printf(...) in debug builds with fprintf(stderr, ...).
storage/innobase/ut/ut0mem.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/ut/ut0ut.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
  
    r765:
    Split lines before binary operators, not after them.
storage/innobase/ut/ut0vec.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
storage/innobase/ut/ut0wqueue.c:
  Applied InnoDB 5.1 snapshot ss787.
  
    r763:
    Reindent the code base (except for ha_innodb.{cc,h} and generated parser
    and lexer files).
parent fbf2bc18
Loading
Loading
Loading
Loading
+29 −10
Original line number Diff line number Diff line
@@ -6787,19 +6787,17 @@ ha_innobase::store_lock(
	row_prebuilt_t* prebuilt	= (row_prebuilt_t*) innobase_prebuilt;
	trx_t*		trx;

	/* Call update_thd() to update prebuilt->trx to point to the trx
	object of thd! Failure to do this caused a serious memory
	corruption bug in 5.1.11. */
	/* Note that trx in this function is NOT necessarily prebuilt->trx
	because we call update_thd() later, in ::external_lock()! Failure to
	understand this caused a serious memory corruption bug in 5.1.11. */

	update_thd(thd);

	trx = prebuilt->trx;
	trx = check_trx_exists(thd);

	/* NOTE: MySQL can call this function with lock 'type' TL_IGNORE!
	Be careful to ignore TL_IGNORE if we are going to do something with
	only 'real' locks! */

	/* If no MySQL tables is use we need to set isolation level
	/* If no MySQL table is in use, we need to set the isolation level
	of the transaction. */

	if (lock_type != TL_IGNORE
@@ -6809,7 +6807,13 @@ ha_innobase::store_lock(
						thd->variables.tx_isolation);
	}

	if ((lock_type == TL_READ && thd->in_lock_tables) ||
	if (thd->lex->sql_command == SQLCOM_DROP_TABLE) {

		/* MySQL calls this function in DROP TABLE though this table
		handle may belong to another thd that is running a query. Let
		us in that case skip any changes to the prebuilt struct. */ 

	} else if ((lock_type == TL_READ && thd->in_lock_tables) ||
		(lock_type == TL_READ_HIGH_PRIORITY && thd->in_lock_tables) ||
		lock_type == TL_READ_WITH_SHARED_LOCKS ||
		lock_type == TL_READ_NO_INSERT ||
@@ -7400,7 +7404,9 @@ innobase_xa_prepare(
	int error = 0;
	trx_t* trx = check_trx_exists(thd);

	if (thd->lex->sql_command != SQLCOM_XA_PREPARE) {
	if (thd->lex->sql_command != SQLCOM_XA_PREPARE &&
	    (all || !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))))
	{

		/* For ibbackup to work the order of transactions in binlog
		and InnoDB must be the same. Consider the situation
@@ -7625,6 +7631,19 @@ SHOW_VAR innodb_status_variables_export[]= {
  {NullS, NullS, SHOW_LONG}
};

static int show_innodb_vars(THD *thd, SHOW_VAR *var, char *buff)
{
  innodb_export_status();
  var->type= SHOW_ARRAY;
  var->value= (char *) &innodb_status_variables;
  return 0;
}

SHOW_VAR innodb_status_variables_export[]= {
  {"Innodb",                   (char*) &show_innodb_vars, SHOW_FUNC},
  {NullS, NullS, SHOW_LONG}
};

struct st_mysql_storage_engine innobase_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION, &innobase_hton};

+2 −1
Original line number Diff line number Diff line
@@ -87,7 +87,8 @@ EXTRA_DIST = include/btr0btr.h include/btr0btr.ic include/btr0cur.h include/btr
		include/ut0byte.h include/ut0byte.ic include/ut0dbg.h include/ut0lst.h \
		include/ut0mem.h include/ut0mem.ic include/ut0rnd.h include/ut0rnd.ic \
		include/ut0sort.h include/ut0ut.h include/ut0ut.ic include/ut0vec.h include/ut0vec.ic include/ha_prototypes.h \
		include/ut0list.h include/ut0list.ic include/ut0wqueue.h \
		include/ut0list.h include/ut0list.ic \
		include/ut0wqueue.h \
		CMakeLists.txt

noinst_LIBRARIES =	libinnobase.a
+285 −263
Original line number Diff line number Diff line
@@ -143,8 +143,8 @@ btr_root_get(
	root_page_no = dict_tree_get_page(tree);

	root = btr_page_get(space, root_page_no, RW_X_LATCH, mtr);
	ut_a((ibool)!!page_is_comp(root) ==
			dict_table_is_comp(tree->tree_index->table));
	ut_a((ibool)!!page_is_comp(root)
	     == dict_table_is_comp(tree->tree_index->table));

	return(root);
}
@@ -303,7 +303,8 @@ btr_page_alloc_for_ibuf(
	flst_remove(root + PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST,
		    new_page + PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST_NODE,
		    mtr);
	ut_ad(flst_validate(root + PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST, mtr));
	ut_ad(flst_validate(root + PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST,
			    mtr));

	return(new_page);
}
@@ -596,8 +597,8 @@ btr_page_get_father_for_rec(
	offsets = rec_get_offsets(node_ptr, index, offsets,
				  ULINT_UNDEFINED, &heap);

	if (btr_node_ptr_get_child_page_no(node_ptr, offsets) !=
						buf_frame_get_page_no(page)) {
	if (UNIV_UNLIKELY(btr_node_ptr_get_child_page_no(node_ptr, offsets)
			  != buf_frame_get_page_no(page))) {
		rec_t*	print_rec;
		fputs("InnoDB: Dump of the child page:\n", stderr);
		buf_page_print(buf_frame_align(page));
@@ -621,15 +622,18 @@ btr_page_get_father_for_rec(
					  ULINT_UNDEFINED, &heap);
		page_rec_print(node_ptr, offsets);

		fputs(
"InnoDB: You should dump + drop + reimport the table to fix the\n"
"InnoDB: corruption. If the crash happens at the database startup, see\n"
"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html about\n"
"InnoDB: forcing recovery. Then dump + drop + reimport.\n", stderr);
		fputs("InnoDB: You should dump + drop + reimport the table"
		      " to fix the\n"
		      "InnoDB: corruption. If the crash happens at "
		      "the database startup, see\n"
		      "InnoDB: http://dev.mysql.com/doc/refman/5.1/en/"
		      "forcing-recovery.html about\n"
		      "InnoDB: forcing recovery. "
		      "Then dump + drop + reimport.\n", stderr);
	}

	ut_a(btr_node_ptr_get_child_page_no(node_ptr, offsets) ==
						buf_frame_get_page_no(page));
	ut_a(btr_node_ptr_get_child_page_no(node_ptr, offsets)
	     == buf_frame_get_page_no(page));
	mem_heap_free(heap);

	return(node_ptr);
@@ -648,7 +652,8 @@ btr_page_get_father_node_ptr(
				user record */
	mtr_t*		mtr)	/* in: mtr */
{
	return(btr_page_get_father_for_rec(tree, page,
	return(btr_page_get_father_for_rec
	       (tree, page,
		page_rec_get_next(page_get_infimum_rec(page)), mtr));
}

@@ -678,8 +683,8 @@ btr_create(

	if (type & DICT_IBUF) {
		/* Allocate first the ibuf header page */
		ibuf_hdr_frame = fseg_create(space, 0,
				IBUF_HEADER + IBUF_TREE_SEG_HEADER, mtr);
		ibuf_hdr_frame = fseg_create
			(space, 0, IBUF_HEADER + IBUF_TREE_SEG_HEADER, mtr);

#ifdef UNIV_SYNC_DEBUG
		buf_page_dbg_add_level(ibuf_hdr_frame, SYNC_TREE_NODE_NEW);
@@ -689,9 +694,9 @@ btr_create(
		/* Allocate then the next page to the segment: it will be the
		tree root page */

		page_no = fseg_alloc_free_page(
				ibuf_hdr_frame + IBUF_HEADER
				+ IBUF_TREE_SEG_HEADER, IBUF_TREE_ROOT_PAGE_NO,
		page_no = fseg_alloc_free_page(ibuf_hdr_frame + IBUF_HEADER
					       + IBUF_TREE_SEG_HEADER,
					       IBUF_TREE_ROOT_PAGE_NO,
					       FSP_UP, mtr);
		ut_ad(page_no == IBUF_TREE_ROOT_PAGE_NO);

@@ -781,8 +786,8 @@ btr_free_but_not_root(
	/* NOTE: page hash indexes are dropped when a page is freed inside
	fsp0fsp. */

	finished = fseg_free_step(
				root + PAGE_HEADER + PAGE_BTR_SEG_LEAF, &mtr);
	finished = fseg_free_step
		(root + PAGE_HEADER + PAGE_BTR_SEG_LEAF, &mtr);
	mtr_commit(&mtr);

	if (!finished) {
@@ -794,8 +799,8 @@ btr_free_but_not_root(

	root = btr_page_get(space, root_page_no, RW_X_LATCH, &mtr);

	finished = fseg_free_step_not_header(
				root + PAGE_HEADER + PAGE_BTR_SEG_TOP, &mtr);
	finished = fseg_free_step_not_header
		(root + PAGE_HEADER + PAGE_BTR_SEG_TOP, &mtr);
	mtr_commit(&mtr);

	if (!finished) {
@@ -822,8 +827,8 @@ btr_free_root(

	btr_search_drop_page_hash_index(root);
top_loop:
	finished = fseg_free_step(
				root + PAGE_HEADER + PAGE_BTR_SEG_TOP, mtr);
	finished = fseg_free_step
		(root + PAGE_HEADER + PAGE_BTR_SEG_TOP, mtr);
	if (!finished) {

		goto top_loop;
@@ -885,7 +890,8 @@ btr_page_reorganize_low(
	do not copy the lock bits yet */

	page_copy_rec_list_end_no_locks(page, new_page,
				page_get_infimum_rec(new_page), index, mtr);
					page_get_infimum_rec(new_page),
					index, mtr);
	/* Copy max trx id to recreated page */
	page_set_max_trx_id(page, page_get_max_trx_id(new_page));

@@ -901,9 +907,12 @@ btr_page_reorganize_low(
		buf_page_print(page);
		buf_page_print(new_page);
		fprintf(stderr,
"InnoDB: Error: page old data size %lu new data size %lu\n"
"InnoDB: Error: page old max ins size %lu new max ins size %lu\n"
"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n",
			"InnoDB: Error: page old data size %lu"
			" new data size %lu\n"
			"InnoDB: Error: page old max ins size %lu"
			" new max ins size %lu\n"
			"InnoDB: Submit a detailed bug report"
			" to http://bugs.mysql.com\n",
			(unsigned long) data_size1, (unsigned long) data_size2,
			(unsigned long) max_ins_size1,
			(unsigned long) max_ins_size2);
@@ -1078,8 +1087,10 @@ btr_root_raise_and_insert(

	/* We play safe and reset the free bits for the new page */

/*	fprintf(stderr, "Root raise new page no %lu\n",
					buf_frame_get_page_no(new_page)); */
#if 0
	fprintf(stderr, "Root raise new page no %lu\n",
		buf_frame_get_page_no(new_page));
#endif

	ibuf_reset_free_bits(tree->tree_index, new_page);
	/* Reposition the cursor to the child node */
@@ -1265,7 +1276,8 @@ btr_page_get_sure_split_rec(
			incl_data += insert_size;
		} else {
			offsets = rec_get_offsets(rec, cursor->index,
					offsets, ULINT_UNDEFINED, &heap);
						  offsets, ULINT_UNDEFINED,
						  &heap);
			incl_data += rec_offs_size(offsets);
		}

@@ -1423,12 +1435,15 @@ btr_insert_on_non_leaf_level(
	first parameter for btr_cur_search_to_nth_level. */

	btr_cur_search_to_nth_level(tree->tree_index,
		level, tuple, PAGE_CUR_LE, BTR_CONT_MODIFY_TREE,
				    level, tuple, PAGE_CUR_LE,
				    BTR_CONT_MODIFY_TREE,
				    &cursor, 0, mtr);

	err = btr_cur_pessimistic_insert(BTR_NO_LOCKING_FLAG
		| BTR_KEEP_SYS_FLAG | BTR_NO_UNDO_LOG_FLAG,
		&cursor, tuple, &rec, &dummy_big_rec, NULL, mtr);
					 | BTR_KEEP_SYS_FLAG
					 | BTR_NO_UNDO_LOG_FLAG,
					 &cursor, tuple, &rec,
					 &dummy_big_rec, NULL, mtr);
	ut_a(err == DB_SUCCESS);
}

@@ -1484,9 +1499,8 @@ btr_attach_half_pages(
		/* Replace the address of the old child node (= page) with the
		address of the new lower half */

		btr_node_ptr_set_child_page_no(node_ptr,
			rec_get_offsets(node_ptr,
					tree->tree_index,
		btr_node_ptr_set_child_page_no(node_ptr, rec_get_offsets
					       (node_ptr, tree->tree_index,
						NULL, ULINT_UNDEFINED, &heap),
					       lower_page_no, mtr);
		mem_heap_empty(heap);
@@ -1673,10 +1687,12 @@ btr_page_split_and_insert(
					  n_uniq, &heap);

		insert_will_fit = btr_page_insert_fits(cursor,
					split_rec, offsets, tuple, heap);
						       split_rec, offsets,
						       tuple, heap);
	} else {
		insert_will_fit = btr_page_insert_fits(cursor,
					NULL, NULL, tuple, heap);
						       NULL, NULL,
						       tuple, heap);
	}

	if (insert_will_fit && (btr_page_get_level(page, mtr) == 0)) {
@@ -1775,9 +1791,11 @@ btr_page_split_and_insert(

	ibuf_update_free_bits_for_two_pages_low(cursor->index, left_page,
						right_page, mtr);
	/* fprintf(stderr, "Split and insert done %lu %lu\n",
#if 0
	fprintf(stderr, "Split and insert done %lu %lu\n",
		buf_frame_get_page_no(left_page),
				buf_frame_get_page_no(right_page)); */
		buf_frame_get_page_no(right_page));
#endif

	ut_ad(page_validate(left_page, tree->tree_index));
	ut_ad(page_validate(right_page, tree->tree_index));
@@ -1849,8 +1867,8 @@ btr_set_min_rec_mark_log(
	ulint	comp,	/* nonzero=compact record format */
	mtr_t*	mtr)	/* in: mtr */
{
	mlog_write_initial_log_record(rec,
		comp ? MLOG_COMP_REC_MIN_MARK : MLOG_REC_MIN_MARK, mtr);
	mlog_write_initial_log_record
		(rec, comp ? MLOG_COMP_REC_MIN_MARK : MLOG_REC_MIN_MARK, mtr);

	/* Write rec offset as a 2-byte ulint */
	mlog_catenate_ulint(mtr, ut_align_offset(rec, UNIV_PAGE_SIZE),
@@ -1961,8 +1979,8 @@ btr_lift_page_up(
	ut_ad(btr_page_get_next(page, mtr) == FIL_NULL);
	ut_ad(mtr_memo_contains(mtr, buf_block_align(page),
				MTR_MEMO_PAGE_X_FIX));
	father_page = buf_frame_align(
			btr_page_get_father_node_ptr(tree, page, mtr));
	father_page = buf_frame_align
		(btr_page_get_father_node_ptr(tree, page, mtr));

	page_level = btr_page_get_level(page, mtr);
	index = tree->tree_index;
@@ -2041,8 +2059,10 @@ btr_compress(
	left_page_no = btr_page_get_prev(page, mtr);
	right_page_no = btr_page_get_next(page, mtr);

/*	fprintf(stderr, "Merge left page %lu right %lu \n", left_page_no,
							right_page_no); */
#if 0
	fprintf(stderr, "Merge left page %lu right %lu \n",
		left_page_no, right_page_no);
#endif

	node_ptr = btr_page_get_father_node_ptr(tree, page, mtr);
	ut_ad(!comp || rec_get_status(node_ptr) == REC_STATUS_NODE_PTR);
@@ -2082,8 +2102,8 @@ btr_compress(
	data_size = page_get_data_size(page);
	ut_a(page_is_comp(merge_page) == comp);

	max_ins_size_reorg = page_get_max_insert_size_after_reorganize(
							merge_page, n_recs);
	max_ins_size_reorg = page_get_max_insert_size_after_reorganize
		(merge_page, n_recs);
	if (data_size > max_ins_size_reorg) {

		/* No space for merge */
@@ -2129,9 +2149,10 @@ btr_compress(
		/* Replace the address of the old child node (= page) with the
		address of the merge page to the right */

		btr_node_ptr_set_child_page_no(node_ptr,
				rec_get_offsets(node_ptr, cursor->index,
				offsets_, ULINT_UNDEFINED, &heap),
		btr_node_ptr_set_child_page_no(node_ptr, rec_get_offsets
					       (node_ptr, cursor->index,
						offsets_, ULINT_UNDEFINED, 
						&heap),
					       right_page_no, mtr);
		if (UNIV_LIKELY_NULL(heap)) {
			mem_heap_free(heap);
@@ -2141,17 +2162,19 @@ btr_compress(

	/* Move records to the merge page */
	if (is_left) {
		orig_pred = page_rec_get_prev(
					page_get_supremum_rec(merge_page));
		orig_pred = page_rec_get_prev
			(page_get_supremum_rec(merge_page));
		page_copy_rec_list_start(merge_page, page,
			page_get_supremum_rec(page), cursor->index, mtr);
					 page_get_supremum_rec(page),
					 cursor->index, mtr);

		lock_update_merge_left(merge_page, orig_pred, page);
	} else {
		orig_succ = page_rec_get_next(
					page_get_infimum_rec(merge_page));
		orig_succ = page_rec_get_next
			(page_get_infimum_rec(merge_page));
		page_copy_rec_list_end(merge_page, page,
			page_get_infimum_rec(page), cursor->index, mtr);
				       page_get_infimum_rec(page),
				       cursor->index, mtr);

		lock_update_merge_right(orig_succ, page);
	}
@@ -2292,8 +2315,8 @@ btr_discard_page(
	if (left_page_no != FIL_NULL) {
		lock_update_discard(page_get_supremum_rec(merge_page), page);
	} else {
		lock_update_discard(page_rec_get_next(
				page_get_infimum_rec(merge_page)), page);
		lock_update_discard(page_rec_get_next
				    (page_get_infimum_rec(merge_page)), page);
	}

	/* Free the file page */
@@ -2316,9 +2339,8 @@ btr_print_size(
	mtr_t		mtr;

	if (tree->type & DICT_IBUF) {
		fputs(
	"Sorry, cannot print info of an ibuf tree: use ibuf functions\n",
			stderr);
		fputs("Sorry, cannot print info of an ibuf tree:"
		      " use ibuf functions\n", stderr);

		return;
	}
@@ -2472,15 +2494,13 @@ btr_check_node_ptr(

	heap = mem_heap_create(256);

	node_ptr_tuple = dict_tree_build_node_ptr(
				tree,
				page_rec_get_next(page_get_infimum_rec(page)),
	node_ptr_tuple = dict_tree_build_node_ptr
		(tree, page_rec_get_next(page_get_infimum_rec(page)),
		 0, heap, btr_page_get_level(page, mtr));

	ut_a(cmp_dtuple_rec(node_ptr_tuple, node_ptr,
			rec_get_offsets(node_ptr,
			tree->tree_index,
			NULL, ULINT_UNDEFINED, &heap)) == 0);
	ut_a(!cmp_dtuple_rec(node_ptr_tuple, node_ptr,
			     rec_get_offsets(node_ptr, tree->tree_index,
					     NULL, ULINT_UNDEFINED, &heap)));

	mem_heap_free(heap);

@@ -2579,16 +2599,17 @@ btr_index_rec_validate(
		if ((dict_index_get_nth_field(index, i)->prefix_len == 0
		     && len != UNIV_SQL_NULL && fixed_size
		     && len != fixed_size)
		   ||
		   (dict_index_get_nth_field(index, i)->prefix_len > 0
		    || (dict_index_get_nth_field(index, i)->prefix_len > 0
			&& len != UNIV_SQL_NULL
			   && len >
			   dict_index_get_nth_field(index, i)->prefix_len)) {
			&& len
			> dict_index_get_nth_field(index, i)->prefix_len)) {

			btr_index_rec_validate_report(page, rec, index);
			fprintf(stderr,
"InnoDB: field %lu len is %lu, should be %lu\n",
				(ulong) i, (ulong) len, (ulong) dtype_get_fixed_size(type));
				"InnoDB: field %lu len is %lu,"
				" should be %lu\n",
				(ulong) i, (ulong) len,
				(ulong) dtype_get_fixed_size(type));

			if (dump_on_error) {
				buf_page_print(page);
@@ -2771,8 +2792,9 @@ btr_validate_level(
	left_page_no = btr_page_get_prev(page, &mtr);

	ut_a((page_get_n_recs(page) > 0)
		|| ((level == 0) &&
		  (buf_frame_get_page_no(page) == dict_tree_get_page(tree))));
	     || ((level == 0)
		 && (buf_frame_get_page_no(page)
		     == dict_tree_get_page(tree))));

	if (right_page_no != FIL_NULL) {
		rec_t*	right_rec;
@@ -2802,14 +2824,15 @@ btr_validate_level(
		}

		rec = page_rec_get_prev(page_get_supremum_rec(page));
		right_rec = page_rec_get_next(
					page_get_infimum_rec(right_page));
		right_rec = page_rec_get_next(page_get_infimum_rec
					      (right_page));
		offsets = rec_get_offsets(rec, index,
					  offsets, ULINT_UNDEFINED, &heap);
		offsets2 = rec_get_offsets(right_rec, index,
					   offsets2, ULINT_UNDEFINED, &heap);
		if (UNIV_UNLIKELY(cmp_rec_rec(rec, right_rec,
				offsets, offsets2, index) >= 0)) {
					      offsets, offsets2,
					      index) >= 0)) {

			btr_validate_report2(index, level, page, right_page);

@@ -2824,8 +2847,8 @@ btr_validate_level(
			rec_print(stderr, rec, index);
			putc('\n', stderr);
			fputs("InnoDB: record ", stderr);
			rec = page_rec_get_next(page_get_infimum_rec(
						right_page));
			rec = page_rec_get_next
				(page_get_infimum_rec(right_page));
			rec_print(stderr, rec, index);
			putc('\n', stderr);

@@ -2834,8 +2857,8 @@ btr_validate_level(
	}

	if (level > 0 && left_page_no == FIL_NULL) {
		ut_a(REC_INFO_MIN_REC_FLAG & rec_get_info_bits(
			page_rec_get_next(page_get_infimum_rec(page)),
		ut_a(REC_INFO_MIN_REC_FLAG & rec_get_info_bits
		     (page_rec_get_next(page_get_infimum_rec(page)),
		      page_is_comp(page)));
	}

@@ -2848,11 +2871,11 @@ btr_validate_level(
		offsets	= rec_get_offsets(node_ptr, index,
					  offsets, ULINT_UNDEFINED, &heap);

		if (btr_node_ptr_get_child_page_no(node_ptr, offsets) !=
						buf_frame_get_page_no(page)
		   || node_ptr != btr_page_get_father_for_rec(tree, page,
			page_rec_get_prev(page_get_supremum_rec(page)),
							&mtr)) {
		if (btr_node_ptr_get_child_page_no(node_ptr, offsets)
		    != buf_frame_get_page_no(page)
		    || node_ptr != btr_page_get_father_for_rec
		    (tree, page,
		     page_rec_get_prev(page_get_supremum_rec(page)), &mtr)) {
			btr_validate_report1(index, level, page);

			fputs("InnoDB: node pointer to the page is wrong\n",
@@ -2866,13 +2889,13 @@ btr_validate_level(

			fprintf(stderr, "\n"
				"InnoDB: node ptr child page n:o %lu\n",
				(unsigned long) btr_node_ptr_get_child_page_no(
						node_ptr, offsets));
				(unsigned long) btr_node_ptr_get_child_page_no
				(node_ptr, offsets));

			fputs("InnoDB: record on page ", stderr);
			rec = btr_page_get_father_for_rec(tree, page,
				page_rec_get_prev(page_get_supremum_rec(page)),
				&mtr);
			rec = btr_page_get_father_for_rec
				(tree, page, page_rec_get_prev
				 (page_get_supremum_rec(page)), &mtr);
			rec_print(stderr, rec, index);
			putc('\n', stderr);
			ret = FALSE;
@@ -2882,19 +2905,18 @@ btr_validate_level(

		if (btr_page_get_level(page, &mtr) > 0) {
			offsets	= rec_get_offsets(node_ptr, index,
					offsets, ULINT_UNDEFINED, &heap);
						  offsets, ULINT_UNDEFINED,
						  &heap);

			node_ptr_tuple = dict_tree_build_node_ptr(
					tree,
					page_rec_get_next(
						page_get_infimum_rec(page)),
						0, heap,
					btr_page_get_level(page, &mtr));
			node_ptr_tuple = dict_tree_build_node_ptr
				(tree,
				 page_rec_get_next(page_get_infimum_rec(page)),
				 0, heap, btr_page_get_level(page, &mtr));

			if (cmp_dtuple_rec(node_ptr_tuple, node_ptr,
					   offsets)) {
				rec_t*	first_rec	= page_rec_get_next(
					page_get_infimum_rec(page));
				rec_t*	first_rec	= page_rec_get_next
					(page_get_infimum_rec(page));

				btr_validate_report1(index, level, page);

@@ -2915,26 +2937,26 @@ btr_validate_level(
		}

		if (left_page_no == FIL_NULL) {
			ut_a(node_ptr == page_rec_get_next(
					page_get_infimum_rec(father_page)));
			ut_a(node_ptr == page_rec_get_next
			     (page_get_infimum_rec(father_page)));
			ut_a(btr_page_get_prev(father_page, &mtr) == FIL_NULL);
		}

		if (right_page_no == FIL_NULL) {
			ut_a(node_ptr == page_rec_get_prev(
				page_get_supremum_rec(father_page)));
			ut_a(node_ptr == page_rec_get_prev
			     (page_get_supremum_rec(father_page)));
			ut_a(btr_page_get_next(father_page, &mtr) == FIL_NULL);
		} else {
			right_node_ptr = btr_page_get_father_node_ptr(tree,
							right_page, &mtr);
			if (page_rec_get_next(node_ptr) !=
					page_get_supremum_rec(father_page)) {
			right_node_ptr = btr_page_get_father_node_ptr
				(tree, right_page, &mtr);
			if (page_rec_get_next(node_ptr)
			    != page_get_supremum_rec(father_page)) {

				if (right_node_ptr !=
						page_rec_get_next(node_ptr)) {
				if (right_node_ptr
				    != page_rec_get_next(node_ptr)) {
					ret = FALSE;
					fputs(
			"InnoDB: node pointer to the right page is wrong\n",
					fputs("InnoDB: node pointer to"
					      " the right page is wrong\n",
					      stderr);

					btr_validate_report1(index, level,
@@ -2945,15 +2967,15 @@ btr_validate_level(
					buf_page_print(right_page);
				}
			} else {
				right_father_page = buf_frame_align(
							right_node_ptr);
				right_father_page = buf_frame_align
					(right_node_ptr);

				if (right_node_ptr != page_rec_get_next(
							page_get_infimum_rec(
							right_father_page))) {
				if (right_node_ptr != page_rec_get_next
				    (page_get_infimum_rec
				     (right_father_page))) {
					ret = FALSE;
					fputs(
			"InnoDB: node pointer 2 to the right page is wrong\n",
					fputs("InnoDB: node pointer 2 to"
					      " the right page is wrong\n",
					      stderr);

					btr_validate_report1(index, level,
@@ -2969,8 +2991,8 @@ btr_validate_level(
				    != btr_page_get_next(father_page, &mtr)) {

					ret = FALSE;
					fputs(
			"InnoDB: node pointer 3 to the right page is wrong\n",
					fputs("InnoDB: node pointer 3 to"
					      " the right page is wrong\n",
					      stderr);

					btr_validate_report1(index, level,
+349 −328

File changed.

Preview size limit exceeded, changes collapsed.

+49 −45
Original line number Diff line number Diff line
@@ -133,14 +133,13 @@ btr_pcur_store_position(
	}

	cursor->old_stored = BTR_PCUR_OLD_STORED;
	cursor->old_rec = dict_tree_copy_rec_order_prefix(tree, rec,
						&cursor->old_n_fields,
						&cursor->old_rec_buf,
						&cursor->buf_size);
	cursor->old_rec = dict_tree_copy_rec_order_prefix
		(tree, rec, &cursor->old_n_fields,
		 &cursor->old_rec_buf, &cursor->buf_size);

	cursor->block_when_stored = buf_block_align(page);
	cursor->modify_clock = buf_block_get_modify_clock(
				cursor->block_when_stored);
	cursor->modify_clock = buf_block_get_modify_clock
		(cursor->block_when_stored);
}

/******************************************************************
@@ -216,19 +215,20 @@ btr_pcur_restore_position(
		ut_error;
	}

	if (UNIV_UNLIKELY(cursor->rel_pos == BTR_PCUR_AFTER_LAST_IN_TREE
	if (UNIV_UNLIKELY
	    (cursor->rel_pos == BTR_PCUR_AFTER_LAST_IN_TREE
	     || cursor->rel_pos == BTR_PCUR_BEFORE_FIRST_IN_TREE)) {

		/* In these cases we do not try an optimistic restoration,
		but always do a search */

		btr_cur_open_at_index_side(
			cursor->rel_pos == BTR_PCUR_BEFORE_FIRST_IN_TREE,
		btr_cur_open_at_index_side
			(cursor->rel_pos == BTR_PCUR_BEFORE_FIRST_IN_TREE,
			 btr_pcur_get_btr_cur(cursor)->index, latch_mode,
			 btr_pcur_get_btr_cur(cursor), mtr);

		cursor->block_when_stored =
				buf_block_align(btr_pcur_get_page(cursor));
		cursor->block_when_stored
			= buf_block_align(btr_pcur_get_page(cursor));

		return(FALSE);
	}
@@ -242,7 +242,8 @@ btr_pcur_restore_position(
	    || UNIV_LIKELY(latch_mode == BTR_MODIFY_LEAF)) {
		/* Try optimistic restoration */

		if (UNIV_LIKELY(buf_page_optimistic_get(latch_mode,
		if (UNIV_LIKELY
		    (buf_page_optimistic_get(latch_mode,
					     cursor->block_when_stored, page,
					     cursor->modify_clock, mtr))) {
			cursor->pos_state = BTR_PCUR_IS_POSITIONED;
@@ -262,14 +263,16 @@ btr_pcur_restore_position(
				index = btr_pcur_get_btr_cur(cursor)->index;

				heap = mem_heap_create(256);
				offsets1 = rec_get_offsets(cursor->old_rec,
						index, NULL,
				offsets1 = rec_get_offsets
					(cursor->old_rec, index, NULL,
					 cursor->old_n_fields, &heap);
				offsets2 = rec_get_offsets(rec, index, NULL,
				offsets2 = rec_get_offsets
					(rec, index, NULL,
					 cursor->old_n_fields, &heap);

				ut_ad(cmp_rec_rec(cursor->old_rec,
					rec, offsets1, offsets2, index) == 0);
				ut_ad(!cmp_rec_rec(cursor->old_rec,
						   rec, offsets1, offsets2,
						   index));
				mem_heap_free(heap);
#endif /* UNIV_DEBUG */
				return(TRUE);
@@ -308,7 +311,8 @@ btr_pcur_restore_position(
	if (cursor->rel_pos == BTR_PCUR_ON
	    && btr_pcur_is_on_user_rec(cursor, mtr)
	    && 0 == cmp_dtuple_rec(tuple, btr_pcur_get_rec(cursor),
			rec_get_offsets(btr_pcur_get_rec(cursor),
				   rec_get_offsets
				   (btr_pcur_get_rec(cursor),
				    btr_pcur_get_btr_cur(cursor)->index,
				    NULL, ULINT_UNDEFINED, &heap))) {

@@ -316,10 +320,10 @@ btr_pcur_restore_position(
		the cursor can now be on a different page! But we can retain
		the value of old_rec */

		cursor->block_when_stored =
			buf_block_align(btr_pcur_get_page(cursor));
		cursor->modify_clock =
			buf_block_get_modify_clock(cursor->block_when_stored);
		cursor->block_when_stored = buf_block_align
			(btr_pcur_get_page(cursor));
		cursor->modify_clock = buf_block_get_modify_clock
			(cursor->block_when_stored);
		cursor->old_stored = BTR_PCUR_OLD_STORED;

		mem_heap_free(heap);
Loading