diff options
author | unknown <tsmith@maint1.mysql.com> | 2006-09-05 03:52:15 +0200 |
---|---|---|
committer | unknown <tsmith@maint1.mysql.com> | 2006-09-05 03:52:15 +0200 |
commit | 0da158aa2f8ea28e20359701d3fae0d7d3dd09de (patch) | |
tree | 53a9a2f242d2a61c1a3f936b0a15fe42e9df2aac /storage/innobase/os | |
parent | fbf2bc183aad7dd3a25bf0877ebdf89f946674b4 (diff) | |
download | mariadb-git-0da158aa2f8ea28e20359701d3fae0d7d3dd09de.tar.gz |
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).
Diffstat (limited to 'storage/innobase/os')
-rw-r--r-- | storage/innobase/os/os0file.c | 629 | ||||
-rw-r--r-- | storage/innobase/os/os0proc.c | 231 | ||||
-rw-r--r-- | storage/innobase/os/os0sync.c | 51 | ||||
-rw-r--r-- | storage/innobase/os/os0thread.c | 36 |
4 files changed, 532 insertions, 415 deletions
diff --git a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c index 3aebf20ac41..65903717cfb 100644 --- a/storage/innobase/os/os0file.c +++ b/storage/innobase/os/os0file.c @@ -224,31 +224,39 @@ os_file_get_last_error( err = (ulint) GetLastError(); if (report_all_errors - || (err != ERROR_DISK_FULL && err != ERROR_FILE_EXISTS)) { + || (err != ERROR_DISK_FULL && err != ERROR_FILE_EXISTS)) { ut_print_timestamp(stderr); fprintf(stderr, - " InnoDB: Operating system error number %lu in a file operation.\n", (ulong) err); + " InnoDB: Operating system error number %lu" + " in a file operation.\n", (ulong) err); if (err == ERROR_PATH_NOT_FOUND) { fprintf(stderr, - "InnoDB: The error means the system cannot find the path specified.\n"); + "InnoDB: The error means the system" + " cannot find the path specified.\n"); if (srv_is_being_started) { fprintf(stderr, - "InnoDB: If you are installing InnoDB, remember that you must create\n" - "InnoDB: directories yourself, InnoDB does not create them.\n"); + "InnoDB: If you are installing InnoDB," + " remember that you must create\n" + "InnoDB: directories yourself, InnoDB" + " does not create them.\n"); } } else if (err == ERROR_ACCESS_DENIED) { fprintf(stderr, - "InnoDB: The error means mysqld does not have the access rights to\n" - "InnoDB: the directory. It may also be you have created a subdirectory\n" - "InnoDB: of the same name as a data file.\n"); + "InnoDB: The error means mysqld does not have" + " the access rights to\n" + "InnoDB: the directory. It may also be" + " you have created a subdirectory\n" + "InnoDB: of the same name as a data file.\n"); } else { fprintf(stderr, - "InnoDB: Some operating system error numbers are described at\n" - "InnoDB: " - "http://dev.mysql.com/doc/refman/5.1/en/operating-system-error-codes.html\n"); + "InnoDB: Some operating system error numbers" + " are described at\n" + "InnoDB: " + "http://dev.mysql.com/doc/refman/5.1/en/" + "operating-system-error-codes.html\n"); } } @@ -267,35 +275,44 @@ os_file_get_last_error( err = (ulint) errno; if (report_all_errors - || (err != ENOSPC && err != EEXIST)) { + || (err != ENOSPC && err != EEXIST)) { ut_print_timestamp(stderr); fprintf(stderr, - " InnoDB: Operating system error number %lu in a file operation.\n", (ulong) err); + " InnoDB: Operating system error number %lu" + " in a file operation.\n", (ulong) err); if (err == ENOENT) { fprintf(stderr, - "InnoDB: The error means the system cannot find the path specified.\n"); + "InnoDB: The error means the system" + " cannot find the path specified.\n"); if (srv_is_being_started) { fprintf(stderr, - "InnoDB: If you are installing InnoDB, remember that you must create\n" - "InnoDB: directories yourself, InnoDB does not create them.\n"); + "InnoDB: If you are installing InnoDB," + " remember that you must create\n" + "InnoDB: directories yourself, InnoDB" + " does not create them.\n"); } } else if (err == EACCES) { fprintf(stderr, - "InnoDB: The error means mysqld does not have the access rights to\n" - "InnoDB: the directory.\n"); + "InnoDB: The error means mysqld does not have" + " the access rights to\n" + "InnoDB: the directory.\n"); } else { if (strerror((int)err) != NULL) { fprintf(stderr, - "InnoDB: Error number %lu means '%s'.\n", err, strerror((int)err)); + "InnoDB: Error number %lu" + " means '%s'.\n", + err, strerror((int)err)); } fprintf(stderr, - "InnoDB: Some operating system error numbers are described at\n" - "InnoDB: " - "http://dev.mysql.com/doc/refman/5.1/en/operating-system-error-codes.html\n"); + "InnoDB: Some operating system" + " error numbers are described at\n" + "InnoDB: " + "http://dev.mysql.com/doc/refman/5.1/en/" + "operating-system-error-codes.html\n"); } } @@ -345,12 +362,14 @@ os_file_handle_error( if (name) { ut_print_timestamp(stderr); fprintf(stderr, - " InnoDB: Encountered a problem with file %s\n", name); + " InnoDB: Encountered a problem with" + " file %s\n", name); } ut_print_timestamp(stderr); fprintf(stderr, - " InnoDB: Disk is full. Try to clean the disk to free space.\n"); + " InnoDB: Disk is full. Try to clean the disk" + " to free space.\n"); os_has_said_disk_full = TRUE; @@ -363,7 +382,7 @@ os_file_handle_error( return(TRUE); } else if (err == OS_FILE_ALREADY_EXISTS - || err == OS_FILE_PATH_ERROR) { + || err == OS_FILE_PATH_ERROR) { return(FALSE); } else { @@ -413,8 +432,10 @@ os_file_lock( if (errno == EAGAIN || errno == EACCES) { fprintf(stderr, -"InnoDB: Check that you do not already have another mysqld process\n" -"InnoDB: using the same InnoDB data or log files.\n"); + "InnoDB: Check that you do not already have" + " another mysqld process\n" + "InnoDB: using the same InnoDB data" + " or log files.\n"); } return(-1); @@ -450,12 +471,14 @@ os_file_handle_error_no_exit( if (name) { ut_print_timestamp(stderr); fprintf(stderr, - " InnoDB: Encountered a problem with file %s\n", name); + " InnoDB: Encountered a problem with" + " file %s\n", name); } ut_print_timestamp(stderr); fprintf(stderr, - " InnoDB: Disk is full. Try to clean the disk to free space.\n"); + " InnoDB: Disk is full. Try to clean the disk" + " to free space.\n"); os_has_said_disk_full = TRUE; @@ -468,7 +491,7 @@ os_file_handle_error_no_exit( return(TRUE); } else if (err == OS_FILE_ALREADY_EXISTS - || err == OS_FILE_PATH_ERROR) { + || err == OS_FILE_PATH_ERROR) { return(FALSE); } else { @@ -670,10 +693,11 @@ next_file: ret = FindNextFile(dir, lpFindFileData); if (ret) { - ut_a(strlen((char *) lpFindFileData->cFileName) < OS_FILE_MAX_PATH); + ut_a(strlen((char *) lpFindFileData->cFileName) + < OS_FILE_MAX_PATH); if (strcmp((char *) lpFindFileData->cFileName, ".") == 0 - || strcmp((char *) lpFindFileData->cFileName, "..") == 0) { + || strcmp((char *) lpFindFileData->cFileName, "..") == 0) { goto next_file; } @@ -681,17 +705,20 @@ next_file: strcpy(info->name, (char *) lpFindFileData->cFileName); info->size = (ib_longlong)(lpFindFileData->nFileSizeLow) - + (((ib_longlong)(lpFindFileData->nFileSizeHigh)) << 32); + + (((ib_longlong)(lpFindFileData->nFileSizeHigh)) + << 32); if (lpFindFileData->dwFileAttributes - & FILE_ATTRIBUTE_REPARSE_POINT) { -/* TODO: test Windows symlinks */ -/* TODO: MySQL has apparently its own symlink implementation in Windows, -dbname.sym can redirect a database directory: -http://dev.mysql.com/doc/refman/5.1/en/windows-symbolic-links.html */ + & FILE_ATTRIBUTE_REPARSE_POINT) { + /* TODO: test Windows symlinks */ + /* TODO: MySQL has apparently its own symlink + implementation in Windows, dbname.sym can + redirect a database directory: + http://dev.mysql.com/doc/refman/5.1/en/ + windows-symbolic-links.html */ info->type = OS_FILE_TYPE_LINK; } else if (lpFindFileData->dwFileAttributes - & FILE_ATTRIBUTE_DIRECTORY) { + & FILE_ATTRIBUTE_DIRECTORY) { info->type = OS_FILE_TYPE_DIR; } else { /* It is probably safest to assume that all other @@ -711,7 +738,7 @@ http://dev.mysql.com/doc/refman/5.1/en/windows-symbolic-links.html */ return(1); } else { os_file_handle_error_no_exit(dirname, - "readdir_next_file"); + "readdir_next_file"); return(-1); } #else @@ -720,11 +747,11 @@ http://dev.mysql.com/doc/refman/5.1/en/windows-symbolic-links.html */ int ret; struct stat statinfo; #ifdef HAVE_READDIR_R - char dirent_buf[sizeof(struct dirent) + _POSIX_PATH_MAX + - 100]; - /* In /mysys/my_lib.c, _POSIX_PATH_MAX + 1 is used as - the max file name len; but in most standards, the - length is NAME_MAX; we add 100 to be even safer */ + char dirent_buf[sizeof(struct dirent) + + _POSIX_PATH_MAX + 100]; + /* In /mysys/my_lib.c, _POSIX_PATH_MAX + 1 is used as + the max file name len; but in most standards, the + length is NAME_MAX; we add 100 to be even safer */ #endif next_file: @@ -734,7 +761,8 @@ next_file: if (ret != 0) { fprintf(stderr, -"InnoDB: cannot read directory %s, error %lu\n", dirname, (ulong)ret); + "InnoDB: cannot read directory %s, error %lu\n", + dirname, (ulong)ret); return(-1); } @@ -815,8 +843,9 @@ os_file_create_directory( BOOL rcode; rcode = CreateDirectory((LPCTSTR) pathname, NULL); - if (!(rcode != 0 || - (GetLastError() == ERROR_ALREADY_EXISTS && !fail_if_exists))) { + if (!(rcode != 0 + || (GetLastError() == ERROR_ALREADY_EXISTS + && !fail_if_exists))) { /* failure */ os_file_handle_error(pathname, "CreateDirectory"); @@ -899,21 +928,21 @@ try_again: } file = CreateFile((LPCTSTR) name, - access, - FILE_SHARE_READ | FILE_SHARE_WRITE, - /* file can be read ansd written also - by other processes */ - NULL, /* default security attributes */ - create_flag, - attributes, - NULL); /* no template file */ + access, + FILE_SHARE_READ | FILE_SHARE_WRITE, + /* file can be read ansd written also + by other processes */ + NULL, /* default security attributes */ + create_flag, + attributes, + NULL); /* no template file */ if (file == INVALID_HANDLE_VALUE) { *success = FALSE; retry = os_file_handle_error(name, - create_mode == OS_FILE_OPEN ? - "open" : "create"); + create_mode == OS_FILE_OPEN ? + "open" : "create"); if (retry) { goto try_again; } @@ -953,7 +982,7 @@ try_again: if (create_mode == OS_FILE_CREATE) { file = open(name, create_flag, S_IRUSR | S_IWUSR - | S_IRGRP | S_IWGRP); + | S_IRGRP | S_IWGRP); } else { file = open(name, create_flag); } @@ -962,14 +991,14 @@ try_again: *success = FALSE; retry = os_file_handle_error(name, - create_mode == OS_FILE_OPEN ? - "open" : "create"); + create_mode == OS_FILE_OPEN ? + "open" : "create"); if (retry) { goto try_again; } #ifdef USE_FILE_LOCK } else if (access_type == OS_FILE_READ_WRITE - && os_file_lock(file, name)) { + && os_file_lock(file, name)) { *success = FALSE; close(file); file = -1; @@ -1028,7 +1057,7 @@ os_file_create_simple_no_error_handling( } else if (access_type == OS_FILE_READ_ALLOW_DELETE) { access = GENERIC_READ; share_mode = FILE_SHARE_DELETE | FILE_SHARE_READ - | FILE_SHARE_WRITE; /* A backup program has to give + | FILE_SHARE_WRITE; /* A backup program has to give mysqld the maximum freedom to do what it likes with the file */ @@ -1038,12 +1067,12 @@ os_file_create_simple_no_error_handling( } file = CreateFile((LPCTSTR) name, - access, - share_mode, - NULL, /* default security attributes */ - create_flag, - attributes, - NULL); /* no template file */ + access, + share_mode, + NULL, /* default security attributes */ + create_flag, + attributes, + NULL); /* no template file */ if (file == INVALID_HANDLE_VALUE) { *success = FALSE; @@ -1073,7 +1102,7 @@ os_file_create_simple_no_error_handling( if (create_mode == OS_FILE_CREATE) { file = open(name, create_flag, S_IRUSR | S_IWUSR - | S_IRGRP | S_IWGRP); + | S_IRGRP | S_IWGRP); } else { file = open(name, create_flag); } @@ -1082,7 +1111,7 @@ os_file_create_simple_no_error_handling( *success = FALSE; #ifdef USE_FILE_LOCK } else if (access_type == OS_FILE_READ_WRITE - && os_file_lock(file, name)) { + && os_file_lock(file, name)) { *success = FALSE; close(file); file = -1; @@ -1137,7 +1166,7 @@ try_again: create_flag = OPEN_EXISTING; share_mode = FILE_SHARE_WRITE; } else if (create_mode == OS_FILE_OPEN - || create_mode == OS_FILE_OPEN_RETRY) { + || create_mode == OS_FILE_OPEN_RETRY) { create_flag = OPEN_EXISTING; } else if (create_mode == OS_FILE_CREATE) { create_flag = CREATE_NEW; @@ -1162,8 +1191,8 @@ try_again: /* Do not use unbuffered i/o to log files because value 2 denotes that we do not flush the log at every commit, but only once per second */ - } else if (srv_win_file_flush_method == - SRV_WIN_IO_UNBUFFERED) { + } else if (srv_win_file_flush_method + == SRV_WIN_IO_UNBUFFERED) { attributes = attributes | FILE_FLAG_NO_BUFFERING; } #endif @@ -1174,8 +1203,8 @@ try_again: /* Do not use unbuffered i/o to log files because value 2 denotes that we do not flush the log at every commit, but only once per second */ - } else if (srv_win_file_flush_method == - SRV_WIN_IO_UNBUFFERED) { + } else if (srv_win_file_flush_method + == SRV_WIN_IO_UNBUFFERED) { attributes = attributes | FILE_FLAG_NO_BUFFERING; } #endif @@ -1185,9 +1214,9 @@ try_again: } file = CreateFile((LPCTSTR) name, - GENERIC_READ | GENERIC_WRITE, /* read and write + GENERIC_READ | GENERIC_WRITE, /* read and write access */ - share_mode, /* File can be read also by other + share_mode, /* File can be read also by other processes; we must give the read permission because of ibbackup. We do not give the write permission to @@ -1198,17 +1227,17 @@ try_again: raw disk partitions, Microsoft manuals say that we must give also the write permission. */ - NULL, /* default security attributes */ - create_flag, - attributes, - NULL); /* no template file */ + NULL, /* default security attributes */ + create_flag, + attributes, + NULL); /* no template file */ if (file == INVALID_HANDLE_VALUE) { *success = FALSE; retry = os_file_handle_error(name, - create_mode == OS_FILE_CREATE ? - "create" : "open"); + create_mode == OS_FILE_CREATE ? + "create" : "open"); if (retry) { goto try_again; } @@ -1229,7 +1258,7 @@ try_again: ut_a(name); if (create_mode == OS_FILE_OPEN || create_mode == OS_FILE_OPEN_RAW - || create_mode == OS_FILE_OPEN_RETRY) { + || create_mode == OS_FILE_OPEN_RETRY) { mode_str = "OPEN"; create_flag = O_RDWR; } else if (create_mode == OS_FILE_CREATE) { @@ -1259,30 +1288,34 @@ try_again: ut_error; } -/* fprintf(stderr, "Opening file %s, mode %s, type %s, purpose %s\n", - name, mode_str, type_str, purpose_str); */ +#if 0 + fprintf(stderr, "Opening file %s, mode %s, type %s, purpose %s\n", + name, mode_str, type_str, purpose_str); +#endif #ifdef O_SYNC /* We let O_SYNC only affect log files; note that we map O_DSYNC to O_SYNC because the datasync options seemed to corrupt files in 2001 in both Linux and Solaris */ if (type == OS_LOG_FILE - && srv_unix_file_flush_method == SRV_UNIX_O_DSYNC) { + && srv_unix_file_flush_method == SRV_UNIX_O_DSYNC) { -/* fprintf(stderr, "Using O_SYNC for file %s\n", name); */ +# if 0 + fprintf(stderr, "Using O_SYNC for file %s\n", name); +# endif create_flag = create_flag | O_SYNC; } -#endif +#endif /* O_SYNC */ #ifdef O_DIRECT /* We let O_DIRECT only affect data files */ if (type != OS_LOG_FILE - && srv_unix_file_flush_method == SRV_UNIX_O_DIRECT) { - -/* fprintf(stderr, "Using O_DIRECT for file %s\n", name); */ - + && srv_unix_file_flush_method == SRV_UNIX_O_DIRECT) { +# if 0 + fprintf(stderr, "Using O_DIRECT for file %s\n", name); +# endif create_flag = create_flag | O_DIRECT; } -#endif +#endif /* O_DIRECT */ if (create_mode == OS_FILE_CREATE) { file = open(name, create_flag, os_innodb_umask); } else { @@ -1293,20 +1326,21 @@ try_again: *success = FALSE; retry = os_file_handle_error(name, - create_mode == OS_FILE_CREATE ? - "create" : "open"); + create_mode == OS_FILE_CREATE ? + "create" : "open"); if (retry) { goto try_again; } #ifdef USE_FILE_LOCK } else if (create_mode != OS_FILE_OPEN_RAW - && os_file_lock(file, name)) { + && os_file_lock(file, name)) { *success = FALSE; if (create_mode == OS_FILE_OPEN_RETRY) { int i; ut_print_timestamp(stderr); - fputs(" InnoDB: Retrying to lock the first data file\n", - stderr); + fputs(" InnoDB: Retrying to lock" + " the first data file\n", + stderr); for (i = 0; i < 100; i++) { os_thread_sleep(1000000); if (!os_file_lock(file, name)) { @@ -1316,7 +1350,7 @@ try_again: } ut_print_timestamp(stderr); fputs(" InnoDB: Unable to open the first data file\n", - stderr); + stderr); } close(file); file = -1; @@ -1361,8 +1395,9 @@ loop: if (count > 100 && 0 == (count % 10)) { fprintf(stderr, -"InnoDB: Warning: cannot delete file %s\n" -"InnoDB: Are you running ibbackup to back up the file?\n", name); + "InnoDB: Warning: cannot delete file %s\n" + "InnoDB: Are you running ibbackup" + " to back up the file?\n", name); os_file_get_last_error(TRUE); /* print error information */ } @@ -1423,8 +1458,9 @@ loop: if (count > 100 && 0 == (count % 10)) { fprintf(stderr, -"InnoDB: Warning: cannot delete file %s\n" -"InnoDB: Are you running ibbackup to back up the file?\n", name); + "InnoDB: Warning: cannot delete file %s\n" + "InnoDB: Are you running ibbackup" + " to back up the file?\n", name); os_file_get_last_error(TRUE); /* print error information */ } @@ -1664,7 +1700,7 @@ os_file_set_size( /* Write up to 1 megabyte at a time. */ buf_size = ut_min(64, (ulint) (desired_size / UNIV_PAGE_SIZE)) - * UNIV_PAGE_SIZE; + * UNIV_PAGE_SIZE; buf2 = ut_malloc(buf_size + UNIV_PAGE_SIZE); /* Align the buffer for possible raw i/o */ @@ -1688,9 +1724,9 @@ os_file_set_size( } ret = os_file_write(name, file, buf, - (ulint)(current_size & 0xFFFFFFFF), - (ulint)(current_size >> 32), - n_bytes); + (ulint)(current_size & 0xFFFFFFFF), + (ulint)(current_size >> 32), + n_bytes); if (!ret) { ut_free(buf2); goto error_handling; @@ -1698,11 +1734,11 @@ os_file_set_size( /* Print about progress for each 100 MB written */ if ((current_size + n_bytes) / (ib_longlong)(100 * 1024 * 1024) - != current_size / (ib_longlong)(100 * 1024 * 1024)) { + != current_size / (ib_longlong)(100 * 1024 * 1024)) { fprintf(stderr, " %lu00", (ulong) ((current_size + n_bytes) - / (ib_longlong)(100 * 1024 * 1024))); + / (ib_longlong)(100 * 1024 * 1024))); } current_size += n_bytes; @@ -1769,7 +1805,7 @@ os_file_flush( raw disks */ if (srv_start_raw_disk_in_use && GetLastError() - == ERROR_INVALID_FUNCTION) { + == ERROR_INVALID_FUNCTION) { return(TRUE); } @@ -1812,7 +1848,7 @@ os_file_flush( #elif HAVE_FDATASYNC ret = fdatasync(file); #else -/* fprintf(stderr, "Flushing to file %p\n", file); */ + /* fprintf(stderr, "Flushing to file %p\n", file); */ ret = fsync(file); #endif os_n_fsyncs++; @@ -1876,7 +1912,7 @@ os_file_pread( if (offset_high > 0) { fprintf(stderr, - "InnoDB: Error: file read at offset > 4 GB\n"); + "InnoDB: Error: file read at offset > 4 GB\n"); } } @@ -1898,34 +1934,34 @@ os_file_pread( return(n_bytes); #else { - off_t ret_offset; - ssize_t ret; - ulint i; + off_t ret_offset; + ssize_t ret; + ulint i; - os_mutex_enter(os_file_count_mutex); - os_n_pending_reads++; - os_mutex_exit(os_file_count_mutex); + os_mutex_enter(os_file_count_mutex); + os_n_pending_reads++; + os_mutex_exit(os_file_count_mutex); - /* Protect the seek / read operation with a mutex */ - i = ((ulint) file) % OS_FILE_N_SEEK_MUTEXES; + /* Protect the seek / read operation with a mutex */ + i = ((ulint) file) % OS_FILE_N_SEEK_MUTEXES; - os_mutex_enter(os_file_seek_mutexes[i]); + os_mutex_enter(os_file_seek_mutexes[i]); - ret_offset = lseek(file, offs, SEEK_SET); + ret_offset = lseek(file, offs, SEEK_SET); - if (ret_offset < 0) { - ret = -1; - } else { - ret = read(file, buf, (ssize_t)n); - } + if (ret_offset < 0) { + ret = -1; + } else { + ret = read(file, buf, (ssize_t)n); + } - os_mutex_exit(os_file_seek_mutexes[i]); + os_mutex_exit(os_file_seek_mutexes[i]); - os_mutex_enter(os_file_count_mutex); - os_n_pending_reads--; - os_mutex_exit(os_file_count_mutex); + os_mutex_enter(os_file_count_mutex); + os_n_pending_reads--; + os_mutex_exit(os_file_count_mutex); - return(ret); + return(ret); } #endif } @@ -1960,7 +1996,8 @@ os_file_pwrite( if (offset_high > 0) { fprintf(stderr, - "InnoDB: Error: file write at offset > 4 GB\n"); + "InnoDB: Error: file write" + " at offset > 4 GB\n"); } } @@ -1981,8 +2018,8 @@ os_file_pwrite( # ifdef UNIV_DO_FLUSH if (srv_unix_file_flush_method != SRV_UNIX_LITTLESYNC - && srv_unix_file_flush_method != SRV_UNIX_NOSYNC - && !os_do_not_call_flush_at_each_write) { + && srv_unix_file_flush_method != SRV_UNIX_NOSYNC + && !os_do_not_call_flush_at_each_write) { /* Always do fsync to reduce the probability that when the OS crashes, a database page is only partially @@ -1995,49 +2032,49 @@ os_file_pwrite( return(ret); #else { - off_t ret_offset; - ulint i; + off_t ret_offset; + ulint i; - os_mutex_enter(os_file_count_mutex); - os_n_pending_writes++; - os_mutex_exit(os_file_count_mutex); + os_mutex_enter(os_file_count_mutex); + os_n_pending_writes++; + os_mutex_exit(os_file_count_mutex); - /* Protect the seek / write operation with a mutex */ - i = ((ulint) file) % OS_FILE_N_SEEK_MUTEXES; + /* Protect the seek / write operation with a mutex */ + i = ((ulint) file) % OS_FILE_N_SEEK_MUTEXES; - os_mutex_enter(os_file_seek_mutexes[i]); + os_mutex_enter(os_file_seek_mutexes[i]); - ret_offset = lseek(file, offs, SEEK_SET); + ret_offset = lseek(file, offs, SEEK_SET); - if (ret_offset < 0) { - ret = -1; + if (ret_offset < 0) { + ret = -1; - goto func_exit; - } + goto func_exit; + } - ret = write(file, buf, (ssize_t)n); + ret = write(file, buf, (ssize_t)n); # ifdef UNIV_DO_FLUSH - if (srv_unix_file_flush_method != SRV_UNIX_LITTLESYNC - && srv_unix_file_flush_method != SRV_UNIX_NOSYNC - && !os_do_not_call_flush_at_each_write) { + if (srv_unix_file_flush_method != SRV_UNIX_LITTLESYNC + && srv_unix_file_flush_method != SRV_UNIX_NOSYNC + && !os_do_not_call_flush_at_each_write) { - /* Always do fsync to reduce the probability that when - the OS crashes, a database page is only partially - physically written to disk. */ + /* Always do fsync to reduce the probability that when + the OS crashes, a database page is only partially + physically written to disk. */ - ut_a(TRUE == os_file_flush(file)); - } + ut_a(TRUE == os_file_flush(file)); + } # endif /* UNIV_DO_FLUSH */ func_exit: - os_mutex_exit(os_file_seek_mutexes[i]); + os_mutex_exit(os_file_seek_mutexes[i]); - os_mutex_enter(os_file_count_mutex); - os_n_pending_writes--; - os_mutex_exit(os_file_count_mutex); + os_mutex_enter(os_file_count_mutex); + os_n_pending_writes--; + os_mutex_exit(os_file_count_mutex); - return(ret); + return(ret); } #endif } @@ -2129,9 +2166,10 @@ try_again: } fprintf(stderr, -"InnoDB: Error: tried to read %lu bytes at offset %lu %lu.\n" -"InnoDB: Was only able to read %ld.\n", (ulong)n, (ulong)offset_high, - (ulong)offset, (long)ret); + "InnoDB: Error: tried to read %lu bytes at offset %lu %lu.\n" + "InnoDB: Was only able to read %ld.\n", + (ulong)n, (ulong)offset_high, + (ulong)offset, (long)ret); #endif #ifdef __WIN__ error_handling: @@ -2143,7 +2181,8 @@ error_handling: } fprintf(stderr, -"InnoDB: Fatal error: cannot read from file. OS error number %lu.\n", + "InnoDB: Fatal error: cannot read from file." + " OS error number %lu.\n", #ifdef __WIN__ (ulong) GetLastError() #else @@ -2339,11 +2378,15 @@ retry: ut_print_timestamp(stderr); fprintf(stderr, -" InnoDB: Error: File pointer positioning to file %s failed at\n" -"InnoDB: offset %lu %lu. Operating system error number %lu.\n" -"InnoDB: Some operating system error numbers are described at\n" -"InnoDB: " -"http://dev.mysql.com/doc/refman/5.1/en/operating-system-error-codes.html\n", + " InnoDB: Error: File pointer positioning to" + " file %s failed at\n" + "InnoDB: offset %lu %lu. Operating system" + " error number %lu.\n" + "InnoDB: Some operating system error numbers" + " are described at\n" + "InnoDB: " + "http://dev.mysql.com/doc/refman/5.1/en/" + "operating-system-error-codes.html\n", name, (ulong) offset_high, (ulong) offset, (ulong) GetLastError()); @@ -2392,23 +2435,30 @@ retry: ut_print_timestamp(stderr); fprintf(stderr, -" InnoDB: Error: Write to file %s failed at offset %lu %lu.\n" -"InnoDB: %lu bytes should have been written, only %lu were written.\n" -"InnoDB: Operating system error number %lu.\n" -"InnoDB: Check that your OS and file system support files of this size.\n" -"InnoDB: Check also that the disk is not full or a disk quota exceeded.\n", + " InnoDB: Error: Write to file %s failed" + " at offset %lu %lu.\n" + "InnoDB: %lu bytes should have been written," + " only %lu were written.\n" + "InnoDB: Operating system error number %lu.\n" + "InnoDB: Check that your OS and file system" + " support files of this size.\n" + "InnoDB: Check also that the disk is not full" + " or a disk quota exceeded.\n", name, (ulong) offset_high, (ulong) offset, (ulong) n, (ulong) len, (ulong) err); if (strerror((int)err) != NULL) { fprintf(stderr, -"InnoDB: Error number %lu means '%s'.\n", (ulong) err, strerror((int)err)); + "InnoDB: Error number %lu means '%s'.\n", + (ulong) err, strerror((int)err)); } fprintf(stderr, -"InnoDB: Some operating system error numbers are described at\n" -"InnoDB: " -"http://dev.mysql.com/doc/refman/5.1/en/operating-system-error-codes.html\n"); + "InnoDB: Some operating system error numbers" + " are described at\n" + "InnoDB: " + "http://dev.mysql.com/doc/refman/5.1/en/" + "operating-system-error-codes.html\n"); os_has_said_disk_full = TRUE; } @@ -2429,22 +2479,29 @@ retry: ut_print_timestamp(stderr); fprintf(stderr, -" InnoDB: Error: Write to file %s failed at offset %lu %lu.\n" -"InnoDB: %lu bytes should have been written, only %ld were written.\n" -"InnoDB: Operating system error number %lu.\n" -"InnoDB: Check that your OS and file system support files of this size.\n" -"InnoDB: Check also that the disk is not full or a disk quota exceeded.\n", + " InnoDB: Error: Write to file %s failed" + " at offset %lu %lu.\n" + "InnoDB: %lu bytes should have been written," + " only %ld were written.\n" + "InnoDB: Operating system error number %lu.\n" + "InnoDB: Check that your OS and file system" + " support files of this size.\n" + "InnoDB: Check also that the disk is not full" + " or a disk quota exceeded.\n", name, offset_high, offset, n, (long int)ret, - (ulint)errno); + (ulint)errno); if (strerror(errno) != NULL) { fprintf(stderr, -"InnoDB: Error number %lu means '%s'.\n", (ulint)errno, strerror(errno)); + "InnoDB: Error number %lu means '%s'.\n", + (ulint)errno, strerror(errno)); } fprintf(stderr, -"InnoDB: Some operating system error numbers are described at\n" -"InnoDB: " -"http://dev.mysql.com/doc/refman/5.1/en/operating-system-error-codes.html\n"); + "InnoDB: Some operating system error numbers" + " are described at\n" + "InnoDB: " + "http://dev.mysql.com/doc/refman/5.1/en/" + "operating-system-error-codes.html\n"); os_has_said_disk_full = TRUE; } @@ -2531,9 +2588,11 @@ This function returns information about the specified file */ ibool os_file_get_status( /*===============*/ - /* out: TRUE if stat information found */ - const char* path, /* in: pathname of the file */ - os_file_stat_t* stat_info) /* information of a file in a directory */ + /* out: TRUE if stat + information found */ + const char* path, /* in: pathname of the file */ + os_file_stat_t* stat_info) /* information of a file in a + directory */ { #ifdef __WIN__ int ret; @@ -2613,7 +2672,7 @@ os_file_get_status( The function os_file_dirname returns a directory component of a null-terminated pathname string. In the usual case, dirname returns the string up to, but not including, the final '/', and basename -is the component following the final '/'. Trailing '/' charac +is the component following the final '/'. Trailing '/' charac ters are not counted as part of the pathname. If path does not contain a slash, dirname returns the string ".". @@ -2681,7 +2740,7 @@ os_file_create_subdirs_if_needed( subdir = os_file_dirname(path); if (strlen(subdir) == 1 - && (*subdir == OS_FILE_PATH_SEPARATOR || *subdir == '.')) { + && (*subdir == OS_FILE_PATH_SEPARATOR || *subdir == '.')) { /* subdir is root or cwd, nothing to do */ mem_free(subdir); @@ -2825,14 +2884,14 @@ os_aio_init( srv_io_thread_function[1] = "log thread"; os_aio_read_array = os_aio_array_create(n_read_segs * n_per_seg, - n_read_segs); + n_read_segs); for (i = 2; i < 2 + n_read_segs; i++) { ut_a(i < SRV_MAX_N_IO_THREADS); srv_io_thread_function[i] = "read thread"; } os_aio_write_array = os_aio_array_create(n_write_segs * n_per_seg, - n_write_segs); + n_write_segs); for (i = 2 + n_read_segs; i < n_segments; i++) { ut_a(i < SRV_MAX_N_IO_THREADS); srv_io_thread_function[i] = "write thread"; @@ -2868,7 +2927,7 @@ os_aio_init( pthread_sigmask(SIG_BLOCK, &sigset, NULL); */ #endif -} + } #ifdef WIN_ASYNC_IO /**************************************************************************** @@ -2946,17 +3005,17 @@ os_aio_get_segment_no_from_slot( segment = 1; } else if (array == os_aio_read_array) { - seg_len = os_aio_read_array->n_slots / - os_aio_read_array->n_segments; + seg_len = os_aio_read_array->n_slots + / os_aio_read_array->n_segments; segment = 2 + slot->pos / seg_len; } else { ut_a(array == os_aio_write_array); - seg_len = os_aio_write_array->n_slots / - os_aio_write_array->n_segments; + seg_len = os_aio_write_array->n_slots + / os_aio_write_array->n_segments; segment = os_aio_read_array->n_segments + 2 - + slot->pos / seg_len; + + slot->pos / seg_len; } return(segment); @@ -3161,13 +3220,13 @@ loop: control->aio_offset = offset; control->aio_reqprio = 0; control->aio_sigevent.sigev_notify = SIGEV_SIGNAL; - control->aio_sigevent.sigev_signo = - SIGRTMIN + 1 + os_aio_get_array_no(array); - /* TODO: How to choose the signal numbers? */ -/* + control->aio_sigevent.sigev_signo + = SIGRTMIN + 1 + os_aio_get_array_no(array); + /* TODO: How to choose the signal numbers? */ + /* fprintf(stderr, "AIO signal number %lu\n", - (ulint) control->aio_sigevent.sigev_signo); -*/ + (ulint) control->aio_sigevent.sigev_signo); + */ control->aio_sigevent.sigev_value.sival_ptr = slot; #endif os_mutex_exit(array->mutex); @@ -3362,9 +3421,9 @@ os_aio( if (mode == OS_AIO_SYNC #ifdef WIN_ASYNC_IO - && !os_aio_use_native_aio + && !os_aio_use_native_aio #endif - ) { + ) { /* This is actually an ordinary synchronous read or write: no need to use an i/o-handler thread. NOTE that if we use Windows async i/o, Windows does not allow us to use @@ -3374,7 +3433,7 @@ os_aio( if (type == OS_FILE_READ) { return(os_file_read(file, buf, offset, - offset_high, n)); + offset_high, n)); } ut_a(type == OS_FILE_WRITE); @@ -3408,7 +3467,7 @@ try_again: } slot = os_aio_array_reserve_slot(type, array, message1, message2, file, - name, buf, offset, offset_high, n); + name, buf, offset, offset_high, n); if (type == OS_FILE_READ) { if (os_aio_use_native_aio) { #ifdef WIN_ASYNC_IO @@ -3416,7 +3475,7 @@ try_again: os_bytes_read_since_printout += len; ret = ReadFile(file, buf, (DWORD)n, &len, - &(slot->control)); + &(slot->control)); #elif defined(POSIX_ASYNC_IO) slot->control.aio_lio_opcode = LIO_READ; err = (ulint) aio_read(&(slot->control)); @@ -3424,8 +3483,9 @@ try_again: #endif } else { if (!wake_later) { - os_aio_simulated_wake_handler_thread( - os_aio_get_segment_no_from_slot(array, slot)); + os_aio_simulated_wake_handler_thread + (os_aio_get_segment_no_from_slot + (array, slot)); } } } else if (type == OS_FILE_WRITE) { @@ -3433,7 +3493,7 @@ try_again: #ifdef WIN_ASYNC_IO os_n_file_writes++; ret = WriteFile(file, buf, (DWORD)n, &len, - &(slot->control)); + &(slot->control)); #elif defined(POSIX_ASYNC_IO) slot->control.aio_lio_opcode = LIO_WRITE; err = (ulint) aio_write(&(slot->control)); @@ -3441,8 +3501,9 @@ try_again: #endif } else { if (!wake_later) { - os_aio_simulated_wake_handler_thread( - os_aio_get_segment_no_from_slot(array, slot)); + os_aio_simulated_wake_handler_thread + (os_aio_get_segment_no_from_slot + (array, slot)); } } } else { @@ -3452,7 +3513,7 @@ try_again: #ifdef WIN_ASYNC_IO if (os_aio_use_native_aio) { if ((ret && len == n) - || (!ret && GetLastError() == ERROR_IO_PENDING)) { + || (!ret && GetLastError() == ERROR_IO_PENDING)) { /* aio was queued successfully! */ if (mode == OS_AIO_SYNC) { @@ -3462,9 +3523,10 @@ try_again: async i/o */ retval = os_aio_windows_handle(ULINT_UNDEFINED, - slot->pos, - &dummy_mess1, &dummy_mess2, - &dummy_type); + slot->pos, + &dummy_mess1, + &dummy_mess2, + &dummy_type); return(retval); } @@ -3484,7 +3546,8 @@ try_again: os_aio_array_free_slot(array, slot); retry = os_file_handle_error(name, - type == OS_FILE_READ ? "aio read" : "aio write"); + type == OS_FILE_READ + ? "aio read" : "aio write"); if (retry) { goto try_again; @@ -3554,7 +3617,8 @@ os_aio_windows_handle( } else { srv_set_io_thread_op_info(orig_seg, "wait Windows aio"); i = os_event_wait_multiple(n, - (array->native_events) + segment * n); + (array->native_events) + + segment * n); } os_mutex_enter(array->mutex); @@ -3565,7 +3629,7 @@ os_aio_windows_handle( if (orig_seg != ULINT_UNDEFINED) { srv_set_io_thread_op_info(orig_seg, - "get windows aio return value"); + "get windows aio return value"); } ret = GetOverlappedResult(slot->file, &(slot->control), &len, TRUE); @@ -3580,8 +3644,8 @@ os_aio_windows_handle( # ifdef UNIV_DO_FLUSH if (slot->type == OS_FILE_WRITE - && !os_do_not_call_flush_at_each_write) { - ut_a(TRUE == os_file_flush(slot->file)); + && !os_do_not_call_flush_at_each_write) { + ut_a(TRUE == os_file_flush(slot->file)); } # endif /* UNIV_DO_FLUSH */ } else { @@ -3631,16 +3695,16 @@ os_aio_posix_handle( pthread_sigmask(SIG_UNBLOCK, &sigset, NULL); - /* +#if 0 sigprocmask(0, NULL, &proc_sigset); pthread_sigmask(0, NULL, &thr_sigset); for (i = 32 ; i < 40; i++) { fprintf(stderr, "%lu : %lu %lu\n", (ulint)i, - (ulint)sigismember(&proc_sigset, i), - (ulint)sigismember(&thr_sigset, i)); + (ulint) sigismember(&proc_sigset, i), + (ulint) sigismember(&thr_sigset, i)); } - */ +#endif ret = sigwaitinfo(&sigset, &info); @@ -3666,7 +3730,7 @@ os_aio_posix_handle( # ifdef UNIV_DO_FLUSH if (slot->type == OS_FILE_WRITE - && !os_do_not_call_flush_at_each_write) { + && !os_do_not_call_flush_at_each_write) { ut_a(TRUE == os_file_flush(slot->file)); } # endif /* UNIV_DO_FLUSH */ @@ -3693,19 +3757,24 @@ os_file_check_page_trailers( ulint len; for (len = 0; len + UNIV_PAGE_SIZE <= total_len; - len += UNIV_PAGE_SIZE) { + len += UNIV_PAGE_SIZE) { byte* buf = combined_buf + len; - if (memcmp(buf + (FIL_PAGE_LSN + 4), buf + (UNIV_PAGE_SIZE - - FIL_PAGE_END_LSN_OLD_CHKSUM + 4), 4)) { + if (UNIV_UNLIKELY + (memcmp(buf + (FIL_PAGE_LSN + 4), + buf + (UNIV_PAGE_SIZE + - FIL_PAGE_END_LSN_OLD_CHKSUM + 4), 4))) { ut_print_timestamp(stderr); fprintf(stderr, -" InnoDB: ERROR: The page to be written seems corrupt!\n" -"InnoDB: Writing a block of %lu bytes, currently at offset %lu\n", - (ulong)total_len, (ulong)len); + " InnoDB: ERROR: The page to be written" + " seems corrupt!\n" + "InnoDB: Writing a block of %lu bytes," + " currently at offset %lu\n", + (ulong)total_len, (ulong)len); buf_page_print(buf); fprintf(stderr, -"InnoDB: ERROR: The page to be written seems corrupt!\n"); + "InnoDB: ERROR: The page to be written" + " seems corrupt!\n"); } } } @@ -3755,7 +3824,7 @@ restart: we do not have to acquire the protecting mutex yet */ srv_set_io_thread_op_info(global_segment, - "looking for i/o requests (a)"); + "looking for i/o requests (a)"); ut_ad(os_aio_validate()); ut_ad(segment < array->n_segments); @@ -3764,7 +3833,7 @@ restart: /* Look through n slots after the segment * n'th slot */ if (array == os_aio_read_array - && os_aio_recommend_sleep_for_read_threads) { + && os_aio_recommend_sleep_for_read_threads) { /* Give other threads chance to add several i/os to the array at once. */ @@ -3775,7 +3844,7 @@ restart: os_mutex_enter(array->mutex); srv_set_io_thread_op_info(global_segment, - "looking for i/o requests (b)"); + "looking for i/o requests (b)"); /* Check if there is a slot for which the i/o has already been done */ @@ -3787,7 +3856,9 @@ restart: if (os_aio_print_debug) { fprintf(stderr, -"InnoDB: i/o for slot %lu already done, returning\n", (ulong) i); + "InnoDB: i/o for slot %lu" + " already done, returning\n", + (ulong) i); } ret = TRUE; @@ -3810,11 +3881,11 @@ restart: if (slot->reserved) { age = (ulint)difftime(time(NULL), - slot->reservation_time); + slot->reservation_time); if ((age >= 2 && age > biggest_age) - || (age >= 2 && age == biggest_age - && slot->offset < lowest_offset)) { + || (age >= 2 && age == biggest_age + && slot->offset < lowest_offset)) { /* Found an i/o request */ consecutive_ios[0] = slot; @@ -3836,7 +3907,7 @@ restart: for (i = 0; i < n; i++) { slot = os_aio_array_get_nth_slot(array, - i + segment * n); + i + segment * n); if (slot->reserved && slot->offset < lowest_offset) { @@ -3866,12 +3937,12 @@ consecutive_loop: slot2 = os_aio_array_get_nth_slot(array, i + segment * n); if (slot2->reserved && slot2 != slot - && slot2->offset == slot->offset + slot->len - /* check that sum does not wrap over */ - && slot->offset + slot->len > slot->offset - && slot2->offset_high == slot->offset_high - && slot2->type == slot->type - && slot2->file == slot->file) { + && slot2->offset == slot->offset + slot->len + /* check that sum does not wrap over */ + && slot->offset + slot->len > slot->offset + && slot2->offset_high == slot->offset_high + && slot2->type == slot->type + && slot2->file == slot->file) { /* Found a consecutive i/o request */ @@ -3927,7 +3998,7 @@ consecutive_loop: for (i = 0; i < n_consecutive; i++) { ut_memcpy(combined_buf + offs, consecutive_ios[i]->buf, - consecutive_ios[i]->len); + consecutive_ios[i]->len); offs += consecutive_ios[i]->len; } } @@ -3936,7 +4007,8 @@ consecutive_loop: if (os_aio_print_debug) { fprintf(stderr, -"InnoDB: doing i/o of type %lu at offset %lu %lu, length %lu\n", + "InnoDB: doing i/o of type %lu at offset %lu %lu," + " length %lu\n", (ulong) slot->type, (ulong) slot->offset_high, (ulong) slot->offset, (ulong) total_len); } @@ -3945,9 +4017,10 @@ consecutive_loop: if (slot->type == OS_FILE_WRITE) { if (array == os_aio_write_array) { if ((total_len % UNIV_PAGE_SIZE != 0) - || (slot->offset % UNIV_PAGE_SIZE != 0)) { + || (slot->offset % UNIV_PAGE_SIZE != 0)) { fprintf(stderr, -"InnoDB: Error: trying a displaced write to %s %lu %lu, len %lu\n", + "InnoDB: Error: trying a displaced" + " write to %s %lu %lu, len %lu\n", slot->name, (ulong) slot->offset_high, (ulong) slot->offset, (ulong) total_len); @@ -3958,22 +4031,25 @@ consecutive_loop: } ret = os_file_write(slot->name, slot->file, combined_buf, - slot->offset, slot->offset_high, total_len); + slot->offset, slot->offset_high, + total_len); if (array == os_aio_write_array) { os_file_check_page_trailers(combined_buf, total_len); } } else { ret = os_file_read(slot->file, combined_buf, - slot->offset, slot->offset_high, total_len); + slot->offset, slot->offset_high, total_len); } ut_a(ret); srv_set_io_thread_op_info(global_segment, "file i/o done"); -/* fprintf(stderr, - "aio: %lu consecutive %lu:th segment, first offs %lu blocks\n", - n_consecutive, global_segment, slot->offset / UNIV_PAGE_SIZE); */ +#if 0 + fprintf(stderr, + "aio: %lu consecutive %lu:th segment, first offs %lu blocks\n", + n_consecutive, global_segment, slot->offset / UNIV_PAGE_SIZE); +#endif if (slot->type == OS_FILE_READ && n_consecutive > 1) { /* Copy the combined buffer to individual buffers */ @@ -3982,7 +4058,7 @@ consecutive_loop: for (i = 0; i < n_consecutive; i++) { ut_memcpy(consecutive_ios[i]->buf, combined_buf + offs, - consecutive_ios[i]->len); + consecutive_ios[i]->len); offs += consecutive_ios[i]->len; } } @@ -4035,7 +4111,8 @@ recommended_sleep: if (os_aio_print_debug) { fprintf(stderr, -"InnoDB: i/o handler thread for i/o segment %lu wakes up\n", + "InnoDB: i/o handler thread for i/o" + " segment %lu wakes up\n", (ulong) global_segment); } @@ -4113,8 +4190,8 @@ os_aio_print( for (i = 0; i < srv_n_file_io_threads; i++) { fprintf(file, "I/O thread %lu state: %s (%s)", (ulong) i, - srv_io_thread_op_info[i], - srv_io_thread_function[i]); + srv_io_thread_op_info[i], + srv_io_thread_function[i]); #ifndef __WIN__ if (os_aio_segment_wait_events[i]->is_set) { @@ -4143,8 +4220,11 @@ loop: if (slot->reserved) { n_reserved++; - /* fprintf(stderr, "Reserved slot, messages %p %p\n", - slot->message1, slot->message2); */ +#if 0 + fprintf(stderr, "Reserved slot, messages %p %p\n", + (void*) slot->message1, + (void*) slot->message2); +#endif ut_a(slot->len > 0); } } @@ -4206,12 +4286,13 @@ loop: if (os_n_file_reads == os_n_file_reads_old) { avg_bytes_read = 0.0; } else { - avg_bytes_read = (double) os_bytes_read_since_printout / - (os_n_file_reads - os_n_file_reads_old); + avg_bytes_read = (double) os_bytes_read_since_printout + / (os_n_file_reads - os_n_file_reads_old); } fprintf(file, -"%.2f reads/s, %lu avg bytes/read, %.2f writes/s, %.2f fsyncs/s\n", + "%.2f reads/s, %lu avg bytes/read," + " %.2f writes/s, %.2f fsyncs/s\n", (os_n_file_reads - os_n_file_reads_old) / time_elapsed, (ulong)avg_bytes_read, diff --git a/storage/innobase/os/os0proc.c b/storage/innobase/os/os0proc.c index fc1b2d0d2dd..a99fe8b6a0e 100644 --- a/storage/innobase/os/os0proc.c +++ b/storage/innobase/os/os0proc.c @@ -90,8 +90,8 @@ os_awe_enable_lock_pages_in_mem(void) #elif defined(__WIN2000__) struct { - DWORD Count; - LUID_AND_ATTRIBUTES Privilege[1]; + DWORD Count; + LUID_AND_ATTRIBUTES Privilege[1]; } Info; HANDLE hProcess; HANDLE Token; @@ -102,7 +102,7 @@ os_awe_enable_lock_pages_in_mem(void) /* Open the token of the current process */ Result = OpenProcessToken(hProcess, - TOKEN_ADJUST_PRIVILEGES, &Token); + TOKEN_ADJUST_PRIVILEGES, &Token); if (Result != TRUE) { fprintf(stderr, "InnoDB: AWE: Cannot open process token, error %lu\n", @@ -118,10 +118,11 @@ os_awe_enable_lock_pages_in_mem(void) privilege */ Result = LookupPrivilegeValue(NULL, SE_LOCK_MEMORY_NAME, - &(Info.Privilege[0].Luid)); + &(Info.Privilege[0].Luid)); if (Result != TRUE) { fprintf(stderr, - "InnoDB: AWE: Cannot get local privilege value for %s, error %lu.\n", + "InnoDB: AWE: Cannot get local privilege" + " value for %s, error %lu.\n", SE_LOCK_MEMORY_NAME, (ulint)GetLastError()); return(FALSE); @@ -130,23 +131,29 @@ os_awe_enable_lock_pages_in_mem(void) /* Try to adjust the privilege */ Result = AdjustTokenPrivileges(Token, FALSE, - (PTOKEN_PRIVILEGES)&Info, - 0, NULL, NULL); + (PTOKEN_PRIVILEGES)&Info, + 0, NULL, NULL); /* Check the result */ if (Result != TRUE) { fprintf(stderr, - "InnoDB: AWE: Cannot adjust process token privileges, error %u.\n", + "InnoDB: AWE: Cannot adjust process token privileges," + " error %u.\n", GetLastError()); return(FALSE); } else if (GetLastError() != ERROR_SUCCESS) { fprintf(stderr, -"InnoDB: AWE: Cannot enable SE_LOCK_MEMORY privilege, error %lu.\n" -"InnoDB: In Windows XP Home you cannot use AWE. In Windows 2000 and XP\n" -"InnoDB: Professional you must go to the Control Panel, to\n" -"InnoDB: Security Settings, to Local Policies, and enable\n" -"InnoDB: the 'lock pages in memory' privilege for the user who runs\n" -"InnoDB: the MySQL server.\n", GetLastError()); + "InnoDB: AWE: Cannot enable SE_LOCK_MEMORY privilege," + " error %lu.\n" + "InnoDB: In Windows XP Home you cannot use AWE." + " In Windows 2000 and XP\n" + "InnoDB: Professional you must go to the" + " Control Panel, to\n" + "InnoDB: Security Settings, to Local Policies," + " and enable\n" + "InnoDB: the 'lock pages in memory' privilege" + " for the user who runs\n" + "InnoDB: the MySQL server.\n", GetLastError()); return(FALSE); } @@ -157,7 +164,8 @@ os_awe_enable_lock_pages_in_mem(void) #else #ifdef __WIN__ fprintf(stderr, -"InnoDB: AWE: Error: to use AWE you must use a ...-nt MySQL executable.\n"); + "InnoDB: AWE: Error: to use AWE you must use" + " a ...-nt MySQL executable.\n"); #endif return(FALSE); #endif @@ -178,12 +186,12 @@ os_awe_allocate_physical_mem( ulint n_megabytes) /* in: number of megabytes to allocate */ { #ifdef UNIV_SIMULATE_AWE - os_awe_simulate_page_info = ut_malloc(sizeof(os_awe_t) * - n_megabytes * ((1024 * 1024) / OS_AWE_X86_PAGE_SIZE)); + os_awe_simulate_page_info = ut_malloc + (sizeof(os_awe_t) * n_megabytes + * ((1024 * 1024) / OS_AWE_X86_PAGE_SIZE)); - os_awe_simulate_mem = ut_align(ut_malloc( - 4096 + 1024 * 1024 * n_megabytes), - 4096); + os_awe_simulate_mem + = ut_align(ut_malloc(4096 + 1024 * 1024 * n_megabytes), 4096); os_awe_simulate_mem_size = n_megabytes * 1024 * 1024; *page_info = os_awe_simulate_page_info; @@ -204,8 +212,9 @@ os_awe_allocate_physical_mem( if (n_megabytes > 64 * 1024) { fprintf(stderr, -"InnoDB: AWE: Error: tried to allocate %lu MB.\n" -"InnoDB: AWE cannot allocate more than 64 GB in any computer.\n", n_megabytes); + "InnoDB: AWE: Error: tried to allocate %lu MB.\n" + "InnoDB: AWE cannot allocate more than" + " 64 GB in any computer.\n", n_megabytes); return(FALSE); } @@ -214,8 +223,10 @@ os_awe_allocate_physical_mem( if ((ulint)OS_AWE_X86_PAGE_SIZE != (ulint)sSysInfo.dwPageSize) { fprintf(stderr, -"InnoDB: AWE: Error: this computer has a page size of %lu.\n" -"InnoDB: Should be 4096 bytes for InnoDB AWE support to work.\n", + "InnoDB: AWE: Error: this computer has a page size" + " of %lu.\n" + "InnoDB: Should be 4096 bytes for" + " InnoDB AWE support to work.\n", (ulint)sSysInfo.dwPageSize); return(FALSE); @@ -233,7 +244,8 @@ os_awe_allocate_physical_mem( if (*page_info == NULL) { fprintf(stderr, -"InnoDB: AWE: Failed to allocate page info array from process heap, error %lu\n", + "InnoDB: AWE: Failed to allocate page info" + " array from process heap, error %lu\n", (ulint)GetLastError()); return(FALSE); @@ -259,10 +271,11 @@ os_awe_allocate_physical_mem( defined, see the note at the start of this file */ bResult = AllocateUserPhysicalPages(GetCurrentProcess(), - &NumberOfPages, *page_info); + &NumberOfPages, *page_info); if (bResult != TRUE) { fprintf(stderr, -"InnoDB: AWE: Cannot allocate physical pages, error %lu.\n", + "InnoDB: AWE: Cannot allocate physical pages," + " error %lu.\n", (ulint)GetLastError()); return(FALSE); @@ -270,14 +283,19 @@ os_awe_allocate_physical_mem( if (NumberOfPagesInitial != NumberOfPages) { fprintf(stderr, -"InnoDB: AWE: Error: allocated only %lu pages of %lu requested.\n" -"InnoDB: Check that you have enough free RAM.\n" -"InnoDB: In Windows XP Professional and 2000 Professional\n" -"InnoDB: Windows PAE size is max 4 GB. In 2000 and .NET\n" -"InnoDB: Advanced Servers and 2000 Datacenter Server it is 32 GB,\n" -"InnoDB: and in .NET Datacenter Server it is 64 GB.\n" -"InnoDB: A Microsoft web page said that the processor must be an Intel\n" -"InnoDB: processor.\n", + "InnoDB: AWE: Error: allocated only %lu pages" + " of %lu requested.\n" + "InnoDB: Check that you have enough free RAM.\n" + "InnoDB: In Windows XP Professional and" + " 2000 Professional\n" + "InnoDB: Windows PAE size is max 4 GB." + " In 2000 and .NET\n" + "InnoDB: Advanced Servers and 2000 Datacenter Server" + " it is 32 GB,\n" + "InnoDB: and in .NET Datacenter Server it is 64 GB.\n" + "InnoDB: A Microsoft web page said that" + " the processor must be an Intel\n" + "InnoDB: processor.\n", (ulint)NumberOfPages, (ulint)NumberOfPagesInitial); @@ -285,7 +303,8 @@ os_awe_allocate_physical_mem( } fprintf(stderr, -"InnoDB: Using Address Windowing Extensions (AWE); allocated %lu MB\n", + "InnoDB: Using Address Windowing Extensions (AWE);" + " allocated %lu MB\n", n_megabytes); return(TRUE); @@ -328,17 +347,19 @@ os_awe_allocate_virtual_mem_window( if (size > (ulint)0x7FFFFFFFUL) { fprintf(stderr, -"InnoDB: AWE: Cannot allocate %lu bytes of virtual memory\n", size); + "InnoDB: AWE: Cannot allocate %lu bytes" + " of virtual memory\n", size); return(NULL); } ptr = VirtualAlloc(NULL, (SIZE_T)size, MEM_RESERVE | MEM_PHYSICAL, - PAGE_READWRITE); + PAGE_READWRITE); if (ptr == NULL) { fprintf(stderr, -"InnoDB: AWE: Cannot allocate %lu bytes of virtual memory, error %lu\n", - size, (ulint)GetLastError()); + "InnoDB: AWE: Cannot allocate %lu bytes" + " of virtual memory, error %lu\n", + size, (ulint)GetLastError()); return(NULL); } @@ -390,14 +411,14 @@ os_awe_map_physical_mem_to_window( ut_a(ptr >= os_awe_simulate_window); ut_a(ptr < os_awe_simulate_window + os_awe_simulate_window_size); ut_a(page_info >= os_awe_simulate_page_info); - ut_a(page_info < os_awe_simulate_page_info + - (os_awe_simulate_mem_size / 4096)); + ut_a(page_info < os_awe_simulate_page_info + + (os_awe_simulate_mem_size / 4096)); /* First look if some other 'physical pages' are mapped at ptr, and copy them back to where they were if yes */ map = os_awe_simulate_map - + ((ulint)(ptr - os_awe_simulate_window)) / 4096; + + ((ulint)(ptr - os_awe_simulate_window)) / 4096; page = ptr; for (i = 0; i < n_mem_pages; i++) { @@ -412,15 +433,15 @@ os_awe_map_physical_mem_to_window( assume page_info is a segment of the array we created at the start */ phys_page = os_awe_simulate_mem - + (ulint)(page_info - os_awe_simulate_page_info) - * 4096; + + (ulint)(page_info - os_awe_simulate_page_info) + * 4096; ut_memcpy(ptr, phys_page, n_mem_pages * 4096); /* Update the map */ map = os_awe_simulate_map - + ((ulint)(ptr - os_awe_simulate_window)) / 4096; + + ((ulint)(ptr - os_awe_simulate_window)) / 4096; for (i = 0; i < n_mem_pages; i++) { *map = phys_page; @@ -439,29 +460,34 @@ os_awe_map_physical_mem_to_window( if (!(ptr >= os_awe_window)) { fprintf(stderr, -"InnoDB: AWE: Error: trying to map to address %lx but AWE window start %lx\n", - (ulint)ptr, (ulint)os_awe_window); + "InnoDB: AWE: Error: trying to map to address %lx" + " but AWE window start %lx\n", + (ulint)ptr, (ulint)os_awe_window); ut_a(0); } if (!(ptr <= os_awe_window + os_awe_window_size - UNIV_PAGE_SIZE)) { fprintf(stderr, -"InnoDB: AWE: Error: trying to map to address %lx but AWE window end %lx\n", - (ulint)ptr, (ulint)os_awe_window + os_awe_window_size); + "InnoDB: AWE: Error: trying to map to address %lx" + " but AWE window end %lx\n", + (ulint)ptr, (ulint)os_awe_window + os_awe_window_size); ut_a(0); } if (!(page_info >= os_awe_page_info)) { fprintf(stderr, -"InnoDB: AWE: Error: trying to map page info at %lx but array start %lx\n", - (ulint)page_info, (ulint)os_awe_page_info); + "InnoDB: AWE: Error: trying to map page info" + " at %lx but array start %lx\n", + (ulint)page_info, (ulint)os_awe_page_info); ut_a(0); } if (!(page_info <= os_awe_page_info + (os_awe_n_pages - 4))) { fprintf(stderr, -"InnoDB: AWE: Error: trying to map page info at %lx but array end %lx\n", - (ulint)page_info, (ulint)(os_awe_page_info + os_awe_n_pages)); + "InnoDB: AWE: Error: trying to map page info" + " at %lx but array end %lx\n", + (ulint)page_info, + (ulint)(os_awe_page_info + os_awe_n_pages)); ut_a(0); } @@ -470,9 +496,10 @@ os_awe_map_physical_mem_to_window( if (bResult != TRUE) { ut_print_timestamp(stderr); fprintf(stderr, -" InnoDB: AWE: Mapping of %lu physical pages to address %lx failed,\n" -"InnoDB: error %lu.\n" -"InnoDB: Cannot continue operation.\n", + " InnoDB: AWE: Mapping of %lu physical pages" + " to address %lx failed,\n" + "InnoDB: error %lu.\n" + "InnoDB: Cannot continue operation.\n", n_mem_pages, (ulint)ptr, (ulint)GetLastError()); exit(1); } @@ -517,7 +544,7 @@ os_mem_alloc_nocache( void* ptr; ptr = VirtualAlloc(NULL, n, MEM_COMMIT, - PAGE_READWRITE | PAGE_NOCACHE); + PAGE_READWRITE | PAGE_NOCACHE); ut_a(ptr); return(ptr); @@ -541,47 +568,50 @@ os_mem_alloc_large( the memory cannot be allocated */ { #ifdef HAVE_LARGE_PAGES - ulint size; - int shmid; - void *ptr = NULL; - struct shmid_ds buf; + ulint size; + int shmid; + void *ptr = NULL; + struct shmid_ds buf; - if (!os_use_large_pages || !os_large_page_size) { - goto skip; - } + if (!os_use_large_pages || !os_large_page_size) { + goto skip; + } #ifdef UNIV_LINUX - /* Align block size to os_large_page_size */ - size = ((n - 1) & ~(os_large_page_size - 1)) + os_large_page_size; - - shmid = shmget(IPC_PRIVATE, (size_t)size, SHM_HUGETLB | SHM_R | SHM_W); - if (shmid < 0) { - fprintf(stderr, "InnoDB: HugeTLB: Warning: Failed to allocate" - " %lu bytes. errno %d\n", n, errno); - } else { - ptr = shmat(shmid, NULL, 0); - if (ptr == (void *)-1) { - fprintf(stderr, "InnoDB: HugeTLB: Warning: Failed to" - " attach shared memory segment, errno %d\n", errno); - } - - /* Remove the shared memory segment so that it will be - automatically freed after memory is detached or process exits */ - shmctl(shmid, IPC_RMID, &buf); - } + /* Align block size to os_large_page_size */ + size = ((n - 1) & ~(os_large_page_size - 1)) + os_large_page_size; + + shmid = shmget(IPC_PRIVATE, (size_t)size, SHM_HUGETLB | SHM_R | SHM_W); + if (shmid < 0) { + fprintf(stderr, "InnoDB: HugeTLB: Warning: Failed to allocate" + " %lu bytes. errno %d\n", n, errno); + } else { + ptr = shmat(shmid, NULL, 0); + if (ptr == (void *)-1) { + fprintf(stderr, "InnoDB: HugeTLB: Warning: Failed to" + " attach shared memory segment, errno %d\n", + errno); + } + + /* Remove the shared memory segment so that it will be + automatically freed after memory is detached or + process exits */ + shmctl(shmid, IPC_RMID, &buf); + } #endif - if (ptr) { - if (set_to_zero) { + if (ptr) { + if (set_to_zero) { #ifdef UNIV_SET_MEM_TO_ZERO - memset(ptr, '\0', size); + memset(ptr, '\0', size); #endif - } + } - return(ptr); - } + return(ptr); + } - fprintf(stderr, "InnoDB HugeTLB: Warning: Using conventional memory pool\n"); + fprintf(stderr, "InnoDB HugeTLB: Warning: Using conventional" + " memory pool\n"); skip: #endif /* HAVE_LARGE_PAGES */ @@ -597,16 +627,16 @@ os_mem_free_large( void *ptr) /* in: number of bytes */ { #ifdef HAVE_LARGE_PAGES - if (os_use_large_pages && os_large_page_size + if (os_use_large_pages && os_large_page_size #ifdef UNIV_LINUX - && !shmdt(ptr) + && !shmdt(ptr) #endif - ) { - return; - } + ) { + return; + } #endif - ut_free(ptr); + ut_free(ptr); } /******************************************************************** @@ -632,11 +662,12 @@ os_process_set_priority_boost( # error "TRUE != 1" #endif -/* Does not do anything currently! + /* Does not do anything currently! SetProcessPriorityBoost(GetCurrentProcess(), no_boost); -*/ - fputs("Warning: process priority boost setting currently not functional!\n", - stderr); + */ + fputs("Warning: process priority boost setting" + " currently not functional!\n", + stderr); #else UT_NOT_USED(do_boost); #endif diff --git a/storage/innobase/os/os0sync.c b/storage/innobase/os/os0sync.c index eceedcb66b2..9c6b1134e12 100644 --- a/storage/innobase/os/os0sync.c +++ b/storage/innobase/os/os0sync.c @@ -90,8 +90,8 @@ os_sync_free(void) while (mutex) { if (mutex == os_sync_mutex) { /* Set the flag to FALSE so that we do not try to - reserve os_sync_mutex any more in remaining freeing - operations in shutdown */ + reserve os_sync_mutex any more in remaining freeing + operations in shutdown */ os_sync_mutex_inited = FALSE; } @@ -118,14 +118,15 @@ os_event_create( event = ut_malloc(sizeof(struct os_event_struct)); - event->handle = CreateEvent(NULL,/* No security attributes */ - TRUE, /* Manual reset */ - FALSE, /* Initial state nonsignaled */ - (LPCTSTR) name); + event->handle = CreateEvent(NULL, /* No security attributes */ + TRUE, /* Manual reset */ + FALSE, /* Initial state nonsignaled */ + (LPCTSTR) name); if (!event->handle) { fprintf(stderr, -"InnoDB: Could not create a Windows event semaphore; Windows error %lu\n", - (ulong) GetLastError()); + "InnoDB: Could not create a Windows event semaphore;" + " Windows error %lu\n", + (ulong) GetLastError()); } #else /* Unix */ os_event_t event; @@ -138,7 +139,7 @@ os_event_create( #if defined(UNIV_HOTBACKUP) && defined(UNIV_HPUX10) ut_a(0 == pthread_cond_init(&(event->cond_var), - pthread_condattr_default)); + pthread_condattr_default)); #else ut_a(0 == pthread_cond_init(&(event->cond_var), NULL)); #endif @@ -174,15 +175,16 @@ os_event_create_auto( event = ut_malloc(sizeof(struct os_event_struct)); - event->handle = CreateEvent(NULL,/* No security attributes */ - FALSE, /* Auto-reset */ - FALSE, /* Initial state nonsignaled */ - (LPCTSTR) name); + event->handle = CreateEvent(NULL, /* No security attributes */ + FALSE, /* Auto-reset */ + FALSE, /* Initial state nonsignaled */ + (LPCTSTR) name); if (!event->handle) { fprintf(stderr, -"InnoDB: Could not create a Windows auto event semaphore; Windows error %lu\n", - (ulong) GetLastError()); + "InnoDB: Could not create a Windows auto" + " event semaphore; Windows error %lu\n", + (ulong) GetLastError()); } /* Put to the list of events */ @@ -320,7 +322,7 @@ os_event_wait( for (;;) { if (event->is_set == TRUE - || event->signal_count != old_signal_count) { + || event->signal_count != old_signal_count) { os_fast_mutex_unlock(&(event->os_mutex)); @@ -409,9 +411,9 @@ os_event_wait_multiple( ut_a(n > 0); index = WaitForMultipleObjects((DWORD) n, native_event_array, - FALSE, /* Wait for any 1 event */ - INFINITE); /* Infinite wait time - limit */ + FALSE, /* Wait for any 1 event */ + INFINITE); /* Infinite wait time + limit */ ut_a(index >= WAIT_OBJECT_0); /* NOTE: Pointless comparision */ ut_a(index < WAIT_OBJECT_0 + n); @@ -439,8 +441,8 @@ os_mutex_create( os_mutex_t mutex_str; mutex = CreateMutex(NULL, /* No security attributes */ - FALSE, /* Initial state: no owner */ - (LPCTSTR) name); + FALSE, /* Initial state: no owner */ + (LPCTSTR) name); ut_a(mutex); #else os_fast_mutex_t* mutex; @@ -638,10 +640,11 @@ os_fast_mutex_free( if (ret != 0) { ut_print_timestamp(stderr); fprintf(stderr, -" InnoDB: error: return value %lu when calling\n" -"InnoDB: pthread_mutex_destroy().\n", (ulint)ret); + " InnoDB: error: return value %lu when calling\n" + "InnoDB: pthread_mutex_destroy().\n", (ulint)ret); fprintf(stderr, -"InnoDB: Byte contents of the pthread mutex at %p:\n", (void*) fast_mutex); + "InnoDB: Byte contents of the pthread mutex at %p:\n", + (void*) fast_mutex); ut_print_buf(stderr, fast_mutex, sizeof(os_fast_mutex_t)); fprintf(stderr, "\n"); } diff --git a/storage/innobase/os/os0thread.c b/storage/innobase/os/os0thread.c index 138db6426ea..0c9434ccc7f 100644 --- a/storage/innobase/os/os0thread.c +++ b/storage/innobase/os/os0thread.c @@ -107,11 +107,11 @@ os_thread_create( os_mutex_exit(os_sync_mutex); thread = CreateThread(NULL, /* no security attributes */ - 0, /* default size stack */ - (LPTHREAD_START_ROUTINE)start_f, - arg, - 0, /* thread runs immediately */ - &win_thread_id); + 0, /* default size stack */ + (LPTHREAD_START_ROUTINE)start_f, + arg, + 0, /* thread runs immediately */ + &win_thread_id); if (srv_set_thread_priorities) { @@ -142,21 +142,23 @@ os_thread_create( AIX is always big enough. An empirical test on AIX-4.3 suggested the size was 96 kB, though. */ - ret = pthread_attr_setstacksize(&attr, - (size_t)(PTHREAD_STACK_MIN + 32 * 1024)); + ret = pthread_attr_setstacksize + (&attr, (size_t)(PTHREAD_STACK_MIN + 32 * 1024)); if (ret) { - fprintf(stderr, - "InnoDB: Error: pthread_attr_setstacksize returned %d\n", ret); - exit(1); + fprintf(stderr, + "InnoDB: Error: pthread_attr_setstacksize" + " returned %d\n", ret); + exit(1); } #endif #ifdef __NETWARE__ ret = pthread_attr_setstacksize(&attr, (size_t) NW_THD_STACKSIZE); if (ret) { - fprintf(stderr, - "InnoDB: Error: pthread_attr_setstacksize returned %d\n", ret); - exit(1); + fprintf(stderr, + "InnoDB: Error: pthread_attr_setstacksize" + " returned %d\n", ret); + exit(1); } #endif os_mutex_enter(os_sync_mutex); @@ -169,9 +171,9 @@ os_thread_create( ret = pthread_create(&pthread, &attr, start_f, arg); #endif if (ret) { - fprintf(stderr, - "InnoDB: Error: pthread_create returned %d\n", ret); - exit(1); + fprintf(stderr, + "InnoDB: Error: pthread_create returned %d\n", ret); + exit(1); } #if !(defined(UNIV_HOTBACKUP) && defined(UNIV_HPUX10)) @@ -220,7 +222,7 @@ os_thread_join( /*===========*/ os_thread_id_t thread_id) /* in: id of the thread to join */ { - return(pthread_join(thread_id, NULL)); + return(pthread_join(thread_id, NULL)); } #endif /********************************************************************* |