diff options
author | unknown <aivanov@mysql.com> | 2006-03-10 19:22:21 +0300 |
---|---|---|
committer | unknown <aivanov@mysql.com> | 2006-03-10 19:22:21 +0300 |
commit | 050f14ac371e03dc96b96e8a9b0cd8fa8e3a23e0 (patch) | |
tree | 8105d79f7267d8af93861befd1899063f1ad42c2 /storage/innobase/page | |
parent | 1cef1679a47bfbf744d656646770193ba07c30fe (diff) | |
download | mariadb-git-050f14ac371e03dc96b96e8a9b0cd8fa8e3a23e0.tar.gz |
Applied innodb-5.1-ss269 snapshot.
Fixed BUGS:
#3300: "UPDATE statement with no index column in where condition locks
all rows"
Implement semi-consistent read to reduce lock conflicts at the cost
of breaking serializability.
ha_innobase::unlock_row(): reset the "did semi consistent read" flag
ha_innobase::was_semi_consistent_read(),
ha_innobase::try_semi_consistent_read(): new methods
row_prebuilt_t, row_create_prebuilt(): add field row_read_type for
keeping track of semi-consistent reads
row_vers_build_for_semi_consistent_read(),
row_sel_build_committed_vers_for_mysql(): new functions
row_search_for_mysql(): implement semi-consistent reads
#9802: "Foreign key checks disallow alter table".
Added test cases.
#12456: "Cursor shows incorrect data - DML does not affect,
probably caching"
This patch implements a high-granularity read view to be used with
cursors. In this high-granularity consistent read view modifications
done by the creating transaction after the cursor is created or
future transactions are not visible. But those modifications that
transaction did before the cursor was created are visible.
#12701: "Support >4GB buffer pool and log files on 64-bit Windows"
Do not call os_file_create_tmpfile() at runtime. Instead, create all
tempfiles at startup and guard access to them with mutexes.
#13778: "If FOREIGN_KEY_CHECKS=0, one can create inconsistent FOREIGN KEYs".
When FOREIGN_KEY_CHECKS=0 we still need to check that datatypes between
foreign key references are compatible.
#14189: "VARBINARY and BINARY variables: trailing space ignored with InnoDB"
innobase_init(): Assert that
DATA_MYSQL_BINARY_CHARSET_COLL == my_charset_bin.number.
dtype_get_pad_char(): Do not pad VARBINARY or BINARY columns.
row_ins_cascade_calc_update_vec(): Refuse ON UPDATE CASCADE when trying
to change the length of a VARBINARY column that refers to or is referenced
by a BINARY column. BINARY columns are no longer padded on comparison,
and thus they cannot be padded on storage either.
#14747: "Race condition can cause btr_search_drop_page_hash_index() to crash"
Note that buf_block_t::index should be protected by btr_search_latch
or an s-latch or x-latch on the index page.
btr_search_drop_page_hash_index(): Read block->index while holding
btr_search_latch and use the cached value in the loop. Remove some
redundant assertions.
#15108: "mysqld crashes when innodb_log_file_size is set > 4G"
#15308: "Problem of Order with Enum Column in Primary Key"
#15550: "mysqld crashes in printing a FOREIGN KEY error in InnoDB"
row_ins_foreign_report_add_err(): When printing the parent record,
use the index in the parent table rather than the index in the child table.
#15653: "Slow inserts to InnoDB if many thousands of .ibd files"
Keep track on unflushed modifications to file spaces. When there are tens
of thousands of file spaces, flushing all files in fil_flush_file_spaces()
would be very slow.
fil_flush_file_spaces(): Only flush unflushed file spaces.
fil_space_t, fil_system_t: Add a list of unflushed spaces.
#15991: "innodb-file-per-table + symlink database + rename = cr"
os_file_handle_error(): Map the error codes EXDEV, ENOTDIR, and EISDIR
to the new code OS_FILE_PATH_ERROR. Treat this code as OS_FILE_PATH_ERROR.
This fixes the crash on RENAME TABLE when the .ibd file is a symbolic link
to a different file system.
#16157: "InnoDB crashes when main location settings are empty"
This patch is from Heikki.
#16298: "InnoDB segfaults in INSERTs in upgrade of 4.0 -> 5.0 tables
with VARCHAR BINARY"
dict_load_columns(): Set the charset-collation code
DATA_MYSQL_BINARY_CHARSET_COLL for those binary string columns
that lack a charset-collation code, i.e., the tables were created
with an older version of MySQL/InnoDB than 4.1.2.
#16229: "MySQL/InnoDB uses full explicit table locks in trigger processing"
Take a InnoDB table lock only if user has explicitly requested a table
lock. Added some additional comments to store_lock() and external_lock().
#16387: "InnoDB crash when dropping a foreign key <table>_ibfk_0"
Do not mistake TABLENAME_ibfk_0 for auto-generated id.
dict_table_get_highest_foreign_id(): Ignore foreign constraint
identifiers starting with the pattern TABLENAME_ibfk_0.
#16582: "InnoDB: Error in an adaptive hash index pointer to page"
Account for a race condition when dropping the adaptive hash index
for a B-tree page.
btr_search_drop_page_hash_index(): Retry the operation if a hash index
with different parameters was built meanwhile. Add diagnostics for the
case that hash node pointers to the page remain.
btr_search_info_update_hash(), btr_search_info_update_slow():
Document the parameter "info" as in/out.
#16814: "SHOW INNODB STATUS format error in LATEST FOREIGN KEY ERROR
section"
Add a missing newline to the LAST FOREIGN KEY ERROR section in SHOW
INNODB STATUS output.
dict_foreign_error_report(): Always print a newline after invoking
dict_print_info_on_foreign_key_in_create_format().
#16827: "Better InnoDB error message if ibdata files omitted from my.cnf"
#17126: "CHECK TABLE on InnoDB causes a short hang during check of adaptive
hash"
CHECK TABLE blocking other queries, by releasing the btr_search_latch
periodically during the adaptive hash table validation.
#17405: "Valgrind: conditional jump or move depends on unititialised values"
buf_block_init(): Reset magic_n, buf_fix_count and io_fix to avoid
testing uninitialized variables.
mysql-test/r/innodb.result:
Applied innodb-5.1-ss269 snapshot.
mysql-test/t/innodb.test:
Applied innodb-5.1-ss269 snapshot.
sql/ha_innodb.cc:
Applied innodb-5.1-ss269 snapshot.
sql/ha_innodb.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/btr/btr0btr.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/btr/btr0cur.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/btr/btr0pcur.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/btr/btr0sea.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/buf/buf0buf.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/buf/buf0flu.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/buf/buf0lru.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/buf/buf0rea.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/data/data0data.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/data/data0type.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/dict/dict0boot.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/dict/dict0crea.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/dict/dict0dict.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/dict/dict0load.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/dict/dict0mem.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/dyn/dyn0dyn.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/eval/eval0eval.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/eval/eval0proc.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/fil/fil0fil.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/fsp/fsp0fsp.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/fut/fut0lst.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/ha/ha0ha.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/ha/hash0hash.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/ibuf/ibuf0ibuf.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/btr0btr.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/btr0btr.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/btr0cur.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/btr0cur.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/btr0pcur.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/btr0pcur.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/btr0sea.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/btr0sea.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/btr0types.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/buf0buf.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/buf0buf.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/buf0flu.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/buf0flu.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/buf0lru.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/data0data.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/data0data.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/data0type.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/data0type.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/db0err.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/dict0boot.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/dict0boot.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/dict0crea.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/dict0dict.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/dict0dict.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/dict0load.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/dict0mem.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/dyn0dyn.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/dyn0dyn.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/eval0eval.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/eval0eval.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/eval0proc.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/eval0proc.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/fil0fil.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/fsp0fsp.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/fut0lst.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/ha0ha.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/hash0hash.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/hash0hash.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/ibuf0ibuf.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/ibuf0ibuf.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/lock0lock.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/lock0types.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/log0log.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/log0log.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/log0recv.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/mach0data.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/mach0data.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/mem0dbg.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/mem0dbg.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/mem0mem.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/mem0mem.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/mem0pool.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/mtr0log.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/mtr0mtr.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/mtr0mtr.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/os0file.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/os0proc.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/os0sync.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/os0sync.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/os0thread.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/page0cur.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/page0cur.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/page0page.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/page0page.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/page0types.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/pars0grm.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/pars0opt.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/pars0pars.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/pars0sym.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/pars0types.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/que0que.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/que0que.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/que0types.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/read0read.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/read0read.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/rem0cmp.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/rem0cmp.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/rem0rec.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/rem0rec.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/row0ins.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/row0mysql.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/row0purge.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/row0row.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/row0row.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/row0sel.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/row0sel.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/row0types.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/row0uins.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/row0umod.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/row0undo.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/row0upd.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/row0upd.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/row0vers.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/srv0srv.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/srv0start.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/sync0arr.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/sync0rw.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/sync0rw.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/sync0sync.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/sync0sync.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/trx0purge.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/trx0purge.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/trx0rec.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/trx0roll.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/trx0rseg.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/trx0rseg.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/trx0sys.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/trx0sys.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/trx0trx.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/trx0trx.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/trx0types.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/trx0undo.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/trx0undo.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/trx0xa.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/univ.i:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/usr0sess.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/usr0types.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/ut0byte.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/ut0byte.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/ut0dbg.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/ut0lst.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/ut0mem.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/ut0mem.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/ut0rnd.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/ut0rnd.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/ut0sort.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/ut0ut.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/include/ut0ut.ic:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/lock/lock0lock.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/log/log0log.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/log/log0recv.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/mach/mach0data.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/mem/mem0dbg.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/mem/mem0mem.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/mem/mem0pool.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/mtr/mtr0log.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/mtr/mtr0mtr.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/os/os0file.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/os/os0proc.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/os/os0sync.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/os/os0thread.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/page/page0cur.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/page/page0page.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/pars/lexyy.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/pars/pars0grm.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/pars/pars0grm.h:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/pars/pars0grm.y:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/pars/pars0lex.l:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/pars/pars0opt.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/pars/pars0pars.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/pars/pars0sym.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/que/que0que.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/read/read0read.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/rem/rem0cmp.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/rem/rem0rec.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/row/row0ins.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/row/row0mysql.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/row/row0purge.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/row/row0row.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/row/row0sel.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/row/row0uins.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/row/row0umod.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/row/row0undo.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/row/row0upd.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/row/row0vers.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/srv/srv0que.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/srv/srv0srv.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/srv/srv0start.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/sync/sync0arr.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/sync/sync0rw.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/sync/sync0sync.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/thr/thr0loc.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/trx/trx0purge.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/trx/trx0rec.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/trx/trx0roll.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/trx/trx0rseg.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/trx/trx0sys.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/trx/trx0trx.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/trx/trx0undo.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/usr/usr0sess.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/ut/ut0byte.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/ut/ut0dbg.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/ut/ut0mem.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/ut/ut0rnd.c:
Applied innodb-5.1-ss269 snapshot.
storage/innobase/ut/ut0ut.c:
Applied innodb-5.1-ss269 snapshot.
mysql-test/r/innodb_unsafe_binlog.result:
New BitKeeper file ``mysql-test/r/innodb_unsafe_binlog.result''
mysql-test/t/innodb_unsafe_binlog-master.opt:
New BitKeeper file ``mysql-test/t/innodb_unsafe_binlog-master.opt''
mysql-test/t/innodb_unsafe_binlog.test:
New BitKeeper file ``mysql-test/t/innodb_unsafe_binlog.test''
storage/innobase/pars/make_bison.sh:
New BitKeeper file ``storage/innobase/pars/make_bison.sh''
Diffstat (limited to 'storage/innobase/page')
-rw-r--r-- | storage/innobase/page/page0cur.c | 284 | ||||
-rw-r--r-- | storage/innobase/page/page0page.c | 298 |
2 files changed, 294 insertions, 288 deletions
diff --git a/storage/innobase/page/page0cur.c b/storage/innobase/page/page0cur.c index d0b89e81787..70943ec3c8a 100644 --- a/storage/innobase/page/page0cur.c +++ b/storage/innobase/page/page0cur.c @@ -45,7 +45,7 @@ page_cur_try_search_shortcut( ulint* ilow_matched_bytes, /* in/out: already matched bytes in a field not yet completely matched */ - page_cur_t* cursor) /* out: page cursor */ + page_cur_t* cursor) /* out: page cursor */ { rec_t* rec; rec_t* next_rec; @@ -96,11 +96,11 @@ page_cur_try_search_shortcut( #ifdef UNIV_SEARCH_DEBUG page_cur_search_with_match(page, index, tuple, PAGE_CUR_DBG, - iup_matched_fields, - iup_matched_bytes, - ilow_matched_fields, - ilow_matched_bytes, - &cursor2); + iup_matched_fields, + iup_matched_bytes, + ilow_matched_fields, + ilow_matched_bytes, + &cursor2); ut_a(cursor2.rec == cursor->rec); if (next_rec != page_get_supremum_rec(page)) { @@ -150,38 +150,39 @@ page_cur_rec_field_extends( const ulint* offsets,/* in: array returned by rec_get_offsets() */ ulint n) /* in: compare nth field */ { - dtype_t* type; - dfield_t* dfield; - byte* rec_f; - ulint rec_f_len; + dtype_t* type; + dfield_t* dfield; + byte* rec_f; + ulint rec_f_len; ut_ad(rec_offs_validate(rec, NULL, offsets)); - dfield = dtuple_get_nth_field(tuple, n); + dfield = dtuple_get_nth_field(tuple, n); - type = dfield_get_type(dfield); + type = dfield_get_type(dfield); rec_f = rec_get_nth_field(rec, offsets, n, &rec_f_len); - if (type->mtype == DATA_VARCHAR - || type->mtype == DATA_CHAR - || type->mtype == DATA_FIXBINARY - || type->mtype == DATA_BINARY - || type->mtype == DATA_BLOB - || type->mtype == DATA_VARMYSQL - || type->mtype == DATA_MYSQL) { - - if (dfield_get_len(dfield) != UNIV_SQL_NULL - && rec_f_len != UNIV_SQL_NULL - && rec_f_len >= dfield_get_len(dfield) - && 0 == cmp_data_data_slow(type, dfield_get_data(dfield), - dfield_get_len(dfield), - rec_f, dfield_get_len(dfield))) { - - return(TRUE); + if (type->mtype == DATA_VARCHAR + || type->mtype == DATA_CHAR + || type->mtype == DATA_FIXBINARY + || type->mtype == DATA_BINARY + || type->mtype == DATA_BLOB + || type->mtype == DATA_VARMYSQL + || type->mtype == DATA_MYSQL) { + + if (dfield_get_len(dfield) != UNIV_SQL_NULL + && rec_f_len != UNIV_SQL_NULL + && rec_f_len >= dfield_get_len(dfield) + && 0 == cmp_data_data_slow(type, + dfield_get_data(dfield), + dfield_get_len(dfield), + rec_f, dfield_get_len(dfield))) { + + return(TRUE); } } - return(FALSE); + return(FALSE); } #endif /* PAGE_CUR_LE_OR_EXTENDS */ @@ -208,10 +209,10 @@ page_cur_search_with_match( ulint* ilow_matched_bytes, /* in/out: already matched bytes in a field not yet completely matched */ - page_cur_t* cursor) /* out: page cursor */ + page_cur_t* cursor) /* out: page cursor */ { - ulint up; - ulint low; + ulint up; + ulint low; ulint mid; page_dir_slot_t* slot; rec_t* up_rec; @@ -235,7 +236,7 @@ page_cur_search_with_match( *offsets_ = (sizeof offsets_) / sizeof *offsets_; ut_ad(page && tuple && iup_matched_fields && iup_matched_bytes - && ilow_matched_fields && ilow_matched_bytes && cursor); + && ilow_matched_fields && ilow_matched_bytes && cursor); ut_ad(dtuple_validate(tuple)); ut_ad(dtuple_check_typed(tuple)); #ifdef UNIV_DEBUG @@ -246,38 +247,36 @@ page_cur_search_with_match( if (mode != PAGE_CUR_LE_OR_EXTENDS) # endif /* PAGE_CUR_LE_OR_EXTENDS */ ut_ad((mode == PAGE_CUR_L) || (mode == PAGE_CUR_LE) - || (mode == PAGE_CUR_G) || (mode == PAGE_CUR_GE)); + || (mode == PAGE_CUR_G) || (mode == PAGE_CUR_GE)); #endif /* UNIV_DEBUG */ page_check_dir(page); #ifdef PAGE_CUR_ADAPT if ((page_header_get_field(page, PAGE_LEVEL) == 0) - && (mode == PAGE_CUR_LE) - && (page_header_get_field(page, PAGE_N_DIRECTION) > 3) - && (page_header_get_ptr(page, PAGE_LAST_INSERT)) - && (page_header_get_field(page, PAGE_DIRECTION) == PAGE_RIGHT)) { + && (mode == PAGE_CUR_LE) + && (page_header_get_field(page, PAGE_N_DIRECTION) > 3) + && (page_header_get_ptr(page, PAGE_LAST_INSERT)) + && (page_header_get_field(page, PAGE_DIRECTION) == PAGE_RIGHT)) { if (page_cur_try_search_shortcut(page, index, tuple, - iup_matched_fields, - iup_matched_bytes, - ilow_matched_fields, - ilow_matched_bytes, - cursor)) { - return; - } + iup_matched_fields, iup_matched_bytes, + ilow_matched_fields, ilow_matched_bytes, + cursor)) { + return; + } } # ifdef PAGE_CUR_DBG if (mode == PAGE_CUR_DBG) { mode = PAGE_CUR_LE; } # endif -#endif +#endif /* The following flag does not work for non-latin1 char sets because cmp_full_field does not tell how many bytes matched */ #ifdef PAGE_CUR_LE_OR_EXTENDS - ut_a(mode != PAGE_CUR_LE_OR_EXTENDS); + ut_a(mode != PAGE_CUR_LE_OR_EXTENDS); #endif /* PAGE_CUR_LE_OR_EXTENDS */ /* If mode PAGE_CUR_G is specified, we are trying to position the @@ -301,7 +300,7 @@ page_cur_search_with_match( /* Perform binary search until the lower and upper limit directory slots come to the distance 1 of each other */ - while (up - low > 1) { + while (up - low > 1) { mid = (low + up) / 2; slot = page_dir_get_nth_slot(page, mid); mid_rec = page_dir_slot_get_rec(slot); @@ -325,8 +324,8 @@ low_slot_match: } else if (UNIV_LIKELY(cmp /* == -1 */)) { #ifdef PAGE_CUR_LE_OR_EXTENDS if (mode == PAGE_CUR_LE_OR_EXTENDS - && page_cur_rec_field_extends(tuple, mid_rec, - offsets, cur_matched_fields)) { + && page_cur_rec_field_extends(tuple, mid_rec, + offsets, cur_matched_fields)) { goto low_slot_match; } @@ -347,7 +346,7 @@ up_slot_match: goto up_slot_match; } - } + } slot = page_dir_get_nth_slot(page, low); low_rec = page_dir_slot_get_rec(slot); @@ -357,7 +356,7 @@ up_slot_match: /* Perform linear search until the upper and lower records come to distance 1 of each other. */ - while (page_rec_get_next(low_rec) != up_rec) { + while (page_rec_get_next(low_rec) != up_rec) { mid_rec = page_rec_get_next(low_rec); @@ -380,8 +379,8 @@ low_rec_match: } else if (UNIV_LIKELY(cmp /* == -1 */)) { #ifdef PAGE_CUR_LE_OR_EXTENDS if (mode == PAGE_CUR_LE_OR_EXTENDS - && page_cur_rec_field_extends(tuple, mid_rec, - offsets, cur_matched_fields)) { + && page_cur_rec_field_extends(tuple, mid_rec, + offsets, cur_matched_fields)) { goto low_rec_match; } @@ -401,7 +400,7 @@ up_rec_match: goto up_rec_match; } - } + } #ifdef UNIV_SEARCH_DEBUG @@ -426,7 +425,7 @@ up_rec_match: } if (low_rec != page_get_infimum_rec(page)) { - + ut_a(low_matched_fields == dbg_matched_fields); ut_a(low_matched_bytes == dbg_matched_bytes); } @@ -487,9 +486,9 @@ page_cur_open_on_rnd_user_rec( page_cur_position(page_get_infimum_rec(page), cursor); return; - } + } - page_rnd += 87584577; + page_rnd += 87584577; rnd = page_rnd % page_get_n_recs(page); @@ -504,8 +503,8 @@ page_cur_open_on_rnd_user_rec( } page_cur_position(rec, cursor); -} - +} + /*************************************************************** Writes the log record of a record insert on a page. */ static @@ -533,7 +532,8 @@ page_cur_insert_rec_write_log( ut_a(rec_size < UNIV_PAGE_SIZE); ut_ad(buf_frame_align(insert_rec) == buf_frame_align(cursor_rec)); - ut_ad(!page_rec_is_comp(insert_rec) == !index->table->comp); + ut_ad(!page_rec_is_comp(insert_rec) + == !dict_table_is_comp(index->table)); comp = page_rec_is_comp(insert_rec); { @@ -573,7 +573,7 @@ page_cur_insert_rec_write_log( /* Find out the first byte in insert_rec which differs from cursor_rec; skip the bytes in the record info */ - + for (;;) { if (i >= min_rec_size) { @@ -624,15 +624,15 @@ page_cur_insert_rec_write_log( } if ((rec_get_info_and_status_bits(insert_rec, comp) != - rec_get_info_and_status_bits(cursor_rec, comp)) - || (extra_size != cur_extra_size) - || (rec_size != cur_rec_size)) { + rec_get_info_and_status_bits(cursor_rec, comp)) + || (extra_size != cur_extra_size) + || (rec_size != cur_rec_size)) { extra_info_yes = 1; } else { extra_info_yes = 0; } - + /* Write the record end segment length and the extra info storage flag */ log_ptr += mach_write_compressed(log_ptr, 2 * (rec_size - i) @@ -652,7 +652,7 @@ page_cur_insert_rec_write_log( ut_a(i < UNIV_PAGE_SIZE); ut_a(extra_size < UNIV_PAGE_SIZE); } - + /* Write to the log the inserted index record end segment which differs from the cursor record */ @@ -666,7 +666,7 @@ page_cur_insert_rec_write_log( ut_a(rec_size < UNIV_PAGE_SIZE); mlog_catenate_string(mtr, ins_ptr, rec_size); } -} +} /*************************************************************** Parses a log record of a record insert on a page. */ @@ -690,7 +690,7 @@ page_cur_parse_insert_rec( rec_t* cursor_rec; byte buf1[1024]; byte* buf; - byte* ptr2 = ptr; + byte* ptr2 = ptr; ulint info_and_status_bits = 0; /* remove warning */ page_cur_t cursor; mem_heap_t* heap = NULL; @@ -714,7 +714,7 @@ page_cur_parse_insert_rec( return(NULL); } - + ptr += 2; } @@ -733,7 +733,7 @@ page_cur_parse_insert_rec( return(NULL); } - + if (extra_info_yes) { /* Read the info bits */ @@ -741,7 +741,7 @@ page_cur_parse_insert_rec( return(NULL); } - + info_and_status_bits = mach_read_from_1(ptr); ptr++; @@ -768,13 +768,13 @@ page_cur_parse_insert_rec( return(NULL); } - + if (page == NULL) { return(ptr + end_seg_len); } - ut_ad(!!page_is_comp(page) == index->table->comp); + ut_ad(!!page_is_comp(page) == dict_table_is_comp(index->table)); /* Read from the log the inserted index record end segment which differs from the cursor record */ @@ -794,7 +794,7 @@ page_cur_parse_insert_rec( origin_offset = rec_offs_extra_size(offsets); mismatch_index = rec_offs_size(offsets) - end_seg_len; } - + if (mismatch_index + end_seg_len < sizeof buf1) { buf = buf1; } else { @@ -802,25 +802,25 @@ page_cur_parse_insert_rec( } /* Build the inserted record to buf */ - - if (mismatch_index >= UNIV_PAGE_SIZE) { + + if (mismatch_index >= UNIV_PAGE_SIZE) { fprintf(stderr, "Is short %lu, info_and_status_bits %lu, offset %lu, " "o_offset %lu\n" - "mismatch index %lu, end_seg_len %lu\n" - "parsed len %lu\n", - (ulong) is_short, (ulong) info_and_status_bits, - (ulong) offset, - (ulong) origin_offset, - (ulong) mismatch_index, (ulong) end_seg_len, - (ulong) (ptr - ptr2)); + "mismatch index %lu, end_seg_len %lu\n" + "parsed len %lu\n", + (ulong) is_short, (ulong) info_and_status_bits, + (ulong) offset, + (ulong) origin_offset, + (ulong) mismatch_index, (ulong) end_seg_len, + (ulong) (ptr - ptr2)); fputs("Dump of 300 bytes of log:\n", stderr); ut_print_buf(stderr, ptr2, 300); - buf_page_print(page); + buf_page_print(page); - ut_error; + ut_error; } ut_memcpy(buf, rec_get_start(cursor_rec, offsets), mismatch_index); @@ -845,7 +845,7 @@ page_cur_parse_insert_rec( } return(ptr + end_seg_len); -} +} /*************************************************************** Inserts a record next to page cursor. Returns pointer to inserted record if @@ -889,9 +889,9 @@ page_cur_insert_rec_low( page = page_cur_get_page(cursor); comp = page_is_comp(page); - ut_ad(index->table->comp == !!comp); + ut_ad(dict_table_is_comp(index->table) == !!comp); - ut_ad(cursor->rec != page_get_supremum_rec(page)); + ut_ad(cursor->rec != page_get_supremum_rec(page)); /* 1. Get the size of the physical record in the page */ if (tuple != NULL) { @@ -929,7 +929,7 @@ page_cur_insert_rec_low( ut_ad(insert_rec); ut_ad(rec_size == rec_offs_size(offsets)); - + /* 4. Insert the record in the linked list of records */ current_rec = cursor->rec; @@ -944,12 +944,12 @@ page_cur_insert_rec_low( page_header_set_field(page, PAGE_N_RECS, 1 + page_get_n_recs(page)); /* 5. Set the n_owned field in the inserted record to zero, - and set the heap_no field */ - + and set the heap_no field */ + rec_set_n_owned(insert_rec, comp, 0); rec_set_heap_no(insert_rec, comp, heap_no); - /* 6. Update the last insertion info in page header */ + /* 6. Update the last insertion info in page header */ last_insert = page_header_get_ptr(page, PAGE_LAST_INSERT); ut_ad(!last_insert || !comp @@ -957,31 +957,31 @@ page_cur_insert_rec_low( == rec_get_node_ptr_flag(insert_rec)); if (last_insert == NULL) { - page_header_set_field(page, PAGE_DIRECTION, PAGE_NO_DIRECTION); - page_header_set_field(page, PAGE_N_DIRECTION, 0); + page_header_set_field(page, PAGE_DIRECTION, PAGE_NO_DIRECTION); + page_header_set_field(page, PAGE_N_DIRECTION, 0); } else if ((last_insert == current_rec) - && (page_header_get_field(page, PAGE_DIRECTION) != PAGE_LEFT)) { + && (page_header_get_field(page, PAGE_DIRECTION) != PAGE_LEFT)) { - page_header_set_field(page, PAGE_DIRECTION, PAGE_RIGHT); - page_header_set_field(page, PAGE_N_DIRECTION, + page_header_set_field(page, PAGE_DIRECTION, PAGE_RIGHT); + page_header_set_field(page, PAGE_N_DIRECTION, page_header_get_field(page, PAGE_N_DIRECTION) + 1); } else if ((page_rec_get_next(insert_rec) == last_insert) - && (page_header_get_field(page, PAGE_DIRECTION) != PAGE_RIGHT)) { + && (page_header_get_field(page, PAGE_DIRECTION) != PAGE_RIGHT)) { - page_header_set_field(page, PAGE_DIRECTION, PAGE_LEFT); - page_header_set_field(page, PAGE_N_DIRECTION, + page_header_set_field(page, PAGE_DIRECTION, PAGE_LEFT); + page_header_set_field(page, PAGE_N_DIRECTION, page_header_get_field(page, PAGE_N_DIRECTION) + 1); } else { - page_header_set_field(page, PAGE_DIRECTION, PAGE_NO_DIRECTION); - page_header_set_field(page, PAGE_N_DIRECTION, 0); + page_header_set_field(page, PAGE_DIRECTION, PAGE_NO_DIRECTION); + page_header_set_field(page, PAGE_N_DIRECTION, 0); } - + page_header_set_ptr(page, PAGE_LAST_INSERT, insert_rec); - /* 7. It remains to update the owner record. */ - + /* 7. It remains to update the owner record. */ + owner_rec = page_rec_find_owner_rec(insert_rec); n_owned = rec_get_n_owned(owner_rec, comp); rec_set_n_owned(owner_rec, comp, n_owned + 1); @@ -998,7 +998,7 @@ page_cur_insert_rec_low( /* 9. Write log record of the insert */ page_cur_insert_rec_write_log(insert_rec, rec_size, current_rec, index, mtr); - + if (UNIV_LIKELY_NULL(heap)) { mem_heap_free(heap); } @@ -1019,7 +1019,7 @@ page_copy_rec_list_to_created_page_write_log( { byte* log_ptr; - ut_ad(!!page_is_comp(page) == index->table->comp); + ut_ad(!!page_is_comp(page) == dict_table_is_comp(index->table)); log_ptr = mlog_open_and_write_index(mtr, page, index, page_is_comp(page) @@ -1046,7 +1046,7 @@ page_parse_copy_rec_list_to_created_page( { byte* rec_end; ulint log_data_len; - + if (ptr + 4 > end_ptr) { return(NULL); @@ -1073,12 +1073,12 @@ page_parse_copy_rec_list_to_created_page( } ut_a(ptr == rec_end); - + page_header_set_ptr(page, PAGE_LAST_INSERT, NULL); page_header_set_field(page, PAGE_DIRECTION, PAGE_NO_DIRECTION); page_header_set_field(page, PAGE_N_DIRECTION, 0); - return(rec_end); + return(rec_end); } /***************************************************************** @@ -1110,11 +1110,11 @@ page_copy_rec_list_end_to_created_page( ulint offsets_[REC_OFFS_NORMAL_SIZE]; ulint* offsets = offsets_; *offsets_ = (sizeof offsets_) / sizeof *offsets_; - + ut_ad(page_dir_get_n_heap(new_page) == 2); ut_ad(page != new_page); ut_ad(comp == page_is_comp(new_page)); - + if (rec == page_get_infimum_rec(page)) { rec = page_rec_get_next(rec); @@ -1124,7 +1124,7 @@ page_copy_rec_list_end_to_created_page( return; } - + #ifdef UNIV_DEBUG /* To pass the debug tests we have to set these dummy values in the debug version */ @@ -1141,7 +1141,7 @@ page_copy_rec_list_end_to_created_page( /* Individual inserts are logged in a shorter form */ log_mode = mtr_set_log_mode(mtr, MTR_LOG_SHORT_INSERTS); - + prev_rec = page_get_infimum_rec(new_page); if (comp) { heap_top = new_page + PAGE_NEW_SUPREMUM_END; @@ -1166,7 +1166,7 @@ page_copy_rec_list_end_to_created_page( rec_size = rec_offs_size(offsets); heap_top = heap_top + rec_size; - + ut_ad(heap_top < new_page + UNIV_PAGE_SIZE); count++; @@ -1183,8 +1183,8 @@ page_copy_rec_list_end_to_created_page( count = 0; } - - page_cur_insert_rec_write_log(insert_rec, rec_size, prev_rec, + + page_cur_insert_rec_write_log(insert_rec, rec_size, prev_rec, index, mtr); prev_rec = insert_rec; rec = page_rec_get_next(rec); @@ -1192,7 +1192,7 @@ page_copy_rec_list_end_to_created_page( if ((slot_index > 0) && (count + 1 + (PAGE_DIR_SLOT_MAX_N_OWNED + 1) / 2 - <= PAGE_DIR_SLOT_MAX_N_OWNED)) { + <= PAGE_DIR_SLOT_MAX_N_OWNED)) { /* We can merge the two last dir slots. This operation is here to make this function imitate exactly the equivalent task made using page_cur_insert_rec, which we use in database @@ -1201,7 +1201,7 @@ page_copy_rec_list_end_to_created_page( that it imitates exactly. */ count += (PAGE_DIR_SLOT_MAX_N_OWNED + 1) / 2; - + page_dir_slot_set_n_owned(slot, 0); slot_index--; @@ -1216,7 +1216,7 @@ page_copy_rec_list_end_to_created_page( ut_a(log_data_len < 100 * UNIV_PAGE_SIZE); mach_write_to_4(log_ptr, log_data_len); - + rec_set_next_offs(insert_rec, comp, comp ? PAGE_NEW_SUPREMUM : PAGE_OLD_SUPREMUM); @@ -1229,7 +1229,7 @@ page_copy_rec_list_end_to_created_page( page_header_set_ptr(new_page, PAGE_HEAP_TOP, heap_top); page_dir_set_n_heap(new_page, 2 + n_recs); page_header_set_field(new_page, PAGE_N_RECS, n_recs); - + page_header_set_ptr(new_page, PAGE_LAST_INSERT, NULL); page_header_set_field(new_page, PAGE_DIRECTION, PAGE_NO_DIRECTION); page_header_set_field(new_page, PAGE_N_DIRECTION, 0); @@ -1251,7 +1251,7 @@ page_cur_delete_rec_write_log( { byte* log_ptr; - ut_ad(!!page_rec_is_comp(rec) == index->table->comp); + ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table)); log_ptr = mlog_open_and_write_index(mtr, rec, index, page_rec_is_comp(rec) @@ -1268,7 +1268,7 @@ page_cur_delete_rec_write_log( mach_write_to_2(log_ptr, ut_align_offset(rec, UNIV_PAGE_SIZE)); mlog_close(mtr, log_ptr + 2); -} +} /*************************************************************** Parses log record of a record delete on a page. */ @@ -1285,7 +1285,7 @@ page_cur_parse_delete_rec( { ulint offset; page_cur_t cursor; - + if (end_ptr < ptr + 2) { return(NULL); @@ -1314,7 +1314,7 @@ page_cur_parse_delete_rec( } return(ptr); -} +} /*************************************************************** Deletes a record at the page cursor. The cursor is moved to the next @@ -1323,7 +1323,7 @@ record after the deleted one. */ void page_cur_delete_rec( /*================*/ - page_cur_t* cursor, /* in: a page cursor */ + page_cur_t* cursor, /* in: a page cursor */ dict_index_t* index, /* in: record descriptor */ const ulint* offsets,/* in: rec_get_offsets(cursor->rec, index) */ mtr_t* mtr) /* in: mini-transaction handle */ @@ -1337,18 +1337,18 @@ page_cur_delete_rec( ulint cur_slot_no; ulint cur_n_owned; rec_t* rec; - + ut_ad(cursor && mtr); - + page = page_cur_get_page(cursor); current_rec = cursor->rec; ut_ad(rec_offs_validate(current_rec, index, offsets)); - ut_ad(!!page_is_comp(page) == index->table->comp); + ut_ad(!!page_is_comp(page) == dict_table_is_comp(index->table)); /* The record must not be the supremum or infimum record. */ - ut_ad(current_rec != page_get_supremum_rec(page)); - ut_ad(current_rec != page_get_infimum_rec(page)); - + ut_ad(current_rec != page_get_supremum_rec(page)); + ut_ad(current_rec != page_get_infimum_rec(page)); + /* Save to local variables some data associated with current_rec */ cur_slot_no = page_dir_find_owner_slot(current_rec); cur_dir_slot = page_dir_get_nth_slot(page, cur_slot_no); @@ -1366,15 +1366,15 @@ page_cur_delete_rec( frame modify clock */ buf_frame_modify_clock_inc(page); - + /* 2. Find the next and the previous record. Note that the cursor is left at the next record. */ ut_ad(cur_slot_no > 0); prev_slot = page_dir_get_nth_slot(page, cur_slot_no - 1); - + rec = page_dir_slot_get_rec(prev_slot); - + /* rec now points to the record of the previous directory slot. Look for the immediate predecessor of current_rec in a loop. */ @@ -1385,7 +1385,7 @@ page_cur_delete_rec( page_cur_move_to_next(cursor); next_rec = cursor->rec; - + /* 3. Remove the record from the linked list of records */ page_rec_set_next(prev_rec, next_rec); @@ -1396,14 +1396,16 @@ page_cur_delete_rec( record pointer in slot. In the following if-clause we assume that prev_rec is owned by the same slot, i.e., PAGE_DIR_SLOT_MIN_N_OWNED >= 2. */ - - ut_ad(PAGE_DIR_SLOT_MIN_N_OWNED >= 2); + +#if PAGE_DIR_SLOT_MIN_N_OWNED < 2 +# error "PAGE_DIR_SLOT_MIN_N_OWNED < 2" +#endif ut_ad(cur_n_owned > 1); if (current_rec == page_dir_slot_get_rec(cur_dir_slot)) { page_dir_slot_set_rec(cur_dir_slot, prev_rec); } - + /* 5. Update the number of owned records of the slot */ page_dir_slot_set_n_owned(cur_dir_slot, cur_n_owned - 1); @@ -1414,7 +1416,7 @@ page_cur_delete_rec( /* 7. Now we have decremented the number of owned records of the slot. If the number drops below PAGE_DIR_SLOT_MIN_N_OWNED, we balance the slots. */ - + if (cur_n_owned <= PAGE_DIR_SLOT_MIN_N_OWNED) { page_dir_balance_slot(page, cur_slot_no); } diff --git a/storage/innobase/page/page0page.c b/storage/innobase/page/page0page.c index 7e09cdf073e..a7a0dd4b788 100644 --- a/storage/innobase/page/page0page.c +++ b/storage/innobase/page/page0page.c @@ -23,7 +23,7 @@ Created 2/2/1994 Heikki Tuuri /* THE INDEX PAGE ============== - + The index page consists of a page header which contains the page's id and other information. On top of it are the the index records in a heap linked into a one way linear list according to alphabetic order. @@ -33,13 +33,13 @@ to about every sixth record in the list. The pointers are placed in the directory in the alphabetical order of the records pointed to, enabling us to make binary search using the array. Each slot n:o I in the directory points to a record, where a 4-bit field contains a count -of those records which are in the linear list between pointer I and +of those records which are in the linear list between pointer I and the pointer I - 1 in the directory, including the record pointed to by pointer I and not including the record pointed to by I - 1. We say that the record pointed to by slot I, or that slot I, owns these records. The count is always kept in the range 4 to 8, with -the exception that it is 1 for the first slot, and 1--8 for the second slot. - +the exception that it is 1 for the first slot, and 1--8 for the second slot. + An essentially binary search can be performed in the list of index records, like we could do if we had pointer to every record in the page directory. The data structure is, however, more efficient when @@ -200,7 +200,7 @@ page_set_max_trx_id( /* It is not necessary to write this change to the redo log, as during a database recovery we assume that the max trx id of every page is the maximum trx id assigned before the crash. */ - + mach_write_to_8(page + PAGE_HEADER + PAGE_MAX_TRX_ID, trx_id); if (block->is_hashed) { @@ -227,7 +227,7 @@ page_mem_alloc( byte* block; ulint avl_space; ulint garbage; - + ut_ad(page && heap_no); /* If there are records in the free list, look if the first is @@ -269,9 +269,9 @@ page_mem_alloc( } /* Could not find space from the free list, try top of heap */ - + avl_space = page_get_max_insert_size(page, 1); - + if (avl_space >= need) { block = page_header_get_ptr(page, PAGE_HEAP_TOP); @@ -328,7 +328,7 @@ page_parse_create( /************************************************************** The index page creation function. */ -page_t* +page_t* page_create( /*========*/ /* out: pointer to the page */ @@ -339,7 +339,7 @@ page_create( { page_dir_slot_t* slot; mem_heap_t* heap; - dtuple_t* tuple; + dtuple_t* tuple; dfield_t* field; byte* heap_top; rec_t* infimum_rec; @@ -349,25 +349,27 @@ page_create( ulint* offsets; index = comp ? srv_sys->dummy_ind2 : srv_sys->dummy_ind1; - + ut_ad(frame && mtr); - ut_ad(PAGE_BTR_IBUF_FREE_LIST + FLST_BASE_NODE_SIZE - <= PAGE_DATA); - ut_ad(PAGE_BTR_IBUF_FREE_LIST_NODE + FLST_NODE_SIZE - <= PAGE_DATA); +#if PAGE_BTR_IBUF_FREE_LIST + FLST_BASE_NODE_SIZE > PAGE_DATA +# error "PAGE_BTR_IBUF_FREE_LIST + FLST_BASE_NODE_SIZE > PAGE_DATA" +#endif +#if PAGE_BTR_IBUF_FREE_LIST_NODE + FLST_NODE_SIZE > PAGE_DATA +# error "PAGE_BTR_IBUF_FREE_LIST_NODE + FLST_NODE_SIZE > PAGE_DATA" +#endif /* 1. INCREMENT MODIFY CLOCK */ buf_frame_modify_clock_inc(frame); /* 2. WRITE LOG INFORMATION */ page_create_write_log(frame, mtr, comp); - + page = frame; fil_page_set_type(page, FIL_PAGE_INDEX); heap = mem_heap_create(200); - + /* 3. CREATE THE INFIMUM AND SUPREMUM RECORDS */ /* Create first a data tuple for infimum record */ @@ -382,7 +384,7 @@ page_create( record heap */ heap_top = page + PAGE_DATA; - + infimum_rec = rec_convert_dtuple_to_rec(heap_top, index, tuple); ut_a(infimum_rec == @@ -448,7 +450,7 @@ page_create( page_dir_slot_set_rec(slot, supremum_rec); /* Set the next pointers in infimum and supremum */ - + rec_set_next_offs(infimum_rec, comp, (ulint)(supremum_rec - page)); rec_set_next_offs(supremum_rec, comp, 0); @@ -483,18 +485,19 @@ page_copy_rec_list_end_no_locks( page_cur_move_to_next(&cur1); } - ut_a((ibool)!!page_is_comp(new_page) == index->table->comp); + ut_a((ibool)!!page_is_comp(new_page) + == dict_table_is_comp(index->table)); ut_a(page_is_comp(new_page) == page_is_comp(page)); ut_a(mach_read_from_2(new_page + UNIV_PAGE_SIZE - 10) == (ulint) (page_is_comp(new_page) ? PAGE_NEW_INFIMUM : PAGE_OLD_INFIMUM)); page_cur_set_before_first(new_page, &cur2); - - /* Copy records from the original page to the new page */ + + /* Copy records from the original page to the new page */ sup = page_get_supremum_rec(page); - + for (;;) { rec_t* cur1_rec = page_cur_get_rec(&cur1); if (cur1_rec == sup) { @@ -507,15 +510,16 @@ page_copy_rec_list_end_no_locks( /* Track an assertion failure reported on the mailing list on June 18th, 2003 */ - buf_page_print(new_page); - buf_page_print(page); + buf_page_print(new_page); + buf_page_print(page); ut_print_timestamp(stderr); fprintf(stderr, "InnoDB: rec offset %lu, cur1 offset %lu, cur2 offset %lu\n", - (ulong)(rec - page), - (ulong)(page_cur_get_rec(&cur1) - page), - (ulong)(page_cur_get_rec(&cur2) - new_page)); + (ulong)(rec - page), + (ulong)(page_cur_get_rec(&cur1) - page), + (ulong)(page_cur_get_rec(&cur2) - new_page)); + ut_error; } @@ -557,7 +561,7 @@ page_copy_rec_list_end( page_update_max_trx_id(new_page, page_get_max_trx_id(page)); btr_search_move_or_delete_hash_entries(new_page, page, index); -} +} /***************************************************************** Copies records from page to new_page, up to the given record, @@ -589,12 +593,12 @@ page_copy_rec_list_start( } page_cur_move_to_next(&cur1); - + page_cur_set_after_last(new_page, &cur2); page_cur_move_to_prev(&cur2); old_end = page_cur_get_rec(&cur2); - - /* Copy records from the original page to the new page */ + + /* Copy records from the original page to the new page */ while (page_cur_get_rec(&cur1) != rec) { rec_t* ins_rec; @@ -610,7 +614,7 @@ page_copy_rec_list_start( } /* Update the lock table, MAX_TRX_ID, and possible hash index */ - + lock_move_rec_list_start(new_page, page, rec, old_end); page_update_max_trx_id(new_page, page_get_max_trx_id(page)); @@ -666,19 +670,19 @@ page_parse_delete_rec_list( mtr_t* mtr) /* in: mtr or NULL */ { ulint offset; - + ut_ad(type == MLOG_LIST_END_DELETE || type == MLOG_LIST_START_DELETE || type == MLOG_COMP_LIST_END_DELETE || type == MLOG_COMP_LIST_START_DELETE); - + /* Read the record offset as a 2-byte ulint */ if (end_ptr < ptr + 2) { return(NULL); } - + offset = mach_read_from_2(ptr); ptr += 2; @@ -687,7 +691,7 @@ page_parse_delete_rec_list( return(ptr); } - ut_ad(!!page_is_comp(page) == index->table->comp); + ut_ad(!!page_is_comp(page) == dict_table_is_comp(index->table)); if (type == MLOG_LIST_END_DELETE || type == MLOG_COMP_LIST_END_DELETE) { @@ -738,9 +742,9 @@ page_delete_rec_list_end( frame modify clock */ buf_frame_modify_clock_inc(page); - + sup = page_get_supremum_rec(page); - + comp = page_is_comp(page); if (page_rec_is_infimum_low(rec - page)) { rec = page_rec_get_next(rec); @@ -753,7 +757,7 @@ page_delete_rec_list_end( return; } - + prev_rec = page_rec_get_prev(rec); last_rec = page_rec_get_prev(sup); @@ -792,10 +796,10 @@ page_delete_rec_list_end( /* Update the page directory; there is no need to balance the number of the records owned by the supremum record, as it is allowed to be less than PAGE_DIR_SLOT_MIN_N_OWNED */ - + rec2 = rec; count = 0; - + while (rec_get_n_owned(rec2, comp) == 0) { count++; @@ -805,15 +809,15 @@ page_delete_rec_list_end( ut_ad(rec_get_n_owned(rec2, comp) - count > 0); n_owned = rec_get_n_owned(rec2, comp) - count; - + slot_index = page_dir_find_owner_slot(rec2); slot = page_dir_get_nth_slot(page, slot_index); - + page_dir_slot_set_rec(slot, sup); page_dir_slot_set_n_owned(slot, n_owned); page_dir_set_n_slots(page, slot_index + 1); - + /* Remove the record chain segment from the record chain */ page_rec_set_next(prev_rec, page_get_supremum_rec(page)); @@ -829,7 +833,7 @@ page_delete_rec_list_end( page_header_set_field(page, PAGE_N_RECS, (ulint)(page_get_n_recs(page) - n_recs)); -} +} /***************************************************************** Deletes records from page, up to the given record, NOT including @@ -851,7 +855,7 @@ page_delete_rec_list_start( byte type; *offsets_ = (sizeof offsets_) / sizeof *offsets_; - ut_ad(!!page_is_comp(page) == index->table->comp); + ut_ad(!!page_is_comp(page) == dict_table_is_comp(index->table)); if (page_is_comp(page)) { type = MLOG_COMP_LIST_START_DELETE; @@ -869,7 +873,7 @@ page_delete_rec_list_start( } page_cur_move_to_next(&cur1); - + /* Individual deletes are not logged */ log_mode = mtr_set_log_mode(mtr, MTR_LOG_NONE); @@ -887,7 +891,7 @@ page_delete_rec_list_start( /* Restore log mode */ mtr_set_log_mode(mtr, log_mode); -} +} /***************************************************************** Moves record list end to another page. Moved records include @@ -909,7 +913,7 @@ page_move_rec_list_end( old_data_size = page_get_data_size(new_page); old_n_recs = page_get_n_recs(new_page); - + page_copy_rec_list_end(new_page, page, split_rec, index, mtr); new_data_size = page_get_data_size(new_page); @@ -953,7 +957,7 @@ page_rec_write_index_page_no( { byte* data; ulint len; - + data = rec_get_nth_field_old(rec, i, &len); ut_ad(len == 4); @@ -971,7 +975,7 @@ page_dir_delete_slots( /*==================*/ page_t* page, /* in: the index page */ ulint start, /* in: first slot to be deleted */ - ulint n) /* in: number of slots to delete (currently + ulint n) /* in: number of slots to delete (currently only n == 1 allowed) */ { page_dir_slot_t* slot; @@ -980,7 +984,7 @@ page_dir_delete_slots( ulint n_slots; rec_t* rec; - ut_ad(n == 1); + ut_ad(n == 1); ut_ad(start > 0); ut_ad(start + n < page_dir_get_n_slots(page)); @@ -1023,7 +1027,7 @@ page_dir_add_slots( /*===============*/ page_t* page, /* in: the index page */ ulint start, /* in: the slot above which the new slots are added */ - ulint n) /* in: number of slots to add (currently only n == 1 + ulint n) /* in: number of slots to add (currently only n == 1 allowed) */ { page_dir_slot_t* slot; @@ -1032,7 +1036,7 @@ page_dir_add_slots( rec_t* rec; ut_ad(n == 1); - + n_slots = page_dir_get_n_slots(page); ut_ad(start < n_slots - 1); @@ -1060,7 +1064,7 @@ page_dir_split_slot( /*================*/ page_t* page, /* in: the index page in question */ ulint slot_no) /* in: the directory slot */ -{ +{ rec_t* rec; page_dir_slot_t* new_slot; page_dir_slot_t* prev_slot; @@ -1072,13 +1076,13 @@ page_dir_split_slot( ut_ad(slot_no > 0); slot = page_dir_get_nth_slot(page, slot_no); - + n_owned = page_dir_slot_get_n_owned(slot); ut_ad(n_owned == PAGE_DIR_SLOT_MAX_N_OWNED + 1); - /* 1. We loop to find a record approximately in the middle of the + /* 1. We loop to find a record approximately in the middle of the records owned by the slot. */ - + prev_slot = page_dir_get_nth_slot(page, slot_no - 1); rec = page_dir_slot_get_rec(prev_slot); @@ -1100,11 +1104,11 @@ page_dir_split_slot( slot = page_dir_get_nth_slot(page, slot_no + 1); /* 3. We store the appropriate values to the new slot. */ - + page_dir_slot_set_rec(new_slot, rec); page_dir_slot_set_n_owned(new_slot, n_owned / 2); - - /* 4. Finally, we update the number of records field of the + + /* 4. Finally, we update the number of records field of the original slot */ page_dir_slot_set_n_owned(slot, n_owned - (n_owned / 2)); @@ -1119,7 +1123,7 @@ void page_dir_balance_slot( /*==================*/ page_t* page, /* in: index page */ - ulint slot_no) /* in: the directory slot */ + ulint slot_no) /* in: the directory slot */ { page_dir_slot_t* slot; page_dir_slot_t* up_slot; @@ -1132,7 +1136,7 @@ page_dir_balance_slot( ut_ad(slot_no > 0); slot = page_dir_get_nth_slot(page, slot_no); - + /* The last directory slot cannot be balanced with the upper neighbor, as there is none. */ @@ -1140,35 +1144,35 @@ page_dir_balance_slot( return; } - + up_slot = page_dir_get_nth_slot(page, slot_no + 1); - + n_owned = page_dir_slot_get_n_owned(slot); up_n_owned = page_dir_slot_get_n_owned(up_slot); - + ut_ad(n_owned == PAGE_DIR_SLOT_MIN_N_OWNED - 1); /* If the upper slot has the minimum value of n_owned, we will merge - the two slots, therefore we assert: */ + the two slots, therefore we assert: */ ut_ad(2 * PAGE_DIR_SLOT_MIN_N_OWNED - 1 <= PAGE_DIR_SLOT_MAX_N_OWNED); - + if (up_n_owned > PAGE_DIR_SLOT_MIN_N_OWNED) { /* In this case we can just transfer one record owned by the upper slot to the property of the lower slot */ old_rec = page_dir_slot_get_rec(slot); new_rec = page_rec_get_next(old_rec); - + rec_set_n_owned(old_rec, page_is_comp(page), 0); rec_set_n_owned(new_rec, page_is_comp(page), n_owned + 1); - + page_dir_slot_set_rec(slot, new_rec); - + page_dir_slot_set_n_owned(up_slot, up_n_owned -1); } else { /* In this case we may merge the two slots */ page_dir_delete_slots(page, slot_no, 1); - } + } } /**************************************************************** @@ -1218,7 +1222,7 @@ page_get_middle_rec( return(rec); } - + /******************************************************************* Returns the number of records before the given record in chain. The number includes infimum and supremum records. */ @@ -1246,7 +1250,7 @@ page_rec_get_n_recs_before( rec = page_rec_get_next(rec); n--; } - + for (i = 0; ; i++) { slot = page_dir_get_nth_slot(page, i); slot_rec = page_dir_slot_get_rec(slot); @@ -1269,7 +1273,7 @@ page_rec_get_n_recs_before( /**************************************************************** Prints record contents including the data relevant only in the index page context. */ - + void page_rec_print( /*===========*/ @@ -1281,7 +1285,7 @@ page_rec_print( ut_a(!comp == !rec_offs_comp(offsets)); rec_print_new(stderr, rec, offsets); fprintf(stderr, - " n_owned: %lu; heap_no: %lu; next rec: %lu\n", + " n_owned: %lu; heap_no: %lu; next rec: %lu\n", (ulong) rec_get_n_owned(rec, comp), (ulong) rec_get_heap_no(rec, comp), (ulong) rec_get_next_offs(rec, comp)); @@ -1305,7 +1309,7 @@ page_dir_print( page_dir_slot_t* slot; n = page_dir_get_n_slots(page); - + fprintf(stderr, "--------------------------------\n" "PAGE DIRECTORY\n" "Page address %p\n" @@ -1316,18 +1320,18 @@ page_dir_print( if ((i == pr_n) && (i < n - pr_n)) { fputs(" ... \n", stderr); } - if ((i < pr_n) || (i >= n - pr_n)) { + if ((i < pr_n) || (i >= n - pr_n)) { fprintf(stderr, - "Contents of slot: %lu: n_owned: %lu, rec offs: %lu\n", + "Contents of slot: %lu: n_owned: %lu, rec offs: %lu\n", (ulong) i, (ulong) page_dir_slot_get_n_owned(slot), (ulong)(page_dir_slot_get_rec(slot) - page)); - } + } } fprintf(stderr, "Total of %lu records\n" "--------------------------------\n", (ulong) (2 + page_get_n_recs(page))); -} - +} + /******************************************************************* This is used to print the contents of the page record list for debugging purposes. */ @@ -1347,7 +1351,7 @@ page_print_list( ulint* offsets = offsets_; *offsets_ = (sizeof offsets_) / sizeof *offsets_; - ut_a((ibool)!!page_is_comp(page) == index->table->comp); + ut_a((ibool)!!page_is_comp(page) == dict_table_is_comp(index->table)); fprintf(stderr, "--------------------------------\n" @@ -1365,27 +1369,27 @@ page_print_list( if (count == pr_n) { break; - } + } if (page_cur_is_after_last(&cur)) { break; - } + } page_cur_move_to_next(&cur); - count++; + count++; } - + if (n_recs > 2 * pr_n) { fputs(" ... \n", stderr); } - + while (!page_cur_is_after_last(&cur)) { page_cur_move_to_next(&cur); - if (count + pr_n >= n_recs) { + if (count + pr_n >= n_recs) { offsets = rec_get_offsets(cur.rec, index, offsets, ULINT_UNDEFINED, &heap); page_rec_print(cur.rec, offsets); } - count++; + count++; } fprintf(stderr, @@ -1396,7 +1400,7 @@ page_print_list( if (UNIV_LIKELY_NULL(heap)) { mem_heap_free(heap); } -} +} /******************************************************************* Prints the info in a page header. */ @@ -1431,7 +1435,7 @@ debugging purposes. */ void page_print( -/*======*/ +/*=======*/ page_t* page, /* in: index page */ dict_index_t* index, /* in: dictionary index of the page */ ulint dn, /* in: print dn first and last entries @@ -1442,7 +1446,7 @@ page_print( page_header_print(page); page_dir_print(page, dn); page_print_list(page, index, rn); -} +} /******************************************************************* The following is used to validate a record on a page. This function @@ -1485,7 +1489,7 @@ page_rec_validate( (ulong) page_dir_get_n_heap(page)); return(FALSE); } - + return(TRUE); } @@ -1504,22 +1508,22 @@ page_check_dir( n_slots = page_dir_get_n_slots(page); if (page_dir_slot_get_rec(page_dir_get_nth_slot(page, 0)) - != page_get_infimum_rec(page)) { + != page_get_infimum_rec(page)) { - fprintf(stderr, + fprintf(stderr, "InnoDB: Page directory corruption: supremum not pointed to\n"); buf_page_print(page); - } + } if (page_dir_slot_get_rec(page_dir_get_nth_slot(page, n_slots - 1)) - != page_get_supremum_rec(page)) { + != page_get_supremum_rec(page)) { - fprintf(stderr, + fprintf(stderr, "InnoDB: Page directory corruption: supremum not pointed to\n"); buf_page_print(page); - } + } } - + /******************************************************************* This function checks the consistency of an index page when we do not know the index. This is also resilient so that this should never crash @@ -1531,7 +1535,7 @@ page_simple_validate( /* out: TRUE if ok */ page_t* page) /* in: index page */ { - page_cur_t cur; + page_cur_t cur; page_dir_slot_t* slot; ulint slot_no; ulint n_slots; @@ -1555,16 +1559,16 @@ page_simple_validate( } rec_heap_top = page_header_get_ptr(page, PAGE_HEAP_TOP); - + if (rec_heap_top > page_dir_get_nth_slot(page, n_slots - 1)) { fprintf(stderr, "InnoDB: Record heap and dir overlap on a page, heap top %lu, dir %lu\n", - (ulong)(page_header_get_ptr(page, PAGE_HEAP_TOP) - page), - (ulong)(page_dir_get_nth_slot(page, n_slots - 1) - page)); + (ulong)(page_header_get_ptr(page, PAGE_HEAP_TOP) - page), + (ulong)(page_dir_get_nth_slot(page, n_slots - 1) - page)); - goto func_exit; - } + goto func_exit; + } /* Validate the record list in a loop checking also that it is consistent with the page record directory. */ @@ -1578,7 +1582,7 @@ page_simple_validate( for (;;) { rec = (&cur)->rec; - + if (rec > rec_heap_top) { fprintf(stderr, "InnoDB: Record %lu is above rec heap top %lu\n", @@ -1607,7 +1611,7 @@ page_simple_validate( goto func_exit; } - + own_count = 0; if (!page_cur_is_after_last(&cur)) { @@ -1631,7 +1635,7 @@ page_simple_validate( goto func_exit; } - count++; + count++; if (count > UNIV_PAGE_SIZE) { fprintf(stderr, @@ -1639,22 +1643,22 @@ page_simple_validate( (ulong) count); goto func_exit; } - + page_cur_move_to_next(&cur); own_count++; } - + if (rec_get_n_owned(rec, comp) == 0) { fprintf(stderr, "InnoDB: n owned is zero in a supremum rec\n"); goto func_exit; } - + if (slot_no != n_slots - 1) { fprintf(stderr, "InnoDB: n slots wrong %lu, %lu\n", (ulong) slot_no, (ulong) (n_slots - 1)); goto func_exit; - } + } if (page_header_get_field(page, PAGE_N_RECS) + 2 != count + 1) { fprintf(stderr, "InnoDB: n recs wrong %lu %lu\n", @@ -1686,17 +1690,17 @@ page_simple_validate( } count++; - + if (count > UNIV_PAGE_SIZE) { fprintf(stderr, "InnoDB: Page free list appears to be circular %lu\n", - (ulong) count); + (ulong) count); goto func_exit; } rec = page_rec_get_next(rec); } - + if (page_dir_get_n_heap(page) != count + 1) { fprintf(stderr, "InnoDB: N heap is wrong %lu, %lu\n", @@ -1706,10 +1710,10 @@ page_simple_validate( goto func_exit; } - ret = TRUE; + ret = TRUE; func_exit: - return(ret); + return(ret); } /******************************************************************* @@ -1725,7 +1729,7 @@ page_validate( { page_dir_slot_t* slot; mem_heap_t* heap; - page_cur_t cur; + page_cur_t cur; byte* buf; ulint count; ulint own_count; @@ -1741,7 +1745,7 @@ page_validate( ulint* offsets = NULL; ulint* old_offsets = NULL; - if ((ibool)!!comp != index->table->comp) { + if ((ibool)!!comp != dict_table_is_comp(index->table)) { fputs("InnoDB: 'compact format' flag mismatch\n", stderr); goto func_exit2; } @@ -1750,7 +1754,7 @@ page_validate( } heap = mem_heap_create(UNIV_PAGE_SIZE + 200); - + /* The following buffer is used to check that the records in the page record heap do not overlap */ @@ -1772,8 +1776,8 @@ page_validate( page_header_get_ptr(page, PAGE_HEAP_TOP), page_dir_get_nth_slot(page, n_slots - 1)); - goto func_exit; - } + goto func_exit; + } /* Validate the record list in a loop checking also that it is consistent with the directory. */ @@ -1801,7 +1805,7 @@ page_validate( if (!page_rec_validate(rec, offsets)) { goto func_exit; } - + /* Check that the records are in the ascending order */ if ((count >= 2) && (!page_cur_is_after_last(&cur))) { if (!(1 == cmp_rec_rec(rec, old_rec, @@ -1815,7 +1819,7 @@ page_validate( fputs("\nInnoDB: record ", stderr); rec_print_new(stderr, rec, offsets); putc('\n', stderr); - + goto func_exit; } } @@ -1824,9 +1828,9 @@ page_validate( data_size += rec_offs_size(offsets); } - + offs = rec_get_start(rec, offsets) - page; - + for (i = 0; i < rec_offs_size(offsets); i++) { if (!buf[offs + i] == 0) { /* No other record may overlap this */ @@ -1835,10 +1839,10 @@ page_validate( stderr); goto func_exit; } - + buf[offs + i] = 1; } - + if (rec_get_n_owned(rec, comp) != 0) { /* This is a record pointed to by a dir slot */ if (rec_get_n_owned(rec, comp) != own_count) { @@ -1855,9 +1859,9 @@ page_validate( stderr); goto func_exit; } - + page_dir_slot_check(slot); - + own_count = 0; if (!page_cur_is_after_last(&cur)) { slot_no++; @@ -1877,7 +1881,7 @@ page_validate( goto func_exit; } - count++; + count++; page_cur_move_to_next(&cur); own_count++; old_rec = rec; @@ -1888,17 +1892,17 @@ page_validate( offsets = offs; } } - + if (rec_get_n_owned(rec, comp) == 0) { fputs("InnoDB: n owned is zero\n", stderr); goto func_exit; } - + if (slot_no != n_slots - 1) { fprintf(stderr, "InnoDB: n slots wrong %lu %lu\n", (ulong) slot_no, (ulong) (n_slots - 1)); goto func_exit; - } + } if (page_header_get_field(page, PAGE_N_RECS) + 2 != count + 1) { fprintf(stderr, "InnoDB: n recs wrong %lu %lu\n", @@ -1924,10 +1928,10 @@ page_validate( goto func_exit; } - - count++; + + count++; offs = rec_get_start(rec, offsets) - page; - + for (i = 0; i < rec_offs_size(offsets); i++) { if (buf[offs + i] != 0) { @@ -1935,13 +1939,13 @@ page_validate( "InnoDB: Record overlaps another in free list\n", stderr); goto func_exit; } - + buf[offs + i] = 1; } - + rec = page_rec_get_next(rec); } - + if (page_dir_get_n_heap(page) != count + 1) { fprintf(stderr, "InnoDB: N heap is wrong %lu %lu\n", (ulong) page_dir_get_n_heap(page), @@ -1949,7 +1953,7 @@ page_validate( goto func_exit; } - ret = TRUE; + ret = TRUE; func_exit: mem_heap_free(heap); @@ -1962,8 +1966,8 @@ func_exit: putc('\n', stderr); buf_page_print(page); } - - return(ret); + + return(ret); } /******************************************************************* @@ -1989,7 +1993,7 @@ page_find_rec_with_heap_no( if (page_cur_is_after_last(&cur)) { return(NULL); - } + } page_cur_move_to_next(&cur); } |