Commit 0da158aa authored by unknown's avatar unknown

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
......@@ -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};
......
......@@ -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
......
This diff is collapsed.
This diff is collapsed.
......@@ -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);
......
......@@ -432,8 +432,9 @@ btr_search_update_hash_ref(
}
tree_id = ((cursor->index)->tree)->id;
fold = rec_fold(rec, rec_get_offsets(rec, cursor->index,
offsets_, ULINT_UNDEFINED, &heap),
fold = rec_fold(rec,
rec_get_offsets(rec, cursor->index, offsets_,
ULINT_UNDEFINED, &heap),
block->curr_n_fields,
block->curr_n_bytes, tree_id);
if (UNIV_LIKELY_NULL(heap)) {
......@@ -617,8 +618,8 @@ btr_search_check_guess(
prev_rec = page_rec_get_prev(rec);
if (page_rec_is_infimum(prev_rec)) {
success = btr_page_get_prev(
buf_frame_align(prev_rec), mtr) == FIL_NULL;
success = btr_page_get_prev
(buf_frame_align(prev_rec), mtr) == FIL_NULL;
goto exit_func;
}
......@@ -642,8 +643,8 @@ btr_search_check_guess(
next_rec = page_rec_get_next(rec);
if (page_rec_is_supremum(next_rec)) {
if (btr_page_get_next(
buf_frame_align(next_rec), mtr) == FIL_NULL) {
if (btr_page_get_next
(buf_frame_align(next_rec), mtr) == FIL_NULL) {
cursor->up_match = 0;
success = TRUE;
......@@ -762,10 +763,10 @@ btr_search_guess_on_hash(
if (UNIV_LIKELY(!has_search_latch)) {
if (UNIV_UNLIKELY(!buf_page_get_known_nowait(latch_mode, page,
if (UNIV_UNLIKELY
(!buf_page_get_known_nowait(latch_mode, page,
BUF_MAKE_YOUNG,
__FILE__, __LINE__,
mtr))) {
__FILE__, __LINE__, mtr))) {
goto failure_unlock;
}
......@@ -802,7 +803,8 @@ btr_search_guess_on_hash(
right. */
if (UNIV_EXPECT(ut_dulint_cmp(tree_id, btr_page_get_index_id(page)), 0)
|| !btr_search_check_guess(cursor,
can_only_compare_to_cursor_rec, tuple, mode, mtr)) {
can_only_compare_to_cursor_rec,
tuple, mode, mtr)) {
if (UNIV_LIKELY(!has_search_latch)) {
btr_leaf_page_release(page, latch_mode, mtr);
}
......@@ -1029,8 +1031,10 @@ cleanup:
/* Corruption */
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Corruption of adaptive hash index. After dropping\n"
"InnoDB: the hash index to a page of %s, still %lu hash nodes remain.\n",
" InnoDB: Corruption of adaptive hash index."
" After dropping\n"
"InnoDB: the hash index to a page of %s,"
" still %lu hash nodes remain.\n",
index->name, (ulong) block->n_pointers);
rw_lock_x_unlock(&btr_search_latch);
......@@ -1378,8 +1382,8 @@ btr_search_update_hash_on_delete(
tree_id = cursor->index->tree->id;
fold = rec_fold(rec, rec_get_offsets(rec, cursor->index, offsets_,
ULINT_UNDEFINED, &heap), block->curr_n_fields,
block->curr_n_bytes, tree_id);
ULINT_UNDEFINED, &heap),
block->curr_n_fields, block->curr_n_bytes, tree_id);
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
......@@ -1570,11 +1574,11 @@ check_next_rec:
if (side == BTR_SEARCH_RIGHT_SIDE) {
ha_insert_for_fold(table, ins_fold, ins_rec);
/*
/*
fputs("Hash insert for ", stderr);
dict_index_name_print(stderr, cursor->index);
fprintf(stderr, " fold %lu\n", ins_fold);
*/
*/
} else {
ha_insert_for_fold(table, next_fold, next_rec);
}
......@@ -1635,10 +1639,11 @@ btr_search_validate(void)
offsets = rec_get_offsets((rec_t*) node->data,
block->index, offsets,
block->curr_n_fields
+ (block->curr_n_bytes > 0), &heap);
+ (block->curr_n_bytes > 0),
&heap);
if (!block->is_hashed
|| node->fold != rec_fold((rec_t*)(node->data),
if (!block->is_hashed || node->fold
!= rec_fold((rec_t*)(node->data),
offsets,
block->curr_n_fields,
block->curr_n_bytes,
......@@ -1647,28 +1652,36 @@ btr_search_validate(void)
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Error in an adaptive hash index pointer to page %lu\n"
"ptr mem address %p index id %lu %lu, node fold %lu, rec fold %lu\n",
" InnoDB: Error in an adaptive hash"
" index pointer to page %lu\n"
"InnoDB: ptr mem address %p"
" index id %lu %lu,"
" node fold %lu, rec fold %lu\n",
(ulong) buf_frame_get_page_no(page),
node->data,
(ulong) ut_dulint_get_high(btr_page_get_index_id(page)),
(ulong) ut_dulint_get_low(btr_page_get_index_id(page)),
(ulong) ut_dulint_get_high
(btr_page_get_index_id(page)),
(ulong) ut_dulint_get_low
(btr_page_get_index_id(page)),
(ulong) node->fold,
(ulong) rec_fold((rec_t*)(node->data),
offsets,
block->curr_n_fields,
block->curr_n_bytes,
btr_page_get_index_id(page)));
btr_page_get_index_id
(page)));
fputs("InnoDB: Record ", stderr);
rec_print_new(stderr, (rec_t*)node->data,
offsets);
fprintf(stderr, "\nInnoDB: on that page."
"Page mem address %p, is hashed %lu, n fields %lu, n bytes %lu\n"
"side %lu\n",
page, (ulong) block->is_hashed,
" Page mem address %p, is hashed %lu,"
" n fields %lu, n bytes %lu\n"
"InnoDB: side %lu\n",
(void*) page, (ulong) block->is_hashed,
(ulong) block->curr_n_fields,
(ulong) block->curr_n_bytes, (ulong) block->curr_side);
(ulong) block->curr_n_bytes,
(ulong) block->curr_side);
if (n_page_dumps < 20) {
buf_page_print(page);
......
This diff is collapsed.
......@@ -55,8 +55,7 @@ buf_flush_insert_into_flush_list(
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
ut_ad((UT_LIST_GET_FIRST(buf_pool->flush_list) == NULL)
|| (ut_dulint_cmp(
(UT_LIST_GET_FIRST(buf_pool->flush_list))
|| (ut_dulint_cmp((UT_LIST_GET_FIRST(buf_pool->flush_list))
->oldest_modification,
block->oldest_modification) <= 0));
......@@ -118,7 +117,8 @@ buf_flush_ready_for_replace(
if (block->state != BUF_BLOCK_FILE_PAGE) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Error: buffer block state %lu in the LRU list!\n",
" InnoDB: Error: buffer block state %lu"
" in the LRU list!\n",
(ulong)block->state);
ut_print_buf(stderr, block, sizeof(buf_block_t));
......@@ -259,9 +259,12 @@ buf_flush_buffered_writes(void)
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: ERROR: The page to be written seems corrupt!\n"
"InnoDB: The lsn fields do not match! Noticed in the buffer pool\n"
"InnoDB: before posting to the doublewrite buffer.\n");
" InnoDB: ERROR: The page to be written"
" seems corrupt!\n"
"InnoDB: The lsn fields do not match!"
" Noticed in the buffer pool\n"
"InnoDB: before posting to the"
" doublewrite buffer.\n");
}
if (block->check_index_page_at_flush
......@@ -271,9 +274,12 @@ buf_flush_buffered_writes(void)
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Apparent corruption of an index page n:o %lu in space %lu\n"
"InnoDB: to be written to data file. We intentionally crash server\n"
"InnoDB: to prevent corrupt data from ending up in data\n"
" InnoDB: Apparent corruption of an"
" index page n:o %lu in space %lu\n"
"InnoDB: to be written to data file."
" We intentionally crash server\n"
"InnoDB: to prevent corrupt data"
" from ending up in data\n"
"InnoDB: files.\n",
(ulong) block->offset, (ulong) block->space);
......@@ -304,8 +310,10 @@ buf_flush_buffered_writes(void)
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: ERROR: The page to be written seems corrupt!\n"
"InnoDB: The lsn fields do not match! Noticed in the doublewrite block1.\n");
" InnoDB: ERROR: The page to be written"
" seems corrupt!\n"
"InnoDB: The lsn fields do not match!"
" Noticed in the doublewrite block1.\n");
}
}
......@@ -317,7 +325,8 @@ buf_flush_buffered_writes(void)
TRUE, TRX_SYS_SPACE,
trx_doublewrite->block2, 0, len,
(void*)(trx_doublewrite->write_buf
+ TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * UNIV_PAGE_SIZE),
+ TRX_SYS_DOUBLEWRITE_BLOCK_SIZE
* UNIV_PAGE_SIZE),
NULL);
write_buf = trx_doublewrite->write_buf
......@@ -328,11 +337,15 @@ buf_flush_buffered_writes(void)
+ FIL_PAGE_LSN + 4)
!= mach_read_from_4(write_buf + len2
+ UNIV_PAGE_SIZE
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) {
- FIL_PAGE_END_LSN_OLD_CHKSUM
+ 4)) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: ERROR: The page to be written seems corrupt!\n"
"InnoDB: The lsn fields do not match! Noticed in the doublewrite block2.\n");
" InnoDB: ERROR: The page to be"
" written seems corrupt!\n"
"InnoDB: The lsn fields do not match!"
" Noticed in"
" the doublewrite block2.\n");
}
}
}
......@@ -353,10 +366,14 @@ buf_flush_buffered_writes(void)
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: ERROR: The page to be written seems corrupt!\n"
"InnoDB: The lsn fields do not match! Noticed in the buffer pool\n"
"InnoDB: after posting and flushing the doublewrite buffer.\n"
"InnoDB: Page buf fix count %lu, io fix %lu, state %lu\n",
" InnoDB: ERROR: The page to be written"
" seems corrupt!\n"
"InnoDB: The lsn fields do not match!"
" Noticed in the buffer pool\n"
"InnoDB: after posting and flushing"
" the doublewrite buffer.\n"
"InnoDB: Page buf fix count %lu,"
" io fix %lu, state %lu\n",
(ulong)block->buf_fix_count,
(ulong)block->io_fix,
(ulong)block->state);
......@@ -457,8 +474,9 @@ buf_flush_init_for_writing(
/* Store the new formula checksum */
mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
srv_use_checksums ?
buf_calc_page_new_checksum(page) : BUF_NO_CHECKSUM_MAGIC);
srv_use_checksums
? buf_calc_page_new_checksum(page)
: BUF_NO_CHECKSUM_MAGIC);
/* We overwrite the first 4 bytes of the end lsn field to store
the old formula checksum. Since it depends also on the field
......@@ -466,8 +484,9 @@ buf_flush_init_for_writing(
new formula checksum. */
mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
srv_use_checksums ?
buf_calc_page_old_checksum(page) : BUF_NO_CHECKSUM_MAGIC);
srv_use_checksums
? buf_calc_page_old_checksum(page)
: BUF_NO_CHECKSUM_MAGIC);
}
/************************************************************************
......@@ -493,8 +512,8 @@ buf_flush_write_block_low(
#ifdef UNIV_LOG_DEBUG
if (!univ_log_debug_warned) {
univ_log_debug_warned = TRUE;
fputs(
"Warning: cannot force log to disk if UNIV_LOG_DEBUG is defined!\n"
fputs("Warning: cannot force log to disk if"
" UNIV_LOG_DEBUG is defined!\n"
"Crash recovery will not work!\n",
stderr);
}
......@@ -680,7 +699,8 @@ buf_flush_try_page(
#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fprintf(stderr,
"Flushing single page space %lu, page no %lu \n",
"Flushing single page space %lu,"
" page no %lu \n",
(ulong) block->space,
(ulong) block->offset);
}
......@@ -870,9 +890,8 @@ buf_flush_batch(
old_page_count = page_count;
/* Try to flush also all the neighbors */
page_count +=
buf_flush_try_neighbors(space, offset,
flush_type);
page_count += buf_flush_try_neighbors
(space, offset, flush_type);
/* fprintf(stderr,
"Flush type %lu, page no %lu, neighb %lu\n",
flush_type, offset,
......
......@@ -103,7 +103,7 @@ scan_again:
if (block->space == id) {
#ifdef UNIV_DEBUG
if (buf_debug_prints) {
printf(
fprintf(stderr,
"Dropping space %lu page %lu\n",
(ulong) block->space,
(ulong) block->offset);
......@@ -216,7 +216,8 @@ buf_LRU_search_and_free_block(
#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fprintf(stderr,
"Putting space %lu page %lu to free list\n",
"Putting space %lu page %lu"
" to free list\n",
(ulong) block->space,
(ulong) block->offset);
}
......@@ -344,14 +345,19 @@ loop:
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: ERROR: over 95 percent of the buffer pool is occupied by\n"
"InnoDB: lock heaps or the adaptive hash index! Check that your\n"
"InnoDB: transactions do not set too many row locks.\n"
"InnoDB: Your buffer pool size is %lu MB. Maybe you should make\n"
"InnoDB: the buffer pool bigger?\n"
"InnoDB: We intentionally generate a seg fault to print a stack trace\n"
"InnoDB: on Linux!\n",
(ulong)(buf_pool->curr_size / (1024 * 1024 / UNIV_PAGE_SIZE)));
" InnoDB: ERROR: over 95 percent of the buffer pool"
" is occupied by\n"
"InnoDB: lock heaps or the adaptive hash index!"
" Check that your\n"
"InnoDB: transactions do not set too many row locks.\n"
"InnoDB: Your buffer pool size is %lu MB."
" Maybe you should make\n"
"InnoDB: the buffer pool bigger?\n"
"InnoDB: We intentionally generate a seg fault"
" to print a stack trace\n"
"InnoDB: on Linux!\n",
(ulong) (buf_pool->curr_size
/ (1024 * 1024 / UNIV_PAGE_SIZE)));
ut_error;
......@@ -366,14 +372,20 @@ loop:
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: WARNING: over 67 percent of the buffer pool is occupied by\n"
"InnoDB: lock heaps or the adaptive hash index! Check that your\n"
"InnoDB: transactions do not set too many row locks.\n"
"InnoDB: Your buffer pool size is %lu MB. Maybe you should make\n"
"InnoDB: the buffer pool bigger?\n"
"InnoDB: Starting the InnoDB Monitor to print diagnostics, including\n"
"InnoDB: lock heap and hash index sizes.\n",
(ulong) (buf_pool->curr_size / (1024 * 1024 / UNIV_PAGE_SIZE)));
" InnoDB: WARNING: over 67 percent of"
" the buffer pool is occupied by\n"
"InnoDB: lock heaps or the adaptive"
" hash index! Check that your\n"
"InnoDB: transactions do not set too many"
" row locks.\n"
"InnoDB: Your buffer pool size is %lu MB."
" Maybe you should make\n"
"InnoDB: the buffer pool bigger?\n"
"InnoDB: Starting the InnoDB Monitor to print"
" diagnostics, including\n"
"InnoDB: lock heap and hash index sizes.\n",
(ulong) (buf_pool->curr_size
/ (1024 * 1024 / UNIV_PAGE_SIZE)));
buf_lru_switched_on_innodb_mon = TRUE;
srv_print_innodb_monitor = TRUE;
......@@ -405,7 +417,8 @@ loop:
/* Remove from the list of mapped pages */
UT_LIST_REMOVE(awe_LRU_free_mapped,
buf_pool->awe_LRU_free_mapped, block);
buf_pool->awe_LRU_free_mapped,
block);
} else {
/* We map the page to a frame; second param
FALSE below because we do not want it to be
......@@ -441,15 +454,22 @@ loop:
ut_print_timestamp(stderr);
fprintf(stderr,
"InnoDB: Warning: difficult to find free blocks from\n"
"InnoDB: the buffer pool (%lu search iterations)! Consider\n"
"InnoDB: the buffer pool (%lu search iterations)!"
" Consider\n"
"InnoDB: increasing the buffer pool size.\n"
"InnoDB: It is also possible that in your Unix version\n"
"InnoDB: fsync is very slow, or completely frozen inside\n"
"InnoDB: the OS kernel. Then upgrading to a newer version\n"
"InnoDB: of your operating system may help. Look at the\n"
"InnoDB: It is also possible that"
" in your Unix version\n"
"InnoDB: fsync is very slow, or"
" completely frozen inside\n"
"InnoDB: the OS kernel. Then upgrading to"
" a newer version\n"
"InnoDB: of your operating system may help."
" Look at the\n"
"InnoDB: number of fsyncs in diagnostic info below.\n"
"InnoDB: Pending flushes (fsync) log: %lu; buffer pool: %lu\n"
"InnoDB: %lu OS file reads, %lu OS file writes, %lu OS fsyncs\n"
"InnoDB: Pending flushes (fsync) log: %lu;"
" buffer pool: %lu\n"
"InnoDB: %lu OS file reads, %lu OS file writes,"
" %lu OS fsyncs\n"
"InnoDB: Starting InnoDB Monitor to print further\n"
"InnoDB: diagnostics to the standard output.\n",
(ulong) n_iterations,
......@@ -522,16 +542,16 @@ buf_LRU_old_adjust_len(void)
if (old_len < new_len - BUF_LRU_OLD_TOLERANCE) {
buf_pool->LRU_old = UT_LIST_GET_PREV(LRU,
buf_pool->LRU_old);
buf_pool->LRU_old = UT_LIST_GET_PREV
(LRU, buf_pool->LRU_old);
(buf_pool->LRU_old)->old = TRUE;
buf_pool->LRU_old_len++;
} else if (old_len > new_len + BUF_LRU_OLD_TOLERANCE) {
(buf_pool->LRU_old)->old = FALSE;
buf_pool->LRU_old = UT_LIST_GET_NEXT(LRU,
buf_pool->LRU_old);
buf_pool->LRU_old = UT_LIST_GET_NEXT
(LRU, buf_pool->LRU_old);
buf_pool->LRU_old_len--;
} else {
ut_a(buf_pool->LRU_old); /* Check that we did not
......@@ -875,15 +895,20 @@ buf_LRU_block_remove_hashed_page(
if (block != buf_page_hash_get(block->space, block->offset)) {
fprintf(stderr,
"InnoDB: Error: page %lu %lu not found from the hash table\n",
"InnoDB: Error: page %lu %lu not found"
" in the hash table\n",
(ulong) block->space,
(ulong) block->offset);
if (buf_page_hash_get(block->space, block->offset)) {
fprintf(stderr,
"InnoDB: From hash table we find block %p of %lu %lu which is not %p\n",
(void*) buf_page_hash_get(block->space, block->offset),
(ulong) buf_page_hash_get(block->space, block->offset)->space,
(ulong) buf_page_hash_get(block->space, block->offset)->offset,
"InnoDB: In hash table we find block"
" %p of %lu %lu which is not %p\n",
(void*) buf_page_hash_get
(block->space, block->offset),
(ulong) buf_page_hash_get
(block->space, block->offset)->space,
(ulong) buf_page_hash_get
(block->space, block->offset)->offset,
(void*) block);
}
......@@ -1009,7 +1034,8 @@ buf_LRU_print(void)
ut_ad(buf_pool);
mutex_enter(&(buf_pool->mutex));
fprintf(stderr, "Pool ulint clock %lu\n", (ulong) buf_pool->ulint_clock);
fprintf(stderr, "Pool ulint clock %lu\n",
(ulong) buf_pool->ulint_clock);
block = UT_LIST_GET_FIRST(buf_pool->LRU);
......@@ -1042,7 +1068,8 @@ buf_LRU_print(void)
fprintf(stderr, "LRU pos %lu type %lu index id %lu ",
(ulong) block->LRU_position,
(ulong) fil_page_get_type(frame),
(ulong) ut_dulint_get_low(btr_page_get_index_id(frame)));
(ulong) ut_dulint_get_low
(btr_page_get_index_id(frame)));
block = UT_LIST_GET_NEXT(LRU, block);
if (++len == 10) {
......
......@@ -89,24 +89,13 @@ buf_read_page_low(
+ TRX_SYS_DOUBLEWRITE_BLOCK_SIZE))) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Warning: trying to read doublewrite buffer page %lu\n",
" InnoDB: Warning: trying to read"
" doublewrite buffer page %lu\n",
(ulong) offset);
return(0);
}
#ifdef UNIV_LOG_DEBUG
if (space % 2 == 1) {
/* We are updating a replicate space while holding the
log mutex: the read must be handled before other reads
which might incur ibuf operations and thus write to the log */
fputs("Log debug: reading replicate page in sync mode\n",
stderr);
sync = TRUE;
}
#endif
if (ibuf_bitmap_page(offset) || trx_sys_hdr_page(space, offset)) {
/* Trx sys header is so low in the latching order that we play
......@@ -224,8 +213,8 @@ buf_read_ahead_random(
mutex_enter(&(buf_pool->mutex));
if (buf_pool->n_pend_reads >
buf_pool->curr_size / BUF_READ_AHEAD_PEND_LIMIT) {
if (buf_pool->n_pend_reads
> buf_pool->curr_size / BUF_READ_AHEAD_PEND_LIMIT) {
mutex_exit(&(buf_pool->mutex));
return(0);
......@@ -268,15 +257,18 @@ buf_read_ahead_random(
mode: hence FALSE as the first parameter */
if (!ibuf_bitmap_page(i)) {
count += buf_read_page_low(&err, FALSE, ibuf_mode
| OS_AIO_SIMULATED_WAKE_LATER,
count += buf_read_page_low
(&err, FALSE,
ibuf_mode | OS_AIO_SIMULATED_WAKE_LATER,
space, tablespace_version, i);
if (err == DB_TABLESPACE_DELETED) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Warning: in random readahead trying to access tablespace\n"
"InnoDB: %lu page no. %lu,\n"
"InnoDB: but the tablespace does not exist or is just being dropped.\n",
" InnoDB: Warning: in random"
" readahead trying to access\n"
"InnoDB: tablespace %lu page %lu,\n"
"InnoDB: but the tablespace does not"
" exist or is just being dropped.\n",
(ulong) space, (ulong) i);
}
}
......@@ -334,8 +326,10 @@ buf_read_page(
if (err == DB_TABLESPACE_DELETED) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Error: trying to access tablespace %lu page no. %lu,\n"
"InnoDB: but the tablespace does not exist or is just being dropped.\n",
" InnoDB: Error: trying to access"
" tablespace %lu page no. %lu,\n"
"InnoDB: but the tablespace does not exist"
" or is just being dropped.\n",
(ulong) space, (ulong) offset);
}
......@@ -432,8 +426,8 @@ buf_read_ahead_linear(
return(0);
}
if (buf_pool->n_pend_reads >
buf_pool->curr_size / BUF_READ_AHEAD_PEND_LIMIT) {
if (buf_pool->n_pend_reads
> buf_pool->curr_size / BUF_READ_AHEAD_PEND_LIMIT) {
mutex_exit(&(buf_pool->mutex));
return(0);
......@@ -469,8 +463,8 @@ buf_read_ahead_linear(
}
}
if (fail_count > BUF_READ_AHEAD_LINEAR_AREA -
BUF_READ_AHEAD_LINEAR_THRESHOLD) {
if (fail_count > BUF_READ_AHEAD_LINEAR_AREA
- BUF_READ_AHEAD_LINEAR_THRESHOLD) {
/* Too many failures: return */
mutex_exit(&(buf_pool->mutex));
......@@ -555,15 +549,18 @@ buf_read_ahead_linear(
aio mode: hence FALSE as the first parameter */
if (!ibuf_bitmap_page(i)) {
count += buf_read_page_low(&err, FALSE, ibuf_mode
| OS_AIO_SIMULATED_WAKE_LATER,
count += buf_read_page_low
(&err, FALSE,
ibuf_mode | OS_AIO_SIMULATED_WAKE_LATER,
space, tablespace_version, i);
if (err == DB_TABLESPACE_DELETED) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Warning: in linear readahead trying to access tablespace\n"
"InnoDB: %lu page no. %lu,\n"
"InnoDB: but the tablespace does not exist or is just being dropped.\n",
" InnoDB: Warning: in"
" linear readahead trying to access\n"
"InnoDB: tablespace %lu page %lu,\n"
"InnoDB: but the tablespace does not"
" exist or is just being dropped.\n",
(ulong) space, (ulong) i);
}
}
......@@ -618,19 +615,17 @@ buf_read_ibuf_merge_pages(
#ifdef UNIV_IBUF_DEBUG
ut_a(n_stored < UNIV_PAGE_SIZE);
#endif
while (buf_pool->n_pend_reads >
buf_pool->curr_size / BUF_READ_AHEAD_PEND_LIMIT) {
while (buf_pool->n_pend_reads
> buf_pool->curr_size / BUF_READ_AHEAD_PEND_LIMIT) {
os_thread_sleep(500000);
}
for (i = 0; i < n_stored; i++) {
if ((i + 1 == n_stored) && sync) {
buf_read_page_low(&err, TRUE, BUF_READ_ANY_PAGE,
space_ids[i], space_versions[i], page_nos[i]);
} else {
buf_read_page_low(&err, FALSE, BUF_READ_ANY_PAGE,
space_ids[i], space_versions[i], page_nos[i]);
}
buf_read_page_low(&err,
(i + 1 == n_stored) && sync,
BUF_READ_ANY_PAGE,
space_ids[i], space_versions[i],
page_nos[i]);
if (err == DB_TABLESPACE_DELETED) {
/* We have deleted or are deleting the single-table
......@@ -691,9 +686,12 @@ buf_read_recv_pages(
if (count > 100) {
fprintf(stderr,
"InnoDB: Error: InnoDB has waited for 50 seconds for pending\n"
"InnoDB: reads to the buffer pool to be finished.\n"
"InnoDB: Number of pending reads %lu, pending pread calls %lu\n",
"InnoDB: Error: InnoDB has waited for"
" 50 seconds for pending\n"
"InnoDB: reads to the buffer pool to"
" be finished.\n"
"InnoDB: Number of pending reads %lu,"
" pending pread calls %lu\n",
(ulong) buf_pool->n_pend_reads,
(ulong)os_file_n_pending_preads);
......@@ -704,12 +702,14 @@ buf_read_recv_pages(
os_aio_print_debug = FALSE;
if ((i + 1 == n_stored) && sync) {
buf_read_page_low(&err, TRUE, BUF_READ_ANY_PAGE, space,
tablespace_version, page_nos[i]);
buf_read_page_low(&err, TRUE, BUF_READ_ANY_PAGE,
space, tablespace_version,
page_nos[i]);
} else {
buf_read_page_low(&err, FALSE, BUF_READ_ANY_PAGE
| OS_AIO_SIMULATED_WAKE_LATER,
space, tablespace_version, page_nos[i]);
space, tablespace_version,
page_nos[i]);
}
}
......@@ -721,7 +721,8 @@ buf_read_recv_pages(
#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fprintf(stderr,
"Recovery applies read-ahead pages %lu\n", (ulong) n_stored);
"Recovery applies read-ahead pages %lu\n",
(ulong) n_stored);
}
#endif /* UNIV_DEBUG */
}
......@@ -192,7 +192,7 @@ dfield_check_typed_no_assert(
|| dfield_get_type(field)->mtype < DATA_VARCHAR) {
fprintf(stderr,
"InnoDB: Error: data field type %lu, len %lu\n",
"InnoDB: Error: data field type %lu, len %lu\n",
(ulong) dfield_get_type(field)->mtype,
(ulong) dfield_get_len(field));
return(FALSE);
......@@ -215,9 +215,9 @@ dtuple_check_typed_no_assert(
if (dtuple_get_n_fields(tuple) > REC_MAX_N_FIELDS) {
fprintf(stderr,
"InnoDB: Error: index entry has %lu fields\n",
"InnoDB: Error: index entry has %lu fields\n",
(ulong) dtuple_get_n_fields(tuple));
dump:
dump:
fputs("InnoDB: Tuple contents: ", stderr);
dtuple_print(stderr, tuple);
putc('\n', stderr);
......@@ -250,7 +250,7 @@ dfield_check_typed(
|| dfield_get_type(field)->mtype < DATA_VARCHAR) {
fprintf(stderr,
"InnoDB: Error: data field type %lu, len %lu\n",
"InnoDB: Error: data field type %lu, len %lu\n",
(ulong) dfield_get_type(field)->mtype,
(ulong) dfield_get_len(field));
......@@ -433,15 +433,20 @@ dfield_print_also_hex(
/*****************************************************************
Print a dfield value using ut_print_buf. */
static
void
dfield_print_raw(
/*=============*/
FILE* f, /* in: output stream */
dfield_t* dfield) /* in: dfield */
{
if (dfield->len != UNIV_SQL_NULL) {
ut_print_buf(f, dfield->data, dfield->len);
ulint len = dfield->len;
if (len != UNIV_SQL_NULL) {
ulint print_len = ut_min(len, 1000);
ut_print_buf(f, dfield->data, print_len);
if (len != print_len) {
fprintf(f, "(total %lu bytes)", (ulong) len);
}
} else {
fputs(" SQL NULL", f);
}
......@@ -513,7 +518,8 @@ dtuple_convert_big_rec(
if (UNIV_UNLIKELY(size > 1000000000)) {
fprintf(stderr,
"InnoDB: Warning: tuple size very big: %lu\n", (ulong) size);
"InnoDB: Warning: tuple size very big: %lu\n",
(ulong) size);
fputs("InnoDB: Tuple contents: ", stderr);
dtuple_print(stderr, entry);
putc('\n', stderr);
......@@ -534,8 +540,8 @@ dtuple_convert_big_rec(
n_fields = 0;
while (rec_get_converted_size(index, entry)
>= ut_min(page_get_free_space_of_empty(
dict_table_is_comp(index->table)) / 2,
>= ut_min(page_get_free_space_of_empty
(dict_table_is_comp(index->table)) / 2,
REC_MAX_DATA_SIZE)) {
longest = 0;
......@@ -559,8 +565,8 @@ dtuple_convert_big_rec(
dfield = dtuple_get_nth_field(entry, i);
if (dfield->len != UNIV_SQL_NULL &&
dfield->len > longest) {
if (dfield->len != UNIV_SQL_NULL
&& dfield->len > longest) {
longest = dfield->len;
......@@ -604,8 +610,8 @@ dtuple_convert_big_rec(
vector->fields[n_fields].len = dfield->len
- DICT_MAX_INDEX_COL_LEN;
vector->fields[n_fields].data = mem_heap_alloc(heap,
vector->fields[n_fields].len);
vector->fields[n_fields].data = mem_heap_alloc
(heap, vector->fields[n_fields].len);
/* Copy data (from the end of field) to big rec vector */
......
......@@ -67,8 +67,8 @@ dtype_get_at_most_n_mbchars(
if (dtype->mbminlen != dtype->mbmaxlen) {
ut_a(!(prefix_len % dtype->mbmaxlen));
return(innobase_get_at_most_n_mbchars(
dtype_get_charset_coll(dtype->prtype),
return(innobase_get_at_most_n_mbchars
(dtype_get_charset_coll(dtype->prtype),
prefix_len, data_len, str));
}
......
......@@ -236,9 +236,9 @@ dict_boot(void)
..._MARGIN, it will immediately be updated to the disk-based
header. */
dict_sys->row_id = ut_dulint_add(
ut_dulint_align_up(
mtr_read_dulint(dict_hdr + DICT_HDR_ROW_ID, &mtr),
dict_sys->row_id = ut_dulint_add
(ut_dulint_align_up(mtr_read_dulint
(dict_hdr + DICT_HDR_ROW_ID, &mtr),
DICT_HDR_ROW_ID_WRITE_MARGIN),
DICT_HDR_ROW_ID_WRITE_MARGIN);
......@@ -262,14 +262,16 @@ dict_boot(void)
dict_sys->sys_tables = table;
index = dict_mem_index_create("SYS_TABLES", "CLUST_IND",
DICT_HDR_SPACE, DICT_UNIQUE | DICT_CLUSTERED, 1);
DICT_HDR_SPACE,
DICT_UNIQUE | DICT_CLUSTERED, 1);
dict_mem_index_add_field(index, "NAME", 0);
index->id = DICT_TABLES_ID;
success = dict_index_add_to_cache(table, index, mtr_read_ulint(
dict_hdr + DICT_HDR_TABLES, MLOG_4BYTES, &mtr));
success = dict_index_add_to_cache(table, index, mtr_read_ulint
(dict_hdr + DICT_HDR_TABLES,
MLOG_4BYTES, &mtr));
ut_a(success);
/*-------------------------*/
index = dict_mem_index_create("SYS_TABLES", "ID_IND",
......@@ -277,8 +279,10 @@ dict_boot(void)
dict_mem_index_add_field(index, "ID", 0);
index->id = DICT_TABLE_IDS_ID;
success = dict_index_add_to_cache(table, index, mtr_read_ulint(
dict_hdr + DICT_HDR_TABLE_IDS, MLOG_4BYTES, &mtr));
success = dict_index_add_to_cache(table, index,
mtr_read_ulint
(dict_hdr + DICT_HDR_TABLE_IDS,
MLOG_4BYTES, &mtr));
ut_a(success);
/*-------------------------*/
table = dict_mem_table_create("SYS_COLUMNS", DICT_HDR_SPACE, 7, 0);
......@@ -297,14 +301,16 @@ dict_boot(void)
dict_sys->sys_columns = table;
index = dict_mem_index_create("SYS_COLUMNS", "CLUST_IND",
DICT_HDR_SPACE, DICT_UNIQUE | DICT_CLUSTERED, 2);
DICT_HDR_SPACE,
DICT_UNIQUE | DICT_CLUSTERED, 2);
dict_mem_index_add_field(index, "TABLE_ID", 0);
dict_mem_index_add_field(index, "POS", 0);
index->id = DICT_COLUMNS_ID;
success = dict_index_add_to_cache(table, index, mtr_read_ulint(
dict_hdr + DICT_HDR_COLUMNS, MLOG_4BYTES, &mtr));
success = dict_index_add_to_cache(table, index, mtr_read_ulint
(dict_hdr + DICT_HDR_COLUMNS,
MLOG_4BYTES, &mtr));
ut_a(success);
/*-------------------------*/
table = dict_mem_table_create("SYS_INDEXES", DICT_HDR_SPACE, 7, 0);
......@@ -333,14 +339,16 @@ dict_boot(void)
dict_sys->sys_indexes = table;
index = dict_mem_index_create("SYS_INDEXES", "CLUST_IND",
DICT_HDR_SPACE, DICT_UNIQUE | DICT_CLUSTERED, 2);
DICT_HDR_SPACE,
DICT_UNIQUE | DICT_CLUSTERED, 2);
dict_mem_index_add_field(index, "TABLE_ID", 0);
dict_mem_index_add_field(index, "ID", 0);
index->id = DICT_INDEXES_ID;
success = dict_index_add_to_cache(table, index, mtr_read_ulint(
dict_hdr + DICT_HDR_INDEXES, MLOG_4BYTES, &mtr));
success = dict_index_add_to_cache(table, index, mtr_read_ulint
(dict_hdr + DICT_HDR_INDEXES,
MLOG_4BYTES, &mtr));
ut_a(success);
/*-------------------------*/
table = dict_mem_table_create("SYS_FIELDS", DICT_HDR_SPACE, 3, 0);
......@@ -354,14 +362,16 @@ dict_boot(void)
dict_sys->sys_fields = table;
index = dict_mem_index_create("SYS_FIELDS", "CLUST_IND",
DICT_HDR_SPACE, DICT_UNIQUE | DICT_CLUSTERED, 2);
DICT_HDR_SPACE,
DICT_UNIQUE | DICT_CLUSTERED, 2);
dict_mem_index_add_field(index, "INDEX_ID", 0);
dict_mem_index_add_field(index, "POS", 0);
index->id = DICT_FIELDS_ID;
success = dict_index_add_to_cache(table, index, mtr_read_ulint(
dict_hdr + DICT_HDR_FIELDS, MLOG_4BYTES, &mtr));
success = dict_index_add_to_cache(table, index, mtr_read_ulint
(dict_hdr + DICT_HDR_FIELDS,
MLOG_4BYTES, &mtr));
ut_a(success);
mtr_commit(&mtr);
......
......@@ -222,8 +222,8 @@ dict_build_table_def_step(
row_len = 0;
for (i = 0; i < table->n_def; i++) {
row_len += dtype_get_min_size(dict_col_get_type(
&table->cols[i]));
row_len += dtype_get_min_size(dict_col_get_type
(&table->cols[i]));
}
if (row_len > BTR_PAGE_MAX_REC_SIZE) {
return(DB_TOO_BIG_RECORD);
......@@ -251,8 +251,8 @@ dict_build_table_def_step(
is_path = FALSE;
}
error = fil_create_new_single_table_tablespace(
&(table->space), path_or_name, is_path,
error = fil_create_new_single_table_tablespace
(&table->space, path_or_name, is_path,
FIL_IBD_FILE_INITIAL_SIZE);
if (error != DB_SUCCESS) {
......@@ -684,7 +684,8 @@ dict_drop_index_tree(
btr_free_root(space, root_page_no, mtr);
page_rec_write_index_page_no(rec,
DICT_SYS_INDEXES_PAGE_NO_FIELD, FIL_NULL, mtr);
DICT_SYS_INDEXES_PAGE_NO_FIELD,
FIL_NULL, mtr);
}
/***********************************************************************
......@@ -767,8 +768,8 @@ dict_truncate_index_tree(
appropriate field in the SYS_INDEXES record: this mini-transaction
marks the B-tree totally truncated */
comp = page_is_comp(btr_page_get(
space, root_page_no, RW_X_LATCH, mtr));
comp = page_is_comp(btr_page_get
(space, root_page_no, RW_X_LATCH, mtr));
btr_free_root(space, root_page_no, mtr);
/* We will temporarily write FIL_NULL to the PAGE_NO field
......@@ -1157,13 +1158,15 @@ dict_create_or_check_foreign_constraint_tables(void)
if (table1) {
fprintf(stderr,
"InnoDB: dropping incompletely created SYS_FOREIGN table\n");
"InnoDB: dropping incompletely created"
" SYS_FOREIGN table\n");
row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE);
}
if (table2) {
fprintf(stderr,
"InnoDB: dropping incompletely created SYS_FOREIGN_COLS table\n");
"InnoDB: dropping incompletely created"
" SYS_FOREIGN_COLS table\n");
row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE);
}
......@@ -1184,13 +1187,19 @@ dict_create_or_check_foreign_constraint_tables(void)
"PROCEDURE CREATE_FOREIGN_SYS_TABLES_PROC () IS\n"
"BEGIN\n"
"CREATE TABLE\n"
"SYS_FOREIGN(ID CHAR, FOR_NAME CHAR, REF_NAME CHAR, N_COLS INT);\n"
"CREATE UNIQUE CLUSTERED INDEX ID_IND ON SYS_FOREIGN (ID);\n"
"CREATE INDEX FOR_IND ON SYS_FOREIGN (FOR_NAME);\n"
"CREATE INDEX REF_IND ON SYS_FOREIGN (REF_NAME);\n"
"SYS_FOREIGN(ID CHAR, FOR_NAME CHAR,"
" REF_NAME CHAR, N_COLS INT);\n"
"CREATE UNIQUE CLUSTERED INDEX ID_IND"
" ON SYS_FOREIGN (ID);\n"
"CREATE INDEX FOR_IND"
" ON SYS_FOREIGN (FOR_NAME);\n"
"CREATE INDEX REF_IND"
" ON SYS_FOREIGN (REF_NAME);\n"
"CREATE TABLE\n"
"SYS_FOREIGN_COLS(ID CHAR, POS INT, FOR_COL_NAME CHAR, REF_COL_NAME CHAR);\n"
"CREATE UNIQUE CLUSTERED INDEX ID_IND ON SYS_FOREIGN_COLS (ID, POS);\n"
"SYS_FOREIGN_COLS(ID CHAR, POS INT,"
" FOR_COL_NAME CHAR, REF_COL_NAME CHAR);\n"
"CREATE UNIQUE CLUSTERED INDEX ID_IND"
" ON SYS_FOREIGN_COLS (ID, POS);\n"
"COMMIT WORK;\n"
"END;\n"
, FALSE, trx);
......@@ -1201,10 +1210,11 @@ dict_create_or_check_foreign_constraint_tables(void)
ut_a(error == DB_OUT_OF_FILE_SPACE);
fprintf(stderr, "InnoDB: creation failed\n");
fprintf(stderr, "InnoDB: tablespace is full\n");
fprintf(stderr,
"InnoDB: dropping incompletely created SYS_FOREIGN tables\n");
"InnoDB: creation failed\n"
"InnoDB: tablespace is full\n"
"InnoDB: dropping incompletely created"
" SYS_FOREIGN tables\n");
row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE);
row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE);
......@@ -1220,7 +1230,8 @@ dict_create_or_check_foreign_constraint_tables(void)
if (error == DB_SUCCESS) {
fprintf(stderr,
"InnoDB: Foreign key constraint system tables created\n");
"InnoDB: Foreign key constraint system tables"
" created\n");
}
return(error);
......@@ -1282,7 +1293,8 @@ dict_foreign_eval_sql(
" for table ", ef);
ut_print_name(ef, trx, TRUE, table->name);
fputs(".\n"
"See the MySQL .err log in the datadir for more information.\n", ef);
"See the MySQL .err log in the datadir"
" for more information.\n", ef);
mutex_exit(&dict_foreign_err_mutex);
return(error);
......@@ -1316,13 +1328,13 @@ dict_create_add_foreign_field_to_dictionary(
pars_info_add_str_literal(info, "ref_col_name",
foreign->referenced_col_names[field_nr]);
return dict_foreign_eval_sql(info,
"PROCEDURE P () IS\n"
return(dict_foreign_eval_sql
(info, "PROCEDURE P () IS\n"
"BEGIN\n"
"INSERT INTO SYS_FOREIGN_COLS VALUES"
"(:id, :pos, :for_col_name, :ref_col_name);\n"
"END;\n"
, table, foreign, trx);
"END;\n",
table, foreign, trx));
}
/************************************************************************
......@@ -1381,8 +1393,8 @@ dict_create_add_foreign_to_dictionary(
}
for (i = 0; i < foreign->n_fields; i++) {
error = dict_create_add_foreign_field_to_dictionary(i,
table, foreign, trx);
error = dict_create_add_foreign_field_to_dictionary
(i, table, foreign, trx);
if (error != DB_SUCCESS) {
......@@ -1428,7 +1440,8 @@ dict_create_add_foreigns_to_dictionary(
if (NULL == dict_table_get_low("SYS_FOREIGN")) {
fprintf(stderr,
"InnoDB: table SYS_FOREIGN not found from internal data dictionary\n");
"InnoDB: table SYS_FOREIGN not found"
" in internal data dictionary\n");
return(DB_ERROR);
}
......@@ -1437,8 +1450,8 @@ dict_create_add_foreigns_to_dictionary(
foreign;
foreign = UT_LIST_GET_NEXT(foreign_list, foreign)) {
error = dict_create_add_foreign_to_dictionary(&number,
table, foreign, trx);
error = dict_create_add_foreign_to_dictionary
(&number, table, foreign, trx);
if (error != DB_SUCCESS) {
......
This diff is collapsed.
This diff is collapsed.
......@@ -333,10 +333,10 @@ eval_predefined_2(
ut_ad(len2 >= len1);
if (len2 > len1) {
int_val = (lint)(len1 +
(eval_rnd % (len2 - len1 + 1)));
int_val = (lint) (len1
+ (eval_rnd % (len2 - len1 + 1)));
} else {
int_val = (lint)len1;
int_val = (lint) len1;
}
eval_rnd = ut_rnd_gen_next_ulint(eval_rnd);
......@@ -741,7 +741,8 @@ eval_predefined(
uint_val = (ulint) int_val;
}
for (tmp = int_len; uint_val > 0; uint_val /= 10) {
data[--tmp] = (byte) ('0' + (byte)(uint_val % 10));
data[--tmp] = (byte)
('0' + (byte)(uint_val % 10));
}
}
......
......@@ -51,7 +51,8 @@ if_step(
for (;;) {
eval_exp(elsif_node->cond);
if (eval_node_get_ibool_val(elsif_node->cond)) {
if (eval_node_get_ibool_val
(elsif_node->cond)) {
/* The condition evaluated to TRUE:
start execution from the first
......@@ -192,8 +193,8 @@ for_step(
loop_var_value = eval_node_get_int_val(node->loop_start_limit);
node->loop_end_value = eval_node_get_int_val(
node->loop_end_limit);
node->loop_end_value
= eval_node_get_int_val(node->loop_end_limit);
}
/* Check if we should do another loop */
......
This diff is collapsed.
This diff is collapsed.
......@@ -310,8 +310,9 @@ ha_validate(
if (hash_calc_hash(node->fold, table) != i) {
ut_print_timestamp(stderr);
fprintf(stderr,
"InnoDB: Error: hash table node fold value %lu does not\n"
"InnoDB: match with the cell number %lu.\n",
"InnoDB: Error: hash table node"
" fold value %lu does not\n"
"InnoDB: match the cell number %lu.\n",
(ulong) node->fold, (ulong) i);
ok = FALSE;
......@@ -363,6 +364,7 @@ ha_print_info(
n_bufs++;
}
fprintf(file, ", node heap has %lu buffer(s)\n", (ulong) n_bufs);
fprintf(file, ", node heap has %lu buffer(s)\n",
(ulong) n_bufs);
}
}
This diff is collapsed.
......@@ -202,7 +202,8 @@ btr_node_ptr_get_child_page_no(
if (UNIV_UNLIKELY(page_no == 0)) {
fprintf(stderr,
"InnoDB: a nonsensical page number 0 in a node ptr record at offset %lu\n",
"InnoDB: a nonsensical page number 0"
" in a node ptr record at offset %lu\n",
(ulong) ut_align_offset(rec, UNIV_PAGE_SIZE));
buf_page_print(buf_frame_align(rec));
}
......
......@@ -583,9 +583,11 @@ to know struct size! */
struct btr_cur_struct {
dict_index_t* index; /* index where positioned */
page_cur_t page_cur; /* page cursor */
page_t* left_page; /* this field is used to store a pointer
to the left neighbor page, in the cases
BTR_SEARCH_PREV and BTR_MODIFY_PREV */
page_t* left_page; /* this field is used to store
a pointer to the left neighbor
page, in the cases
BTR_SEARCH_PREV and
BTR_MODIFY_PREV */
/*------------------------------*/
que_thr_t* thr; /* this field is only used when
btr_cur_search_... is called for an
......
......@@ -156,8 +156,8 @@ improve debugging. Only values RW_S_LATCH and RW_X_LATCH are allowed as LA! */
NOTE! The following macros should be used instead of
buf_page_optimistic_get_func, to improve debugging. Only values RW_S_LATCH and
RW_X_LATCH are allowed as LA! */
#define buf_page_optimistic_get(LA, BL, G, MC, MTR) buf_page_optimistic_get_func(\
LA, BL, G, MC, __FILE__, __LINE__, MTR)
#define buf_page_optimistic_get(LA, BL, G, MC, MTR) \
buf_page_optimistic_get_func(LA, BL, G, MC, __FILE__, __LINE__, MTR)
/************************************************************************
This is the general function used to get optimistic access to a database
page. */
......
......@@ -213,12 +213,15 @@ buf_block_align(
ut_print_timestamp(stderr);
fprintf(stderr,
"InnoDB: Error: trying to access a stray pointer %p\n"
"InnoDB: buf pool start is at %p, end at %p\n"
"InnoDB: Probable reason is database corruption or memory\n"
"InnoDB: corruption. If this happens in an InnoDB database recovery, see\n"
"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html\n"
"InnoDB: how to force recovery.\n",
"InnoDB: Error: trying to access a stray pointer %p\n"
"InnoDB: buf pool start is at %p, end at %p\n"
"InnoDB: Probable reason is database corruption"
" or memory\n"
"InnoDB: corruption. If this happens in an"
" InnoDB database recovery, see\n"
"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/"
"forcing-recovery.html\n"
"InnoDB: how to force recovery.\n",
ptr, frame_zero,
buf_pool->high_end);
ut_error;
......@@ -249,12 +252,15 @@ buf_frame_align(
ut_print_timestamp(stderr);
fprintf(stderr,
"InnoDB: Error: trying to access a stray pointer %p\n"
"InnoDB: buf pool start is at %p, end at %p\n"
"InnoDB: Probable reason is database corruption or memory\n"
"InnoDB: corruption. If this happens in an InnoDB database recovery, see\n"
"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html\n"
"InnoDB: how to force recovery.\n",
"InnoDB: Error: trying to access a stray pointer %p\n"
"InnoDB: buf pool start is at %p, end at %p\n"
"InnoDB: Probable reason is database corruption"
" or memory\n"
"InnoDB: corruption. If this happens in an"
" InnoDB database recovery, see\n"
"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/"
"forcing-recovery.html\n"
"InnoDB: how to force recovery.\n",
ptr, buf_pool->frame_zero,
buf_pool->high_end);
ut_error;
......
......@@ -94,7 +94,8 @@ buf_read_recv_pages(
/* The size in pages of the area which the read-ahead algorithms read if
invoked */
#define BUF_READ_AHEAD_AREA ut_min(64, ut_2_power_up(buf_pool->curr_size / 32))
#define BUF_READ_AHEAD_AREA \
ut_min(64, ut_2_power_up(buf_pool->curr_size / 32))
/* Modes used in read-ahead */
#define BUF_READ_IBUF_PAGES_ONLY 131
......
......@@ -320,14 +320,6 @@ void
dfield_print_also_hex(
/*==================*/
dfield_t* dfield); /* in: dfield */
/*****************************************************************
Print a dfield value using ut_print_buf. */
void
dfield_print_raw(
/*=============*/
FILE* f, /* in: output stream */
dfield_t* dfield); /* in: dfield */
/**************************************************************
The following function prints the contents of a tuple. */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment