mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
Changes to create storage directory for storage engines.
storage/heap/.cvsignore: mvdir storage/heap/ChangeLog: mvdir storage/heap/Makefile.am: mvdir storage/heap/_check.c: mvdir storage/heap/_rectest.c: mvdir storage/heap/heapdef.h: mvdir storage/heap/hp_block.c: mvdir storage/heap/hp_clear.c: mvdir storage/heap/hp_close.c: mvdir storage/heap/hp_create.c: mvdir storage/heap/hp_delete.c: mvdir storage/heap/hp_extra.c: mvdir storage/heap/hp_hash.c: mvdir storage/heap/hp_info.c: mvdir storage/heap/hp_open.c: mvdir storage/heap/hp_panic.c: mvdir storage/heap/hp_rename.c: mvdir storage/heap/hp_rfirst.c: mvdir storage/heap/hp_rkey.c: mvdir storage/heap/hp_rlast.c: mvdir storage/heap/hp_rnext.c: mvdir storage/heap/hp_rprev.c: mvdir storage/heap/hp_rrnd.c: mvdir storage/heap/hp_rsame.c: mvdir storage/heap/hp_scan.c: mvdir storage/heap/hp_static.c: mvdir storage/heap/hp_test1.c: mvdir storage/heap/hp_test2.c: mvdir storage/heap/hp_update.c: mvdir storage/heap/hp_write.c: mvdir storage/heap/make-ccc: mvdir storage/myisam/.cvsignore: mvdir storage/myisam/ChangeLog: mvdir storage/myisam/Makefile.am: mvdir storage/myisam/NEWS: mvdir storage/myisam/TODO: mvdir storage/myisam/ft_boolean_search.c: mvdir storage/myisam/ft_eval.c: mvdir storage/myisam/ft_eval.h: mvdir storage/myisam/ft_nlq_search.c: mvdir storage/myisam/ft_parser.c: mvdir storage/myisam/ft_static.c: mvdir storage/myisam/ft_stem.c: mvdir storage/myisam/ft_stopwords.c: mvdir storage/myisam/ft_test1.c: mvdir storage/myisam/ft_test1.h: mvdir storage/myisam/ft_update.c: mvdir storage/myisam/ftdefs.h: mvdir storage/myisam/fulltext.h: mvdir storage/myisam/make-ccc: mvdir storage/myisam/mi_cache.c: mvdir storage/myisam/mi_changed.c: mvdir storage/myisam/mi_check.c: mvdir storage/myisam/mi_checksum.c: mvdir storage/myisam/mi_close.c: mvdir storage/myisam/mi_create.c: mvdir storage/myisam/mi_dbug.c: mvdir storage/myisam/mi_delete.c: mvdir storage/myisam/mi_delete_all.c: mvdir storage/myisam/mi_delete_table.c: mvdir storage/myisam/mi_dynrec.c: mvdir storage/myisam/mi_extra.c: mvdir storage/myisam/mi_info.c: mvdir storage/myisam/mi_key.c: mvdir storage/myisam/mi_keycache.c: mvdir storage/myisam/mi_locking.c: mvdir storage/myisam/mi_log.c: mvdir storage/myisam/mi_open.c: mvdir storage/myisam/mi_packrec.c: mvdir storage/myisam/mi_page.c: mvdir storage/myisam/mi_panic.c: mvdir storage/myisam/mi_preload.c: mvdir storage/myisam/mi_range.c: mvdir storage/myisam/mi_rename.c: mvdir storage/myisam/mi_rfirst.c: mvdir storage/myisam/mi_rkey.c: mvdir storage/myisam/mi_rlast.c: mvdir storage/myisam/mi_rnext.c: mvdir storage/myisam/mi_rnext_same.c: mvdir storage/myisam/mi_rprev.c: mvdir storage/myisam/mi_rrnd.c: mvdir storage/myisam/mi_rsame.c: mvdir storage/myisam/ftbench/Ecompare.pl: mvdir storage/myisam/ftbench/Ecreate.pl: mvdir storage/myisam/ftbench/Ereport.pl: mvdir storage/myisam/ftbench/README: mvdir storage/myisam/ftbench/ft-test-run.sh: mvdir storage/myisam/mi_rsamepos.c: mvdir storage/myisam/mi_scan.c: mvdir storage/myisam/mi_search.c: mvdir storage/myisam/mi_static.c: mvdir storage/myisam/mi_statrec.c: mvdir storage/myisam/mi_test1.c: mvdir storage/myisam/mi_test2.c: mvdir storage/myisam/mi_test3.c: mvdir storage/myisam/mi_test_all.res: mvdir storage/myisam/mi_test_all.sh: mvdir storage/myisam/mi_unique.c: mvdir storage/myisam/mi_update.c: mvdir storage/myisam/mi_write.c: mvdir storage/myisam/myisam_ftdump.c: mvdir storage/myisam/myisamchk.c: mvdir storage/myisam/myisamdef.h: mvdir storage/myisam/myisamlog.c: mvdir storage/myisam/myisampack.c: mvdir storage/myisam/rt_index.c: mvdir storage/myisam/rt_index.h: mvdir storage/myisam/rt_key.c: mvdir storage/myisam/rt_key.h: mvdir storage/myisam/rt_mbr.c: mvdir storage/myisam/rt_mbr.h: mvdir storage/myisam/rt_split.c: mvdir storage/myisam/rt_test.c: mvdir storage/myisam/sort.c: mvdir storage/myisam/sp_defs.h: mvdir storage/myisam/sp_key.c: mvdir storage/myisam/sp_test.c: mvdir storage/myisam/test_pack: mvdir storage/myisammrg/.cvsignore: mvdir storage/myisammrg/Makefile.am: mvdir storage/myisammrg/make-ccc: mvdir storage/myisammrg/myrg_close.c: mvdir storage/myisammrg/myrg_create.c: mvdir storage/myisammrg/myrg_def.h: mvdir storage/myisammrg/myrg_delete.c: mvdir storage/myisammrg/myrg_extra.c: mvdir storage/myisammrg/myrg_info.c: mvdir storage/myisammrg/myrg_locking.c: mvdir storage/myisammrg/myrg_open.c: mvdir storage/myisammrg/myrg_panic.c: mvdir storage/myisammrg/myrg_queue.c: mvdir storage/myisammrg/myrg_range.c: mvdir storage/myisammrg/myrg_rfirst.c: mvdir storage/myisammrg/myrg_rkey.c: mvdir storage/myisammrg/myrg_rlast.c: mvdir storage/myisammrg/myrg_rnext.c: mvdir storage/myisammrg/myrg_rnext_same.c: mvdir storage/myisammrg/myrg_rprev.c: mvdir storage/myisammrg/myrg_rrnd.c: mvdir storage/myisammrg/myrg_rsame.c: mvdir storage/myisammrg/myrg_static.c: mvdir storage/myisammrg/myrg_update.c: mvdir storage/myisammrg/myrg_write.c: mvdir storage/innobase/Makefile.am: mvdir storage/innobase/btr/Makefile.am: mvdir storage/innobase/btr/btr0btr.c: mvdir storage/innobase/btr/btr0cur.c: mvdir storage/innobase/btr/btr0pcur.c: mvdir storage/innobase/btr/btr0sea.c: mvdir storage/innobase/btr/makefilewin: mvdir storage/innobase/buf/Makefile.am: mvdir storage/innobase/buf/buf0buf.c: mvdir storage/innobase/buf/buf0flu.c: mvdir storage/innobase/buf/buf0lru.c: mvdir storage/innobase/buf/buf0rea.c: mvdir storage/innobase/buf/makefilewin: mvdir storage/innobase/configure.in: mvdir storage/innobase/data/Makefile.am: mvdir storage/innobase/data/data0data.c: mvdir storage/innobase/data/data0type.c: mvdir storage/innobase/data/makefilewin: mvdir storage/innobase/db/db0err.h: mvdir storage/innobase/dict/Makefile.am: mvdir storage/innobase/dict/dict0boot.c: mvdir storage/innobase/dict/dict0crea.c: mvdir storage/innobase/dict/dict0dict.c: mvdir storage/innobase/dict/dict0load.c: mvdir storage/innobase/makefilewin: mvdir storage/innobase/my_cnf: mvdir storage/innobase/dict/dict0mem.c: mvdir storage/innobase/dict/makefilewin: mvdir storage/innobase/dyn/Makefile.am: mvdir storage/innobase/dyn/dyn0dyn.c: mvdir storage/innobase/dyn/makefilewin: mvdir storage/innobase/eval/Makefile.am: mvdir storage/innobase/eval/eval0eval.c: mvdir storage/innobase/eval/eval0proc.c: mvdir storage/innobase/eval/makefilewin: mvdir storage/innobase/fil/Makefile.am: mvdir storage/innobase/fil/fil0fil.c: mvdir storage/innobase/fil/makefilewin: mvdir storage/innobase/fsp/Makefile.am: mvdir storage/innobase/fsp/fsp0fsp.c: mvdir storage/innobase/fsp/makefilewin: mvdir storage/innobase/fut/Makefile.am: mvdir storage/innobase/fut/fut0fut.c: mvdir storage/innobase/fut/fut0lst.c: mvdir storage/innobase/fut/makefilewin: mvdir storage/innobase/ha/Makefile.am: mvdir storage/innobase/ha/ha0ha.c: mvdir storage/innobase/ha/hash0hash.c: mvdir storage/innobase/ha/makefilewin: mvdir storage/innobase/ibuf/Makefile.am: mvdir storage/innobase/ibuf/ibuf0ibuf.c: mvdir storage/innobase/ibuf/makefilewin: mvdir storage/innobase/include/Makefile.am: mvdir storage/innobase/include/Makefile.i: mvdir storage/innobase/include/btr0btr.h: mvdir storage/innobase/include/btr0btr.ic: mvdir storage/innobase/include/btr0cur.h: mvdir storage/innobase/include/btr0cur.ic: mvdir storage/innobase/include/btr0pcur.h: mvdir storage/innobase/include/btr0pcur.ic: mvdir storage/innobase/include/btr0sea.h: mvdir storage/innobase/include/btr0sea.ic: mvdir storage/innobase/include/btr0types.h: mvdir storage/innobase/include/buf0buf.h: mvdir storage/innobase/include/buf0buf.ic: mvdir storage/innobase/include/buf0flu.h: mvdir storage/innobase/include/buf0flu.ic: mvdir storage/innobase/include/buf0lru.h: mvdir storage/innobase/include/buf0lru.ic: mvdir storage/innobase/include/buf0rea.h: mvdir storage/innobase/include/buf0types.h: mvdir storage/innobase/include/data0data.h: mvdir storage/innobase/include/data0data.ic: mvdir storage/innobase/include/data0type.h: mvdir storage/innobase/include/data0type.ic: mvdir storage/innobase/include/data0types.h: mvdir storage/innobase/include/db0err.h: mvdir storage/innobase/include/dict0boot.h: mvdir storage/innobase/include/dict0boot.ic: mvdir storage/innobase/include/dict0crea.h: mvdir storage/innobase/include/dict0crea.ic: mvdir storage/innobase/include/dict0dict.h: mvdir storage/innobase/include/dict0dict.ic: mvdir storage/innobase/include/dict0load.h: mvdir storage/innobase/include/dict0load.ic: mvdir storage/innobase/include/dict0mem.h: mvdir storage/innobase/include/dict0mem.ic: mvdir storage/innobase/include/dict0types.h: mvdir storage/innobase/include/dyn0dyn.h: mvdir storage/innobase/include/dyn0dyn.ic: mvdir storage/innobase/include/eval0eval.h: mvdir storage/innobase/include/eval0eval.ic: mvdir storage/innobase/include/eval0proc.h: mvdir storage/innobase/include/eval0proc.ic: mvdir storage/innobase/include/fil0fil.h: mvdir storage/innobase/include/fsp0fsp.h: mvdir storage/innobase/include/fsp0fsp.ic: mvdir storage/innobase/include/fut0fut.h: mvdir storage/innobase/include/fut0fut.ic: mvdir storage/innobase/include/fut0lst.h: mvdir storage/innobase/include/fut0lst.ic: mvdir storage/innobase/include/ha0ha.h: mvdir storage/innobase/include/ha0ha.ic: mvdir storage/innobase/include/hash0hash.h: mvdir storage/innobase/include/hash0hash.ic: mvdir storage/innobase/include/ibuf0ibuf.h: mvdir storage/innobase/include/ibuf0ibuf.ic: mvdir storage/innobase/include/ibuf0types.h: mvdir storage/innobase/include/lock0lock.h: mvdir storage/innobase/include/lock0lock.ic: mvdir storage/innobase/include/lock0types.h: mvdir storage/innobase/include/log0log.h: mvdir storage/innobase/include/log0log.ic: mvdir storage/innobase/include/log0recv.h: mvdir storage/innobase/include/log0recv.ic: mvdir storage/innobase/include/mach0data.h: mvdir storage/innobase/include/mach0data.ic: mvdir storage/innobase/include/makefilewin.i: mvdir storage/innobase/include/mem0dbg.h: mvdir storage/innobase/include/mem0dbg.ic: mvdir storage/innobase/include/mem0mem.h: mvdir storage/innobase/include/mem0mem.ic: mvdir storage/innobase/include/mem0pool.h: mvdir storage/innobase/include/mem0pool.ic: mvdir storage/innobase/include/mtr0log.h: mvdir storage/innobase/include/mtr0log.ic: mvdir storage/innobase/include/mtr0mtr.h: mvdir storage/innobase/include/mtr0mtr.ic: mvdir storage/innobase/include/mtr0types.h: mvdir storage/innobase/include/os0file.h: mvdir storage/innobase/include/os0proc.h: mvdir storage/innobase/include/os0proc.ic: mvdir storage/innobase/include/os0sync.h: mvdir storage/innobase/include/os0sync.ic: mvdir storage/innobase/include/os0thread.h: mvdir storage/innobase/include/os0thread.ic: mvdir storage/innobase/include/page0cur.h: mvdir storage/innobase/include/page0cur.ic: mvdir storage/innobase/include/page0page.h: mvdir storage/innobase/include/page0page.ic: mvdir storage/innobase/include/page0types.h: mvdir storage/innobase/include/pars0grm.h: mvdir storage/innobase/include/pars0opt.h: mvdir storage/innobase/include/pars0opt.ic: mvdir storage/innobase/include/pars0pars.h: mvdir storage/innobase/include/pars0pars.ic: mvdir storage/innobase/include/pars0sym.h: mvdir storage/innobase/include/pars0sym.ic: mvdir storage/innobase/include/pars0types.h: mvdir storage/innobase/include/que0que.h: mvdir storage/innobase/include/que0que.ic: mvdir storage/innobase/include/que0types.h: mvdir storage/innobase/include/read0read.h: mvdir storage/innobase/include/read0read.ic: mvdir storage/innobase/include/read0types.h: mvdir storage/innobase/include/rem0cmp.h: mvdir storage/innobase/include/rem0cmp.ic: mvdir storage/innobase/include/rem0rec.h: mvdir storage/innobase/include/rem0rec.ic: mvdir storage/innobase/include/rem0types.h: mvdir storage/innobase/include/row0ins.h: mvdir storage/innobase/include/row0ins.ic: mvdir storage/innobase/include/row0mysql.h: mvdir storage/innobase/include/row0mysql.ic: mvdir storage/innobase/include/row0purge.h: mvdir storage/innobase/include/row0purge.ic: mvdir storage/innobase/include/row0row.h: mvdir storage/innobase/include/row0row.ic: mvdir storage/innobase/include/row0sel.h: mvdir storage/innobase/include/row0sel.ic: mvdir storage/innobase/include/row0types.h: mvdir storage/innobase/include/row0uins.h: mvdir storage/innobase/include/row0uins.ic: mvdir storage/innobase/include/row0umod.h: mvdir storage/innobase/include/row0umod.ic: mvdir storage/innobase/include/row0undo.h: mvdir storage/innobase/include/row0undo.ic: mvdir storage/innobase/include/row0upd.h: mvdir storage/innobase/include/row0upd.ic: mvdir storage/innobase/include/row0vers.h: mvdir storage/innobase/include/row0vers.ic: mvdir storage/innobase/include/srv0que.h: mvdir storage/innobase/include/srv0srv.h: mvdir storage/innobase/include/srv0srv.ic: mvdir storage/innobase/include/srv0start.h: mvdir storage/innobase/include/sync0arr.h: mvdir storage/innobase/include/sync0arr.ic: mvdir storage/innobase/include/sync0rw.h: mvdir storage/innobase/include/sync0rw.ic: mvdir storage/innobase/include/sync0sync.h: mvdir storage/innobase/include/sync0sync.ic: mvdir storage/innobase/include/sync0types.h: mvdir storage/innobase/include/thr0loc.h: mvdir storage/innobase/include/thr0loc.ic: mvdir storage/innobase/include/trx0purge.h: mvdir storage/innobase/include/trx0purge.ic: mvdir storage/innobase/include/trx0rec.h: mvdir storage/innobase/include/trx0rec.ic: mvdir storage/innobase/include/trx0roll.h: mvdir storage/innobase/include/trx0roll.ic: mvdir storage/innobase/include/trx0rseg.h: mvdir storage/innobase/include/trx0rseg.ic: mvdir storage/innobase/include/trx0sys.h: mvdir storage/innobase/include/trx0sys.ic: mvdir storage/innobase/include/trx0trx.h: mvdir storage/innobase/include/trx0trx.ic: mvdir storage/innobase/include/trx0types.h: mvdir storage/innobase/include/trx0undo.h: mvdir storage/innobase/include/trx0undo.ic: mvdir storage/innobase/include/trx0xa.h: mvdir storage/innobase/include/univ.i: mvdir storage/innobase/include/usr0sess.h: mvdir storage/innobase/include/usr0sess.ic: mvdir storage/innobase/include/usr0types.h: mvdir storage/innobase/include/ut0byte.h: mvdir storage/innobase/include/ut0byte.ic: mvdir storage/innobase/include/ut0dbg.h: mvdir storage/innobase/include/ut0lst.h: mvdir storage/innobase/include/ut0mem.h: mvdir storage/innobase/include/ut0mem.ic: mvdir storage/innobase/include/ut0rnd.h: mvdir storage/innobase/include/ut0rnd.ic: mvdir storage/innobase/include/ut0sort.h: mvdir storage/innobase/include/ut0ut.h: mvdir storage/innobase/include/ut0ut.ic: mvdir storage/innobase/lock/Makefile.am: mvdir storage/innobase/lock/lock0lock.c: mvdir storage/innobase/lock/makefilewin: mvdir storage/innobase/log/Makefile.am: mvdir storage/innobase/log/log0log.c: mvdir storage/innobase/log/log0recv.c: mvdir storage/innobase/log/makefilewin: mvdir storage/innobase/mach/Makefile.am: mvdir storage/innobase/mach/mach0data.c: mvdir storage/innobase/mach/makefilewin: mvdir storage/innobase/mem/Makefile.am: mvdir storage/innobase/mem/makefilewin: mvdir storage/innobase/mem/mem0dbg.c: mvdir storage/innobase/mem/mem0mem.c: mvdir storage/innobase/mem/mem0pool.c: mvdir storage/innobase/mtr/Makefile.am: mvdir storage/innobase/mtr/makefilewin: mvdir storage/innobase/mtr/mtr0log.c: mvdir storage/innobase/mtr/mtr0mtr.c: mvdir storage/innobase/os/Makefile.am: mvdir storage/innobase/os/makefilewin: mvdir storage/innobase/os/os0file.c: mvdir storage/innobase/os/os0proc.c: mvdir storage/innobase/os/os0sync.c: mvdir storage/innobase/os/os0thread.c: mvdir storage/innobase/page/Makefile.am: mvdir storage/innobase/page/makefilewin: mvdir storage/innobase/page/page0cur.c: mvdir storage/innobase/page/page0page.c: mvdir storage/innobase/pars/Makefile.am: mvdir storage/innobase/pars/lexyy.c: mvdir storage/innobase/pars/makefilewin: mvdir storage/innobase/pars/pars0grm.c: mvdir storage/innobase/pars/pars0grm.h: mvdir storage/innobase/pars/pars0grm.y: mvdir storage/innobase/pars/pars0lex.l: mvdir storage/innobase/pars/pars0opt.c: mvdir storage/innobase/pars/pars0pars.c: mvdir storage/innobase/pars/pars0sym.c: mvdir storage/innobase/que/Makefile.am: mvdir storage/innobase/que/makefilewin: mvdir storage/innobase/que/que0que.c: mvdir storage/innobase/read/Makefile.am: mvdir storage/innobase/read/makefilewin: mvdir storage/innobase/read/read0read.c: mvdir storage/innobase/rem/Makefile.am: mvdir storage/innobase/rem/makefilewin: mvdir storage/innobase/rem/rem0cmp.c: mvdir storage/innobase/rem/rem0rec.c: mvdir storage/innobase/row/Makefile.am: mvdir storage/innobase/row/makefilewin: mvdir storage/innobase/row/row0ins.c: mvdir storage/innobase/row/row0mysql.c: mvdir storage/innobase/row/row0purge.c: mvdir storage/innobase/row/row0row.c: mvdir storage/innobase/row/row0sel.c: mvdir storage/innobase/row/row0uins.c: mvdir storage/innobase/row/row0umod.c: mvdir storage/innobase/row/row0undo.c: mvdir storage/innobase/row/row0upd.c: mvdir storage/innobase/row/row0vers.c: mvdir storage/innobase/srv/Makefile.am: mvdir storage/innobase/srv/makefilewin: mvdir storage/innobase/srv/srv0que.c: mvdir storage/innobase/srv/srv0srv.c: mvdir storage/innobase/srv/srv0start.c: mvdir storage/innobase/sync/Makefile.am: mvdir storage/innobase/sync/makefilewin: mvdir storage/innobase/sync/sync0arr.c: mvdir storage/innobase/sync/sync0rw.c: mvdir storage/innobase/sync/sync0sync.c: mvdir storage/innobase/thr/Makefile.am: mvdir storage/innobase/thr/makefilewin: mvdir storage/innobase/thr/thr0loc.c: mvdir storage/innobase/trx/Makefile.am: mvdir storage/innobase/trx/makefilewin: mvdir storage/innobase/trx/trx0purge.c: mvdir storage/innobase/trx/trx0rec.c: mvdir storage/innobase/trx/trx0roll.c: mvdir storage/innobase/trx/trx0rseg.c: mvdir storage/innobase/trx/trx0sys.c: mvdir storage/innobase/trx/trx0trx.c: mvdir storage/innobase/trx/trx0undo.c: mvdir storage/innobase/usr/Makefile.am: mvdir storage/innobase/usr/makefilewin: mvdir storage/innobase/usr/usr0sess.c: mvdir storage/innobase/ut/Makefile.am: mvdir storage/innobase/ut/makefilewin: mvdir storage/innobase/ut/ut0byte.c: mvdir storage/innobase/ut/ut0dbg.c: mvdir storage/innobase/ut/ut0mem.c: mvdir storage/innobase/ut/ut0rnd.c: mvdir storage/innobase/ut/ut0ut.c: mvdir storage/ndb/Makefile.am: mvdir storage/ndb/bin/.empty: mvdir storage/ndb/bin/check-regression.sh: mvdir storage/ndb/bin/makeTestPrograms_html.sh: mvdir storage/ndb/config/common.mk.am: mvdir storage/ndb/config/make-win-dsw.sh: mvdir storage/ndb/config/type_kernel.mk.am: mvdir storage/ndb/config/type_mgmapiclient.mk.am: mvdir storage/ndb/config/type_ndbapi.mk.am: mvdir storage/ndb/config/type_ndbapiclient.mk.am: mvdir storage/ndb/config/type_ndbapitest.mk.am: mvdir storage/ndb/config/type_ndbapitools.mk.am: mvdir storage/ndb/config/type_util.mk.am: mvdir storage/ndb/config/win-includes: mvdir storage/ndb/config/win-lib.am: mvdir storage/ndb/config/win-libraries: mvdir storage/ndb/config/win-name: mvdir storage/ndb/config/win-prg.am: mvdir storage/ndb/config/win-sources: mvdir storage/ndb/demos/1-node/1-api-3/Ndb.cfg: mvdir storage/ndb/demos/1-node/1-db-2/Ndb.cfg: mvdir storage/ndb/demos/1-node/1-mgm-1/Ndb.cfg: mvdir storage/ndb/demos/1-node/1-mgm-1/template_config.ini: mvdir storage/ndb/demos/2-node/2-api-4/Ndb.cfg: mvdir storage/ndb/demos/2-node/2-api-5/Ndb.cfg: mvdir storage/ndb/demos/2-node/2-api-6/Ndb.cfg: mvdir storage/ndb/demos/2-node/2-api-7/Ndb.cfg: mvdir storage/ndb/demos/2-node/2-db-2/Ndb.cfg: mvdir storage/ndb/demos/2-node/2-db-3/Ndb.cfg: mvdir storage/ndb/demos/2-node/2-mgm-1/Ndb.cfg: mvdir storage/ndb/demos/2-node/2-mgm-1/template_config.ini: mvdir storage/ndb/demos/config-templates/config_template-1-REP.ini: mvdir storage/ndb/demos/config-templates/config_template-4.ini: mvdir storage/ndb/demos/config-templates/config_template-install.ini: mvdir storage/ndb/demos/run_demo1-PS-SS_common.sh: mvdir storage/ndb/demos/run_demo1-PS.sh: mvdir storage/ndb/demos/run_demo1-SS.sh: mvdir storage/ndb/demos/run_demo1.sh: mvdir storage/ndb/demos/run_demo2.sh: mvdir storage/ndb/docs/Makefile.am: mvdir storage/ndb/docs/README: mvdir storage/ndb/docs/doxygen/Doxyfile.mgmapi: mvdir storage/ndb/docs/doxygen/Doxyfile.ndbapi: mvdir storage/ndb/docs/doxygen/Doxyfile.ndb: mvdir storage/ndb/docs/doxygen/Doxyfile.odbc: mvdir storage/ndb/docs/doxygen/Doxyfile.test: mvdir storage/ndb/docs/doxygen/header.mgmapi.tex: mvdir storage/ndb/docs/doxygen/header.ndbapi.tex: mvdir storage/ndb/docs/doxygen/postdoxy.pl: mvdir storage/ndb/docs/doxygen/predoxy.pl: mvdir storage/ndb/docs/wl2077.txt: mvdir storage/ndb/home/bin/Linuxmkisofs: mvdir storage/ndb/home/bin/Solarismkisofs: mvdir storage/ndb/home/bin/cvs2cl.pl: mvdir storage/ndb/home/bin/fix-cvs-root: mvdir storage/ndb/home/bin/import-from-bk.sh: mvdir storage/ndb/home/bin/ndb_deploy: mvdir storage/ndb/home/bin/ndbdoxy.pl: mvdir storage/ndb/home/bin/ngcalc: mvdir storage/ndb/home/bin/parseConfigFile.awk: mvdir storage/ndb/home/bin/setup-test.sh: mvdir storage/ndb/home/bin/signallog2html.lib/signallog2list.awk: mvdir storage/ndb/home/bin/signallog2html.lib/uniq_blocks.awk: mvdir storage/ndb/home/bin/signallog2html.sh: mvdir storage/ndb/home/bin/stripcr: mvdir storage/ndb/home/lib/funcs.sh: mvdir storage/ndb/include/Makefile.am: mvdir storage/ndb/include/debugger/DebuggerNames.hpp: mvdir storage/ndb/include/debugger/EventLogger.hpp: mvdir storage/ndb/include/debugger/GrepError.hpp: mvdir storage/ndb/include/debugger/SignalLoggerManager.hpp: mvdir storage/ndb/include/editline/editline.h: mvdir storage/ndb/include/kernel/AttributeDescriptor.hpp: mvdir storage/ndb/include/kernel/AttributeHeader.hpp: mvdir storage/ndb/include/kernel/AttributeList.hpp: mvdir storage/ndb/include/kernel/BlockNumbers.h: mvdir storage/ndb/include/kernel/GlobalSignalNumbers.h: mvdir storage/ndb/include/kernel/GrepEvent.hpp: mvdir storage/ndb/include/kernel/Interpreter.hpp: mvdir storage/ndb/include/kernel/LogLevel.hpp: mvdir storage/ndb/include/kernel/NodeBitmask.hpp: mvdir storage/ndb/include/kernel/NodeInfo.hpp: mvdir storage/ndb/include/kernel/NodeState.hpp: mvdir storage/ndb/include/kernel/RefConvert.hpp: mvdir storage/ndb/include/kernel/kernel_config_parameters.h: mvdir storage/ndb/include/kernel/kernel_types.h: mvdir storage/ndb/include/kernel/ndb_limits.h: mvdir storage/ndb/include/kernel/signaldata/AbortAll.hpp: mvdir storage/ndb/include/kernel/signaldata/AccFrag.hpp: mvdir storage/ndb/include/kernel/signaldata/AccLock.hpp: mvdir storage/ndb/include/kernel/signaldata/AccScan.hpp: mvdir storage/ndb/include/kernel/signaldata/AccSizeAltReq.hpp: mvdir storage/ndb/include/kernel/signaldata/AlterIndx.hpp: mvdir storage/ndb/include/kernel/signaldata/AlterTab.hpp: mvdir storage/ndb/include/kernel/signaldata/AlterTable.hpp: mvdir storage/ndb/include/kernel/signaldata/AlterTrig.hpp: mvdir storage/ndb/include/kernel/signaldata/ApiRegSignalData.hpp: mvdir storage/ndb/include/kernel/signaldata/ApiVersion.hpp: mvdir storage/ndb/include/kernel/signaldata/ArbitSignalData.hpp: mvdir storage/ndb/include/kernel/signaldata/AttrInfo.hpp: mvdir storage/ndb/include/kernel/trigger_definitions.h: mvdir storage/ndb/include/ndb_constants.h: mvdir storage/ndb/include/ndb_global.h.in: mvdir storage/ndb/include/ndb_init.h: mvdir storage/ndb/include/ndb_net.h: mvdir storage/ndb/include/ndb_types.h.in: mvdir storage/ndb/include/ndb_version.h.in: mvdir storage/ndb/include/kernel/signaldata/BackupContinueB.hpp: mvdir storage/ndb/include/kernel/signaldata/BackupImpl.hpp: mvdir storage/ndb/include/kernel/signaldata/BackupSignalData.hpp: mvdir storage/ndb/include/kernel/signaldata/BlockCommitOrd.hpp: mvdir storage/ndb/include/kernel/signaldata/BuildIndx.hpp: mvdir storage/ndb/include/kernel/signaldata/CheckNodeGroups.hpp: mvdir storage/ndb/include/kernel/signaldata/CloseComReqConf.hpp: mvdir storage/ndb/include/kernel/signaldata/CmInit.hpp: mvdir storage/ndb/include/kernel/signaldata/CmRegSignalData.hpp: mvdir storage/ndb/include/kernel/signaldata/CmvmiCfgConf.hpp: mvdir storage/ndb/include/kernel/signaldata/CntrMasterConf.hpp: mvdir storage/ndb/include/kernel/signaldata/CntrMasterReq.hpp: mvdir storage/ndb/include/kernel/signaldata/CntrStart.hpp: mvdir storage/ndb/include/kernel/signaldata/ConfigParamId.hpp: mvdir storage/ndb/include/kernel/signaldata/ContinueFragmented.hpp: mvdir storage/ndb/include/kernel/signaldata/CopyActive.hpp: mvdir storage/ndb/include/kernel/signaldata/CopyFrag.hpp: mvdir storage/ndb/include/kernel/signaldata/CopyGCIReq.hpp: mvdir storage/ndb/include/kernel/signaldata/CreateEvnt.hpp: mvdir storage/ndb/include/kernel/signaldata/CreateFrag.hpp: mvdir storage/ndb/include/kernel/signaldata/CreateFragmentation.hpp: mvdir storage/ndb/include/kernel/signaldata/CreateIndx.hpp: mvdir storage/ndb/include/kernel/signaldata/CreateTab.hpp: mvdir storage/ndb/include/kernel/signaldata/CreateTable.hpp: mvdir storage/ndb/include/kernel/signaldata/CreateTrig.hpp: mvdir storage/ndb/include/kernel/signaldata/DiAddTab.hpp: mvdir storage/ndb/include/kernel/signaldata/DiGetNodes.hpp: mvdir storage/ndb/include/kernel/signaldata/DictSchemaInfo.hpp: mvdir storage/ndb/include/kernel/signaldata/DictSizeAltReq.hpp: mvdir storage/ndb/include/kernel/signaldata/DictStart.hpp: mvdir storage/ndb/include/kernel/signaldata/DictTabInfo.hpp: mvdir storage/ndb/include/kernel/signaldata/DihAddFrag.hpp: mvdir storage/ndb/include/kernel/signaldata/DihContinueB.hpp: mvdir storage/ndb/include/kernel/signaldata/DihSizeAltReq.hpp: mvdir storage/ndb/include/kernel/signaldata/DihStartTab.hpp: mvdir storage/ndb/include/kernel/signaldata/DihSwitchReplica.hpp: mvdir storage/ndb/include/kernel/signaldata/DisconnectRep.hpp: mvdir storage/ndb/include/kernel/signaldata/DropIndx.hpp: mvdir storage/ndb/include/kernel/signaldata/DropTab.hpp: mvdir storage/ndb/include/kernel/signaldata/DropTabFile.hpp: mvdir storage/ndb/include/kernel/signaldata/DropTable.hpp: mvdir storage/ndb/include/kernel/signaldata/DropTrig.hpp: mvdir storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp: mvdir storage/ndb/include/kernel/signaldata/EmptyLcp.hpp: mvdir storage/ndb/include/kernel/signaldata/EndTo.hpp: mvdir storage/ndb/include/kernel/signaldata/EventReport.hpp: mvdir storage/ndb/include/kernel/signaldata/EventSubscribeReq.hpp: mvdir storage/ndb/include/kernel/signaldata/ExecFragReq.hpp: mvdir storage/ndb/include/kernel/signaldata/FailRep.hpp: mvdir storage/ndb/include/kernel/signaldata/FireTrigOrd.hpp: mvdir storage/ndb/include/kernel/signaldata/FsAppendReq.hpp: mvdir storage/ndb/include/kernel/signaldata/FsCloseReq.hpp: mvdir storage/ndb/include/kernel/signaldata/FsConf.hpp: mvdir storage/ndb/include/kernel/signaldata/FsOpenReq.hpp: mvdir storage/ndb/include/kernel/signaldata/FsReadWriteReq.hpp: mvdir storage/ndb/include/kernel/signaldata/FsRef.hpp: mvdir storage/ndb/include/kernel/signaldata/FsRemoveReq.hpp: mvdir storage/ndb/include/kernel/signaldata/GCPSave.hpp: mvdir storage/ndb/include/kernel/signaldata/GetTabInfo.hpp: mvdir storage/ndb/include/kernel/signaldata/GetTableId.hpp: mvdir storage/ndb/include/kernel/signaldata/GrepImpl.hpp: mvdir storage/ndb/include/kernel/signaldata/HotSpareRep.hpp: mvdir storage/ndb/include/kernel/signaldata/IndxAttrInfo.hpp: mvdir storage/ndb/include/kernel/signaldata/IndxKeyInfo.hpp: mvdir storage/ndb/include/kernel/signaldata/InvalidateNodeLCPConf.hpp: mvdir storage/ndb/include/kernel/signaldata/InvalidateNodeLCPReq.hpp: mvdir storage/ndb/include/kernel/signaldata/KeyInfo.hpp: mvdir storage/ndb/include/kernel/signaldata/LCP.hpp: mvdir storage/ndb/include/kernel/signaldata/ListTables.hpp: mvdir storage/ndb/include/kernel/signaldata/LqhFrag.hpp: mvdir storage/ndb/include/kernel/signaldata/LqhKey.hpp: mvdir storage/ndb/include/kernel/signaldata/LqhSizeAltReq.hpp: mvdir storage/ndb/include/kernel/signaldata/LqhTransConf.hpp: mvdir storage/ndb/include/kernel/signaldata/ManagementServer.hpp: mvdir storage/ndb/include/kernel/signaldata/MasterGCP.hpp: mvdir storage/ndb/include/kernel/signaldata/MasterLCP.hpp: mvdir storage/ndb/include/kernel/signaldata/NFCompleteRep.hpp: mvdir storage/ndb/include/kernel/signaldata/NdbSttor.hpp: mvdir storage/ndb/include/kernel/signaldata/NdbfsContinueB.hpp: mvdir storage/ndb/include/kernel/signaldata/NextScan.hpp: mvdir storage/ndb/include/kernel/signaldata/NodeFailRep.hpp: mvdir storage/ndb/include/kernel/signaldata/NodeStateSignalData.hpp: mvdir storage/ndb/include/kernel/signaldata/PackedSignal.hpp: mvdir storage/ndb/include/kernel/signaldata/PrepDropTab.hpp: mvdir storage/ndb/include/kernel/signaldata/PrepFailReqRef.hpp: mvdir storage/ndb/include/kernel/signaldata/ReadConfig.hpp: mvdir storage/ndb/include/kernel/signaldata/ReadNodesConf.hpp: mvdir storage/ndb/include/kernel/signaldata/RelTabMem.hpp: mvdir storage/ndb/include/kernel/signaldata/RepImpl.hpp: mvdir storage/ndb/include/kernel/signaldata/ResumeReq.hpp: mvdir storage/ndb/include/kernel/signaldata/ScanFrag.hpp: mvdir storage/ndb/include/kernel/signaldata/ScanTab.hpp: mvdir storage/ndb/include/kernel/signaldata/SetLogLevelOrd.hpp: mvdir storage/ndb/include/kernel/signaldata/SetVarReq.hpp: mvdir storage/ndb/include/kernel/signaldata/SignalData.hpp: mvdir storage/ndb/include/kernel/signaldata/SignalDataPrint.hpp: mvdir storage/ndb/include/kernel/signaldata/SignalDroppedRep.hpp: mvdir storage/ndb/include/kernel/signaldata/SrFragidConf.hpp: mvdir storage/ndb/include/kernel/signaldata/StartFragReq.hpp: mvdir storage/ndb/include/kernel/signaldata/StartInfo.hpp: mvdir storage/ndb/include/kernel/signaldata/StartMe.hpp: mvdir storage/ndb/include/kernel/signaldata/StartOrd.hpp: mvdir storage/ndb/include/kernel/signaldata/StartPerm.hpp: mvdir storage/ndb/include/kernel/signaldata/StartRec.hpp: mvdir storage/ndb/include/kernel/signaldata/StartTo.hpp: mvdir storage/ndb/include/kernel/signaldata/StopMe.hpp: mvdir storage/ndb/include/kernel/signaldata/StopPerm.hpp: mvdir storage/ndb/include/kernel/signaldata/StopReq.hpp: mvdir storage/ndb/include/kernel/signaldata/SumaImpl.hpp: mvdir storage/ndb/include/kernel/signaldata/SystemError.hpp: mvdir storage/ndb/include/kernel/signaldata/TamperOrd.hpp: mvdir storage/ndb/include/kernel/signaldata/TcCommit.hpp: mvdir storage/ndb/include/kernel/signaldata/TcContinueB.hpp: mvdir storage/ndb/include/kernel/signaldata/TcHbRep.hpp: mvdir storage/ndb/include/kernel/signaldata/TcIndx.hpp: mvdir storage/ndb/include/kernel/signaldata/TcKeyConf.hpp: mvdir storage/ndb/include/kernel/signaldata/TcKeyFailConf.hpp: mvdir storage/ndb/include/kernel/signaldata/TcKeyRef.hpp: mvdir storage/ndb/include/kernel/signaldata/TcKeyReq.hpp: mvdir storage/ndb/include/kernel/signaldata/TcRollbackRep.hpp: mvdir storage/ndb/include/kernel/signaldata/TcSizeAltReq.hpp: mvdir storage/ndb/include/kernel/signaldata/TestOrd.hpp: mvdir storage/ndb/include/kernel/signaldata/TransIdAI.hpp: mvdir storage/ndb/include/kernel/signaldata/TrigAttrInfo.hpp: mvdir storage/ndb/include/kernel/signaldata/TupCommit.hpp: mvdir storage/ndb/include/kernel/signaldata/TupFrag.hpp: mvdir storage/ndb/include/kernel/signaldata/TupKey.hpp: mvdir storage/ndb/include/kernel/signaldata/TupSizeAltReq.hpp: mvdir storage/ndb/include/kernel/signaldata/TuxBound.hpp: mvdir storage/ndb/include/kernel/signaldata/TuxContinueB.hpp: mvdir storage/ndb/include/kernel/signaldata/TuxMaint.hpp: mvdir storage/ndb/include/kernel/signaldata/TuxSizeAltReq.hpp: mvdir storage/ndb/include/kernel/signaldata/UpdateTo.hpp: mvdir storage/ndb/include/kernel/signaldata/UpgradeStartup.hpp: mvdir storage/ndb/include/kernel/signaldata/UtilDelete.hpp: mvdir storage/ndb/include/kernel/signaldata/UtilExecute.hpp: mvdir storage/ndb/include/kernel/signaldata/UtilLock.hpp: mvdir storage/ndb/include/kernel/signaldata/UtilPrepare.hpp: mvdir storage/ndb/include/kernel/signaldata/UtilRelease.hpp: mvdir storage/ndb/include/kernel/signaldata/UtilSequence.hpp: mvdir storage/ndb/include/kernel/signaldata/WaitGCP.hpp: mvdir storage/ndb/include/logger/ConsoleLogHandler.hpp: mvdir storage/ndb/include/logger/FileLogHandler.hpp: mvdir storage/ndb/include/logger/LogHandler.hpp: mvdir storage/ndb/include/logger/Logger.hpp: mvdir storage/ndb/include/logger/SysLogHandler.hpp: mvdir storage/ndb/include/mgmapi/mgmapi.h: mvdir storage/ndb/include/mgmapi/mgmapi_config_parameters.h: mvdir storage/ndb/include/mgmapi/mgmapi_config_parameters_debug.h: mvdir storage/ndb/include/mgmapi/mgmapi_debug.h: mvdir storage/ndb/include/mgmapi/ndb_logevent.h: mvdir storage/ndb/include/mgmcommon/ConfigRetriever.hpp: mvdir storage/ndb/include/mgmcommon/IPCConfig.hpp: mvdir storage/ndb/include/mgmcommon/MgmtErrorReporter.hpp: mvdir storage/ndb/include/ndbapi/Ndb.hpp: mvdir storage/ndb/include/ndbapi/NdbApi.hpp: mvdir storage/ndb/include/ndbapi/NdbBlob.hpp: mvdir storage/ndb/include/ndbapi/NdbDictionary.hpp: mvdir storage/ndb/include/ndbapi/NdbError.hpp: mvdir storage/ndb/include/ndbapi/NdbEventOperation.hpp: mvdir storage/ndb/include/ndbapi/NdbIndexOperation.hpp: mvdir storage/ndb/include/ndbapi/NdbIndexScanOperation.hpp: mvdir storage/ndb/include/ndbapi/NdbOperation.hpp: mvdir storage/ndb/include/ndbapi/NdbPool.hpp: mvdir storage/ndb/include/ndbapi/NdbRecAttr.hpp: mvdir storage/ndb/include/ndbapi/NdbReceiver.hpp: mvdir storage/ndb/include/ndbapi/NdbScanFilter.hpp: mvdir storage/ndb/include/ndbapi/NdbScanOperation.hpp: mvdir storage/ndb/include/ndbapi/NdbTransaction.hpp: mvdir storage/ndb/include/ndbapi/ndb_cluster_connection.hpp: mvdir storage/ndb/include/ndbapi/ndb_opt_defaults.h: mvdir storage/ndb/include/ndbapi/ndbapi_limits.h: mvdir storage/ndb/include/ndbapi/ndberror.h: mvdir storage/ndb/include/newtonapi/dba.h: mvdir storage/ndb/include/newtonapi/defs/pcn_types.h: mvdir storage/ndb/include/portlib/NdbCondition.h: mvdir storage/ndb/include/portlib/NdbConfig.h: mvdir storage/ndb/include/portlib/NdbDaemon.h: mvdir storage/ndb/include/portlib/NdbEnv.h: mvdir storage/ndb/include/portlib/NdbHost.h: mvdir storage/ndb/include/portlib/NdbMain.h: mvdir storage/ndb/include/portlib/NdbMem.h: mvdir storage/ndb/include/portlib/NdbMutex.h: mvdir storage/ndb/include/portlib/NdbSleep.h: mvdir storage/ndb/include/portlib/NdbTCP.h: mvdir storage/ndb/include/portlib/NdbThread.h: mvdir storage/ndb/include/portlib/NdbTick.h: mvdir storage/ndb/include/portlib/PortDefs.h: mvdir storage/ndb/include/portlib/prefetch.h: mvdir storage/ndb/include/transporter/TransporterCallback.hpp: mvdir storage/ndb/include/transporter/TransporterDefinitions.hpp: mvdir storage/ndb/include/transporter/TransporterRegistry.hpp: mvdir storage/ndb/include/util/Base64.hpp: mvdir storage/ndb/include/util/BaseString.hpp: mvdir storage/ndb/include/util/Bitmask.hpp: mvdir storage/ndb/include/util/ConfigValues.hpp: mvdir storage/ndb/include/util/File.hpp: mvdir storage/ndb/include/util/InputStream.hpp: mvdir storage/ndb/include/util/NdbAutoPtr.hpp: mvdir storage/ndb/include/util/NdbOut.hpp: mvdir storage/ndb/include/util/NdbSqlUtil.hpp: mvdir storage/ndb/include/util/OutputStream.hpp: mvdir storage/ndb/include/util/Parser.hpp: mvdir storage/ndb/include/util/Properties.hpp: mvdir storage/ndb/include/util/SimpleProperties.hpp: mvdir storage/ndb/include/util/SocketAuthenticator.hpp: mvdir storage/ndb/include/util/SocketClient.hpp: mvdir storage/ndb/include/util/SocketServer.hpp: mvdir storage/ndb/include/util/UtilBuffer.hpp: mvdir storage/ndb/include/util/Vector.hpp: mvdir storage/ndb/include/util/basestring_vsnprintf.h: mvdir storage/ndb/include/util/md5_hash.hpp: mvdir storage/ndb/include/util/ndb_opts.h: mvdir storage/ndb/include/util/random.h: mvdir storage/ndb/include/util/socket_io.h: mvdir storage/ndb/include/util/uucode.h: mvdir storage/ndb/include/util/version.h: mvdir storage/ndb/lib/.empty: mvdir storage/ndb/ndbapi-examples/Makefile: mvdir storage/ndb/ndbapi-examples/mgmapi_logevent_example/Makefile: mvdir storage/ndb/ndbapi-examples/mgmapi_logevent_example/mgmapi_logevent.cpp: mvdir storage/ndb/ndbapi-examples/ndbapi_async_example/Makefile: mvdir storage/ndb/ndbapi-examples/ndbapi_async_example/ndbapi_async.cpp: mvdir storage/ndb/ndbapi-examples/ndbapi_async_example/readme.txt: mvdir storage/ndb/ndbapi-examples/ndbapi_async_example1/Makefile: mvdir storage/ndb/ndbapi-examples/ndbapi_async_example1/ndbapi_async1.cpp: mvdir storage/ndb/ndbapi-examples/ndbapi_event_example/Makefile: mvdir storage/ndb/ndbapi-examples/ndbapi_event_example/ndbapi_event.cpp: mvdir storage/ndb/ndbapi-examples/ndbapi_retries_example/Makefile: mvdir storage/ndb/ndbapi-examples/ndbapi_retries_example/ndbapi_retries.cpp: mvdir storage/ndb/ndbapi-examples/ndbapi_scan_example/Makefile: mvdir storage/ndb/ndbapi-examples/ndbapi_scan_example/ndbapi_scan.cpp: mvdir storage/ndb/ndbapi-examples/ndbapi_scan_example/readme.txt: mvdir storage/ndb/ndbapi-examples/ndbapi_simple_example/Makefile: mvdir storage/ndb/ndbapi-examples/ndbapi_simple_example/ndbapi_simple.cpp: mvdir storage/ndb/ndbapi-examples/ndbapi_simple_index_example/Makefile: mvdir storage/ndb/ndbapi-examples/ndbapi_simple_index_example/ndbapi_simple_index.cpp: mvdir storage/ndb/src/Makefile.am: mvdir storage/ndb/src/common/Makefile.am: mvdir storage/ndb/src/common/debugger/BlockNames.cpp: mvdir storage/ndb/src/common/debugger/DebuggerNames.cpp: mvdir storage/ndb/src/common/debugger/EventLogger.cpp: mvdir storage/ndb/src/common/debugger/GrepError.cpp: mvdir storage/ndb/src/common/debugger/Makefile.am: mvdir storage/ndb/src/common/debugger/SignalLoggerManager.cpp: mvdir storage/ndb/src/common/debugger/signaldata/AccLock.cpp: mvdir storage/ndb/src/common/debugger/signaldata/AlterIndx.cpp: mvdir storage/ndb/src/common/debugger/signaldata/AlterTab.cpp: mvdir storage/ndb/src/common/debugger/signaldata/AlterTable.cpp: mvdir storage/ndb/src/common/debugger/signaldata/AlterTrig.cpp: mvdir storage/ndb/src/common/debugger/signaldata/BackupImpl.cpp: mvdir storage/ndb/src/common/debugger/signaldata/BackupSignalData.cpp: mvdir storage/ndb/src/common/debugger/signaldata/CloseComReqConf.cpp: mvdir storage/ndb/src/common/debugger/signaldata/CntrStart.cpp: mvdir storage/ndb/src/common/debugger/signaldata/ContinueB.cpp: mvdir storage/ndb/src/common/debugger/signaldata/CopyGCI.cpp: mvdir storage/ndb/src/common/debugger/signaldata/CreateEvnt.cpp: mvdir storage/ndb/src/common/debugger/signaldata/CreateFragmentation.cpp: mvdir storage/ndb/src/common/debugger/signaldata/CreateIndx.cpp: mvdir storage/ndb/src/common/debugger/signaldata/CreateTrig.cpp: mvdir storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp: mvdir storage/ndb/src/common/debugger/signaldata/DihContinueB.cpp: mvdir storage/ndb/src/common/debugger/signaldata/DihSwitchReplicaReq.cpp: mvdir storage/ndb/src/common/debugger/signaldata/DisconnectRep.cpp: mvdir storage/ndb/src/common/debugger/signaldata/DropIndx.cpp: mvdir storage/ndb/src/common/debugger/signaldata/DropTab.cpp: mvdir storage/ndb/src/common/debugger/signaldata/DropTrig.cpp: mvdir storage/ndb/src/common/debugger/signaldata/FailRep.cpp: mvdir storage/ndb/src/common/debugger/signaldata/FireTrigOrd.cpp: mvdir storage/ndb/src/common/debugger/signaldata/FsAppendReq.cpp: mvdir storage/ndb/src/common/debugger/signaldata/FsCloseReq.cpp: mvdir storage/ndb/src/common/debugger/signaldata/FsConf.cpp: mvdir storage/ndb/src/common/debugger/signaldata/FsOpenReq.cpp: mvdir storage/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp: mvdir storage/ndb/src/common/debugger/signaldata/FsRef.cpp: mvdir storage/ndb/src/common/debugger/signaldata/GCPSave.cpp: mvdir storage/ndb/src/common/debugger/signaldata/IndxAttrInfo.cpp: mvdir storage/ndb/src/common/debugger/signaldata/IndxKeyInfo.cpp: mvdir storage/ndb/src/common/debugger/signaldata/LCP.cpp: mvdir storage/ndb/src/common/debugger/signaldata/LqhFrag.cpp: mvdir storage/ndb/src/common/debugger/signaldata/LqhKey.cpp: mvdir storage/ndb/src/common/debugger/signaldata/LqhTrans.cpp: mvdir storage/ndb/src/common/debugger/signaldata/Makefile.am: mvdir storage/ndb/src/common/debugger/signaldata/MasterLCP.cpp: mvdir storage/ndb/src/common/debugger/signaldata/NFCompleteRep.cpp: mvdir storage/ndb/src/common/debugger/signaldata/NdbSttor.cpp: mvdir storage/ndb/src/common/debugger/signaldata/NdbfsContinueB.cpp: mvdir storage/ndb/src/common/debugger/signaldata/PackedSignal.cpp: mvdir storage/ndb/src/common/debugger/signaldata/PrepDropTab.cpp: mvdir storage/ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp: mvdir storage/ndb/src/common/debugger/signaldata/ReadNodesConf.cpp: mvdir storage/ndb/src/common/debugger/signaldata/ScanFrag.cpp: mvdir storage/ndb/src/common/debugger/signaldata/ScanTab.cpp: mvdir storage/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp: mvdir storage/ndb/src/common/debugger/signaldata/SignalDroppedRep.cpp: mvdir storage/ndb/src/common/debugger/signaldata/SignalNames.cpp: mvdir storage/ndb/src/common/debugger/signaldata/StartRec.cpp: mvdir storage/ndb/src/common/debugger/signaldata/SumaImpl.cpp: mvdir storage/ndb/src/common/debugger/signaldata/SystemError.cpp: mvdir storage/ndb/src/common/debugger/signaldata/TcIndx.cpp: mvdir storage/ndb/src/common/debugger/signaldata/TcKeyConf.cpp: mvdir storage/ndb/src/common/debugger/signaldata/TcKeyRef.cpp: mvdir storage/ndb/src/common/debugger/signaldata/TcKeyReq.cpp: mvdir storage/ndb/src/common/debugger/signaldata/TcRollbackRep.cpp: mvdir storage/ndb/src/common/debugger/signaldata/TrigAttrInfo.cpp: mvdir storage/ndb/src/common/debugger/signaldata/TupCommit.cpp: mvdir storage/ndb/src/common/debugger/signaldata/TupKey.cpp: mvdir storage/ndb/src/common/debugger/signaldata/TuxMaint.cpp: mvdir storage/ndb/src/common/debugger/signaldata/UtilDelete.cpp: mvdir storage/ndb/src/common/debugger/signaldata/UtilExecute.cpp: mvdir storage/ndb/src/common/debugger/signaldata/UtilLock.cpp: mvdir storage/ndb/src/common/debugger/signaldata/UtilPrepare.cpp: mvdir storage/ndb/src/common/debugger/signaldata/UtilSequence.cpp: mvdir storage/ndb/src/common/debugger/signaldata/print.awk: mvdir storage/ndb/src/common/logger/ConsoleLogHandler.cpp: mvdir storage/ndb/src/common/logger/FileLogHandler.cpp: mvdir storage/ndb/src/common/logger/LogHandler.cpp: mvdir storage/ndb/src/common/logger/LogHandlerList.cpp: mvdir storage/ndb/src/common/logger/LogHandlerList.hpp: mvdir storage/ndb/src/common/logger/Logger.cpp: mvdir storage/ndb/src/common/logger/Makefile.am: mvdir storage/ndb/src/common/logger/SysLogHandler.cpp: mvdir storage/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp: mvdir storage/ndb/src/common/logger/listtest/LogHandlerListUnitTest.hpp: mvdir storage/ndb/src/common/logger/listtest/Makefile: mvdir storage/ndb/src/common/logger/loggertest/LoggerUnitTest.cpp: mvdir storage/ndb/src/common/logger/loggertest/LoggerUnitTest.hpp: mvdir storage/ndb/src/common/logger/loggertest/Makefile: mvdir storage/ndb/src/common/mgmcommon/ConfigRetriever.cpp: mvdir storage/ndb/src/common/mgmcommon/IPCConfig.cpp: mvdir storage/ndb/src/common/mgmcommon/Makefile.am: mvdir storage/ndb/src/common/mgmcommon/printConfig/Makefile: mvdir storage/ndb/src/common/mgmcommon/printConfig/printConfig.cpp: mvdir storage/ndb/src/common/portlib/Makefile.am: mvdir storage/ndb/src/common/portlib/NdbCondition.c: mvdir storage/ndb/src/common/portlib/NdbConfig.c: mvdir storage/ndb/src/common/portlib/NdbDaemon.c: mvdir storage/ndb/src/common/portlib/NdbEnv.c: mvdir storage/ndb/src/common/portlib/NdbHost.c: mvdir storage/ndb/src/common/portlib/NdbMem.c: mvdir storage/ndb/src/common/portlib/NdbMutex.c: mvdir storage/ndb/src/common/portlib/NdbPortLibTest.cpp: mvdir storage/ndb/src/common/portlib/NdbSleep.c: mvdir storage/ndb/src/common/portlib/NdbTCP.cpp: mvdir storage/ndb/src/common/portlib/NdbThread.c: mvdir storage/ndb/src/common/portlib/NdbTick.c: mvdir storage/ndb/src/common/portlib/gcc.cpp: mvdir storage/ndb/src/common/portlib/memtest.c: mvdir storage/ndb/src/common/portlib/mmslist.cpp: mvdir storage/ndb/src/common/portlib/mmstest.cpp: mvdir storage/ndb/src/common/portlib/munmaptest.cpp: mvdir storage/ndb/src/common/portlib/old_dirs/memtest/Makefile: mvdir storage/ndb/src/common/portlib/old_dirs/memtest/munmaptest/Makefile: mvdir storage/ndb/src/common/portlib/old_dirs/ose/Makefile: mvdir storage/ndb/src/common/portlib/old_dirs/ose/NdbCondition.c: mvdir storage/ndb/src/common/portlib/old_dirs/ose/NdbConditionOSE.h: mvdir storage/ndb/src/common/portlib/old_dirs/ose/NdbEnv.c: mvdir storage/ndb/src/common/portlib/old_dirs/ose/NdbHost.c: mvdir storage/ndb/src/common/portlib/old_dirs/ose/NdbMem.c: mvdir storage/ndb/src/common/portlib/old_dirs/ose/NdbMem_SoftOse.cpp: mvdir storage/ndb/src/common/portlib/old_dirs/ose/NdbMutex.c: mvdir storage/ndb/src/common/portlib/old_dirs/ose/NdbOut.cpp: mvdir storage/ndb/src/common/portlib/old_dirs/ose/NdbSleep.c: mvdir storage/ndb/src/common/portlib/old_dirs/ose/NdbTCP.c: mvdir storage/ndb/src/common/portlib/old_dirs/ose/NdbThread.c: mvdir storage/ndb/src/common/portlib/old_dirs/ose/NdbTick.c: mvdir storage/ndb/src/common/portlib/old_dirs/test/Makefile: mvdir storage/ndb/src/common/portlib/old_dirs/win32/Makefile: mvdir storage/ndb/src/common/portlib/old_dirs/win32/NdbCondition.c: mvdir storage/ndb/src/common/portlib/old_dirs/win32/NdbDaemon.c: mvdir storage/ndb/src/common/portlib/old_dirs/win32/NdbEnv.c: mvdir storage/ndb/src/common/portlib/old_dirs/win32/NdbHost.c: mvdir storage/ndb/src/common/portlib/old_dirs/win32/NdbMem.c: mvdir storage/ndb/src/common/portlib/old_dirs/win32/NdbMutex.c: mvdir storage/ndb/src/common/portlib/old_dirs/win32/NdbSleep.c: mvdir storage/ndb/src/common/portlib/old_dirs/win32/NdbTCP.c: mvdir storage/ndb/src/common/portlib/old_dirs/win32/NdbThread.c: mvdir storage/ndb/src/common/portlib/old_dirs/win32/NdbTick.c: mvdir storage/ndb/src/common/portlib/win32/NdbCondition.c: mvdir storage/ndb/src/common/portlib/win32/NdbDaemon.c: mvdir storage/ndb/src/common/portlib/win32/NdbEnv.c: mvdir storage/ndb/src/common/portlib/win32/NdbHost.c: mvdir storage/ndb/src/common/portlib/win32/NdbMem.c: mvdir storage/ndb/src/common/portlib/win32/NdbMutex.c: mvdir storage/ndb/src/common/portlib/win32/NdbSleep.c: mvdir storage/ndb/src/common/portlib/win32/NdbTCP.c: mvdir storage/ndb/src/common/portlib/win32/NdbThread.c: mvdir storage/ndb/src/common/portlib/win32/NdbTick.c: mvdir storage/ndb/src/common/transporter/Makefile.am: mvdir storage/ndb/src/common/transporter/OSE_Receiver.cpp: mvdir storage/ndb/src/common/transporter/OSE_Receiver.hpp: mvdir storage/ndb/src/common/transporter/OSE_Signals.hpp: mvdir storage/ndb/src/common/transporter/OSE_Transporter.cpp: mvdir storage/ndb/src/common/transporter/OSE_Transporter.hpp: mvdir storage/ndb/src/common/transporter/Packer.cpp: mvdir storage/ndb/src/common/transporter/Packer.hpp: mvdir storage/ndb/src/common/transporter/SCI_Transporter.cpp: mvdir storage/ndb/src/common/transporter/SCI_Transporter.hpp: mvdir storage/ndb/src/common/transporter/SHM_Buffer.hpp: mvdir storage/ndb/src/common/transporter/SHM_Transporter.cpp: mvdir storage/ndb/src/common/transporter/SHM_Transporter.hpp: mvdir storage/ndb/src/common/transporter/SHM_Transporter.unix.cpp: mvdir storage/ndb/src/common/transporter/SHM_Transporter.win32.cpp: mvdir storage/ndb/src/common/transporter/SendBuffer.cpp: mvdir storage/ndb/src/common/transporter/SendBuffer.hpp: mvdir storage/ndb/src/common/transporter/TCP_Transporter.cpp: mvdir storage/ndb/src/common/transporter/TCP_Transporter.hpp: mvdir storage/ndb/src/common/transporter/Transporter.cpp: mvdir storage/ndb/src/common/transporter/Transporter.hpp: mvdir storage/ndb/src/common/transporter/TransporterInternalDefinitions.hpp: mvdir storage/ndb/src/common/transporter/TransporterRegistry.cpp: mvdir storage/ndb/src/common/transporter/basictest/Makefile: mvdir storage/ndb/src/common/transporter/basictest/basicTransporterTest.cpp: mvdir storage/ndb/src/common/transporter/buddy.cpp: mvdir storage/ndb/src/common/transporter/buddy.hpp: mvdir storage/ndb/src/common/transporter/failoverSCI/Makefile: mvdir storage/ndb/src/common/transporter/failoverSCI/failoverSCI.cpp: mvdir storage/ndb/src/common/transporter/perftest/Makefile: mvdir storage/ndb/src/common/transporter/perftest/perfTransporterTest.cpp: mvdir storage/ndb/src/common/transporter/priotest/Makefile: mvdir storage/ndb/src/common/transporter/priotest/prioOSE/Makefile: mvdir storage/ndb/src/common/transporter/priotest/prioSCI/Makefile: mvdir storage/ndb/src/common/transporter/priotest/prioSCI/prioSCI.cpp: mvdir storage/ndb/src/common/transporter/priotest/prioSHM/Makefile: mvdir storage/ndb/src/common/transporter/priotest/prioSHM/prioSHM.cpp: mvdir storage/ndb/src/common/transporter/priotest/prioTCP/Makefile: mvdir storage/ndb/src/common/transporter/priotest/prioTCP/prioTCP.cpp: mvdir storage/ndb/src/common/transporter/priotest/prioTransporterTest.cpp: mvdir storage/ndb/src/common/transporter/priotest/prioTransporterTest.hpp: mvdir storage/ndb/src/common/util/Base64.cpp: mvdir storage/ndb/src/common/util/BaseString.cpp: mvdir storage/ndb/src/common/util/Bitmask.cpp: mvdir storage/ndb/src/common/util/ConfigValues.cpp: mvdir storage/ndb/src/common/util/File.cpp: mvdir storage/ndb/src/common/util/InputStream.cpp: mvdir storage/ndb/src/common/util/Makefile.am: mvdir storage/ndb/src/common/util/NdbErrHnd.cpp: mvdir storage/ndb/src/common/util/NdbOut.cpp: mvdir storage/ndb/src/common/util/NdbSqlUtil.cpp: mvdir storage/ndb/src/common/util/OutputStream.cpp: mvdir storage/ndb/src/common/util/Parser.cpp: mvdir storage/ndb/src/common/util/Properties.cpp: mvdir storage/ndb/src/common/util/SimpleProperties.cpp: mvdir storage/ndb/src/common/util/SocketAuthenticator.cpp: mvdir storage/ndb/src/common/util/SocketClient.cpp: mvdir storage/ndb/src/common/util/SocketServer.cpp: mvdir storage/ndb/src/common/util/basestring_vsnprintf.c: mvdir storage/ndb/src/common/util/filetest/FileUnitTest.cpp: mvdir storage/ndb/src/common/util/filetest/FileUnitTest.hpp: mvdir storage/ndb/src/common/util/filetest/Makefile: mvdir storage/ndb/src/common/util/getarg.cat3: mvdir storage/ndb/src/common/util/md5_hash.cpp: mvdir storage/ndb/src/common/util/ndb_init.c: mvdir storage/ndb/src/common/util/new.cpp: mvdir storage/ndb/src/common/util/random.c: mvdir storage/ndb/src/common/util/socket_io.cpp: mvdir storage/ndb/src/common/util/strdup.c: mvdir storage/ndb/src/common/util/testConfigValues/Makefile: mvdir storage/ndb/src/common/util/testConfigValues/testConfigValues.cpp: mvdir storage/ndb/src/common/util/uucode.c: mvdir storage/ndb/src/common/util/version.c: mvdir storage/ndb/src/common/util/testProperties/Makefile: mvdir storage/ndb/src/common/util/testProperties/testProperties.cpp: mvdir storage/ndb/src/common/util/testSimpleProperties/Makefile: mvdir storage/ndb/src/common/util/testSimpleProperties/sp_test.cpp: mvdir storage/ndb/src/cw/Makefile.am: mvdir storage/ndb/src/cw/cpcc-win32/C++/CPC_GUI.cpp: mvdir storage/ndb/src/cw/cpcc-win32/C++/CPC_GUI.dsp: mvdir storage/ndb/src/cw/cpcc-win32/C++/CPC_GUI.dsw: mvdir storage/ndb/src/cw/cpcc-win32/C++/CPC_GUI.h: mvdir storage/ndb/src/cw/cpcc-win32/C++/CPC_GUI.ico: mvdir storage/ndb/src/cw/cpcc-win32/C++/CPC_GUI.rc: mvdir storage/ndb/src/cw/cpcc-win32/C++/CPC_GUI.sln: mvdir storage/ndb/src/cw/cpcc-win32/C++/CPC_GUI.suo: mvdir storage/ndb/src/cw/cpcc-win32/C++/CPC_GUI.vcproj: mvdir storage/ndb/src/cw/cpcc-win32/C++/Closed.ICO: mvdir storage/ndb/src/cw/cpcc-win32/C++/NdbControls.cpp: mvdir storage/ndb/src/cw/cpcc-win32/C++/Open.ICO: mvdir storage/ndb/src/cw/cpcc-win32/C++/StdAfx.cpp: mvdir storage/ndb/src/cw/cpcc-win32/C++/StdAfx.h: mvdir storage/ndb/src/cw/cpcc-win32/C++/TreeView.cpp: mvdir storage/ndb/src/cw/cpcc-win32/C++/TreeView.h: mvdir storage/ndb/src/cw/cpcc-win32/C++/bmp00001.bmp: mvdir storage/ndb/src/cw/cpcc-win32/C++/resource.h: mvdir storage/ndb/src/cw/cpcc-win32/C++/small.ico: mvdir storage/ndb/src/cw/cpcc-win32/C++/toolbar.bmp: mvdir storage/ndb/src/cw/cpcc-win32/csharp/App.ico: mvdir storage/ndb/src/cw/cpcc-win32/csharp/CPC_Form.cs: mvdir storage/ndb/src/cw/cpcc-win32/csharp/Computer.cs: mvdir storage/ndb/src/cw/cpcc-win32/csharp/ComputerAddDialog.cs: mvdir storage/ndb/src/cw/cpcc-win32/csharp/ComputerRemoveDialog.cs: mvdir storage/ndb/src/cw/cpcc-win32/csharp/DATABASE.ICO: mvdir storage/ndb/src/cw/cpcc-win32/csharp/Database.cs: mvdir storage/ndb/src/cw/cpcc-win32/csharp/NDB_CPC.csproj.user: mvdir storage/ndb/src/cw/cpcc-win32/csharp/NDB_CPC.csproj: mvdir storage/ndb/src/cw/cpcc-win32/csharp/NDB_CPC.ncb: mvdir storage/ndb/src/cw/cpcc-win32/csharp/NDB_CPC.sln: mvdir storage/ndb/src/cw/cpcc-win32/csharp/PanelWizard.cs: mvdir storage/ndb/src/cw/cpcc-win32/csharp/Process.cs: mvdir storage/ndb/src/cw/cpcc-win32/csharp/ProcessDefineDialog.cs: mvdir storage/ndb/src/cw/cpcc-win32/csharp/fileaccess/FileMgmt.cs: mvdir storage/ndb/src/cw/cpcc-win32/csharp/simpleparser/SimpleCPCParser.cs: mvdir storage/ndb/src/cw/cpcc-win32/csharp/socketcomm/SocketComm.cs: mvdir storage/ndb/src/cw/cpcc-win32/csharp/socketcomm/myTcpClient.cs: mvdir storage/ndb/src/cw/cpcc-win32/csharp/startDatabaseDlg.cs: mvdir storage/ndb/src/cw/cpcc-win32/csharp/telnetclient/telnetClient.cs: mvdir storage/ndb/src/cw/cpcc-win32/vb6/Computer.cls: mvdir storage/ndb/src/cw/cpcc-win32/vb6/Database.cls: mvdir storage/ndb/src/cw/cpcc-win32/vb6/Icon 110.ico: mvdir storage/ndb/src/cw/cpcc-win32/vb6/Icon 231.ico: mvdir storage/ndb/src/cw/cpcc-win32/vb6/Icon 237.ico: mvdir storage/ndb/src/cw/cpcc-win32/vb6/Icon 241.ico: mvdir storage/ndb/src/cw/cpcc-win32/vb6/Icon 242.ico: mvdir storage/ndb/src/cw/cpcc-win32/vb6/Icon 270.ico: mvdir storage/ndb/src/cw/cpcc-win32/vb6/Icon 271.ico: mvdir storage/ndb/src/cw/cpcc-win32/vb6/Icon 273.ico: mvdir storage/ndb/src/cw/cpcc-win32/vb6/Icon 31.ico: mvdir storage/ndb/src/cw/cpcc-win32/vb6/Icon 337.ico: mvdir storage/ndb/src/cw/cpcc-win32/vb6/Icon 338.ico: mvdir storage/ndb/src/cw/cpcc-win32/vb6/Icon 339.ico: mvdir storage/ndb/src/cw/cpcc-win32/vb6/MSSCCPRJ.SCC: mvdir storage/ndb/src/cw/cpcc-win32/vb6/Module1.bas: mvdir storage/ndb/src/cw/cpcc-win32/vb6/NdbCPC.vbp: mvdir storage/ndb/src/cw/cpcc-win32/vb6/NdbCPC.vbw: mvdir storage/ndb/src/cw/cpcc-win32/vb6/Process.cls: mvdir storage/ndb/src/cw/cpcc-win32/vb6/closed folder.ico: mvdir storage/ndb/src/cw/cpcc-win32/vb6/computer.ico: mvdir storage/ndb/src/cw/cpcc-win32/vb6/frmAbout.frm: mvdir storage/ndb/src/cw/cpcc-win32/vb6/frmLogin.frm: mvdir storage/ndb/src/cw/cpcc-win32/vb6/frmMain.frm: mvdir storage/ndb/src/cw/cpcc-win32/vb6/frmNewComputer.frm: mvdir storage/ndb/src/cw/cpcc-win32/vb6/frmNewComputer.frx: mvdir storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase.frx: mvdir storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase1.frm: mvdir storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase2.frm: mvdir storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase2.log: mvdir storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase3.frm: mvdir storage/ndb/src/cw/cpcc-win32/vb6/frmOptions.frm: mvdir storage/ndb/src/cw/cpcc-win32/vb6/frmSplash.frx: mvdir storage/ndb/src/cw/cpcc-win32/vb6/networking.ico: mvdir storage/ndb/src/cw/cpcc-win32/vb6/open folder.ico: mvdir storage/ndb/src/cw/cpcd/APIService.cpp: mvdir storage/ndb/src/cw/cpcd/APIService.hpp: mvdir storage/ndb/src/cw/cpcd/CPCD.cpp: mvdir storage/ndb/src/cw/cpcd/CPCD.hpp: mvdir storage/ndb/src/cw/cpcd/Makefile.am: mvdir storage/ndb/src/cw/cpcd/Monitor.cpp: mvdir storage/ndb/src/cw/cpcd/Process.cpp: mvdir storage/ndb/src/cw/cpcd/common.cpp: mvdir storage/ndb/src/cw/cpcd/common.hpp: mvdir storage/ndb/src/cw/cpcd/main.cpp: mvdir storage/ndb/src/cw/test/socketclient/Makefile: mvdir storage/ndb/src/cw/test/socketclient/socketClientTest.cpp: mvdir storage/ndb/src/cw/util/ClientInterface.cpp: mvdir storage/ndb/src/cw/util/ClientInterface.hpp: mvdir storage/ndb/src/cw/util/Makefile: mvdir storage/ndb/src/cw/util/SocketRegistry.cpp: mvdir storage/ndb/src/cw/util/SocketRegistry.hpp: mvdir storage/ndb/src/cw/util/SocketService.cpp: mvdir storage/ndb/src/cw/util/SocketService.hpp: mvdir storage/ndb/src/external/WIN32.x86/sci/lib/SISCI_LIBRARY_WIN32.TXT: mvdir storage/ndb/src/external/WIN32.x86/sci/lib/scilib.lib: mvdir storage/ndb/src/external/WIN32.x86/sci/lib/scilib_md.lib: mvdir storage/ndb/src/external/WIN32.x86/sci/lib/scilib_mt.lib: mvdir storage/ndb/src/external/WIN32.x86/sci/lib/sisci_api.lib: mvdir storage/ndb/src/external/WIN32.x86/sci/lib/sisci_api_md.lib: mvdir storage/ndb/src/external/WIN32.x86/sci/lib/sisci_api_mt.lib: mvdir storage/ndb/src/kernel/Makefile.am: mvdir storage/ndb/src/kernel/SimBlockList.cpp: mvdir storage/ndb/src/kernel/blocks/ERROR_codes.txt: mvdir storage/ndb/src/kernel/blocks/Makefile.am: mvdir storage/ndb/src/kernel/blocks/NodeRestart.new.txt: mvdir storage/ndb/src/kernel/blocks/NodeRestart.txt: mvdir storage/ndb/src/kernel/blocks/Start.txt: mvdir storage/ndb/src/kernel/blocks/SystemRestart.new.txt: mvdir storage/ndb/src/kernel/blocks/SystemRestart.txt: mvdir storage/ndb/src/kernel/blocks/backup/Backup.cpp: mvdir storage/ndb/src/kernel/blocks/backup/Backup.hpp: mvdir storage/ndb/src/kernel/blocks/backup/Backup.txt: mvdir storage/ndb/src/kernel/blocks/backup/BackupFormat.hpp: mvdir storage/ndb/src/kernel/blocks/backup/BackupInit.cpp: mvdir storage/ndb/src/kernel/blocks/backup/FsBuffer.hpp: mvdir storage/ndb/src/kernel/blocks/backup/Makefile.am: mvdir storage/ndb/src/kernel/blocks/backup/read.cpp: mvdir storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: mvdir storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp: mvdir storage/ndb/src/kernel/blocks/cmvmi/Makefile.am: mvdir storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp: mvdir storage/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp: mvdir storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp: mvdir storage/ndb/src/kernel/blocks/dbacc/Makefile.am: mvdir storage/ndb/src/kernel/blocks/mutexes.hpp: mvdir storage/ndb/src/kernel/blocks/new-block.tar.gz: mvdir storage/ndb/src/kernel/main.cpp: mvdir storage/ndb/src/kernel/blocks/dbdict/CreateIndex.txt: mvdir storage/ndb/src/kernel/blocks/dbdict/CreateTable.new.txt: mvdir storage/ndb/src/kernel/blocks/dbdict/CreateTable.txt: mvdir storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp: mvdir storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp: mvdir storage/ndb/src/kernel/blocks/dbdict/Dbdict.txt: mvdir storage/ndb/src/kernel/blocks/dbdict/DropTable.txt: mvdir storage/ndb/src/kernel/blocks/dbdict/Event.txt: mvdir storage/ndb/src/kernel/blocks/dbdict/Makefile.am: mvdir storage/ndb/src/kernel/blocks/dbdict/Master_AddTable.sfl: mvdir storage/ndb/src/kernel/blocks/dbdict/SchemaFile.hpp: mvdir storage/ndb/src/kernel/blocks/dbdict/Slave_AddTable.sfl: mvdir storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp: mvdir storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp: mvdir storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp: mvdir storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: mvdir storage/ndb/src/kernel/blocks/dbdih/LCP.txt: mvdir storage/ndb/src/kernel/blocks/dbdih/Makefile.am: mvdir storage/ndb/src/kernel/blocks/dbdih/Sysfile.hpp: mvdir storage/ndb/src/kernel/blocks/dbdih/printSysfile/Makefile: mvdir storage/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp: mvdir storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp: mvdir storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp: mvdir storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: mvdir storage/ndb/src/kernel/blocks/dblqh/Makefile.am: mvdir storage/ndb/src/kernel/blocks/dblqh/redoLogReader/Makefile: mvdir storage/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp: mvdir storage/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp: mvdir storage/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp: mvdir storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp: mvdir storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp: mvdir storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: mvdir storage/ndb/src/kernel/blocks/dbtc/Makefile.am: mvdir storage/ndb/src/kernel/blocks/dbtup/AttributeOffset.hpp: mvdir storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp: mvdir storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp: mvdir storage/ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp: mvdir storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp: mvdir storage/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp: mvdir storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp: mvdir storage/ndb/src/kernel/blocks/dbtup/DbtupFixAlloc.cpp: mvdir storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp: mvdir storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp: mvdir storage/ndb/src/kernel/blocks/dbtup/DbtupLCP.cpp: mvdir storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp: mvdir storage/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp: mvdir storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp: mvdir storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp: mvdir storage/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp: mvdir storage/ndb/src/kernel/blocks/dbtup/DbtupSystemRestart.cpp: mvdir storage/ndb/src/kernel/blocks/dbtup/DbtupTabDesMan.cpp: mvdir storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp: mvdir storage/ndb/src/kernel/blocks/dbtup/DbtupUndoLog.cpp: mvdir storage/ndb/src/kernel/blocks/dbtup/Makefile.am: mvdir storage/ndb/src/kernel/blocks/dbtup/Notes.txt: mvdir storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp: mvdir storage/ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp: mvdir storage/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp: mvdir storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp: mvdir storage/ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp: mvdir storage/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp: mvdir storage/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp: mvdir storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp: mvdir storage/ndb/src/kernel/blocks/dbtux/DbtuxSearch.cpp: mvdir storage/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp: mvdir storage/ndb/src/kernel/blocks/dbtux/Makefile.am: mvdir storage/ndb/src/kernel/blocks/dbtux/Times.txt: mvdir storage/ndb/src/kernel/blocks/dbtux/tuxstatus.html: mvdir storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp: mvdir storage/ndb/src/kernel/blocks/dbutil/DbUtil.hpp: mvdir storage/ndb/src/kernel/blocks/dbutil/DbUtil.txt: mvdir storage/ndb/src/kernel/blocks/dbutil/Makefile.am: mvdir storage/ndb/src/kernel/blocks/grep/Grep.cpp: mvdir storage/ndb/src/kernel/blocks/grep/Grep.hpp: mvdir storage/ndb/src/kernel/blocks/grep/GrepInit.cpp: mvdir storage/ndb/src/kernel/blocks/grep/Makefile.am: mvdir storage/ndb/src/kernel/blocks/grep/systab_test/Makefile: mvdir storage/ndb/src/kernel/blocks/grep/systab_test/grep_systab_test.cpp: mvdir storage/ndb/src/kernel/blocks/ndbcntr/Makefile.am: mvdir storage/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp: mvdir storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp: mvdir storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp: mvdir storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrSysTable.cpp: mvdir storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp: mvdir storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp: mvdir storage/ndb/src/kernel/blocks/ndbfs/CircularIndex.cpp: mvdir storage/ndb/src/kernel/blocks/ndbfs/CircularIndex.hpp: mvdir storage/ndb/src/kernel/blocks/ndbfs/Filename.cpp: mvdir storage/ndb/src/kernel/blocks/ndbfs/Filename.hpp: mvdir storage/ndb/src/kernel/blocks/ndbfs/Makefile.am: mvdir storage/ndb/src/kernel/blocks/ndbfs/MemoryChannel.cpp: mvdir storage/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp: mvdir storage/ndb/src/kernel/blocks/ndbfs/AsyncFileTest/AsyncFileTest.cpp: mvdir storage/ndb/src/kernel/blocks/ndbfs/AsyncFileTest/Makefile: mvdir storage/ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp: mvdir storage/ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/Makefile: mvdir storage/ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/MemoryChannelTest.cpp: mvdir storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp: mvdir storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.hpp: mvdir storage/ndb/src/kernel/blocks/ndbfs/OpenFiles.hpp: mvdir storage/ndb/src/kernel/blocks/ndbfs/Pool.hpp: mvdir storage/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp: mvdir storage/ndb/src/kernel/blocks/qmgr/Makefile.am: mvdir storage/ndb/src/kernel/blocks/qmgr/Qmgr.hpp: mvdir storage/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp: mvdir storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp: mvdir storage/ndb/src/kernel/blocks/qmgr/timer.hpp: mvdir storage/ndb/src/kernel/blocks/suma/Makefile.am: mvdir storage/ndb/src/kernel/blocks/suma/Suma.cpp: mvdir storage/ndb/src/kernel/blocks/suma/Suma.hpp: mvdir storage/ndb/src/kernel/blocks/suma/Suma.txt: mvdir storage/ndb/src/kernel/blocks/suma/SumaInit.cpp: mvdir storage/ndb/src/kernel/blocks/trix/Makefile.am: mvdir storage/ndb/src/kernel/blocks/trix/Trix.cpp: mvdir storage/ndb/src/kernel/blocks/trix/Trix.hpp: mvdir storage/ndb/src/kernel/error/Error.hpp: mvdir storage/ndb/src/kernel/error/ErrorHandlingMacros.hpp: mvdir storage/ndb/src/kernel/error/ErrorMessages.cpp: mvdir storage/ndb/src/kernel/error/ErrorMessages.hpp: mvdir storage/ndb/src/kernel/error/ErrorReporter.cpp: mvdir storage/ndb/src/kernel/error/ErrorReporter.hpp: mvdir storage/ndb/src/kernel/error/Makefile.am: mvdir storage/ndb/src/kernel/error/TimeModule.cpp: mvdir storage/ndb/src/kernel/error/TimeModule.hpp: mvdir storage/ndb/src/kernel/vm/Array.hpp: mvdir storage/ndb/src/kernel/vm/ArrayFifoList.hpp: mvdir storage/ndb/src/kernel/vm/ArrayList.hpp: mvdir storage/ndb/src/kernel/vm/ArrayPool.hpp: mvdir storage/ndb/src/kernel/vm/CArray.hpp: mvdir storage/ndb/src/kernel/vm/Callback.hpp: mvdir storage/ndb/src/kernel/vm/ClusterConfiguration.cpp: mvdir storage/ndb/src/kernel/vm/ClusterConfiguration.hpp: mvdir storage/ndb/src/kernel/vm/Configuration.cpp: mvdir storage/ndb/src/kernel/vm/Configuration.hpp: mvdir storage/ndb/src/kernel/vm/DLFifoList.hpp: mvdir storage/ndb/src/kernel/vm/DLHashTable.hpp: mvdir storage/ndb/src/kernel/vm/DLHashTable2.hpp: mvdir storage/ndb/src/kernel/vm/DLList.hpp: mvdir storage/ndb/src/kernel/vm/DataBuffer.hpp: mvdir storage/ndb/src/kernel/vm/Emulator.cpp: mvdir storage/ndb/src/kernel/vm/Emulator.hpp: mvdir storage/ndb/src/kernel/vm/FastScheduler.cpp: mvdir storage/ndb/src/kernel/vm/FastScheduler.hpp: mvdir storage/ndb/src/kernel/vm/GlobalData.hpp: mvdir storage/ndb/src/kernel/vm/KeyTable.hpp: mvdir storage/ndb/src/kernel/vm/KeyTable2.hpp: mvdir storage/ndb/src/kernel/vm/LongSignal.hpp: mvdir storage/ndb/src/kernel/vm/Makefile.am: mvdir storage/ndb/src/kernel/vm/MetaData.cpp: mvdir storage/ndb/src/kernel/vm/MetaData.hpp: mvdir storage/ndb/src/kernel/vm/Mutex.cpp: mvdir storage/ndb/src/kernel/vm/Mutex.hpp: mvdir storage/ndb/src/kernel/vm/Prio.hpp: mvdir storage/ndb/src/kernel/vm/RequestTracker.hpp: mvdir storage/ndb/src/kernel/vm/SLList.hpp: mvdir storage/ndb/src/kernel/vm/SafeCounter.cpp: mvdir storage/ndb/src/kernel/vm/SafeCounter.hpp: mvdir storage/ndb/src/kernel/vm/SectionReader.cpp: mvdir storage/ndb/src/kernel/vm/SectionReader.hpp: mvdir storage/ndb/src/kernel/vm/SignalCounter.hpp: mvdir storage/ndb/src/kernel/vm/SimBlockList.hpp: mvdir storage/ndb/src/kernel/vm/SimplePropertiesSection.cpp: mvdir storage/ndb/src/kernel/vm/SimulatedBlock.cpp: mvdir storage/ndb/src/kernel/vm/SimulatedBlock.hpp: mvdir storage/ndb/src/kernel/vm/ThreadConfig.cpp: mvdir storage/ndb/src/kernel/vm/ThreadConfig.hpp: mvdir storage/ndb/src/kernel/vm/TimeQueue.cpp: mvdir storage/ndb/src/kernel/vm/TimeQueue.hpp: mvdir storage/ndb/src/kernel/vm/TransporterCallback.cpp: mvdir storage/ndb/src/kernel/vm/VMSignal.cpp: mvdir storage/ndb/src/kernel/vm/VMSignal.hpp: mvdir storage/ndb/src/kernel/vm/WaitQueue.hpp: mvdir storage/ndb/src/kernel/vm/WatchDog.cpp: mvdir storage/ndb/src/kernel/vm/WatchDog.hpp: mvdir storage/ndb/src/kernel/vm/al_test/Makefile: mvdir storage/ndb/src/kernel/vm/al_test/arrayListTest.cpp: mvdir storage/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp: mvdir storage/ndb/src/kernel/vm/al_test/main.cpp: mvdir storage/ndb/src/kernel/vm/pc.hpp: mvdir storage/ndb/src/kernel/vm/testCopy/Makefile: mvdir storage/ndb/src/kernel/vm/testCopy/rr.cpp: mvdir storage/ndb/src/kernel/vm/testCopy/testCopy.cpp: mvdir storage/ndb/src/kernel/vm/testDataBuffer/Makefile: mvdir storage/ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp: mvdir storage/ndb/src/kernel/vm/testLongSig/Makefile: mvdir storage/ndb/src/kernel/vm/testLongSig/testLongSig.cpp: mvdir storage/ndb/src/kernel/vm/testSimplePropertiesSection/Makefile: mvdir storage/ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp: mvdir storage/ndb/src/mgmapi/LocalConfig.cpp: mvdir storage/ndb/src/mgmapi/LocalConfig.hpp: mvdir storage/ndb/src/mgmapi/Makefile.am: mvdir storage/ndb/src/mgmapi/mgmapi.cpp: mvdir storage/ndb/src/mgmapi/mgmapi_configuration.cpp: mvdir storage/ndb/src/mgmapi/mgmapi_configuration.hpp: mvdir storage/ndb/src/mgmapi/mgmapi_internal.h: mvdir storage/ndb/src/mgmapi/ndb_logevent.cpp: mvdir storage/ndb/src/mgmapi/ndb_logevent.hpp: mvdir storage/ndb/src/mgmapi/test/Makefile: mvdir storage/ndb/src/mgmapi/test/keso.c: mvdir storage/ndb/src/mgmapi/test/mgmSrvApi.cpp: mvdir storage/ndb/src/mgmclient/CommandInterpreter.cpp: mvdir storage/ndb/src/mgmclient/Makefile.am: mvdir storage/ndb/src/mgmclient/main.cpp: mvdir storage/ndb/src/mgmclient/ndb_mgmclient.hpp: mvdir storage/ndb/src/mgmclient/ndb_mgmclient.h: mvdir storage/ndb/src/mgmclient/test_cpcd/Makefile: mvdir storage/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp: mvdir storage/ndb/src/mgmsrv/Config.cpp: mvdir storage/ndb/src/mgmsrv/Config.hpp: mvdir storage/ndb/src/mgmsrv/ConfigInfo.cpp: mvdir storage/ndb/src/mgmsrv/ConfigInfo.hpp: mvdir storage/ndb/src/mgmsrv/InitConfigFileParser.cpp: mvdir storage/ndb/src/mgmsrv/InitConfigFileParser.hpp: mvdir storage/ndb/src/mgmsrv/Makefile.am: mvdir storage/ndb/src/mgmsrv/MgmtSrvr.cpp: mvdir storage/ndb/src/mgmsrv/MgmtSrvr.hpp: mvdir storage/ndb/src/mgmsrv/MgmtSrvrConfig.cpp: mvdir storage/ndb/src/mgmsrv/MgmtSrvrGeneralSignalHandling.cpp: mvdir storage/ndb/src/mgmsrv/Services.cpp: mvdir storage/ndb/src/mgmsrv/Services.hpp: mvdir storage/ndb/src/mgmsrv/SignalQueue.cpp: mvdir storage/ndb/src/mgmsrv/SignalQueue.hpp: mvdir storage/ndb/src/mgmsrv/convertStrToInt.cpp: mvdir storage/ndb/src/mgmsrv/convertStrToInt.hpp: mvdir storage/ndb/src/mgmsrv/main.cpp: mvdir storage/ndb/src/mgmsrv/mkconfig/Makefile: mvdir storage/ndb/src/mgmsrv/mkconfig/mkconfig.cpp: mvdir storage/ndb/src/ndbapi/API.hpp: mvdir storage/ndb/src/ndbapi/ClusterMgr.cpp: mvdir storage/ndb/src/ndbapi/ClusterMgr.hpp: mvdir storage/ndb/src/ndbapi/DictCache.cpp: mvdir storage/ndb/src/ndbapi/DictCache.hpp: mvdir storage/ndb/src/ndbapi/Makefile.am: mvdir storage/ndb/src/ndbapi/Ndb.cpp: mvdir storage/ndb/src/ndbapi/NdbApiSignal.cpp: mvdir storage/ndb/src/ndbapi/NdbApiSignal.hpp: mvdir storage/ndb/src/ndbapi/NdbBlob.cpp: mvdir storage/ndb/src/ndbapi/NdbBlobImpl.hpp: mvdir storage/ndb/src/ndbapi/NdbDictionary.cpp: mvdir storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp: mvdir storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp: mvdir storage/ndb/src/ndbapi/NdbErrorOut.cpp: mvdir storage/ndb/src/ndbapi/NdbEventOperation.cpp: mvdir storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp: mvdir storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp: mvdir storage/ndb/src/ndbapi/NdbImpl.hpp: mvdir storage/ndb/src/ndbapi/NdbIndexOperation.cpp: mvdir storage/ndb/src/ndbapi/NdbLinHash.hpp: mvdir storage/ndb/src/ndbapi/NdbOperation.cpp: mvdir storage/ndb/src/ndbapi/NdbOperationDefine.cpp: mvdir storage/ndb/src/ndbapi/NdbOperationExec.cpp: mvdir storage/ndb/src/ndbapi/NdbOperationInt.cpp: mvdir storage/ndb/src/ndbapi/NdbOperationScan.cpp: mvdir storage/ndb/src/ndbapi/NdbOperationSearch.cpp: mvdir storage/ndb/src/ndbapi/NdbPool.cpp: mvdir storage/ndb/src/ndbapi/NdbPoolImpl.cpp: mvdir storage/ndb/src/ndbapi/NdbPoolImpl.hpp: mvdir storage/ndb/src/ndbapi/NdbRecAttr.cpp: mvdir storage/ndb/src/ndbapi/NdbReceiver.cpp: mvdir storage/ndb/src/ndbapi/NdbScanFilter.cpp: mvdir storage/ndb/src/ndbapi/NdbScanOperation.cpp: mvdir storage/ndb/src/ndbapi/NdbTransaction.cpp: mvdir storage/ndb/src/ndbapi/NdbTransactionScan.cpp: mvdir storage/ndb/src/ndbapi/NdbUtil.cpp: mvdir storage/ndb/src/ndbapi/NdbUtil.hpp: mvdir storage/ndb/src/ndbapi/NdbWaiter.hpp: mvdir storage/ndb/src/ndbapi/Ndberr.cpp: mvdir storage/ndb/src/ndbapi/Ndbif.cpp: mvdir storage/ndb/src/ndbapi/Ndbinit.cpp: mvdir storage/ndb/src/ndbapi/Ndblist.cpp: mvdir storage/ndb/src/ndbapi/ObjectMap.hpp: mvdir storage/ndb/src/ndbapi/ScanOperation.txt: mvdir storage/ndb/src/ndbapi/TransporterFacade.cpp: mvdir storage/ndb/src/ndbapi/TransporterFacade.hpp: mvdir storage/ndb/src/ndbapi/ndb_cluster_connection.cpp: mvdir storage/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp: mvdir storage/ndb/src/ndbapi/ndberror.c: mvdir storage/ndb/src/ndbapi/signal-sender/Makefile: mvdir storage/ndb/src/ndbapi/signal-sender/SignalSender.cpp: mvdir storage/ndb/src/ndbapi/signal-sender/SignalSender.hpp: mvdir storage/ndb/src/old_files/client/Makefile: mvdir storage/ndb/src/old_files/client/odbc/Extra.mk: mvdir storage/ndb/src/old_files/client/odbc/Makefile: mvdir storage/ndb/src/old_files/client/odbc/NdbOdbc.cpp: mvdir storage/ndb/src/old_files/client/odbc/NdbOdbc.def: mvdir storage/ndb/src/old_files/client/odbc/codegen/CodeGen.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/CodeGen.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_base.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_base.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_column.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_column.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_comp_op.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_comp_op.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_create_index.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_create_index.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_create_row.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_create_row.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_create_table.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_create_table.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_data_type.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_data_type.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_ddl.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_ddl.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_ddl_column.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_ddl_column.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_ddl_constr.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_ddl_constr.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_ddl_row.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_ddl_row.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_delete.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_delete.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_delete_index.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_delete_index.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_delete_lookup.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_delete_lookup.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_delete_scan.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_delete_scan.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_dml.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_dml.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_dml_column.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_dml_column.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_dml_row.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_dml_row.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_drop_index.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_drop_index.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_drop_table.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_drop_table.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_expr.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_expr.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_expr_column.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_expr_column.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_expr_const.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_expr_const.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_expr_conv.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_expr_conv.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_expr_func.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_expr_func.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_expr_op.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_expr_op.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_expr_param.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_expr_param.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_expr_row.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_expr_row.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_idx_column.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_idx_column.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_insert.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_insert.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_pred.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_pred.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_pred_op.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_pred_op.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_count.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_count.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_distinct.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_distinct.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_filter.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_filter.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_group.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_group.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_index.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_index.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_join.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_join.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_lookup.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_lookup.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_project.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_project.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_range.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_range.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_repeat.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_repeat.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_scan.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_scan.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_sort.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_sort.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_sys.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_query_sys.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_root.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_root.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_select.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_select.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_set_row.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_set_row.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_stmt.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_stmt.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_table.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_table.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_table_list.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_table_list.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_update.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_update.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_update_index.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_update_index.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_update_lookup.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_update_lookup.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_update_scan.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Code_update_scan.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/Makefile: mvdir storage/ndb/src/old_files/client/odbc/codegen/SimpleGram.ypp: mvdir storage/ndb/src/old_files/client/odbc/codegen/SimpleParser.cpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/SimpleParser.hpp: mvdir storage/ndb/src/old_files/client/odbc/codegen/SimpleScan.lpp: mvdir storage/ndb/src/old_files/client/odbc/common/AttrArea.cpp: mvdir storage/ndb/src/old_files/client/odbc/common/AttrArea.hpp: mvdir storage/ndb/src/old_files/client/odbc/common/CodeTree.cpp: mvdir storage/ndb/src/old_files/client/odbc/common/CodeTree.hpp: mvdir storage/ndb/src/old_files/client/odbc/common/ConnArea.cpp: mvdir storage/ndb/src/old_files/client/odbc/common/ConnArea.hpp: mvdir storage/ndb/src/old_files/client/odbc/common/Ctx.cpp: mvdir storage/ndb/src/old_files/client/odbc/common/Ctx.hpp: mvdir storage/ndb/src/old_files/client/odbc/common/DataField.cpp: mvdir storage/ndb/src/old_files/client/odbc/common/DataField.hpp: mvdir storage/ndb/src/old_files/client/odbc/common/DataRow.cpp: mvdir storage/ndb/src/old_files/client/odbc/common/DataRow.hpp: mvdir storage/ndb/src/old_files/client/odbc/common/DataType.cpp: mvdir storage/ndb/src/old_files/client/odbc/common/DataType.hpp: mvdir storage/ndb/src/old_files/client/odbc/common/DescArea.cpp: mvdir storage/ndb/src/old_files/client/odbc/common/DescArea.hpp: mvdir storage/ndb/src/old_files/client/odbc/common/DiagArea.cpp: mvdir storage/ndb/src/old_files/client/odbc/common/DiagArea.hpp: mvdir storage/ndb/src/old_files/client/odbc/common/Makefile: mvdir storage/ndb/src/old_files/client/odbc/common/OdbcData.cpp: mvdir storage/ndb/src/old_files/client/odbc/common/OdbcData.hpp: mvdir storage/ndb/src/old_files/client/odbc/common/ResultArea.cpp: mvdir storage/ndb/src/old_files/client/odbc/common/ResultArea.hpp: mvdir storage/ndb/src/old_files/client/odbc/common/Sqlstate.cpp: mvdir storage/ndb/src/old_files/client/odbc/common/Sqlstate.hpp: mvdir storage/ndb/src/old_files/client/odbc/common/StmtArea.cpp: mvdir storage/ndb/src/old_files/client/odbc/common/StmtArea.hpp: mvdir storage/ndb/src/old_files/client/odbc/common/StmtInfo.cpp: mvdir storage/ndb/src/old_files/client/odbc/common/StmtInfo.hpp: mvdir storage/ndb/src/old_files/client/odbc/common/common.cpp: mvdir storage/ndb/src/old_files/client/odbc/common/common.hpp: mvdir storage/ndb/src/old_files/client/odbc/dictionary/DictCatalog.cpp: mvdir storage/ndb/src/old_files/client/odbc/dictionary/DictCatalog.hpp: mvdir storage/ndb/src/old_files/client/odbc/dictionary/DictColumn.cpp: mvdir storage/ndb/src/old_files/client/odbc/dictionary/DictColumn.hpp: mvdir storage/ndb/src/old_files/client/odbc/dictionary/DictIndex.cpp: mvdir storage/ndb/src/old_files/client/odbc/dictionary/DictIndex.hpp: mvdir storage/ndb/src/old_files/client/odbc/dictionary/DictSchema.cpp: mvdir storage/ndb/src/old_files/client/odbc/dictionary/DictSchema.hpp: mvdir storage/ndb/src/old_files/client/odbc/dictionary/DictSys.cpp: mvdir storage/ndb/src/old_files/client/odbc/dictionary/DictSys.hpp: mvdir storage/ndb/src/old_files/client/odbc/dictionary/DictTable.cpp: mvdir storage/ndb/src/old_files/client/odbc/dictionary/DictTable.hpp: mvdir storage/ndb/src/old_files/client/odbc/dictionary/Makefile: mvdir storage/ndb/src/old_files/client/odbc/docs/class.fig: mvdir storage/ndb/src/old_files/client/odbc/docs/descfield.pl: mvdir storage/ndb/src/old_files/client/odbc/docs/diag.txt: mvdir storage/ndb/src/old_files/client/odbc/docs/getinfo.pl: mvdir storage/ndb/src/old_files/client/odbc/docs/gettypeinfo.pl: mvdir storage/ndb/src/old_files/client/odbc/docs/handleattr.pl: mvdir storage/ndb/src/old_files/client/odbc/docs/main.hpp: mvdir storage/ndb/src/old_files/client/odbc/docs/ndbodbc.html: mvdir storage/ndb/src/old_files/client/odbc/docs/select.fig: mvdir storage/ndb/src/old_files/client/odbc/docs/systables.pl: mvdir storage/ndb/src/old_files/client/odbc/docs/type.txt: mvdir storage/ndb/src/old_files/client/odbc/driver/Func.data: mvdir storage/ndb/src/old_files/client/odbc/driver/Func.pl: mvdir storage/ndb/src/old_files/client/odbc/driver/Makefile: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLAllocConnect.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLAllocEnv.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLAllocHandle.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLAllocHandleStd.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLAllocStmt.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLBindCol.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLBindParam.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLBindParameter.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLBrowseConnect.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLBulkOperations.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLCancel.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLCloseCursor.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLColAttribute.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLColAttributes.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLColumnPrivileges.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLColumns.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLConnect.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLCopyDesc.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLDataSources.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLDescribeCol.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLDescribeParam.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLDisconnect.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLDriverConnect.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLDrivers.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLEndTran.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLError.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLExecDirect.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLExecute.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLExtendedFetch.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLFetch.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLFetchScroll.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLForeignKeys.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLFreeConnect.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLFreeEnv.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLFreeHandle.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLFreeStmt.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLGetConnectAttr.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLGetConnectOption.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLGetCursorName.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLGetData.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLGetDescField.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLGetDescRec.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLGetDiagField.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLGetDiagRec.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLGetEnvAttr.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLGetFunctions.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLGetInfo.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLGetStmtAttr.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLGetStmtOption.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLGetTypeInfo.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLMoreResults.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLNativeSql.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLNumParams.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLNumResultCols.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLParamData.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLParamOptions.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLPrepare.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLPrimaryKeys.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLProcedureColumns.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLProcedures.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLPutData.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLRowCount.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLSetConnectAttr.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLSetConnectOption.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLSetCursorName.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLSetDescField.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLSetDescRec.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLSetEnvAttr.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLSetParam.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLSetPos.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLSetScrollOptions.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLSetStmtAttr.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLSetStmtOption.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLSpecialColumns.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLStatistics.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLTablePrivileges.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLTables.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/SQLTransact.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/driver.cpp: mvdir storage/ndb/src/old_files/client/odbc/driver/driver.hpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Exec_comp_op.cpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Exec_create_index.cpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Exec_create_table.cpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Exec_delete_index.cpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Exec_delete_lookup.cpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Exec_delete_scan.cpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Exec_drop_index.cpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Exec_drop_table.cpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Exec_expr_conv.cpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Exec_expr_func.cpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Exec_expr_op.cpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Exec_insert.cpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Exec_pred_op.cpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Exec_query_index.cpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Exec_query_lookup.cpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Exec_query_range.cpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Exec_query_scan.cpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Exec_query_sys.cpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Exec_update_index.cpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Exec_update_lookup.cpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Exec_update_scan.cpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Executor.cpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Executor.hpp: mvdir storage/ndb/src/old_files/client/odbc/executor/Makefile: mvdir storage/ndb/src/old_files/client/odbc/handles/AttrDbc.cpp: mvdir storage/ndb/src/old_files/client/odbc/handles/AttrEnv.cpp: mvdir storage/ndb/src/old_files/client/odbc/handles/AttrRoot.cpp: mvdir storage/ndb/src/old_files/client/odbc/handles/AttrStmt.cpp: mvdir storage/ndb/src/old_files/client/odbc/handles/DescSpec.cpp: mvdir storage/ndb/src/old_files/client/odbc/handles/FuncTab.cpp: mvdir storage/ndb/src/old_files/client/odbc/handles/HandleBase.cpp: mvdir storage/ndb/src/old_files/client/odbc/handles/HandleBase.hpp: mvdir storage/ndb/src/old_files/client/odbc/handles/HandleDbc.cpp: mvdir storage/ndb/src/old_files/client/odbc/handles/HandleDbc.hpp: mvdir storage/ndb/src/old_files/client/odbc/handles/HandleDesc.cpp: mvdir storage/ndb/src/old_files/client/odbc/handles/HandleDesc.hpp: mvdir storage/ndb/src/old_files/client/odbc/handles/HandleEnv.cpp: mvdir storage/ndb/src/old_files/client/odbc/handles/HandleEnv.hpp: mvdir storage/ndb/src/old_files/client/odbc/handles/HandleRoot.cpp: mvdir storage/ndb/src/old_files/client/odbc/handles/HandleRoot.hpp: mvdir storage/ndb/src/old_files/client/odbc/handles/HandleStmt.cpp: mvdir storage/ndb/src/old_files/client/odbc/handles/HandleStmt.hpp: mvdir storage/ndb/src/old_files/client/odbc/handles/InfoTab.cpp: mvdir storage/ndb/src/old_files/client/odbc/handles/Makefile: mvdir storage/ndb/src/old_files/client/odbc/handles/PoolNdb.cpp: mvdir storage/ndb/src/old_files/client/odbc/handles/PoolNdb.hpp: mvdir storage/ndb/src/old_files/client/odbc/handles/handles.hpp: mvdir storage/ndb/src/old_files/ndbbaseclient/Makefile: mvdir storage/ndb/src/old_files/ndbbaseclient/ndbbaseclient_dummy.cpp: mvdir storage/ndb/src/old_files/ndbclient/Makefile: mvdir storage/ndb/src/old_files/ndbclient/ndbclient_dummy.cpp: mvdir storage/ndb/src/old_files/newtonapi/Makefile: mvdir storage/ndb/src/old_files/newtonapi/dba_binding.cpp: mvdir storage/ndb/src/old_files/newtonapi/dba_bulkread.cpp: mvdir storage/ndb/src/old_files/newtonapi/dba_config.cpp: mvdir storage/ndb/src/old_files/newtonapi/dba_dac.cpp: mvdir storage/ndb/src/old_files/newtonapi/dba_error.cpp: mvdir storage/ndb/src/old_files/newtonapi/dba_init.cpp: mvdir storage/ndb/src/old_files/newtonapi/dba_internal.hpp: mvdir storage/ndb/src/old_files/newtonapi/dba_process.cpp: mvdir storage/ndb/src/old_files/newtonapi/dba_process.hpp: mvdir storage/ndb/src/old_files/newtonapi/dba_schema.cpp: mvdir storage/ndb/src/old_files/rep/ExtSender.cpp: mvdir storage/ndb/src/old_files/rep/ExtSender.hpp: mvdir storage/ndb/src/old_files/rep/Makefile: mvdir storage/ndb/src/old_files/rep/NodeConnectInfo.hpp: mvdir storage/ndb/src/old_files/rep/README: mvdir storage/ndb/src/old_files/rep/RepApiInterpreter.cpp: mvdir storage/ndb/src/old_files/rep/RepApiInterpreter.hpp: mvdir storage/ndb/src/old_files/rep/RepApiService.cpp: mvdir storage/ndb/src/old_files/rep/RepApiService.hpp: mvdir storage/ndb/src/old_files/rep/RepCommandInterpreter.cpp: mvdir storage/ndb/src/old_files/rep/RepCommandInterpreter.hpp: mvdir storage/ndb/src/old_files/rep/RepComponents.cpp: mvdir storage/ndb/src/old_files/rep/RepComponents.hpp: mvdir storage/ndb/src/old_files/rep/RepMain.cpp: mvdir storage/ndb/src/old_files/rep/Requestor.cpp: mvdir storage/ndb/src/old_files/rep/Requestor.hpp: mvdir storage/ndb/src/old_files/rep/RequestorSubscriptions.cpp: mvdir storage/ndb/src/old_files/rep/SignalQueue.cpp: mvdir storage/ndb/src/old_files/rep/SignalQueue.hpp: mvdir storage/ndb/src/old_files/rep/TODO: mvdir storage/ndb/src/old_files/rep/adapters/AppNDB.cpp: mvdir storage/ndb/src/old_files/rep/adapters/AppNDB.hpp: mvdir storage/ndb/src/old_files/rep/adapters/ExtAPI.cpp: mvdir storage/ndb/src/old_files/rep/adapters/ExtAPI.hpp: mvdir storage/ndb/src/old_files/rep/adapters/ExtNDB.cpp: mvdir storage/ndb/src/old_files/rep/adapters/ExtNDB.hpp: mvdir storage/ndb/src/old_files/rep/adapters/Makefile: mvdir storage/ndb/src/old_files/rep/adapters/TableInfoPs.hpp: mvdir storage/ndb/src/old_files/rep/dbug_hack.cpp: mvdir storage/ndb/src/old_files/rep/rep_version.hpp: mvdir storage/ndb/src/old_files/rep/repapi/Makefile: mvdir storage/ndb/src/old_files/rep/repapi/repapi.cpp: mvdir storage/ndb/src/old_files/rep/repapi/repapi.h: mvdir storage/ndb/src/old_files/rep/state/Channel.cpp: mvdir storage/ndb/src/old_files/rep/state/Channel.hpp: mvdir storage/ndb/src/old_files/rep/state/Interval.cpp: mvdir storage/ndb/src/old_files/rep/state/Interval.hpp: mvdir storage/ndb/src/old_files/rep/state/Makefile: mvdir storage/ndb/src/old_files/rep/state/RepState.cpp: mvdir storage/ndb/src/old_files/rep/state/RepState.hpp: mvdir storage/ndb/src/old_files/rep/state/RepStateEvent.cpp: mvdir storage/ndb/src/old_files/rep/state/RepStateRequests.cpp: mvdir storage/ndb/src/old_files/rep/state/testInterval/Makefile: mvdir storage/ndb/src/old_files/rep/state/testInterval/testInterval.cpp: mvdir storage/ndb/src/old_files/rep/state/testRepState/Makefile: mvdir storage/ndb/src/old_files/rep/state/testRepState/testRequestor.cpp: mvdir storage/ndb/src/old_files/rep/state/testRepState/testRequestor.hpp: mvdir storage/ndb/src/old_files/rep/storage/GCIBuffer.cpp: mvdir storage/ndb/src/old_files/rep/storage/GCIBuffer.hpp: mvdir storage/ndb/src/old_files/rep/storage/GCIContainer.cpp: mvdir storage/ndb/src/old_files/rep/storage/GCIContainer.hpp: mvdir storage/ndb/src/old_files/rep/storage/GCIContainerPS.cpp: mvdir storage/ndb/src/old_files/rep/storage/GCIContainerPS.hpp: mvdir storage/ndb/src/old_files/rep/storage/GCIPage.cpp: mvdir storage/ndb/src/old_files/rep/storage/GCIPage.hpp: mvdir storage/ndb/src/old_files/rep/storage/LogRecord.hpp: mvdir storage/ndb/src/old_files/rep/storage/Makefile: mvdir storage/ndb/src/old_files/rep/storage/NodeConnectInfo.hpp: mvdir storage/ndb/src/old_files/rep/storage/NodeGroup.cpp: mvdir storage/ndb/src/old_files/rep/storage/NodeGroup.hpp: mvdir storage/ndb/src/old_files/rep/storage/NodeGroupInfo.cpp: mvdir storage/ndb/src/old_files/rep/storage/NodeGroupInfo.hpp: mvdir storage/ndb/src/old_files/rep/transfer/Makefile: mvdir storage/ndb/src/old_files/rep/transfer/TransPS.cpp: mvdir storage/ndb/src/old_files/rep/transfer/TransPS.hpp: mvdir storage/ndb/src/old_files/rep/transfer/TransSS.cpp: mvdir storage/ndb/src/old_files/rep/transfer/TransSS.hpp: mvdir storage/ndb/src/old_files/rep/transfer/TransSSSubscriptions.cpp: mvdir storage/ndb/test/Makefile.am: mvdir storage/ndb/test/include/CpcClient.hpp: mvdir storage/ndb/test/include/HugoAsynchTransactions.hpp: mvdir storage/ndb/test/include/HugoCalculator.hpp: mvdir storage/ndb/test/include/HugoOperations.hpp: mvdir storage/ndb/test/include/HugoTransactions.hpp: mvdir storage/ndb/test/include/NDBT.hpp: mvdir storage/ndb/test/include/NDBT_DataSet.hpp: mvdir storage/ndb/test/include/NDBT_DataSetTransaction.hpp: mvdir storage/ndb/test/include/NDBT_Error.hpp: mvdir storage/ndb/test/include/NDBT_Output.hpp: mvdir storage/ndb/test/include/NDBT_ResultRow.hpp: mvdir storage/ndb/test/include/NDBT_ReturnCodes.h: mvdir storage/ndb/test/include/NDBT_Stats.hpp: mvdir storage/ndb/test/include/NDBT_Table.hpp: mvdir storage/ndb/test/include/NDBT_Tables.hpp: mvdir storage/ndb/test/include/NDBT_Test.hpp: mvdir storage/ndb/test/include/NdbBackup.hpp: mvdir storage/ndb/test/include/NdbConfig.hpp: mvdir storage/ndb/test/include/NdbGrep.hpp: mvdir storage/ndb/test/include/NdbRestarter.hpp: mvdir storage/ndb/test/include/NdbRestarts.hpp: mvdir storage/ndb/test/include/NdbSchemaCon.hpp: mvdir storage/ndb/test/include/NdbSchemaOp.hpp: mvdir storage/ndb/test/include/NdbTest.hpp: mvdir storage/ndb/test/include/NdbTimer.hpp: mvdir storage/ndb/test/include/TestNdbEventOperation.hpp: mvdir storage/ndb/test/include/UtilTransactions.hpp: mvdir storage/ndb/test/include/getarg.h: mvdir storage/ndb/test/ndbapi/InsertRecs.cpp: mvdir storage/ndb/test/ndbapi/Makefile.am: mvdir storage/ndb/test/ndbapi/ScanFilter.hpp: mvdir storage/ndb/test/ndbapi/ScanFunctions.hpp: mvdir storage/ndb/test/ndbapi/ScanInterpretTest.hpp: mvdir storage/ndb/test/ndbapi/TraceNdbApi.cpp: mvdir storage/ndb/test/ndbapi/VerifyNdbApi.cpp: mvdir storage/ndb/test/ndbapi/acid.cpp: mvdir storage/ndb/test/ndbapi/acid2.cpp: mvdir storage/ndb/test/ndbapi/adoInsertRecs.cpp: mvdir storage/ndb/test/ndbapi/asyncGenerator.cpp: mvdir storage/ndb/test/ndbapi/benchronja.cpp: mvdir storage/ndb/test/ndbapi/bulk_copy.cpp: mvdir storage/ndb/test/ndbapi/cdrserver.cpp: mvdir storage/ndb/test/ndbapi/celloDb.cpp: mvdir storage/ndb/test/ndbapi/create_all_tabs.cpp: mvdir storage/ndb/test/ndbapi/create_tab.cpp: mvdir storage/ndb/test/ndbapi/drop_all_tabs.cpp: mvdir storage/ndb/test/ndbapi/flexAsynch.cpp: mvdir storage/ndb/test/ndbapi/flexBench.cpp: mvdir storage/ndb/test/ndbapi/flexHammer.cpp: mvdir storage/ndb/test/ndbapi/flexScan.cpp: mvdir storage/ndb/test/ndbapi/flexTT.cpp: mvdir storage/ndb/test/ndbapi/flexTimedAsynch.cpp: mvdir storage/ndb/test/ndbapi/flex_bench_mysql.cpp: mvdir storage/ndb/test/ndbapi/index.cpp: mvdir storage/ndb/test/ndbapi/index2.cpp: mvdir storage/ndb/test/ndbapi/initronja.cpp: mvdir storage/ndb/test/ndbapi/interpreterInTup.cpp: mvdir storage/ndb/test/ndbapi/mainAsyncGenerator.cpp: mvdir storage/ndb/test/ndbapi/msa.cpp: mvdir storage/ndb/test/ndbapi/ndb_async1.cpp: mvdir storage/ndb/test/ndbapi/ndb_async2.cpp: mvdir storage/ndb/test/ndbapi/ndb_user_populate.cpp: mvdir storage/ndb/test/ndbapi/ndb_user_transaction.cpp: mvdir storage/ndb/test/ndbapi/ndb_user_transaction2.cpp: mvdir storage/ndb/test/ndbapi/ndb_user_transaction3.cpp: mvdir storage/ndb/test/ndbapi/ndb_user_transaction4.cpp: mvdir storage/ndb/test/ndbapi/ndb_user_transaction5.cpp: mvdir storage/ndb/test/ndbapi/ndb_user_transaction6.cpp: mvdir storage/ndb/test/ndbapi/restarter.cpp: mvdir storage/ndb/test/ndbapi/restarter2.cpp: mvdir storage/ndb/test/ndbapi/restarts.cpp: mvdir storage/ndb/test/ndbapi/size.cpp: mvdir storage/ndb/test/ndbapi/slow_select.cpp: mvdir storage/ndb/test/ndbapi/testBackup.cpp: mvdir storage/ndb/test/ndbapi/testBasic.cpp: mvdir storage/ndb/test/ndbapi/testBasicAsynch.cpp: mvdir storage/ndb/test/ndbapi/testBitfield.cpp: mvdir storage/ndb/test/ndbapi/testBlobs.cpp: mvdir storage/ndb/test/ndbapi/testDataBuffers.cpp: mvdir storage/ndb/test/ndbapi/testDeadlock.cpp: mvdir storage/ndb/test/ndbapi/testDict.cpp: mvdir storage/ndb/test/ndbapi/testGrep.cpp: mvdir storage/ndb/test/ndbapi/testGrepVerify.cpp: mvdir storage/ndb/test/ndbapi/testIndex.cpp: mvdir storage/ndb/test/ndbapi/testInterpreter.cpp: mvdir storage/ndb/test/ndbapi/testLcp.cpp: mvdir storage/ndb/test/ndbapi/testMgm.cpp: mvdir storage/ndb/test/ndbapi/testNdbApi.cpp: mvdir storage/ndb/test/ndbapi/testNodeRestart.cpp: mvdir storage/ndb/test/ndbapi/testOIBasic.cpp: mvdir storage/ndb/test/ndbapi/testOperations.cpp: mvdir storage/ndb/test/ndbapi/testOrderedIndex.cpp: mvdir storage/ndb/test/ndbapi/testPartitioning.cpp: mvdir storage/ndb/test/ndbapi/testReadPerf.cpp: mvdir storage/ndb/test/ndbapi/testRestartGci.cpp: mvdir storage/ndb/test/ndbapi/bank/Bank.cpp: mvdir storage/ndb/test/ndbapi/bank/Bank.hpp: mvdir storage/ndb/test/ndbapi/bank/BankLoad.cpp: mvdir storage/ndb/test/ndbapi/bank/Makefile.am: mvdir storage/ndb/test/ndbapi/bank/bankCreator.cpp: mvdir storage/ndb/test/ndbapi/bank/bankMakeGL.cpp: mvdir storage/ndb/test/ndbapi/bank/bankSumAccounts.cpp: mvdir storage/ndb/test/ndbapi/bank/bankTimer.cpp: mvdir storage/ndb/test/ndbapi/bank/bankTransactionMaker.cpp: mvdir storage/ndb/test/ndbapi/bank/bankValidateAllGLs.cpp: mvdir storage/ndb/test/ndbapi/bank/testBank.cpp: mvdir storage/ndb/test/ndbapi/bench/asyncGenerator.cpp: mvdir storage/ndb/test/ndbapi/bench/dbGenerator.h: mvdir storage/ndb/test/ndbapi/bench/dbPopulate.cpp: mvdir storage/ndb/test/ndbapi/bench/dbPopulate.h: mvdir storage/ndb/test/ndbapi/bench/macros.h: mvdir storage/ndb/test/ndbapi/bench/mainAsyncGenerator.cpp: mvdir storage/ndb/test/ndbapi/bench/mainPopulate.cpp: mvdir storage/ndb/test/ndbapi/bench/ndb_async1.cpp: mvdir storage/ndb/test/ndbapi/bench/ndb_async2.cpp: mvdir storage/ndb/test/ndbapi/bench/ndb_error.hpp: mvdir storage/ndb/test/ndbapi/bench/ndb_schema.hpp: mvdir storage/ndb/test/ndbapi/bench/ndb_user_transaction.cpp: mvdir storage/ndb/test/ndbapi/bench/ndb_user_transaction2.cpp: mvdir storage/ndb/test/ndbapi/bench/ndb_user_transaction3.cpp: mvdir storage/ndb/test/ndbapi/bench/ndb_user_transaction4.cpp: mvdir storage/ndb/test/ndbapi/bench/ndb_user_transaction5.cpp: mvdir storage/ndb/test/ndbapi/testScan.cpp: mvdir storage/ndb/test/ndbapi/testScanInterpreter.cpp: mvdir storage/ndb/test/ndbapi/testScanPerf.cpp: mvdir storage/ndb/test/ndbapi/testSystemRestart.cpp: mvdir storage/ndb/test/ndbapi/testTimeout.cpp: mvdir storage/ndb/test/ndbapi/testTransactions.cpp: mvdir storage/ndb/test/ndbapi/test_event.cpp: mvdir storage/ndb/test/ndbapi/test_event_multi_table.cpp: mvdir storage/ndb/test/ndbapi/userInterface.cpp: mvdir storage/ndb/test/ndbapi/bench/ndb_user_transaction6.cpp: mvdir storage/ndb/test/ndbapi/bench/testData.h: mvdir storage/ndb/test/ndbapi/bench/testDefinitions.h: mvdir storage/ndb/test/ndbapi/bench/userInterface.cpp: mvdir storage/ndb/test/ndbapi/bench/userInterface.h: mvdir storage/ndb/test/ndbapi/old_dirs/acid/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/acid2/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/acid2/TraceNdbApi.hpp: mvdir storage/ndb/test/ndbapi/old_dirs/acid2/VerifyNdbApi.hpp: mvdir storage/ndb/test/ndbapi/old_dirs/basicAsynch/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/bulk_copy/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/create_all_tabs/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/create_tab/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/drop_all_tabs/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/flexAsynch/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/flexBench/Makefile.am: mvdir storage/ndb/test/ndbapi/old_dirs/flexBench/ndbplot.pl: mvdir storage/ndb/test/ndbapi/old_dirs/flexHammer/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/flexHammer/README: mvdir storage/ndb/test/ndbapi/old_dirs/flexScan/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/flexScan/README: mvdir storage/ndb/test/ndbapi/old_dirs/flexTT/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/flexTimedAsynch/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/flex_bench_mysql/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/indexTest/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/indexTest2/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/interpreterInTup/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/generator/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/dbGenerator.h: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/testData.h: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/userInterface.h: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/user/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/user/macros.h: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/user/ndb_error.hpp: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/bin/.empty: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/include/ndb_schema.hpp: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/include/testDefinitions.h: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/lib/.empty: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/script/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/script/async-lmc-bench-l-p10.sh: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/script/async-lmc-bench-l.sh: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/script/async-lmc-bench-p10.sh: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/script/async-lmc-bench.sh: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/README: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/dbGenerator.c: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/dbGenerator.h: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/mainGenerator.c: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/include/testData.h: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/include/userInterface.h: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/makevars.linux: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/makevars.sparc: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/dbPopulate.c: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/dbPopulate.h: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/mainPopulate.c: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/localDbPrepare.c: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/macros.h: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/ndb_error.hpp: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userHandle.h: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userInterface.c: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userHandle.h: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userInterface.cpp: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userTransaction.c: mvdir storage/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userTransaction.c: mvdir storage/ndb/test/ndbapi/old_dirs/restarter/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/restarter2/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/restarts/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/ronja/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/ronja/benchronja/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/ronja/initronja/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/telco/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/telco/readme: mvdir storage/ndb/test/ndbapi/old_dirs/testBackup/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/testBasic/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/testBlobs/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/testDataBuffers/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/testDict/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/testGrep/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/testGrep/verify/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/testIndex/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/testInterpreter/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/testMgm/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/testNdbApi/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/testNodeRestart/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/testOIBasic/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/testOIBasic/times.txt: mvdir storage/ndb/test/ndbapi/old_dirs/testOperations/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/testOrderedIndex/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/testRestartGci/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/testScan/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/testScanInterpreter/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/testSystemRestart/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/testTimeout/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/testTransactions/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/test_event/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/vw_test/Makefile: mvdir storage/ndb/test/ndbapi/old_dirs/vw_test/bcd.h: mvdir storage/ndb/test/ndbapi/old_dirs/vw_test/script/client_start: mvdir storage/ndb/test/ndbapi/old_dirs/vw_test/utv.h: mvdir storage/ndb/test/ndbapi/old_dirs/vw_test/vcdrfunc.h: mvdir storage/ndb/test/ndbnet/test.run: mvdir storage/ndb/test/ndbnet/testError.run: mvdir storage/ndb/test/ndbnet/testMNF.run: mvdir storage/ndb/test/ndbnet/testNR.run: mvdir storage/ndb/test/ndbnet/testNR1.run: mvdir storage/ndb/test/ndbnet/testNR4.run: mvdir storage/ndb/test/ndbnet/testSRhang.run: mvdir storage/ndb/test/ndbnet/testTR295.run: mvdir storage/ndb/test/newtonapi/basic_test/Makefile: mvdir storage/ndb/test/newtonapi/basic_test/basic/Makefile: mvdir storage/ndb/test/newtonapi/basic_test/basic/basic.cpp: mvdir storage/ndb/test/newtonapi/basic_test/bulk_read/Makefile: mvdir storage/ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp: mvdir storage/ndb/test/newtonapi/basic_test/common.cpp: mvdir storage/ndb/test/newtonapi/basic_test/common.hpp: mvdir storage/ndb/test/newtonapi/basic_test/ptr_binding/Makefile: mvdir storage/ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp: mvdir storage/ndb/test/newtonapi/basic_test/too_basic.cpp: mvdir storage/ndb/test/newtonapi/perf_test/Makefile: mvdir storage/ndb/test/newtonapi/perf_test/perf.cpp: mvdir storage/ndb/test/odbc/SQL99_test/Makefile: mvdir storage/ndb/test/odbc/SQL99_test/SQL99_test.cpp: mvdir storage/ndb/test/odbc/SQL99_test/SQL99_test.h: mvdir storage/ndb/test/odbc/client/Makefile: mvdir storage/ndb/test/odbc/client/NDBT_ALLOCHANDLE.cpp: mvdir storage/ndb/test/odbc/client/NDBT_ALLOCHANDLE_HDBC.cpp: mvdir storage/ndb/test/odbc/client/NDBT_SQLConnect.cpp: mvdir storage/ndb/test/odbc/client/NDBT_SQLPrepare.cpp: mvdir storage/ndb/test/odbc/client/SQLAllocEnvTest.cpp: mvdir storage/ndb/test/odbc/client/SQLAllocHandleTest.cpp: mvdir storage/ndb/test/odbc/client/SQLAllocHandleTest_bf.cpp: mvdir storage/ndb/test/odbc/client/SQLBindColTest.cpp: mvdir storage/ndb/test/odbc/client/SQLBindParameterTest.cpp: mvdir storage/ndb/test/odbc/client/SQLCancelTest.cpp: mvdir storage/ndb/test/odbc/client/SQLCloseCursorTest.cpp: mvdir storage/ndb/test/odbc/client/SQLColAttributeTest.cpp: mvdir storage/ndb/test/odbc/client/SQLColAttributeTest1.cpp: mvdir storage/ndb/test/odbc/client/SQLColAttributeTest2.cpp: mvdir storage/ndb/test/odbc/client/SQLColAttributeTest3.cpp: mvdir storage/ndb/test/odbc/client/SQLConnectTest.cpp: mvdir storage/ndb/test/odbc/client/SQLCopyDescTest.cpp: mvdir storage/ndb/test/odbc/client/SQLDescribeColTest.cpp: mvdir storage/ndb/test/odbc/client/SQLDisconnectTest.cpp: mvdir storage/ndb/test/odbc/client/SQLDriverConnectTest.cpp: mvdir storage/ndb/test/odbc/client/SQLEndTranTest.cpp: mvdir storage/ndb/test/odbc/client/SQLErrorTest.cpp: mvdir storage/ndb/test/odbc/client/SQLExecDirectTest.cpp: mvdir storage/ndb/test/odbc/client/SQLExecuteTest.cpp: mvdir storage/ndb/test/odbc/client/SQLFetchScrollTest.cpp: mvdir storage/ndb/test/odbc/client/SQLFetchTest.cpp: mvdir storage/ndb/test/odbc/client/SQLFreeHandleTest.cpp: mvdir storage/ndb/test/odbc/client/SQLFreeStmtTest.cpp: mvdir storage/ndb/test/odbc/client/SQLGetConnectAttrTest.cpp: mvdir storage/ndb/test/odbc/client/SQLGetCursorNameTest.cpp: mvdir storage/ndb/test/odbc/client/SQLGetDataTest.cpp: mvdir storage/ndb/test/odbc/client/SQLGetDescFieldTest.cpp: mvdir storage/ndb/test/odbc/client/SQLGetDescRecTest.cpp: mvdir storage/ndb/test/odbc/client/SQLGetDiagFieldTest.cpp: mvdir storage/ndb/test/odbc/client/SQLGetDiagRecSimpleTest.cpp: mvdir storage/ndb/test/odbc/client/SQLGetDiagRecTest.cpp: mvdir storage/ndb/test/odbc/client/SQLGetEnvAttrTest.cpp: mvdir storage/ndb/test/odbc/client/SQLGetFunctionsTest.cpp: mvdir storage/ndb/test/odbc/client/SQLGetInfoTest.cpp: mvdir storage/ndb/test/odbc/client/SQLGetStmtAttrTest.cpp: mvdir storage/ndb/test/odbc/client/SQLGetTypeInfoTest.cpp: mvdir storage/ndb/test/odbc/client/SQLMoreResultsTest.cpp: mvdir storage/ndb/test/odbc/client/SQLNumResultColsTest.cpp: mvdir storage/ndb/test/odbc/client/SQLParamDataTest.cpp: mvdir storage/ndb/test/odbc/client/SQLPrepareTest.cpp: mvdir storage/ndb/test/odbc/client/SQLPutDataTest.cpp: mvdir storage/ndb/test/odbc/client/SQLRowCountTest.cpp: mvdir storage/ndb/test/odbc/client/SQLSetConnectAttrTest.cpp: mvdir storage/ndb/test/odbc/client/SQLSetCursorNameTest.cpp: mvdir storage/ndb/test/odbc/client/SQLSetDescFieldTest.cpp: mvdir storage/ndb/test/odbc/client/SQLSetDescRecTest.cpp: mvdir storage/ndb/test/odbc/client/SQLSetEnvAttrTest.cpp: mvdir storage/ndb/test/odbc/client/SQLSetStmtAttrTest.cpp: mvdir storage/ndb/test/odbc/client/SQLTablesTest.cpp: mvdir storage/ndb/test/odbc/client/SQLTransactTest.cpp: mvdir storage/ndb/test/odbc/client/common.hpp: mvdir storage/ndb/test/odbc/client/main.cpp: mvdir storage/ndb/test/odbc/dm-iodbc/Makefile: mvdir storage/ndb/test/odbc/dm-unixodbc/Makefile: mvdir storage/ndb/test/odbc/driver/Makefile: mvdir storage/ndb/test/odbc/driver/testOdbcDriver.cpp: mvdir storage/ndb/test/odbc/test_compiler/Makefile: mvdir storage/ndb/test/odbc/test_compiler/test_compiler.cpp: mvdir storage/ndb/test/run-test/16node-tests.txt: mvdir storage/ndb/test/run-test/Makefile.am: mvdir storage/ndb/test/run-test/README.ATRT: mvdir storage/ndb/test/run-test/README: mvdir storage/ndb/test/run-test/atrt-analyze-result.sh: mvdir storage/ndb/test/run-test/atrt-clear-result.sh: mvdir storage/ndb/test/run-test/atrt-example.tgz: mvdir storage/ndb/test/run-test/atrt-gather-result.sh: mvdir storage/ndb/test/run-test/atrt-mysql-test-run: mvdir storage/ndb/test/run-test/atrt-setup.sh: mvdir storage/ndb/test/run-test/atrt-testBackup: mvdir storage/ndb/test/run-test/basic.txt: mvdir storage/ndb/test/run-test/daily-basic-tests.txt: mvdir storage/ndb/test/run-test/daily-devel-tests.txt: mvdir storage/ndb/test/run-test/example.conf: mvdir storage/ndb/test/run-test/main.cpp: mvdir storage/ndb/test/run-test/make-config.sh: mvdir storage/ndb/test/run-test/make-html-reports.sh: mvdir storage/ndb/test/run-test/make-index.sh: mvdir storage/ndb/test/run-test/ndb-autotest.sh: mvdir storage/ndb/test/run-test/run-test.hpp: mvdir storage/ndb/test/src/CpcClient.cpp: mvdir storage/ndb/test/src/HugoAsynchTransactions.cpp: mvdir storage/ndb/test/src/HugoCalculator.cpp: mvdir storage/ndb/test/src/HugoOperations.cpp: mvdir storage/ndb/test/src/HugoTransactions.cpp: mvdir storage/ndb/test/src/Makefile.am: mvdir storage/ndb/test/src/NDBT_Error.cpp: mvdir storage/ndb/test/src/NDBT_Output.cpp: mvdir storage/ndb/test/src/NDBT_ResultRow.cpp: mvdir storage/ndb/test/src/NDBT_ReturnCodes.cpp: mvdir storage/ndb/test/src/NDBT_Table.cpp: mvdir storage/ndb/test/src/NDBT_Tables.cpp: mvdir storage/ndb/test/src/NDBT_Test.cpp: mvdir storage/ndb/test/src/NdbBackup.cpp: mvdir storage/ndb/test/src/NdbConfig.cpp: mvdir storage/ndb/test/src/NdbGrep.cpp: mvdir storage/ndb/test/src/NdbRestarter.cpp: mvdir storage/ndb/test/src/NdbRestarts.cpp: mvdir storage/ndb/test/src/NdbSchemaCon.cpp: mvdir storage/ndb/test/src/NdbSchemaOp.cpp: mvdir storage/ndb/test/src/UtilTransactions.cpp: mvdir storage/ndb/test/src/getarg.c: mvdir storage/ndb/test/tools/Makefile.am: mvdir storage/ndb/test/tools/copy_tab.cpp: mvdir storage/ndb/test/tools/cpcc.cpp: mvdir storage/ndb/test/tools/create_index.cpp: mvdir storage/ndb/test/tools/hugoCalculator.cpp: mvdir storage/ndb/test/tools/hugoFill.cpp: mvdir storage/ndb/test/tools/hugoLoad.cpp: mvdir storage/ndb/test/tools/hugoLockRecords.cpp: mvdir storage/ndb/test/tools/hugoPkDelete.cpp: mvdir storage/ndb/test/tools/hugoPkRead.cpp: mvdir storage/ndb/test/tools/hugoPkReadRecord.cpp: mvdir storage/ndb/test/tools/hugoPkUpdate.cpp: mvdir storage/ndb/test/tools/hugoScanRead.cpp: mvdir storage/ndb/test/tools/hugoScanUpdate.cpp: mvdir storage/ndb/test/tools/old_dirs/hugoCalculator/Makefile: mvdir storage/ndb/test/tools/old_dirs/hugoFill/Makefile: mvdir storage/ndb/test/tools/old_dirs/hugoLoad/Makefile: mvdir storage/ndb/test/tools/old_dirs/hugoLockRecords/Makefile: mvdir storage/ndb/test/tools/old_dirs/hugoPkDelete/Makefile: mvdir storage/ndb/test/tools/old_dirs/hugoPkRead/Makefile: mvdir storage/ndb/test/tools/restart.cpp: mvdir storage/ndb/test/tools/transproxy.cpp: mvdir storage/ndb/test/tools/verify_index.cpp: mvdir storage/ndb/test/tools/old_dirs/hugoPkReadRecord/Makefile: mvdir storage/ndb/test/tools/old_dirs/hugoPkUpdate/Makefile: mvdir storage/ndb/test/tools/old_dirs/hugoScanRead/Makefile: mvdir storage/ndb/test/tools/old_dirs/hugoScanUpdate/Makefile: mvdir storage/ndb/test/tools/old_dirs/restart/Makefile: mvdir storage/ndb/test/tools/old_dirs/transproxy/Makefile: mvdir storage/ndb/test/tools/old_dirs/verify_index/Makefile: mvdir storage/ndb/test/tools/old_dirs/waiter/waiter.cpp: mvdir storage/ndb/tools/Makefile.am: mvdir storage/ndb/tools/clean-links.sh: mvdir storage/ndb/tools/delete_all.cpp: mvdir storage/ndb/tools/desc.cpp: mvdir storage/ndb/tools/drop_index.cpp: mvdir storage/ndb/tools/drop_tab.cpp: mvdir storage/ndb/tools/listTables.cpp: mvdir storage/ndb/tools/make-errors.pl: mvdir storage/ndb/tools/make-links.sh: mvdir storage/ndb/tools/ndb_test_platform.cpp: mvdir storage/ndb/tools/ndbsql.cpp: mvdir storage/ndb/tools/old_dirs/copy_tab/Makefile: mvdir storage/ndb/tools/old_dirs/cpcc/Makefile: mvdir storage/ndb/tools/old_dirs/create_index/Makefile: mvdir storage/ndb/tools/old_dirs/delete_all/Makefile: mvdir storage/ndb/tools/old_dirs/desc/Makefile: mvdir storage/ndb/tools/old_dirs/drop_index/Makefile: mvdir storage/ndb/tools/old_dirs/drop_tab/Makefile: mvdir storage/ndb/tools/old_dirs/list_tables/Makefile: mvdir storage/ndb/tools/old_dirs/ndbnet/Makefile.PL: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Net.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Run.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/ndbnet.pl: mvdir storage/ndb/tools/old_dirs/ndbnet/ndbnetd.pl: mvdir storage/ndb/tools/old_dirs/ndbnet/ndbrun: mvdir storage/ndb/tools/rgrep: mvdir storage/ndb/tools/select_all.cpp: mvdir storage/ndb/tools/select_count.cpp: mvdir storage/ndb/tools/waiter.cpp: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Base.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Client.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Command.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Config.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Database.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Env.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Node.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/NodeApi.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/NodeDb.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/NodeMgmt.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Server.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/ServerINET.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/ServerUNIX.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Run/Base.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Run/Database.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Run/Env.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Run/Node.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Util.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Base.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Dir.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Event.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/File.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/IO.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Lock.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Log.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Socket.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/SocketINET.pm: mvdir storage/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/SocketUNIX.pm: mvdir storage/ndb/tools/old_dirs/ndbsql/Makefile: mvdir storage/ndb/tools/old_dirs/select_all/Makefile: mvdir storage/ndb/tools/old_dirs/select_count/Makefile: mvdir storage/ndb/tools/old_dirs/src/counterviewer/CounterViewer.java: mvdir storage/ndb/tools/restore/Restore.cpp: mvdir storage/ndb/tools/restore/Restore.hpp: mvdir storage/ndb/tools/restore/consumer.cpp: mvdir storage/ndb/tools/restore/consumer.hpp: mvdir storage/ndb/tools/restore/consumer_printer.cpp: mvdir storage/ndb/tools/restore/consumer_printer.hpp: mvdir storage/ndb/tools/restore/consumer_restore.cpp: mvdir storage/ndb/tools/restore/consumer_restore.hpp: mvdir storage/ndb/tools/restore/consumer_restorem.cpp: mvdir storage/ndb/tools/restore/restore_main.cpp: mvdir storage/bdb/LICENSE: mvdir storage/bdb/Makefile.in: mvdir storage/bdb/btree/bt_compare.c: mvdir storage/bdb/btree/bt_conv.c: mvdir storage/bdb/btree/bt_curadj.c: mvdir storage/bdb/btree/bt_cursor.c: mvdir storage/bdb/btree/bt_delete.c: mvdir storage/bdb/btree/bt_method.c: mvdir storage/bdb/btree/bt_open.c: mvdir storage/bdb/btree/bt_put.c: mvdir storage/bdb/btree/bt_rec.c: mvdir storage/bdb/btree/bt_reclaim.c: mvdir storage/bdb/btree/bt_recno.c: mvdir storage/bdb/btree/bt_rsearch.c: mvdir storage/bdb/btree/bt_search.c: mvdir storage/bdb/btree/bt_split.c: mvdir storage/bdb/btree/bt_stat.c: mvdir storage/bdb/btree/bt_upgrade.c: mvdir storage/bdb/btree/bt_verify.c: mvdir storage/bdb/btree/btree.src: mvdir storage/bdb/build_unix/.IGNORE_ME: mvdir storage/bdb/build_vxworks/BerkeleyDB.wsp: mvdir storage/bdb/build_vxworks/dbdemo/README: mvdir storage/bdb/build_win32/Berkeley_DB.dsw: mvdir storage/bdb/build_win32/app_dsp.src: mvdir storage/bdb/build_win32/build_all.dsp: mvdir storage/bdb/build_win32/db_java_xa.dsp: mvdir storage/bdb/build_win32/db_java_xaj.mak: mvdir storage/bdb/build_win32/db_lib.dsp: mvdir storage/bdb/build_win32/db_test.src: mvdir storage/bdb/build_win32/dbkill.cpp: mvdir storage/bdb/build_win32/dllmain.c: mvdir storage/bdb/build_win32/dynamic_dsp.src: mvdir storage/bdb/build_win32/java_dsp.src: mvdir storage/bdb/build_win32/libdb_tcl.def: mvdir storage/bdb/build_win32/libdbrc.src: mvdir storage/bdb/build_win32/srcfile_dsp.src: mvdir storage/bdb/build_win32/static_dsp.src: mvdir storage/bdb/build_win32/tcl_dsp.src: mvdir storage/bdb/clib/getcwd.c: mvdir storage/bdb/clib/getopt.c: mvdir storage/bdb/clib/memcmp.c: mvdir storage/bdb/clib/memmove.c: mvdir storage/bdb/clib/raise.c: mvdir storage/bdb/clib/snprintf.c: mvdir storage/bdb/clib/strcasecmp.c: mvdir storage/bdb/clib/strdup.c: mvdir storage/bdb/clib/strerror.c: mvdir storage/bdb/clib/vsnprintf.c: mvdir storage/bdb/common/db_byteorder.c: mvdir storage/bdb/common/db_err.c: mvdir storage/bdb/common/db_getlong.c: mvdir storage/bdb/common/db_idspace.c: mvdir storage/bdb/common/db_log2.c: mvdir storage/bdb/common/util_arg.c: mvdir storage/bdb/common/util_cache.c: mvdir storage/bdb/common/util_log.c: mvdir storage/bdb/common/util_sig.c: mvdir storage/bdb/cxx/cxx_db.cpp: mvdir storage/bdb/cxx/cxx_dbc.cpp: mvdir storage/bdb/cxx/cxx_dbt.cpp: mvdir storage/bdb/cxx/cxx_env.cpp: mvdir storage/bdb/cxx/cxx_except.cpp: mvdir storage/bdb/cxx/cxx_lock.cpp: mvdir storage/bdb/cxx/cxx_logc.cpp: mvdir storage/bdb/cxx/cxx_mpool.cpp: mvdir storage/bdb/cxx/cxx_txn.cpp: mvdir storage/bdb/db/crdel.src: mvdir storage/bdb/db/crdel_rec.c: mvdir storage/bdb/db/db.c: mvdir storage/bdb/db/db.src: mvdir storage/bdb/db/db_am.c: mvdir storage/bdb/db/db_cam.c: mvdir storage/bdb/db/db_conv.c: mvdir storage/bdb/db/db_dispatch.c: mvdir storage/bdb/db/db_dup.c: mvdir storage/bdb/db/db_iface.c: mvdir storage/bdb/db/db_join.c: mvdir storage/bdb/db/db_meta.c: mvdir storage/bdb/db/db_method.c: mvdir storage/bdb/db/db_open.c: mvdir storage/bdb/db/db_overflow.c: mvdir storage/bdb/db/db_pr.c: mvdir storage/bdb/db/db_rec.c: mvdir storage/bdb/db/db_reclaim.c: mvdir storage/bdb/db/db_remove.c: mvdir storage/bdb/db/db_rename.c: mvdir storage/bdb/db/db_ret.c: mvdir storage/bdb/db/db_truncate.c: mvdir storage/bdb/db/db_upg.c: mvdir storage/bdb/db/db_upg_opd.c: mvdir storage/bdb/db/db_vrfy.c: mvdir storage/bdb/db/db_vrfyutil.c: mvdir storage/bdb/db185/db185.c: mvdir storage/bdb/db185/db185_int.in: mvdir storage/bdb/db_archive/db_archive.c: mvdir storage/bdb/db_checkpoint/db_checkpoint.c: mvdir storage/bdb/db_deadlock/db_deadlock.c: mvdir storage/bdb/db_dump/db_dump.c: mvdir storage/bdb/db_dump185/db_dump185.c: mvdir storage/bdb/db_load/db_load.c: mvdir storage/bdb/db_printlog/README: mvdir storage/bdb/db_printlog/commit.awk: mvdir storage/bdb/db_printlog/count.awk: mvdir storage/bdb/db_printlog/db_printlog.c: mvdir storage/bdb/db_printlog/dbname.awk: mvdir storage/bdb/db_printlog/fileid.awk: mvdir storage/bdb/db_printlog/logstat.awk: mvdir storage/bdb/db_printlog/pgno.awk: mvdir storage/bdb/db_printlog/range.awk: mvdir storage/bdb/db_printlog/rectype.awk: mvdir storage/bdb/db_printlog/status.awk: mvdir storage/bdb/db_printlog/txn.awk: mvdir storage/bdb/db_recover/db_recover.c: mvdir storage/bdb/db_stat/db_stat.c: mvdir storage/bdb/db_upgrade/db_upgrade.c: mvdir storage/bdb/db_verify/db_verify.c: mvdir storage/bdb/dbinc/btree.h: mvdir storage/bdb/dbinc/crypto.h: mvdir storage/bdb/dbinc/cxx_common.h: mvdir storage/bdb/dbinc/cxx_except.h: mvdir storage/bdb/dbinc/cxx_int.h: mvdir storage/bdb/dbinc/db.in: mvdir storage/bdb/dbinc/db_185.in: mvdir storage/bdb/dbinc/db_am.h: mvdir storage/bdb/dbinc/db_cxx.in: mvdir storage/bdb/dbinc/db_dispatch.h: mvdir storage/bdb/dbinc/db_int.in: mvdir storage/bdb/dbinc/db_join.h: mvdir storage/bdb/dbinc/db_page.h: mvdir storage/bdb/dbinc/db_server_int.h: mvdir storage/bdb/dbinc/db_shash.h: mvdir storage/bdb/dbinc/db_swap.h: mvdir storage/bdb/dbinc/db_upgrade.h: mvdir storage/bdb/dbinc/db_verify.h: mvdir storage/bdb/dbinc/debug.h: mvdir storage/bdb/dbinc/fop.h: mvdir storage/bdb/dbinc/globals.h: mvdir storage/bdb/dbinc/hash.h: mvdir storage/bdb/dbinc/hmac.h: mvdir storage/bdb/dbinc/lock.h: mvdir storage/bdb/dbinc/log.h: mvdir storage/bdb/dbinc/mp.h: mvdir storage/bdb/dbinc/mutex.h: mvdir storage/bdb/dbinc/os.h: mvdir storage/bdb/dbinc/qam.h: mvdir storage/bdb/dbinc/queue.h: mvdir storage/bdb/dbinc/region.h: mvdir storage/bdb/dbinc/rep.h: mvdir storage/bdb/dbinc/shqueue.h: mvdir storage/bdb/dbinc/tcl_db.h: mvdir storage/bdb/dbinc/txn.h: mvdir storage/bdb/dbinc/xa.h: mvdir storage/bdb/dbm/dbm.c: mvdir storage/bdb/dbreg/dbreg.c: mvdir storage/bdb/dbreg/dbreg.src: mvdir storage/bdb/dbreg/dbreg_rec.c: mvdir storage/bdb/dbreg/dbreg_util.c: mvdir storage/bdb/dist/Makefile.in: mvdir storage/bdb/dist/RELEASE: mvdir storage/bdb/dist/buildrel: mvdir storage/bdb/dist/config.guess: mvdir storage/bdb/dist/config.sub: mvdir storage/bdb/dist/configure.ac: mvdir storage/bdb/dist/db.ecd.in: mvdir storage/bdb/dist/db.spec.in: mvdir storage/bdb/dist/gen_inc.awk: mvdir storage/bdb/dist/gen_rec.awk: mvdir storage/bdb/dist/gen_rpc.awk: mvdir storage/bdb/dist/install-sh: mvdir storage/bdb/dist/ltmain.sh: mvdir storage/bdb/dist/pubdef.in: mvdir storage/bdb/dist/s_all: mvdir storage/bdb/dist/s_config: mvdir storage/bdb/dist/aclocal/config.ac: mvdir storage/bdb/dist/aclocal/cxx.ac: mvdir storage/bdb/dist/aclocal/gcc.ac: mvdir storage/bdb/dist/aclocal/libtool.ac: mvdir storage/bdb/dist/s_crypto: mvdir storage/bdb/dist/s_dir: mvdir storage/bdb/dist/s_include: mvdir storage/bdb/dist/s_javah: mvdir storage/bdb/dist/s_java: mvdir storage/bdb/dist/s_perm: mvdir storage/bdb/dist/s_readme: mvdir storage/bdb/dist/s_recover: mvdir storage/bdb/dist/s_rpc: mvdir storage/bdb/dist/s_symlink: mvdir storage/bdb/dist/s_tags: mvdir storage/bdb/dist/s_test: mvdir storage/bdb/dist/s_vxworks: mvdir storage/bdb/dist/s_win32_dsp: mvdir storage/bdb/dist/s_win32: mvdir storage/bdb/dist/srcfiles.in: mvdir storage/bdb/dist/vx_buildcd: mvdir storage/bdb/dist/vx_config.in: mvdir storage/bdb/dist/win_config.in: mvdir storage/bdb/dist/win_exports.in: mvdir storage/bdb/dist/aclocal/mutex.ac: mvdir storage/bdb/dist/aclocal/options.ac: mvdir storage/bdb/dist/aclocal/programs.ac: mvdir storage/bdb/dist/aclocal/sosuffix.ac: mvdir storage/bdb/dist/aclocal/tcl.ac: mvdir storage/bdb/dist/aclocal/types.ac: mvdir storage/bdb/dist/aclocal_java/ac_check_class.ac: mvdir storage/bdb/dist/aclocal_java/ac_check_classpath.ac: mvdir storage/bdb/dist/aclocal_java/ac_check_junit.ac: mvdir storage/bdb/dist/aclocal_java/ac_check_rqrd_class.ac: mvdir storage/bdb/dist/aclocal_java/ac_java_options.ac: mvdir storage/bdb/dist/aclocal_java/ac_jni_include_dirs.ac: mvdir storage/bdb/dist/aclocal_java/ac_prog_jar.ac: mvdir storage/bdb/dist/aclocal_java/ac_prog_java.ac: mvdir storage/bdb/dist/aclocal_java/ac_prog_java_works.ac: mvdir storage/bdb/dist/aclocal_java/ac_prog_javac.ac: mvdir storage/bdb/dist/aclocal_java/ac_prog_javac_works.ac: mvdir storage/bdb/dist/aclocal_java/ac_prog_javadoc.ac: mvdir storage/bdb/dist/aclocal_java/ac_prog_javah.ac: mvdir storage/bdb/dist/aclocal_java/ac_try_compile_java.ac: mvdir storage/bdb/dist/aclocal_java/ac_try_run_javac.ac: mvdir storage/bdb/dist/template/rec_ctemp: mvdir storage/bdb/dist/vx_2.0/BerkeleyDB.wpj: mvdir storage/bdb/dist/vx_2.0/wpj.in: mvdir storage/bdb/dist/vx_3.1/Makefile.custom: mvdir storage/bdb/dist/vx_3.1/cdf.1: mvdir storage/bdb/dist/vx_3.1/cdf.2: mvdir storage/bdb/dist/vx_3.1/cdf.3: mvdir storage/bdb/dist/vx_3.1/component.cdf: mvdir storage/bdb/dist/vx_3.1/component.wpj: mvdir storage/bdb/dist/vx_3.1/wpj.1: mvdir storage/bdb/dist/vx_3.1/wpj.2: mvdir storage/bdb/dist/vx_3.1/wpj.3: mvdir storage/bdb/dist/vx_3.1/wpj.4: mvdir storage/bdb/dist/vx_3.1/wpj.5: mvdir storage/bdb/dist/vx_setup/CONFIG.in: mvdir storage/bdb/dist/vx_setup/LICENSE.TXT: mvdir storage/bdb/dist/vx_setup/MESSAGES.TCL: mvdir storage/bdb/dist/vx_setup/README.in: mvdir storage/bdb/dist/vx_setup/SETUP.BMP: mvdir storage/bdb/dist/vx_setup/vx_allfile.in: mvdir storage/bdb/dist/vx_setup/vx_demofile.in: mvdir storage/bdb/dist/vx_setup/vx_setup.in: mvdir storage/bdb/env/db_salloc.c: mvdir storage/bdb/env/db_shash.c: mvdir storage/bdb/env/env_file.c: mvdir storage/bdb/env/env_method.c.b: mvdir storage/bdb/env/env_method.c: mvdir storage/bdb/env/env_open.c: mvdir storage/bdb/env/env_recover.c: mvdir storage/bdb/env/env_region.c: mvdir storage/bdb/fileops/fileops.src: mvdir storage/bdb/fileops/fop_basic.c: mvdir storage/bdb/fileops/fop_rec.c: mvdir storage/bdb/fileops/fop_util.c: mvdir storage/bdb/hash/hash.c: mvdir storage/bdb/hash/hash.src: mvdir storage/bdb/hash/hash_conv.c: mvdir storage/bdb/hash/hash_dup.c: mvdir storage/bdb/hash/hash_func.c: mvdir storage/bdb/hash/hash_meta.c: mvdir storage/bdb/hash/hash_method.c: mvdir storage/bdb/hash/hash_open.c: mvdir storage/bdb/hash/hash_page.c: mvdir storage/bdb/hash/hash_rec.c: mvdir storage/bdb/hash/hash_reclaim.c: mvdir storage/bdb/hash/hash_stat.c: mvdir storage/bdb/hash/hash_upgrade.c: mvdir storage/bdb/hash/hash_verify.c: mvdir storage/bdb/hmac/hmac.c: mvdir storage/bdb/hmac/sha1.c: mvdir storage/bdb/hsearch/hsearch.c: mvdir storage/bdb/libdb_java/checkapi.prl: mvdir storage/bdb/libdb_java/com_sleepycat_db_Db.h: mvdir storage/bdb/libdb_java/com_sleepycat_db_DbEnv.h: mvdir storage/bdb/libdb_java/com_sleepycat_db_DbLock.h: mvdir storage/bdb/libdb_java/com_sleepycat_db_DbLogc.h: mvdir storage/bdb/libdb_java/com_sleepycat_db_DbLsn.h: mvdir storage/bdb/libdb_java/com_sleepycat_db_DbTxn.h: mvdir storage/bdb/libdb_java/com_sleepycat_db_DbUtil.h: mvdir storage/bdb/libdb_java/com_sleepycat_db_Dbc.h: mvdir storage/bdb/libdb_java/com_sleepycat_db_Dbt.h: mvdir storage/bdb/libdb_java/com_sleepycat_db_xa_DbXAResource.h: mvdir storage/bdb/libdb_java/java_Db.c: mvdir storage/bdb/libdb_java/java_DbEnv.c: mvdir storage/bdb/libdb_java/java_DbLock.c: mvdir storage/bdb/libdb_java/java_DbLogc.c: mvdir storage/bdb/libdb_java/java_DbLsn.c: mvdir storage/bdb/libdb_java/java_DbTxn.c: mvdir storage/bdb/libdb_java/java_DbUtil.c: mvdir storage/bdb/libdb_java/java_DbXAResource.c: mvdir storage/bdb/libdb_java/java_Dbc.c: mvdir storage/bdb/libdb_java/java_Dbt.c: mvdir storage/bdb/libdb_java/java_info.c: mvdir storage/bdb/libdb_java/java_info.h: mvdir storage/bdb/libdb_java/java_locked.c: mvdir storage/bdb/libdb_java/java_locked.h: mvdir storage/bdb/libdb_java/java_util.c: mvdir storage/bdb/libdb_java/java_util.h: mvdir storage/bdb/lock/Design: mvdir storage/bdb/lock/lock.c: mvdir storage/bdb/lock/lock_deadlock.c: mvdir storage/bdb/lock/lock_method.c: mvdir storage/bdb/lock/lock_region.c: mvdir storage/bdb/lock/lock_stat.c: mvdir storage/bdb/lock/lock_util.c: mvdir storage/bdb/log/log.c: mvdir storage/bdb/log/log_archive.c: mvdir storage/bdb/log/log_compare.c: mvdir storage/bdb/log/log_get.c: mvdir storage/bdb/log/log_method.c: mvdir storage/bdb/log/log_put.c: mvdir storage/bdb/mp/mp_alloc.c: mvdir storage/bdb/mp/mp_bh.c: mvdir storage/bdb/mp/mp_fget.c: mvdir storage/bdb/mp/mp_fopen.c: mvdir storage/bdb/mp/mp_fput.c: mvdir storage/bdb/mp/mp_fset.c: mvdir storage/bdb/mp/mp_method.c: mvdir storage/bdb/mp/mp_region.c: mvdir storage/bdb/mp/mp_register.c: mvdir storage/bdb/mp/mp_stat.c: mvdir storage/bdb/mp/mp_sync.c: mvdir storage/bdb/mp/mp_trickle.c: mvdir storage/bdb/mutex/README: mvdir storage/bdb/mutex/mut_fcntl.c: mvdir storage/bdb/mutex/mut_pthread.c: mvdir storage/bdb/mutex/mut_tas.c: mvdir storage/bdb/mutex/mut_win32.c: mvdir storage/bdb/mutex/mutex.c: mvdir storage/bdb/mutex/tm.c: mvdir storage/bdb/mutex/uts4_cc.s: mvdir storage/bdb/os/os_abs.c: mvdir storage/bdb/os/os_alloc.c: mvdir storage/bdb/os/os_clock.c: mvdir storage/bdb/os/os_config.c: mvdir storage/bdb/os/os_dir.c: mvdir storage/bdb/os/os_errno.c: mvdir storage/bdb/os/os_fid.c: mvdir storage/bdb/os/os_fsync.c: mvdir storage/bdb/os/os_handle.c: mvdir storage/bdb/os/os_id.c: mvdir storage/bdb/os/os_map.c: mvdir storage/bdb/os/os_method.c: mvdir storage/bdb/os/os_oflags.c: mvdir storage/bdb/os/os_open.c: mvdir storage/bdb/os/os_region.c: mvdir storage/bdb/os/os_rename.c: mvdir storage/bdb/os/os_root.c: mvdir storage/bdb/os/os_rpath.c: mvdir storage/bdb/os/os_rw.c: mvdir storage/bdb/os/os_seek.c: mvdir storage/bdb/os/os_sleep.c: mvdir storage/bdb/os/os_spin.c: mvdir storage/bdb/os/os_stat.c: mvdir storage/bdb/os/os_tmpdir.c: mvdir storage/bdb/os/os_unlink.c: mvdir storage/bdb/os_vxworks/os_vx_abs.c: mvdir storage/bdb/os_vxworks/os_vx_config.c: mvdir storage/bdb/os_vxworks/os_vx_map.c: mvdir storage/bdb/os_win32/os_abs.c: mvdir storage/bdb/os_win32/os_clock.c: mvdir storage/bdb/os_win32/os_config.c: mvdir storage/bdb/os_win32/os_dir.c: mvdir storage/bdb/os_win32/os_errno.c: mvdir storage/bdb/os_win32/os_fid.c: mvdir storage/bdb/os_win32/os_fsync.c: mvdir storage/bdb/os_win32/os_handle.c: mvdir storage/bdb/os_win32/os_map.c: mvdir storage/bdb/os_win32/os_open.c: mvdir storage/bdb/os_win32/os_rename.c: mvdir storage/bdb/os_win32/os_rw.c: mvdir storage/bdb/os_win32/os_seek.c: mvdir storage/bdb/os_win32/os_sleep.c: mvdir storage/bdb/os_win32/os_spin.c: mvdir storage/bdb/os_win32/os_stat.c: mvdir storage/bdb/os_win32/os_type.c: mvdir storage/bdb/perl/BerkeleyDB/BerkeleyDB.pm: mvdir storage/bdb/perl/BerkeleyDB/BerkeleyDB.pod.P: mvdir storage/bdb/perl/BerkeleyDB/BerkeleyDB.pod: mvdir storage/bdb/perl/BerkeleyDB/BerkeleyDB.xs: mvdir storage/bdb/perl/BerkeleyDB/Changes: mvdir storage/bdb/perl/BerkeleyDB/MANIFEST: mvdir storage/bdb/perl/BerkeleyDB/Makefile.PL: mvdir storage/bdb/perl/BerkeleyDB/README: mvdir storage/bdb/perl/BerkeleyDB/Todo: mvdir storage/bdb/perl/BerkeleyDB/config.in: mvdir storage/bdb/perl/BerkeleyDB/constants.h: mvdir storage/bdb/perl/BerkeleyDB/constants.xs: mvdir storage/bdb/perl/BerkeleyDB/dbinfo: mvdir storage/bdb/perl/BerkeleyDB/mkconsts: mvdir storage/bdb/perl/BerkeleyDB/mkpod: mvdir storage/bdb/perl/BerkeleyDB/BerkeleyDB/Btree.pm: mvdir storage/bdb/perl/BerkeleyDB/BerkeleyDB/Hash.pm: mvdir storage/bdb/perl/BerkeleyDB/hints/dec_osf.pl: mvdir storage/bdb/perl/BerkeleyDB/hints/irix_6_5.pl: mvdir storage/bdb/perl/BerkeleyDB/hints/solaris.pl: mvdir storage/bdb/perl/BerkeleyDB/patches/5.004_01: mvdir storage/bdb/perl/BerkeleyDB/patches/5.004_02: mvdir storage/bdb/perl/BerkeleyDB/patches/5.004_03: mvdir storage/bdb/perl/BerkeleyDB/patches/5.004_04: mvdir storage/bdb/perl/BerkeleyDB/patches/5.004_05: mvdir storage/bdb/perl/BerkeleyDB/patches/5.004: mvdir storage/bdb/perl/BerkeleyDB/patches/5.005_01: mvdir storage/bdb/perl/BerkeleyDB/patches/5.005_02: mvdir storage/bdb/perl/BerkeleyDB/patches/5.005_03: mvdir storage/bdb/perl/BerkeleyDB/patches/5.005: mvdir storage/bdb/perl/BerkeleyDB/patches/5.6.0: mvdir storage/bdb/perl/BerkeleyDB/ppport.h: mvdir storage/bdb/perl/BerkeleyDB/scan: mvdir storage/bdb/perl/BerkeleyDB/t/btree.t: mvdir storage/bdb/perl/BerkeleyDB/t/destroy.t: mvdir storage/bdb/perl/BerkeleyDB/t/env.t: mvdir storage/bdb/perl/BerkeleyDB/t/examples.t.T: mvdir storage/bdb/perl/BerkeleyDB/t/examples.t: mvdir storage/bdb/perl/BerkeleyDB/t/examples3.t.T: mvdir storage/bdb/perl/BerkeleyDB/t/examples3.t: mvdir storage/bdb/perl/BerkeleyDB/t/filter.t: mvdir storage/bdb/perl/BerkeleyDB/t/hash.t: mvdir storage/bdb/perl/BerkeleyDB/t/join.t: mvdir storage/bdb/perl/BerkeleyDB/t/mldbm.t: mvdir storage/bdb/perl/BerkeleyDB/t/queue.t: mvdir storage/bdb/perl/BerkeleyDB/t/recno.t: mvdir storage/bdb/perl/BerkeleyDB/t/strict.t: mvdir storage/bdb/perl/BerkeleyDB/t/subdb.t: mvdir storage/bdb/perl/BerkeleyDB/t/txn.t: mvdir storage/bdb/perl/BerkeleyDB/typemap: mvdir storage/bdb/perl/BerkeleyDB/t/unknown.t: mvdir storage/bdb/perl/BerkeleyDB/t/util.pm: mvdir storage/bdb/perl/DB_File/Changes: mvdir storage/bdb/perl/DB_File/DB_File.pm: mvdir storage/bdb/perl/DB_File/DB_File.xs: mvdir storage/bdb/perl/DB_File/DB_File_BS: mvdir storage/bdb/perl/DB_File/MANIFEST: mvdir storage/bdb/perl/DB_File/Makefile.PL: mvdir storage/bdb/perl/DB_File/README: mvdir storage/bdb/perl/DB_File/config.in: mvdir storage/bdb/perl/DB_File/dbinfo: mvdir storage/bdb/perl/DB_File/fallback.h: mvdir storage/bdb/perl/DB_File/fallback.xs: mvdir storage/bdb/perl/DB_File/hints/dynixptx.pl: mvdir storage/bdb/perl/DB_File/hints/sco.pl: mvdir storage/bdb/perl/DB_File/patches/5.004_01: mvdir storage/bdb/perl/DB_File/patches/5.004_02: mvdir storage/bdb/perl/DB_File/patches/5.004_03: mvdir storage/bdb/perl/DB_File/patches/5.004_04: mvdir storage/bdb/perl/DB_File/patches/5.004_05: mvdir storage/bdb/perl/DB_File/patches/5.004: mvdir storage/bdb/perl/DB_File/patches/5.005_01: mvdir storage/bdb/perl/DB_File/patches/5.005_02: mvdir storage/bdb/perl/DB_File/patches/5.005_03: mvdir storage/bdb/perl/DB_File/patches/5.005: mvdir storage/bdb/perl/DB_File/patches/5.6.0: mvdir storage/bdb/perl/DB_File/ppport.h: mvdir storage/bdb/perl/DB_File/t/db-btree.t: mvdir storage/bdb/perl/DB_File/t/db-hash.t: mvdir storage/bdb/perl/DB_File/t/db-recno.t: mvdir storage/bdb/perl/DB_File/typemap: mvdir storage/bdb/perl/DB_File/version.c: mvdir storage/bdb/qam/qam.c: mvdir storage/bdb/qam/qam.src: mvdir storage/bdb/qam/qam_conv.c: mvdir storage/bdb/qam/qam_files.c: mvdir storage/bdb/qam/qam_method.c: mvdir storage/bdb/qam/qam_open.c: mvdir storage/bdb/qam/qam_rec.c: mvdir storage/bdb/qam/qam_stat.c: mvdir storage/bdb/qam/qam_upgrade.c: mvdir storage/bdb/qam/qam_verify.c: mvdir storage/bdb/rep/rep_method.c: mvdir storage/bdb/rep/rep_record.c: mvdir storage/bdb/rep/rep_region.c: mvdir storage/bdb/rep/rep_util.c: mvdir storage/bdb/rpc_client/client.c: mvdir storage/bdb/rpc_client/gen_client_ret.c: mvdir storage/bdb/rpc_server/c/db_server_proc.c.in: mvdir storage/bdb/rpc_server/c/db_server_util.c: mvdir storage/bdb/rpc_server/clsrv.html: mvdir storage/bdb/rpc_server/cxx/db_server_cxxproc.cpp: mvdir storage/bdb/rpc_server/cxx/db_server_cxxutil.cpp: mvdir storage/bdb/rpc_server/java/DbDispatcher.java: mvdir storage/bdb/rpc_server/java/DbServer.java: mvdir storage/bdb/rpc_server/java/FreeList.java: mvdir storage/bdb/rpc_server/java/LocalIterator.java: mvdir storage/bdb/rpc_server/java/README: mvdir storage/bdb/rpc_server/java/RpcDb.java: mvdir storage/bdb/rpc_server/java/RpcDbEnv.java: mvdir storage/bdb/rpc_server/java/RpcDbTxn.java: mvdir storage/bdb/rpc_server/java/RpcDbc.java: mvdir storage/bdb/rpc_server/java/Timer.java: mvdir storage/bdb/rpc_server/java/jrpcgen.jar: mvdir storage/bdb/rpc_server/java/oncrpc.jar: mvdir storage/bdb/rpc_server/rpc.src: mvdir storage/bdb/rpc_server/java/gen/DbServerStub.java: mvdir storage/bdb/rpc_server/java/gen/__db_associate_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_associate_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_bt_maxkey_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_bt_maxkey_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_bt_minkey_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_bt_minkey_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_close_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_close_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_create_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_create_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_cursor_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_cursor_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_del_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_del_reply.java: mvdir storage/bdb/rpc_server/java/s_jrpcgen: mvdir storage/bdb/rpc_server/java/gen/__db_encrypt_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_encrypt_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_extentsize_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_extentsize_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_flags_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_flags_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_get_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_get_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_h_ffactor_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_h_ffactor_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_h_nelem_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_h_nelem_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_join_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_join_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_key_range_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_key_range_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_lorder_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_lorder_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_open_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_open_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_pagesize_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_pagesize_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_pget_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_pget_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_put_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_put_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_re_delim_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_re_delim_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_re_len_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_re_len_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_re_pad_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_re_pad_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_remove_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_remove_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_rename_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_rename_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_stat_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_stat_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_sync_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_sync_reply.java: mvdir storage/bdb/rpc_server/java/gen/__db_truncate_msg.java: mvdir storage/bdb/rpc_server/java/gen/__db_truncate_reply.java: mvdir storage/bdb/rpc_server/java/gen/__dbc_close_msg.java: mvdir storage/bdb/rpc_server/java/gen/__dbc_close_reply.java: mvdir storage/bdb/rpc_server/java/gen/__dbc_count_msg.java: mvdir storage/bdb/rpc_server/java/gen/__dbc_count_reply.java: mvdir storage/bdb/rpc_server/java/gen/__dbc_del_msg.java: mvdir storage/bdb/rpc_server/java/gen/__dbc_del_reply.java: mvdir storage/bdb/rpc_server/java/gen/__dbc_dup_msg.java: mvdir storage/bdb/rpc_server/java/gen/__dbc_dup_reply.java: mvdir storage/bdb/rpc_server/java/gen/__dbc_get_msg.java: mvdir storage/bdb/rpc_server/java/gen/__dbc_get_reply.java: mvdir storage/bdb/rpc_server/java/gen/__dbc_pget_msg.java: mvdir storage/bdb/rpc_server/java/gen/__dbc_pget_reply.java: mvdir storage/bdb/rpc_server/java/gen/__dbc_put_msg.java: mvdir storage/bdb/rpc_server/java/gen/__dbc_put_reply.java: mvdir storage/bdb/rpc_server/java/gen/__env_cachesize_msg.java: mvdir storage/bdb/rpc_server/java/gen/__env_cachesize_reply.java: mvdir storage/bdb/rpc_server/java/gen/__env_close_msg.java: mvdir storage/bdb/rpc_server/java/gen/__env_close_reply.java: mvdir storage/bdb/rpc_server/java/gen/__env_create_msg.java: mvdir storage/bdb/rpc_server/java/gen/__env_create_reply.java: mvdir storage/bdb/rpc_server/java/gen/__env_dbremove_msg.java: mvdir storage/bdb/rpc_server/java/gen/__env_dbremove_reply.java: mvdir storage/bdb/rpc_server/java/gen/__env_dbrename_msg.java: mvdir storage/bdb/rpc_server/java/gen/__env_dbrename_reply.java: mvdir storage/bdb/rpc_server/java/gen/__env_encrypt_msg.java: mvdir storage/bdb/rpc_server/java/gen/__env_encrypt_reply.java: mvdir storage/bdb/rpc_server/java/gen/__env_flags_msg.java: mvdir storage/bdb/rpc_server/java/gen/__env_flags_reply.java: mvdir storage/bdb/rpc_server/java/gen/__env_open_msg.java: mvdir storage/bdb/rpc_server/java/gen/__env_open_reply.java: mvdir storage/bdb/rpc_server/java/gen/__env_remove_msg.java: mvdir storage/bdb/rpc_server/java/gen/__env_remove_reply.java: mvdir storage/bdb/rpc_server/java/gen/__txn_abort_msg.java: mvdir storage/bdb/rpc_server/java/gen/__txn_abort_reply.java: mvdir storage/bdb/rpc_server/java/gen/__txn_begin_msg.java: mvdir storage/bdb/rpc_server/java/gen/__txn_begin_reply.java: mvdir storage/bdb/rpc_server/java/gen/__txn_commit_msg.java: mvdir storage/bdb/rpc_server/java/gen/__txn_commit_reply.java: mvdir storage/bdb/rpc_server/java/gen/__txn_discard_msg.java: mvdir storage/bdb/rpc_server/java/gen/__txn_discard_reply.java: mvdir storage/bdb/rpc_server/java/gen/__txn_prepare_msg.java: mvdir storage/bdb/rpc_server/java/gen/__txn_prepare_reply.java: mvdir storage/bdb/rpc_server/java/gen/__txn_recover_msg.java: mvdir storage/bdb/rpc_server/java/gen/__txn_recover_reply.java: mvdir storage/bdb/rpc_server/java/gen/db_server.java: mvdir storage/bdb/tcl/tcl_compat.c: mvdir storage/bdb/tcl/tcl_db.c: mvdir storage/bdb/tcl/tcl_db_pkg.c: mvdir storage/bdb/tcl/docs/db.html: mvdir storage/bdb/tcl/docs/env.html: mvdir storage/bdb/tcl/docs/historic.html: mvdir storage/bdb/tcl/docs/index.html: mvdir storage/bdb/tcl/docs/library.html: mvdir storage/bdb/tcl/docs/lock.html: mvdir storage/bdb/tcl/docs/log.html: mvdir storage/bdb/tcl/docs/mpool.html: mvdir storage/bdb/tcl/docs/rep.html: mvdir storage/bdb/tcl/docs/test.html: mvdir storage/bdb/tcl/docs/txn.html: mvdir storage/bdb/tcl/tcl_dbcursor.c: mvdir storage/bdb/tcl/tcl_env.c: mvdir storage/bdb/tcl/tcl_internal.c: mvdir storage/bdb/tcl/tcl_lock.c: mvdir storage/bdb/tcl/tcl_log.c: mvdir storage/bdb/tcl/tcl_mp.c: mvdir storage/bdb/tcl/tcl_rep.c: mvdir storage/bdb/tcl/tcl_txn.c: mvdir storage/bdb/tcl/tcl_util.c: mvdir storage/bdb/test/archive.tcl: mvdir storage/bdb/test/bigfile001.tcl: mvdir storage/bdb/test/bigfile002.tcl: mvdir storage/bdb/test/byteorder.tcl: mvdir storage/bdb/test/conscript.tcl: mvdir storage/bdb/test/dbm.tcl: mvdir storage/bdb/test/dbscript.tcl: mvdir storage/bdb/test/ddoyscript.tcl: mvdir storage/bdb/test/ddscript.tcl: mvdir storage/bdb/test/dead001.tcl: mvdir storage/bdb/test/dead002.tcl: mvdir storage/bdb/test/dead003.tcl: mvdir storage/bdb/test/dead004.tcl: mvdir storage/bdb/test/dead005.tcl: mvdir storage/bdb/test/dead006.tcl: mvdir storage/bdb/test/dead007.tcl: mvdir storage/bdb/test/env001.tcl: mvdir storage/bdb/test/env002.tcl: mvdir storage/bdb/test/env003.tcl: mvdir storage/bdb/test/env004.tcl: mvdir storage/bdb/test/env005.tcl: mvdir storage/bdb/test/env006.tcl: mvdir storage/bdb/test/env007.tcl: mvdir storage/bdb/test/env008.tcl: mvdir storage/bdb/test/env009.tcl: mvdir storage/bdb/test/env010.tcl: mvdir storage/bdb/test/env011.tcl: mvdir storage/bdb/test/hsearch.tcl: mvdir storage/bdb/test/join.tcl: mvdir storage/bdb/test/lock001.tcl: mvdir storage/bdb/test/lock002.tcl: mvdir storage/bdb/test/lock003.tcl: mvdir storage/bdb/test/lock004.tcl: mvdir storage/bdb/test/lock005.tcl: mvdir storage/bdb/test/lockscript.tcl: mvdir storage/bdb/test/log001.tcl: mvdir storage/bdb/test/log002.tcl: mvdir storage/bdb/test/log003.tcl: mvdir storage/bdb/test/log004.tcl: mvdir storage/bdb/test/log005.tcl: mvdir storage/bdb/test/logtrack.tcl: mvdir storage/bdb/test/mdbscript.tcl: mvdir storage/bdb/test/memp001.tcl: mvdir storage/bdb/test/memp002.tcl: mvdir storage/bdb/test/memp003.tcl: mvdir storage/bdb/test/mpoolscript.tcl: mvdir storage/bdb/test/mutex001.tcl: mvdir storage/bdb/test/mutex002.tcl: mvdir storage/bdb/test/mutex003.tcl: mvdir storage/bdb/test/mutexscript.tcl: mvdir storage/bdb/test/ndbm.tcl: mvdir storage/bdb/test/parallel.tcl: mvdir storage/bdb/test/recd001.tcl: mvdir storage/bdb/test/recd002.tcl: mvdir storage/bdb/test/recd003.tcl: mvdir storage/bdb/test/recd004.tcl: mvdir storage/bdb/test/recd005.tcl: mvdir storage/bdb/test/recd006.tcl: mvdir storage/bdb/test/recd007.tcl: mvdir storage/bdb/test/recd008.tcl: mvdir storage/bdb/test/recd009.tcl: mvdir storage/bdb/test/recd010.tcl: mvdir storage/bdb/test/recd011.tcl: mvdir storage/bdb/test/recd012.tcl: mvdir storage/bdb/test/recd013.tcl: mvdir storage/bdb/test/recd014.tcl: mvdir storage/bdb/test/recd015.tcl: mvdir storage/bdb/test/recd016.tcl: mvdir storage/bdb/test/recd017.tcl: mvdir storage/bdb/test/recd018.tcl: mvdir storage/bdb/test/recd019.tcl: mvdir storage/bdb/test/recd020.tcl: mvdir storage/bdb/test/recd15scr.tcl: mvdir storage/bdb/test/recdscript.tcl: mvdir storage/bdb/test/rep001.tcl: mvdir storage/bdb/test/rep002.tcl: mvdir storage/bdb/test/rep003.tcl: mvdir storage/bdb/test/rep004.tcl: mvdir storage/bdb/test/rep005.tcl: mvdir storage/bdb/test/reputils.tcl: mvdir storage/bdb/test/rpc001.tcl: mvdir storage/bdb/test/rpc002.tcl: mvdir storage/bdb/test/rpc003.tcl: mvdir storage/bdb/test/rpc004.tcl: mvdir storage/bdb/test/rpc005.tcl: mvdir storage/bdb/test/rsrc001.tcl: mvdir storage/bdb/test/rsrc002.tcl: mvdir storage/bdb/test/rsrc003.tcl: mvdir storage/bdb/test/rsrc004.tcl: mvdir storage/bdb/test/sdb001.tcl: mvdir storage/bdb/test/sdb002.tcl: mvdir storage/bdb/test/sdb003.tcl: mvdir storage/bdb/test/sdb004.tcl: mvdir storage/bdb/test/sdb005.tcl: mvdir storage/bdb/test/sdb006.tcl: mvdir storage/bdb/test/sdb007.tcl: mvdir storage/bdb/test/sdb008.tcl: mvdir storage/bdb/test/sdb009.tcl: mvdir storage/bdb/test/sdb010.tcl: mvdir storage/bdb/test/sdb011.tcl: mvdir storage/bdb/test/sdb012.tcl: mvdir storage/bdb/test/sdbscript.tcl: mvdir storage/bdb/test/sdbtest001.tcl: mvdir storage/bdb/test/sdbtest002.tcl: mvdir storage/bdb/test/sdbutils.tcl: mvdir storage/bdb/test/sec001.tcl: mvdir storage/bdb/test/sec002.tcl: mvdir storage/bdb/test/shelltest.tcl: mvdir storage/bdb/test/si001.tcl: mvdir storage/bdb/test/si002.tcl: mvdir storage/bdb/test/si003.tcl: mvdir storage/bdb/test/si004.tcl: mvdir storage/bdb/test/si005.tcl: mvdir storage/bdb/test/si006.tcl: mvdir storage/bdb/test/sindex.tcl: mvdir storage/bdb/test/sysscript.tcl: mvdir storage/bdb/test/test.tcl: mvdir storage/bdb/test/test001.tcl: mvdir storage/bdb/test/test002.tcl: mvdir storage/bdb/test/test003.tcl: mvdir storage/bdb/test/test004.tcl: mvdir storage/bdb/test/test005.tcl: mvdir storage/bdb/test/test006.tcl: mvdir storage/bdb/test/test007.tcl: mvdir storage/bdb/test/test008.tcl: mvdir storage/bdb/test/test009.tcl: mvdir storage/bdb/test/test010.tcl: mvdir storage/bdb/test/test011.tcl: mvdir storage/bdb/test/test012.tcl: mvdir storage/bdb/test/test013.tcl: mvdir storage/bdb/test/test014.tcl: mvdir storage/bdb/test/test015.tcl: mvdir storage/bdb/test/test016.tcl: mvdir storage/bdb/test/test017.tcl: mvdir storage/bdb/test/test018.tcl: mvdir storage/bdb/test/test019.tcl: mvdir storage/bdb/test/test020.tcl: mvdir storage/bdb/test/test021.tcl: mvdir storage/bdb/test/test022.tcl: mvdir storage/bdb/test/test023.tcl: mvdir storage/bdb/test/test024.tcl: mvdir storage/bdb/test/test025.tcl: mvdir storage/bdb/test/test026.tcl: mvdir storage/bdb/test/test027.tcl: mvdir storage/bdb/test/test028.tcl: mvdir storage/bdb/test/test029.tcl: mvdir storage/bdb/test/test030.tcl: mvdir storage/bdb/test/test031.tcl: mvdir storage/bdb/test/test032.tcl: mvdir storage/bdb/test/test033.tcl: mvdir storage/bdb/test/test034.tcl: mvdir storage/bdb/test/test035.tcl: mvdir storage/bdb/test/test036.tcl: mvdir storage/bdb/test/test037.tcl: mvdir storage/bdb/test/test038.tcl: mvdir storage/bdb/test/test039.tcl: mvdir storage/bdb/test/test040.tcl: mvdir storage/bdb/test/test041.tcl: mvdir storage/bdb/test/test042.tcl: mvdir storage/bdb/test/test043.tcl: mvdir storage/bdb/test/test044.tcl: mvdir storage/bdb/test/test045.tcl: mvdir storage/bdb/test/test046.tcl: mvdir storage/bdb/test/test047.tcl: mvdir storage/bdb/test/test048.tcl: mvdir storage/bdb/test/test049.tcl: mvdir storage/bdb/test/test050.tcl: mvdir storage/bdb/test/test051.tcl: mvdir storage/bdb/test/test052.tcl: mvdir storage/bdb/test/test053.tcl: mvdir storage/bdb/test/test054.tcl: mvdir storage/bdb/test/test055.tcl: mvdir storage/bdb/test/test056.tcl: mvdir storage/bdb/test/test057.tcl: mvdir storage/bdb/test/test058.tcl: mvdir storage/bdb/test/test059.tcl: mvdir storage/bdb/test/test060.tcl: mvdir storage/bdb/test/test061.tcl: mvdir storage/bdb/test/test062.tcl: mvdir storage/bdb/test/test063.tcl: mvdir storage/bdb/test/test064.tcl: mvdir storage/bdb/test/test065.tcl: mvdir storage/bdb/test/test066.tcl: mvdir storage/bdb/test/test067.tcl: mvdir storage/bdb/test/test068.tcl: mvdir storage/bdb/test/test069.tcl: mvdir storage/bdb/test/test070.tcl: mvdir storage/bdb/test/test071.tcl: mvdir storage/bdb/test/test072.tcl: mvdir storage/bdb/test/test073.tcl: mvdir storage/bdb/test/test074.tcl: mvdir storage/bdb/test/test075.tcl: mvdir storage/bdb/test/test076.tcl: mvdir storage/bdb/test/test077.tcl: mvdir storage/bdb/test/test078.tcl: mvdir storage/bdb/test/test079.tcl: mvdir storage/bdb/test/test080.tcl: mvdir storage/bdb/test/test081.tcl: mvdir storage/bdb/test/test082.tcl: mvdir storage/bdb/test/test083.tcl: mvdir storage/bdb/test/test084.tcl: mvdir storage/bdb/test/test085.tcl: mvdir storage/bdb/test/test086.tcl: mvdir storage/bdb/test/test087.tcl: mvdir storage/bdb/test/test088.tcl: mvdir storage/bdb/test/test089.tcl: mvdir storage/bdb/test/test090.tcl: mvdir storage/bdb/test/test091.tcl: mvdir storage/bdb/test/test092.tcl: mvdir storage/bdb/test/test093.tcl: mvdir storage/bdb/test/test094.tcl: mvdir storage/bdb/test/test095.tcl: mvdir storage/bdb/test/test096.tcl: mvdir storage/bdb/test/test097.tcl: mvdir storage/bdb/test/test098.tcl: mvdir storage/bdb/test/test099.tcl: mvdir storage/bdb/test/test100.tcl: mvdir storage/bdb/test/test101.tcl: mvdir storage/bdb/test/testparams.tcl: mvdir storage/bdb/test/testutils.tcl: mvdir storage/bdb/test/txn001.tcl: mvdir storage/bdb/test/txn002.tcl: mvdir storage/bdb/test/txn003.tcl: mvdir storage/bdb/test/txn004.tcl: mvdir storage/bdb/test/txn005.tcl: mvdir storage/bdb/test/txn006.tcl: mvdir storage/bdb/test/txn007.tcl: mvdir storage/bdb/test/txn008.tcl: mvdir storage/bdb/test/txn009.tcl: mvdir storage/bdb/test/txnscript.tcl: mvdir storage/bdb/test/update.tcl: mvdir storage/bdb/test/scr001/chk.code: mvdir storage/bdb/test/scr002/chk.def: mvdir storage/bdb/test/scr003/chk.define: mvdir storage/bdb/test/scr004/chk.javafiles: mvdir storage/bdb/test/scr005/chk.nl: mvdir storage/bdb/test/scr006/chk.offt: mvdir storage/bdb/test/scr007/chk.proto: mvdir storage/bdb/test/scr008/chk.pubdef: mvdir storage/bdb/test/scr009/chk.srcfiles: mvdir storage/bdb/test/scr010/chk.str: mvdir storage/bdb/test/scr010/spell.ok: mvdir storage/bdb/test/scr011/chk.tags: mvdir storage/bdb/test/scr012/chk.vx_code: mvdir storage/bdb/test/scr013/chk.stats: mvdir storage/bdb/test/scr014/chk.err: mvdir storage/bdb/test/scr015/README: mvdir storage/bdb/test/scr015/TestConstruct01.cpp: mvdir storage/bdb/test/scr015/TestConstruct01.testerr: mvdir storage/bdb/test/scr015/TestConstruct01.testout: mvdir storage/bdb/test/scr015/TestExceptInclude.cpp: mvdir storage/bdb/test/scr015/TestGetSetMethods.cpp: mvdir storage/bdb/test/scr015/TestKeyRange.cpp: mvdir storage/bdb/test/scr015/TestKeyRange.testin: mvdir storage/bdb/test/scr015/TestKeyRange.testout: mvdir storage/bdb/test/upgrade.tcl: mvdir storage/bdb/test/wordlist: mvdir storage/bdb/test/wrap.tcl: mvdir storage/bdb/test/scr015/TestLogc.cpp: mvdir storage/bdb/test/scr015/TestLogc.testout: mvdir storage/bdb/test/scr015/TestSimpleAccess.cpp: mvdir storage/bdb/test/scr015/TestSimpleAccess.testout: mvdir storage/bdb/test/scr015/TestTruncate.cpp: mvdir storage/bdb/test/scr015/TestTruncate.testout: mvdir storage/bdb/test/scr015/chk.cxxtests: mvdir storage/bdb/test/scr015/ignore: mvdir storage/bdb/test/scr015/testall: mvdir storage/bdb/test/scr015/testone: mvdir storage/bdb/test/scr016/CallbackTest.java: mvdir storage/bdb/test/scr016/CallbackTest.testout: mvdir storage/bdb/test/scr016/README: mvdir storage/bdb/test/scr016/TestAppendRecno.java: mvdir storage/bdb/test/scr016/TestAppendRecno.testout: mvdir storage/bdb/test/scr016/TestAssociate.java: mvdir storage/bdb/test/scr016/TestAssociate.testout: mvdir storage/bdb/test/scr016/TestClosedDb.java: mvdir storage/bdb/test/scr016/TestClosedDb.testout: mvdir storage/bdb/test/scr016/TestConstruct01.java: mvdir storage/bdb/test/scr016/TestConstruct01.testerr: mvdir storage/bdb/test/scr016/TestConstruct01.testout: mvdir storage/bdb/test/scr016/TestConstruct02.java: mvdir storage/bdb/test/scr016/TestConstruct02.testout: mvdir storage/bdb/test/scr016/TestDbtFlags.java: mvdir storage/bdb/test/scr016/TestDbtFlags.testerr: mvdir storage/bdb/test/scr016/TestDbtFlags.testout: mvdir storage/bdb/test/scr016/TestGetSetMethods.java: mvdir storage/bdb/test/scr016/TestKeyRange.java: mvdir storage/bdb/test/scr016/TestKeyRange.testout: mvdir storage/bdb/test/scr016/TestLockVec.java: mvdir storage/bdb/test/scr016/TestLockVec.testout: mvdir storage/bdb/test/scr016/TestLogc.java: mvdir storage/bdb/test/scr016/TestLogc.testout: mvdir storage/bdb/test/scr016/TestOpenEmpty.java: mvdir storage/bdb/test/scr016/TestOpenEmpty.testerr: mvdir storage/bdb/test/scr016/TestReplication.java: mvdir storage/bdb/test/scr016/TestRpcServer.java: mvdir storage/bdb/test/scr016/TestSameDbt.java: mvdir storage/bdb/test/scr016/TestSameDbt.testout: mvdir storage/bdb/test/scr016/TestSimpleAccess.java: mvdir storage/bdb/test/scr016/TestSimpleAccess.testout: mvdir storage/bdb/test/scr016/TestStat.java: mvdir storage/bdb/test/scr016/TestStat.testout: mvdir storage/bdb/test/scr016/TestTruncate.java: mvdir storage/bdb/test/scr016/TestTruncate.testout: mvdir storage/bdb/test/scr016/TestUtil.java: mvdir storage/bdb/test/scr016/TestXAServlet.java: mvdir storage/bdb/test/scr016/chk.javatests: mvdir storage/bdb/test/scr016/ignore: mvdir storage/bdb/test/scr016/testall: mvdir storage/bdb/test/scr016/testone: mvdir storage/bdb/test/scr017/O.BH: mvdir storage/bdb/test/scr017/O.R: mvdir storage/bdb/test/scr017/chk.db185: mvdir storage/bdb/test/scr017/t.c: mvdir storage/bdb/test/scr018/chk.comma: mvdir storage/bdb/test/scr018/t.c: mvdir storage/bdb/test/scr019/chk.include: mvdir storage/bdb/test/scr020/chk.inc: mvdir storage/bdb/test/scr021/chk.flags: mvdir storage/bdb/test/scr022/chk.rr: mvdir storage/bdb/txn/txn.c: mvdir storage/bdb/txn/txn.src: mvdir storage/bdb/txn/txn_method.c: mvdir storage/bdb/txn/txn_rec.c: mvdir storage/bdb/txn/txn_recover.c: mvdir storage/bdb/txn/txn_region.c: mvdir storage/bdb/txn/txn_stat.c: mvdir storage/bdb/txn/txn_util.c: mvdir storage/bdb/xa/xa.c: mvdir storage/bdb/xa/xa_db.c: mvdir storage/bdb/xa/xa_map.c: mvdir
This commit is contained in:
parent
c0333ecee4
commit
b7e422be1b
3252 changed files with 1 additions and 1 deletions
30
storage/innobase/Makefile.am
Normal file
30
storage/innobase/Makefile.am
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
# & Innobase Oy
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
# Process this file with automake to create Makefile.in
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
TAR = gtar
|
||||
|
||||
noinst_HEADERS = ib_config.h
|
||||
|
||||
SUBDIRS = os ut btr buf data dict dyn eval fil fsp fut \
|
||||
ha ibuf include lock log mach mem mtr page \
|
||||
pars que read rem row srv sync thr trx usr
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
24
storage/innobase/btr/Makefile.am
Normal file
24
storage/innobase/btr/Makefile.am
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
# & Innobase Oy
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
include ../include/Makefile.i
|
||||
|
||||
noinst_LIBRARIES = libbtr.a
|
||||
|
||||
libbtr_a_SOURCES = btr0btr.c btr0cur.c btr0pcur.c btr0sea.c
|
||||
|
||||
EXTRA_PROGRAMS =
|
||||
2970
storage/innobase/btr/btr0btr.c
Normal file
2970
storage/innobase/btr/btr0btr.c
Normal file
File diff suppressed because it is too large
Load diff
3781
storage/innobase/btr/btr0cur.c
Normal file
3781
storage/innobase/btr/btr0cur.c
Normal file
File diff suppressed because it is too large
Load diff
562
storage/innobase/btr/btr0pcur.c
Normal file
562
storage/innobase/btr/btr0pcur.c
Normal file
|
|
@ -0,0 +1,562 @@
|
|||
/******************************************************
|
||||
The index tree persistent cursor
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 2/23/1996 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#include "btr0pcur.h"
|
||||
|
||||
#ifdef UNIV_NONINL
|
||||
#include "btr0pcur.ic"
|
||||
#endif
|
||||
|
||||
#include "ut0byte.h"
|
||||
#include "rem0cmp.h"
|
||||
|
||||
/******************************************************************
|
||||
Allocates memory for a persistent cursor object and initializes the cursor. */
|
||||
|
||||
btr_pcur_t*
|
||||
btr_pcur_create_for_mysql(void)
|
||||
/*============================*/
|
||||
/* out, own: persistent cursor */
|
||||
{
|
||||
btr_pcur_t* pcur;
|
||||
|
||||
pcur = mem_alloc(sizeof(btr_pcur_t));
|
||||
|
||||
pcur->btr_cur.index = NULL;
|
||||
btr_pcur_init(pcur);
|
||||
|
||||
return(pcur);
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
Frees the memory for a persistent cursor object. */
|
||||
|
||||
void
|
||||
btr_pcur_free_for_mysql(
|
||||
/*====================*/
|
||||
btr_pcur_t* cursor) /* in, own: persistent cursor */
|
||||
{
|
||||
if (cursor->old_rec_buf != NULL) {
|
||||
|
||||
mem_free(cursor->old_rec_buf);
|
||||
|
||||
cursor->old_rec_buf = NULL;
|
||||
}
|
||||
|
||||
cursor->btr_cur.page_cur.rec = NULL;
|
||||
cursor->old_rec = NULL;
|
||||
cursor->old_n_fields = 0;
|
||||
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
||||
|
||||
cursor->latch_mode = BTR_NO_LATCHES;
|
||||
cursor->pos_state = BTR_PCUR_NOT_POSITIONED;
|
||||
|
||||
mem_free(cursor);
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
The position of the cursor is stored by taking an initial segment of the
|
||||
record the cursor is positioned on, before, or after, and copying it to the
|
||||
cursor data structure, or just setting a flag if the cursor id before the
|
||||
first in an EMPTY tree, or after the last in an EMPTY tree. NOTE that the
|
||||
page where the cursor is positioned must not be empty if the index tree is
|
||||
not totally empty! */
|
||||
|
||||
void
|
||||
btr_pcur_store_position(
|
||||
/*====================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
page_cur_t* page_cursor;
|
||||
rec_t* rec;
|
||||
dict_tree_t* tree;
|
||||
page_t* page;
|
||||
|
||||
ut_a(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||
ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
|
||||
|
||||
tree = btr_cur_get_tree(btr_pcur_get_btr_cur(cursor));
|
||||
|
||||
page_cursor = btr_pcur_get_page_cur(cursor);
|
||||
|
||||
rec = page_cur_get_rec(page_cursor);
|
||||
page = buf_frame_align(rec);
|
||||
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(page),
|
||||
MTR_MEMO_PAGE_S_FIX)
|
||||
|| mtr_memo_contains(mtr, buf_block_align(page),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
ut_a(cursor->latch_mode != BTR_NO_LATCHES);
|
||||
|
||||
if (page_get_n_recs(page) == 0) {
|
||||
/* It must be an empty index tree; NOTE that in this case
|
||||
we do not store the modify_clock, but always do a search
|
||||
if we restore the cursor position */
|
||||
|
||||
ut_a(btr_page_get_next(page, mtr) == FIL_NULL
|
||||
&& btr_page_get_prev(page, mtr) == FIL_NULL);
|
||||
|
||||
if (rec == page_get_supremum_rec(page)) {
|
||||
|
||||
cursor->rel_pos = BTR_PCUR_AFTER_LAST_IN_TREE;
|
||||
cursor->old_stored = BTR_PCUR_OLD_STORED;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
cursor->rel_pos = BTR_PCUR_BEFORE_FIRST_IN_TREE;
|
||||
cursor->old_stored = BTR_PCUR_OLD_STORED;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (rec == page_get_supremum_rec(page)) {
|
||||
|
||||
rec = page_rec_get_prev(rec);
|
||||
|
||||
cursor->rel_pos = BTR_PCUR_AFTER;
|
||||
|
||||
} else if (rec == page_get_infimum_rec(page)) {
|
||||
|
||||
rec = page_rec_get_next(rec);
|
||||
|
||||
cursor->rel_pos = BTR_PCUR_BEFORE;
|
||||
} else {
|
||||
cursor->rel_pos = BTR_PCUR_ON;
|
||||
}
|
||||
|
||||
cursor->old_stored = BTR_PCUR_OLD_STORED;
|
||||
cursor->old_rec = dict_tree_copy_rec_order_prefix(tree, rec,
|
||||
&cursor->old_n_fields,
|
||||
&cursor->old_rec_buf,
|
||||
&cursor->buf_size);
|
||||
|
||||
cursor->block_when_stored = buf_block_align(page);
|
||||
cursor->modify_clock = buf_frame_get_modify_clock(page);
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
Copies the stored position of a pcur to another pcur. */
|
||||
|
||||
void
|
||||
btr_pcur_copy_stored_position(
|
||||
/*==========================*/
|
||||
btr_pcur_t* pcur_receive, /* in: pcur which will receive the
|
||||
position info */
|
||||
btr_pcur_t* pcur_donate) /* in: pcur from which the info is
|
||||
copied */
|
||||
{
|
||||
if (pcur_receive->old_rec_buf) {
|
||||
mem_free(pcur_receive->old_rec_buf);
|
||||
}
|
||||
|
||||
ut_memcpy((byte*)pcur_receive, (byte*)pcur_donate, sizeof(btr_pcur_t));
|
||||
|
||||
if (pcur_donate->old_rec_buf) {
|
||||
|
||||
pcur_receive->old_rec_buf = mem_alloc(pcur_donate->buf_size);
|
||||
|
||||
ut_memcpy(pcur_receive->old_rec_buf, pcur_donate->old_rec_buf,
|
||||
pcur_donate->buf_size);
|
||||
pcur_receive->old_rec = pcur_receive->old_rec_buf
|
||||
+ (pcur_donate->old_rec - pcur_donate->old_rec_buf);
|
||||
}
|
||||
|
||||
pcur_receive->old_n_fields = pcur_donate->old_n_fields;
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
Restores the stored position of a persistent cursor bufferfixing the page and
|
||||
obtaining the specified latches. If the cursor position was saved when the
|
||||
(1) cursor was positioned on a user record: this function restores the position
|
||||
to the last record LESS OR EQUAL to the stored record;
|
||||
(2) cursor was positioned on a page infimum record: restores the position to
|
||||
the last record LESS than the user record which was the successor of the page
|
||||
infimum;
|
||||
(3) cursor was positioned on the page supremum: restores to the first record
|
||||
GREATER than the user record which was the predecessor of the supremum.
|
||||
(4) cursor was positioned before the first or after the last in an empty tree:
|
||||
restores to before first or after the last in the tree. */
|
||||
|
||||
ibool
|
||||
btr_pcur_restore_position(
|
||||
/*======================*/
|
||||
/* out: TRUE if the cursor position
|
||||
was stored when it was on a user record
|
||||
and it can be restored on a user record
|
||||
whose ordering fields are identical to
|
||||
the ones of the original user record */
|
||||
ulint latch_mode, /* in: BTR_SEARCH_LEAF, ... */
|
||||
btr_pcur_t* cursor, /* in: detached persistent cursor */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
dict_tree_t* tree;
|
||||
page_t* page;
|
||||
dtuple_t* tuple;
|
||||
ulint mode;
|
||||
ulint old_mode;
|
||||
ibool from_left;
|
||||
mem_heap_t* heap;
|
||||
|
||||
ut_a(cursor->pos_state == BTR_PCUR_WAS_POSITIONED
|
||||
|| cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||
ut_a(cursor->old_stored == BTR_PCUR_OLD_STORED);
|
||||
|
||||
if (cursor->rel_pos == BTR_PCUR_AFTER_LAST_IN_TREE
|
||||
|| cursor->rel_pos == BTR_PCUR_BEFORE_FIRST_IN_TREE) {
|
||||
|
||||
/* In these cases we do not try an optimistic restoration,
|
||||
but always do a search */
|
||||
|
||||
if (cursor->rel_pos == BTR_PCUR_BEFORE_FIRST_IN_TREE) {
|
||||
from_left = TRUE;
|
||||
} else {
|
||||
from_left = FALSE;
|
||||
}
|
||||
|
||||
btr_cur_open_at_index_side(from_left,
|
||||
btr_pcur_get_btr_cur(cursor)->index, latch_mode,
|
||||
btr_pcur_get_btr_cur(cursor), mtr);
|
||||
|
||||
cursor->block_when_stored =
|
||||
buf_block_align(btr_pcur_get_page(cursor));
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
ut_a(cursor->old_rec);
|
||||
ut_a(cursor->old_n_fields);
|
||||
|
||||
page = btr_cur_get_page(btr_pcur_get_btr_cur(cursor));
|
||||
|
||||
if (latch_mode == BTR_SEARCH_LEAF || latch_mode == BTR_MODIFY_LEAF) {
|
||||
/* Try optimistic restoration */
|
||||
|
||||
if (buf_page_optimistic_get(latch_mode,
|
||||
cursor->block_when_stored, page,
|
||||
cursor->modify_clock, mtr)) {
|
||||
cursor->pos_state = BTR_PCUR_IS_POSITIONED;
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_page_dbg_add_level(page, SYNC_TREE_NODE);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
if (cursor->rel_pos == BTR_PCUR_ON) {
|
||||
#ifdef UNIV_DEBUG
|
||||
rec_t* rec;
|
||||
ulint* offsets1;
|
||||
ulint* offsets2;
|
||||
dict_index_t* index;
|
||||
#endif /* UNIV_DEBUG */
|
||||
cursor->latch_mode = latch_mode;
|
||||
#ifdef UNIV_DEBUG
|
||||
rec = btr_pcur_get_rec(cursor);
|
||||
index = dict_tree_find_index(
|
||||
btr_cur_get_tree(
|
||||
btr_pcur_get_btr_cur(cursor)),
|
||||
rec);
|
||||
|
||||
heap = mem_heap_create(256);
|
||||
offsets1 = rec_get_offsets(cursor->old_rec,
|
||||
index, NULL,
|
||||
cursor->old_n_fields, &heap);
|
||||
offsets2 = rec_get_offsets(rec, index, NULL,
|
||||
cursor->old_n_fields, &heap);
|
||||
|
||||
ut_ad(cmp_rec_rec(cursor->old_rec,
|
||||
rec, offsets1, offsets2, index) == 0);
|
||||
mem_heap_free(heap);
|
||||
#endif /* UNIV_DEBUG */
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
/* If optimistic restoration did not succeed, open the cursor anew */
|
||||
|
||||
heap = mem_heap_create(256);
|
||||
|
||||
tree = btr_cur_get_tree(btr_pcur_get_btr_cur(cursor));
|
||||
tuple = dict_tree_build_data_tuple(tree, cursor->old_rec,
|
||||
cursor->old_n_fields, heap);
|
||||
|
||||
/* Save the old search mode of the cursor */
|
||||
old_mode = cursor->search_mode;
|
||||
|
||||
if (cursor->rel_pos == BTR_PCUR_ON) {
|
||||
mode = PAGE_CUR_LE;
|
||||
} else if (cursor->rel_pos == BTR_PCUR_AFTER) {
|
||||
mode = PAGE_CUR_G;
|
||||
} else {
|
||||
ut_ad(cursor->rel_pos == BTR_PCUR_BEFORE);
|
||||
mode = PAGE_CUR_L;
|
||||
}
|
||||
|
||||
btr_pcur_open_with_no_init(btr_pcur_get_btr_cur(cursor)->index, tuple,
|
||||
mode, latch_mode, cursor, 0, mtr);
|
||||
|
||||
/* Restore the old search mode */
|
||||
cursor->search_mode = old_mode;
|
||||
|
||||
if (cursor->rel_pos == BTR_PCUR_ON
|
||||
&& btr_pcur_is_on_user_rec(cursor, mtr)
|
||||
&& 0 == cmp_dtuple_rec(tuple, btr_pcur_get_rec(cursor),
|
||||
rec_get_offsets(btr_pcur_get_rec(cursor),
|
||||
btr_pcur_get_btr_cur(cursor)->index,
|
||||
NULL, ULINT_UNDEFINED, &heap))) {
|
||||
|
||||
/* We have to store the NEW value for the modify clock, since
|
||||
the cursor can now be on a different page! But we can retain
|
||||
the value of old_rec */
|
||||
|
||||
cursor->modify_clock =
|
||||
buf_frame_get_modify_clock(btr_pcur_get_page(cursor));
|
||||
|
||||
cursor->block_when_stored =
|
||||
buf_block_align(btr_pcur_get_page(cursor));
|
||||
|
||||
cursor->old_stored = BTR_PCUR_OLD_STORED;
|
||||
|
||||
mem_heap_free(heap);
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
mem_heap_free(heap);
|
||||
|
||||
/* We have to store new position information, modify_clock etc.,
|
||||
to the cursor because it can now be on a different page, the record
|
||||
under it may have been removed, etc. */
|
||||
|
||||
btr_pcur_store_position(cursor, mtr);
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
If the latch mode of the cursor is BTR_LEAF_SEARCH or BTR_LEAF_MODIFY,
|
||||
releases the page latch and bufferfix reserved by the cursor.
|
||||
NOTE! In the case of BTR_LEAF_MODIFY, there should not exist changes
|
||||
made by the current mini-transaction to the data protected by the
|
||||
cursor latch, as then the latch must not be released until mtr_commit. */
|
||||
|
||||
void
|
||||
btr_pcur_release_leaf(
|
||||
/*==================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
page_t* page;
|
||||
|
||||
ut_a(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||
ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
|
||||
|
||||
page = btr_cur_get_page(btr_pcur_get_btr_cur(cursor));
|
||||
|
||||
btr_leaf_page_release(page, cursor->latch_mode, mtr);
|
||||
|
||||
cursor->latch_mode = BTR_NO_LATCHES;
|
||||
|
||||
cursor->pos_state = BTR_PCUR_WAS_POSITIONED;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Moves the persistent cursor to the first record on the next page. Releases the
|
||||
latch on the current page, and bufferunfixes it. Note that there must not be
|
||||
modifications on the current page, as then the x-latch can be released only in
|
||||
mtr_commit. */
|
||||
|
||||
void
|
||||
btr_pcur_move_to_next_page(
|
||||
/*=======================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor; must be on the
|
||||
last record of the current page */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
ulint next_page_no;
|
||||
ulint space;
|
||||
page_t* page;
|
||||
page_t* next_page;
|
||||
|
||||
ut_a(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||
ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
|
||||
ut_ad(btr_pcur_is_after_last_on_page(cursor, mtr));
|
||||
|
||||
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
||||
|
||||
page = btr_pcur_get_page(cursor);
|
||||
|
||||
next_page_no = btr_page_get_next(page, mtr);
|
||||
space = buf_frame_get_space_id(page);
|
||||
|
||||
ut_ad(next_page_no != FIL_NULL);
|
||||
|
||||
next_page = btr_page_get(space, next_page_no, cursor->latch_mode, mtr);
|
||||
ut_a(page_is_comp(next_page) == page_is_comp(page));
|
||||
buf_block_align(next_page)->check_index_page_at_flush = TRUE;
|
||||
|
||||
btr_leaf_page_release(page, cursor->latch_mode, mtr);
|
||||
|
||||
page_cur_set_before_first(next_page, btr_pcur_get_page_cur(cursor));
|
||||
|
||||
page_check_dir(next_page);
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Moves the persistent cursor backward if it is on the first record of the page.
|
||||
Commits mtr. Note that to prevent a possible deadlock, the operation
|
||||
first stores the position of the cursor, commits mtr, acquires the necessary
|
||||
latches and restores the cursor position again before returning. The
|
||||
alphabetical position of the cursor is guaranteed to be sensible on
|
||||
return, but it may happen that the cursor is not positioned on the last
|
||||
record of any page, because the structure of the tree may have changed
|
||||
during the time when the cursor had no latches. */
|
||||
|
||||
void
|
||||
btr_pcur_move_backward_from_page(
|
||||
/*=============================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor, must be on the first
|
||||
record of the current page */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
ulint prev_page_no;
|
||||
ulint space;
|
||||
page_t* page;
|
||||
page_t* prev_page;
|
||||
ulint latch_mode;
|
||||
ulint latch_mode2;
|
||||
|
||||
ut_a(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||
ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
|
||||
ut_ad(btr_pcur_is_before_first_on_page(cursor, mtr));
|
||||
ut_ad(!btr_pcur_is_before_first_in_tree(cursor, mtr));
|
||||
|
||||
latch_mode = cursor->latch_mode;
|
||||
|
||||
if (latch_mode == BTR_SEARCH_LEAF) {
|
||||
|
||||
latch_mode2 = BTR_SEARCH_PREV;
|
||||
|
||||
} else if (latch_mode == BTR_MODIFY_LEAF) {
|
||||
|
||||
latch_mode2 = BTR_MODIFY_PREV;
|
||||
} else {
|
||||
latch_mode2 = 0; /* To eliminate compiler warning */
|
||||
ut_error;
|
||||
}
|
||||
|
||||
btr_pcur_store_position(cursor, mtr);
|
||||
|
||||
mtr_commit(mtr);
|
||||
|
||||
mtr_start(mtr);
|
||||
|
||||
btr_pcur_restore_position(latch_mode2, cursor, mtr);
|
||||
|
||||
page = btr_pcur_get_page(cursor);
|
||||
|
||||
prev_page_no = btr_page_get_prev(page, mtr);
|
||||
space = buf_frame_get_space_id(page);
|
||||
|
||||
if (btr_pcur_is_before_first_on_page(cursor, mtr)
|
||||
&& (prev_page_no != FIL_NULL)) {
|
||||
|
||||
prev_page = btr_pcur_get_btr_cur(cursor)->left_page;
|
||||
|
||||
btr_leaf_page_release(page, latch_mode, mtr);
|
||||
|
||||
page_cur_set_after_last(prev_page,
|
||||
btr_pcur_get_page_cur(cursor));
|
||||
} else if (prev_page_no != FIL_NULL) {
|
||||
|
||||
/* The repositioned cursor did not end on an infimum record on
|
||||
a page. Cursor repositioning acquired a latch also on the
|
||||
previous page, but we do not need the latch: release it. */
|
||||
|
||||
prev_page = btr_pcur_get_btr_cur(cursor)->left_page;
|
||||
|
||||
btr_leaf_page_release(prev_page, latch_mode, mtr);
|
||||
}
|
||||
|
||||
cursor->latch_mode = latch_mode;
|
||||
|
||||
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Moves the persistent cursor to the previous record in the tree. If no records
|
||||
are left, the cursor stays 'before first in tree'. */
|
||||
|
||||
ibool
|
||||
btr_pcur_move_to_prev(
|
||||
/*==================*/
|
||||
/* out: TRUE if the cursor was not before first
|
||||
in tree */
|
||||
btr_pcur_t* cursor, /* in: persistent cursor; NOTE that the
|
||||
function may release the page latch */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||
ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
|
||||
|
||||
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
||||
|
||||
if (btr_pcur_is_before_first_on_page(cursor, mtr)) {
|
||||
|
||||
if (btr_pcur_is_before_first_in_tree(cursor, mtr)) {
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
btr_pcur_move_backward_from_page(cursor, mtr);
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
btr_pcur_move_to_prev_on_page(cursor, mtr);
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
If mode is PAGE_CUR_G or PAGE_CUR_GE, opens a persistent cursor on the first
|
||||
user record satisfying the search condition, in the case PAGE_CUR_L or
|
||||
PAGE_CUR_LE, on the last user record. If no such user record exists, then
|
||||
in the first case sets the cursor after last in tree, and in the latter case
|
||||
before first in tree. The latching mode must be BTR_SEARCH_LEAF or
|
||||
BTR_MODIFY_LEAF. */
|
||||
|
||||
void
|
||||
btr_pcur_open_on_user_rec(
|
||||
/*======================*/
|
||||
dict_index_t* index, /* in: index */
|
||||
dtuple_t* tuple, /* in: tuple on which search done */
|
||||
ulint mode, /* in: PAGE_CUR_L, ... */
|
||||
ulint latch_mode, /* in: BTR_SEARCH_LEAF or
|
||||
BTR_MODIFY_LEAF */
|
||||
btr_pcur_t* cursor, /* in: memory buffer for persistent
|
||||
cursor */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
btr_pcur_open(index, tuple, mode, latch_mode, cursor, mtr);
|
||||
|
||||
if ((mode == PAGE_CUR_GE) || (mode == PAGE_CUR_G)) {
|
||||
|
||||
if (btr_pcur_is_after_last_on_page(cursor, mtr)) {
|
||||
|
||||
btr_pcur_move_to_next_user_rec(cursor, mtr);
|
||||
}
|
||||
} else {
|
||||
ut_ad((mode == PAGE_CUR_LE) || (mode == PAGE_CUR_L));
|
||||
|
||||
/* Not implemented yet */
|
||||
|
||||
ut_error;
|
||||
}
|
||||
}
|
||||
1670
storage/innobase/btr/btr0sea.c
Normal file
1670
storage/innobase/btr/btr0sea.c
Normal file
File diff suppressed because it is too large
Load diff
16
storage/innobase/btr/makefilewin
Normal file
16
storage/innobase/btr/makefilewin
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
include ..\include\makefile.i
|
||||
|
||||
btr.lib: btr0cur.obj btr0btr.obj btr0pcur.obj btr0sea.obj
|
||||
lib -out:..\libs\btr.lib btr0cur.obj btr0btr.obj btr0pcur.obj btr0sea.obj
|
||||
|
||||
btr0cur.obj: btr0cur.c
|
||||
$(CCOM) $(CFL) -c btr0cur.c
|
||||
|
||||
btr0btr.obj: btr0btr.c
|
||||
$(CCOM) $(CFL) -c btr0btr.c
|
||||
|
||||
btr0sea.obj: btr0sea.c
|
||||
$(CCOM) $(CFL) -c btr0sea.c
|
||||
|
||||
btr0pcur.obj: btr0pcur.c
|
||||
$(CCOM) $(CFL) -c btr0pcur.c
|
||||
24
storage/innobase/buf/Makefile.am
Normal file
24
storage/innobase/buf/Makefile.am
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
# & Innobase Oy
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
include ../include/Makefile.i
|
||||
|
||||
noinst_LIBRARIES = libbuf.a
|
||||
|
||||
libbuf_a_SOURCES = buf0buf.c buf0flu.c buf0lru.c buf0rea.c
|
||||
|
||||
EXTRA_PROGRAMS =
|
||||
2395
storage/innobase/buf/buf0buf.c
Normal file
2395
storage/innobase/buf/buf0buf.c
Normal file
File diff suppressed because it is too large
Load diff
1059
storage/innobase/buf/buf0flu.c
Normal file
1059
storage/innobase/buf/buf0flu.c
Normal file
File diff suppressed because it is too large
Load diff
1052
storage/innobase/buf/buf0lru.c
Normal file
1052
storage/innobase/buf/buf0lru.c
Normal file
File diff suppressed because it is too large
Load diff
718
storage/innobase/buf/buf0rea.c
Normal file
718
storage/innobase/buf/buf0rea.c
Normal file
|
|
@ -0,0 +1,718 @@
|
|||
/******************************************************
|
||||
The database buffer read
|
||||
|
||||
(c) 1995 Innobase Oy
|
||||
|
||||
Created 11/5/1995 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#include "buf0rea.h"
|
||||
|
||||
#include "fil0fil.h"
|
||||
#include "mtr0mtr.h"
|
||||
|
||||
#include "buf0buf.h"
|
||||
#include "buf0flu.h"
|
||||
#include "buf0lru.h"
|
||||
#include "ibuf0ibuf.h"
|
||||
#include "log0recv.h"
|
||||
#include "trx0sys.h"
|
||||
#include "os0file.h"
|
||||
#include "srv0start.h"
|
||||
|
||||
extern ulint srv_read_ahead_rnd;
|
||||
extern ulint srv_read_ahead_seq;
|
||||
extern ulint srv_buf_pool_reads;
|
||||
|
||||
/* The size in blocks of the area where the random read-ahead algorithm counts
|
||||
the accessed pages when deciding whether to read-ahead */
|
||||
#define BUF_READ_AHEAD_RANDOM_AREA BUF_READ_AHEAD_AREA
|
||||
|
||||
/* There must be at least this many pages in buf_pool in the area to start
|
||||
a random read-ahead */
|
||||
#define BUF_READ_AHEAD_RANDOM_THRESHOLD (5 + BUF_READ_AHEAD_RANDOM_AREA / 8)
|
||||
|
||||
/* The linear read-ahead area size */
|
||||
#define BUF_READ_AHEAD_LINEAR_AREA BUF_READ_AHEAD_AREA
|
||||
|
||||
/* The linear read-ahead threshold */
|
||||
#define BUF_READ_AHEAD_LINEAR_THRESHOLD (3 * BUF_READ_AHEAD_LINEAR_AREA / 8)
|
||||
|
||||
/* If there are buf_pool->curr_size per the number below pending reads, then
|
||||
read-ahead is not done: this is to prevent flooding the buffer pool with
|
||||
i/o-fixed buffer blocks */
|
||||
#define BUF_READ_AHEAD_PEND_LIMIT 2
|
||||
|
||||
/************************************************************************
|
||||
Low-level function which reads a page asynchronously from a file to the
|
||||
buffer buf_pool if it is not already there, in which case does nothing.
|
||||
Sets the io_fix flag and sets an exclusive lock on the buffer frame. The
|
||||
flag is cleared and the x-lock released by an i/o-handler thread. */
|
||||
static
|
||||
ulint
|
||||
buf_read_page_low(
|
||||
/*==============*/
|
||||
/* out: 1 if a read request was queued, 0 if the page
|
||||
already resided in buf_pool, or if the page is in
|
||||
the doublewrite buffer blocks in which case it is never
|
||||
read into the pool, or if the tablespace does not
|
||||
exist or is being dropped */
|
||||
ulint* err, /* out: DB_SUCCESS or DB_TABLESPACE_DELETED if we are
|
||||
trying to read from a non-existent tablespace, or a
|
||||
tablespace which is just now being dropped */
|
||||
ibool sync, /* in: TRUE if synchronous aio is desired */
|
||||
ulint mode, /* in: BUF_READ_IBUF_PAGES_ONLY, ...,
|
||||
ORed to OS_AIO_SIMULATED_WAKE_LATER (see below
|
||||
at read-ahead functions) */
|
||||
ulint space, /* in: space id */
|
||||
ib_longlong tablespace_version, /* in: if the space memory object has
|
||||
this timestamp different from what we are giving here,
|
||||
treat the tablespace as dropped; this is a timestamp we
|
||||
use to stop dangling page reads from a tablespace
|
||||
which we have DISCARDed + IMPORTed back */
|
||||
ulint offset) /* in: page number */
|
||||
{
|
||||
buf_block_t* block;
|
||||
ulint wake_later;
|
||||
|
||||
*err = DB_SUCCESS;
|
||||
|
||||
wake_later = mode & OS_AIO_SIMULATED_WAKE_LATER;
|
||||
mode = mode & ~OS_AIO_SIMULATED_WAKE_LATER;
|
||||
|
||||
if (trx_doublewrite && space == TRX_SYS_SPACE
|
||||
&& ( (offset >= trx_doublewrite->block1
|
||||
&& offset < trx_doublewrite->block1
|
||||
+ TRX_SYS_DOUBLEWRITE_BLOCK_SIZE)
|
||||
|| (offset >= trx_doublewrite->block2
|
||||
&& offset < trx_doublewrite->block2
|
||||
+ TRX_SYS_DOUBLEWRITE_BLOCK_SIZE))) {
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr,
|
||||
" InnoDB: Warning: trying to read doublewrite buffer page %lu\n",
|
||||
(ulong) offset);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
#ifdef UNIV_LOG_DEBUG
|
||||
if (space % 2 == 1) {
|
||||
/* We are updating a replicate space while holding the
|
||||
log mutex: the read must be handled before other reads
|
||||
which might incur ibuf operations and thus write to the log */
|
||||
|
||||
fputs("Log debug: reading replicate page in sync mode\n",
|
||||
stderr);
|
||||
|
||||
sync = TRUE;
|
||||
}
|
||||
#endif
|
||||
if (ibuf_bitmap_page(offset) || trx_sys_hdr_page(space, offset)) {
|
||||
|
||||
/* Trx sys header is so low in the latching order that we play
|
||||
safe and do not leave the i/o-completion to an asynchronous
|
||||
i/o-thread. Ibuf bitmap pages must always be read with
|
||||
syncronous i/o, to make sure they do not get involved in
|
||||
thread deadlocks. */
|
||||
|
||||
sync = TRUE;
|
||||
}
|
||||
|
||||
/* The following call will also check if the tablespace does not exist
|
||||
or is being dropped; if we succeed in initing the page in the buffer
|
||||
pool for read, then DISCARD cannot proceed until the read has
|
||||
completed */
|
||||
block = buf_page_init_for_read(err, mode, space, tablespace_version,
|
||||
offset);
|
||||
if (block == NULL) {
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
#ifdef UNIV_DEBUG
|
||||
if (buf_debug_prints) {
|
||||
fprintf(stderr,
|
||||
"Posting read request for page %lu, sync %lu\n",
|
||||
(ulong) offset,
|
||||
(ulong) sync);
|
||||
}
|
||||
#endif
|
||||
|
||||
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
|
||||
|
||||
*err = fil_io(OS_FILE_READ | wake_later,
|
||||
sync, space,
|
||||
offset, 0, UNIV_PAGE_SIZE,
|
||||
(void*)block->frame, (void*)block);
|
||||
ut_a(*err == DB_SUCCESS);
|
||||
|
||||
if (sync) {
|
||||
/* The i/o is already completed when we arrive from
|
||||
fil_read */
|
||||
buf_page_io_complete(block);
|
||||
}
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Applies a random read-ahead in buf_pool if there are at least a threshold
|
||||
value of accessed pages from the random read-ahead area. Does not read any
|
||||
page, not even the one at the position (space, offset), if the read-ahead
|
||||
mechanism is not activated. NOTE 1: the calling thread may own latches on
|
||||
pages: to avoid deadlocks this function must be written such that it cannot
|
||||
end up waiting for these latches! NOTE 2: the calling thread must want
|
||||
access to the page given: this rule is set to prevent unintended read-aheads
|
||||
performed by ibuf routines, a situation which could result in a deadlock if
|
||||
the OS does not support asynchronous i/o. */
|
||||
static
|
||||
ulint
|
||||
buf_read_ahead_random(
|
||||
/*==================*/
|
||||
/* out: number of page read requests issued; NOTE
|
||||
that if we read ibuf pages, it may happen that
|
||||
the page at the given page number does not get
|
||||
read even if we return a value > 0! */
|
||||
ulint space, /* in: space id */
|
||||
ulint offset) /* in: page number of a page which the current thread
|
||||
wants to access */
|
||||
{
|
||||
ib_longlong tablespace_version;
|
||||
buf_block_t* block;
|
||||
ulint recent_blocks = 0;
|
||||
ulint count;
|
||||
ulint LRU_recent_limit;
|
||||
ulint ibuf_mode;
|
||||
ulint low, high;
|
||||
ulint err;
|
||||
ulint i;
|
||||
|
||||
if (srv_startup_is_before_trx_rollback_phase) {
|
||||
/* No read-ahead to avoid thread deadlocks */
|
||||
return(0);
|
||||
}
|
||||
|
||||
if (ibuf_bitmap_page(offset) || trx_sys_hdr_page(space, offset)) {
|
||||
|
||||
/* If it is an ibuf bitmap page or trx sys hdr, we do
|
||||
no read-ahead, as that could break the ibuf page access
|
||||
order */
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* Remember the tablespace version before we ask te tablespace size
|
||||
below: if DISCARD + IMPORT changes the actual .ibd file meanwhile, we
|
||||
do not try to read outside the bounds of the tablespace! */
|
||||
|
||||
tablespace_version = fil_space_get_version(space);
|
||||
|
||||
low = (offset / BUF_READ_AHEAD_RANDOM_AREA)
|
||||
* BUF_READ_AHEAD_RANDOM_AREA;
|
||||
high = (offset / BUF_READ_AHEAD_RANDOM_AREA + 1)
|
||||
* BUF_READ_AHEAD_RANDOM_AREA;
|
||||
if (high > fil_space_get_size(space)) {
|
||||
|
||||
high = fil_space_get_size(space);
|
||||
}
|
||||
|
||||
/* Get the minimum LRU_position field value for an initial segment
|
||||
of the LRU list, to determine which blocks have recently been added
|
||||
to the start of the list. */
|
||||
|
||||
LRU_recent_limit = buf_LRU_get_recent_limit();
|
||||
|
||||
mutex_enter(&(buf_pool->mutex));
|
||||
|
||||
if (buf_pool->n_pend_reads >
|
||||
buf_pool->curr_size / BUF_READ_AHEAD_PEND_LIMIT) {
|
||||
mutex_exit(&(buf_pool->mutex));
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* Count how many blocks in the area have been recently accessed,
|
||||
that is, reside near the start of the LRU list. */
|
||||
|
||||
for (i = low; i < high; i++) {
|
||||
block = buf_page_hash_get(space, i);
|
||||
|
||||
if ((block)
|
||||
&& (block->LRU_position > LRU_recent_limit)
|
||||
&& block->accessed) {
|
||||
|
||||
recent_blocks++;
|
||||
}
|
||||
}
|
||||
|
||||
mutex_exit(&(buf_pool->mutex));
|
||||
|
||||
if (recent_blocks < BUF_READ_AHEAD_RANDOM_THRESHOLD) {
|
||||
/* Do nothing */
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* Read all the suitable blocks within the area */
|
||||
|
||||
if (ibuf_inside()) {
|
||||
ibuf_mode = BUF_READ_IBUF_PAGES_ONLY;
|
||||
} else {
|
||||
ibuf_mode = BUF_READ_ANY_PAGE;
|
||||
}
|
||||
|
||||
count = 0;
|
||||
|
||||
for (i = low; i < high; i++) {
|
||||
/* It is only sensible to do read-ahead in the non-sync aio
|
||||
mode: hence FALSE as the first parameter */
|
||||
|
||||
if (!ibuf_bitmap_page(i)) {
|
||||
count += buf_read_page_low(&err, FALSE, ibuf_mode
|
||||
| OS_AIO_SIMULATED_WAKE_LATER,
|
||||
space, tablespace_version, i);
|
||||
if (err == DB_TABLESPACE_DELETED) {
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr,
|
||||
" InnoDB: Warning: in random readahead trying to access tablespace\n"
|
||||
"InnoDB: %lu page no. %lu,\n"
|
||||
"InnoDB: but the tablespace does not exist or is just being dropped.\n",
|
||||
(ulong) space, (ulong) i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* In simulated aio we wake the aio handler threads only after
|
||||
queuing all aio requests, in native aio the following call does
|
||||
nothing: */
|
||||
|
||||
os_aio_simulated_wake_handler_threads();
|
||||
|
||||
if (buf_debug_prints && (count > 0)) {
|
||||
fprintf(stderr,
|
||||
"Random read-ahead space %lu offset %lu pages %lu\n",
|
||||
(ulong) space, (ulong) offset,
|
||||
(ulong) count);
|
||||
}
|
||||
|
||||
++srv_read_ahead_rnd;
|
||||
return(count);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
High-level function which reads a page asynchronously from a file to the
|
||||
buffer buf_pool if it is not already there. Sets the io_fix flag and sets
|
||||
an exclusive lock on the buffer frame. The flag is cleared and the x-lock
|
||||
released by the i/o-handler thread. Does a random read-ahead if it seems
|
||||
sensible. */
|
||||
|
||||
ulint
|
||||
buf_read_page(
|
||||
/*==========*/
|
||||
/* out: number of page read requests issued: this can
|
||||
be > 1 if read-ahead occurred */
|
||||
ulint space, /* in: space id */
|
||||
ulint offset) /* in: page number */
|
||||
{
|
||||
ib_longlong tablespace_version;
|
||||
ulint count;
|
||||
ulint count2;
|
||||
ulint err;
|
||||
|
||||
tablespace_version = fil_space_get_version(space);
|
||||
|
||||
count = buf_read_ahead_random(space, offset);
|
||||
|
||||
/* We do the i/o in the synchronous aio mode to save thread
|
||||
switches: hence TRUE */
|
||||
|
||||
count2 = buf_read_page_low(&err, TRUE, BUF_READ_ANY_PAGE, space,
|
||||
tablespace_version, offset);
|
||||
srv_buf_pool_reads+= count2;
|
||||
if (err == DB_TABLESPACE_DELETED) {
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr,
|
||||
" InnoDB: Error: trying to access tablespace %lu page no. %lu,\n"
|
||||
"InnoDB: but the tablespace does not exist or is just being dropped.\n",
|
||||
(ulong) space, (ulong) offset);
|
||||
}
|
||||
|
||||
/* Flush pages from the end of the LRU list if necessary */
|
||||
buf_flush_free_margin();
|
||||
|
||||
return(count + count2);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Applies linear read-ahead if in the buf_pool the page is a border page of
|
||||
a linear read-ahead area and all the pages in the area have been accessed.
|
||||
Does not read any page if the read-ahead mechanism is not activated. Note
|
||||
that the the algorithm looks at the 'natural' adjacent successor and
|
||||
predecessor of the page, which on the leaf level of a B-tree are the next
|
||||
and previous page in the chain of leaves. To know these, the page specified
|
||||
in (space, offset) must already be present in the buf_pool. Thus, the
|
||||
natural way to use this function is to call it when a page in the buf_pool
|
||||
is accessed the first time, calling this function just after it has been
|
||||
bufferfixed.
|
||||
NOTE 1: as this function looks at the natural predecessor and successor
|
||||
fields on the page, what happens, if these are not initialized to any
|
||||
sensible value? No problem, before applying read-ahead we check that the
|
||||
area to read is within the span of the space, if not, read-ahead is not
|
||||
applied. An uninitialized value may result in a useless read operation, but
|
||||
only very improbably.
|
||||
NOTE 2: the calling thread may own latches on pages: to avoid deadlocks this
|
||||
function must be written such that it cannot end up waiting for these
|
||||
latches!
|
||||
NOTE 3: the calling thread must want access to the page given: this rule is
|
||||
set to prevent unintended read-aheads performed by ibuf routines, a situation
|
||||
which could result in a deadlock if the OS does not support asynchronous io. */
|
||||
|
||||
ulint
|
||||
buf_read_ahead_linear(
|
||||
/*==================*/
|
||||
/* out: number of page read requests issued */
|
||||
ulint space, /* in: space id */
|
||||
ulint offset) /* in: page number of a page; NOTE: the current thread
|
||||
must want access to this page (see NOTE 3 above) */
|
||||
{
|
||||
ib_longlong tablespace_version;
|
||||
buf_block_t* block;
|
||||
buf_frame_t* frame;
|
||||
buf_block_t* pred_block = NULL;
|
||||
ulint pred_offset;
|
||||
ulint succ_offset;
|
||||
ulint count;
|
||||
int asc_or_desc;
|
||||
ulint new_offset;
|
||||
ulint fail_count;
|
||||
ulint ibuf_mode;
|
||||
ulint low, high;
|
||||
ulint err;
|
||||
ulint i;
|
||||
|
||||
if (srv_startup_is_before_trx_rollback_phase) {
|
||||
/* No read-ahead to avoid thread deadlocks */
|
||||
return(0);
|
||||
}
|
||||
|
||||
if (ibuf_bitmap_page(offset) || trx_sys_hdr_page(space, offset)) {
|
||||
|
||||
/* If it is an ibuf bitmap page or trx sys hdr, we do
|
||||
no read-ahead, as that could break the ibuf page access
|
||||
order */
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
low = (offset / BUF_READ_AHEAD_LINEAR_AREA)
|
||||
* BUF_READ_AHEAD_LINEAR_AREA;
|
||||
high = (offset / BUF_READ_AHEAD_LINEAR_AREA + 1)
|
||||
* BUF_READ_AHEAD_LINEAR_AREA;
|
||||
|
||||
if ((offset != low) && (offset != high - 1)) {
|
||||
/* This is not a border page of the area: return */
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* Remember the tablespace version before we ask te tablespace size
|
||||
below: if DISCARD + IMPORT changes the actual .ibd file meanwhile, we
|
||||
do not try to read outside the bounds of the tablespace! */
|
||||
|
||||
tablespace_version = fil_space_get_version(space);
|
||||
|
||||
mutex_enter(&(buf_pool->mutex));
|
||||
|
||||
if (high > fil_space_get_size(space)) {
|
||||
mutex_exit(&(buf_pool->mutex));
|
||||
/* The area is not whole, return */
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
if (buf_pool->n_pend_reads >
|
||||
buf_pool->curr_size / BUF_READ_AHEAD_PEND_LIMIT) {
|
||||
mutex_exit(&(buf_pool->mutex));
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* Check that almost all pages in the area have been accessed; if
|
||||
offset == low, the accesses must be in a descending order, otherwise,
|
||||
in an ascending order. */
|
||||
|
||||
asc_or_desc = 1;
|
||||
|
||||
if (offset == low) {
|
||||
asc_or_desc = -1;
|
||||
}
|
||||
|
||||
fail_count = 0;
|
||||
|
||||
for (i = low; i < high; i++) {
|
||||
block = buf_page_hash_get(space, i);
|
||||
|
||||
if ((block == NULL) || !block->accessed) {
|
||||
/* Not accessed */
|
||||
fail_count++;
|
||||
|
||||
} else if (pred_block && (ut_ulint_cmp(block->LRU_position,
|
||||
pred_block->LRU_position)
|
||||
!= asc_or_desc)) {
|
||||
/* Accesses not in the right order */
|
||||
|
||||
fail_count++;
|
||||
pred_block = block;
|
||||
}
|
||||
}
|
||||
|
||||
if (fail_count > BUF_READ_AHEAD_LINEAR_AREA -
|
||||
BUF_READ_AHEAD_LINEAR_THRESHOLD) {
|
||||
/* Too many failures: return */
|
||||
|
||||
mutex_exit(&(buf_pool->mutex));
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* If we got this far, we know that enough pages in the area have
|
||||
been accessed in the right order: linear read-ahead can be sensible */
|
||||
|
||||
block = buf_page_hash_get(space, offset);
|
||||
|
||||
if (block == NULL) {
|
||||
mutex_exit(&(buf_pool->mutex));
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
frame = block->frame;
|
||||
|
||||
/* Read the natural predecessor and successor page addresses from
|
||||
the page; NOTE that because the calling thread may have an x-latch
|
||||
on the page, we do not acquire an s-latch on the page, this is to
|
||||
prevent deadlocks. Even if we read values which are nonsense, the
|
||||
algorithm will work. */
|
||||
|
||||
pred_offset = fil_page_get_prev(frame);
|
||||
succ_offset = fil_page_get_next(frame);
|
||||
|
||||
mutex_exit(&(buf_pool->mutex));
|
||||
|
||||
if ((offset == low) && (succ_offset == offset + 1)) {
|
||||
|
||||
/* This is ok, we can continue */
|
||||
new_offset = pred_offset;
|
||||
|
||||
} else if ((offset == high - 1) && (pred_offset == offset - 1)) {
|
||||
|
||||
/* This is ok, we can continue */
|
||||
new_offset = succ_offset;
|
||||
} else {
|
||||
/* Successor or predecessor not in the right order */
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
low = (new_offset / BUF_READ_AHEAD_LINEAR_AREA)
|
||||
* BUF_READ_AHEAD_LINEAR_AREA;
|
||||
high = (new_offset / BUF_READ_AHEAD_LINEAR_AREA + 1)
|
||||
* BUF_READ_AHEAD_LINEAR_AREA;
|
||||
|
||||
if ((new_offset != low) && (new_offset != high - 1)) {
|
||||
/* This is not a border page of the area: return */
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
if (high > fil_space_get_size(space)) {
|
||||
/* The area is not whole, return */
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* If we got this far, read-ahead can be sensible: do it */
|
||||
|
||||
if (ibuf_inside()) {
|
||||
ibuf_mode = BUF_READ_IBUF_PAGES_ONLY;
|
||||
} else {
|
||||
ibuf_mode = BUF_READ_ANY_PAGE;
|
||||
}
|
||||
|
||||
count = 0;
|
||||
|
||||
/* Since Windows XP seems to schedule the i/o handler thread
|
||||
very eagerly, and consequently it does not wait for the
|
||||
full read batch to be posted, we use special heuristics here */
|
||||
|
||||
os_aio_simulated_put_read_threads_to_sleep();
|
||||
|
||||
for (i = low; i < high; i++) {
|
||||
/* It is only sensible to do read-ahead in the non-sync
|
||||
aio mode: hence FALSE as the first parameter */
|
||||
|
||||
if (!ibuf_bitmap_page(i)) {
|
||||
count += buf_read_page_low(&err, FALSE, ibuf_mode
|
||||
| OS_AIO_SIMULATED_WAKE_LATER,
|
||||
space, tablespace_version, i);
|
||||
if (err == DB_TABLESPACE_DELETED) {
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr,
|
||||
" InnoDB: Warning: in linear readahead trying to access tablespace\n"
|
||||
"InnoDB: %lu page no. %lu,\n"
|
||||
"InnoDB: but the tablespace does not exist or is just being dropped.\n",
|
||||
(ulong) space, (ulong) i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* In simulated aio we wake the aio handler threads only after
|
||||
queuing all aio requests, in native aio the following call does
|
||||
nothing: */
|
||||
|
||||
os_aio_simulated_wake_handler_threads();
|
||||
|
||||
/* Flush pages from the end of the LRU list if necessary */
|
||||
buf_flush_free_margin();
|
||||
|
||||
if (buf_debug_prints && (count > 0)) {
|
||||
fprintf(stderr,
|
||||
"LINEAR read-ahead space %lu offset %lu pages %lu\n",
|
||||
(ulong) space, (ulong) offset, (ulong) count);
|
||||
}
|
||||
|
||||
++srv_read_ahead_seq;
|
||||
return(count);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Issues read requests for pages which the ibuf module wants to read in, in
|
||||
order to contract the insert buffer tree. Technically, this function is like
|
||||
a read-ahead function. */
|
||||
|
||||
void
|
||||
buf_read_ibuf_merge_pages(
|
||||
/*======================*/
|
||||
ibool sync, /* in: TRUE if the caller wants this function
|
||||
to wait for the highest address page to get
|
||||
read in, before this function returns */
|
||||
ulint* space_ids, /* in: array of space ids */
|
||||
ib_longlong* space_versions,/* in: the spaces must have this version
|
||||
number (timestamp), otherwise we discard the
|
||||
read; we use this to cancel reads if
|
||||
DISCARD + IMPORT may have changed the
|
||||
tablespace size */
|
||||
ulint* page_nos, /* in: array of page numbers to read, with the
|
||||
highest page number the last in the array */
|
||||
ulint n_stored) /* in: number of page numbers in the array */
|
||||
{
|
||||
ulint err;
|
||||
ulint i;
|
||||
|
||||
ut_ad(!ibuf_inside());
|
||||
#ifdef UNIV_IBUF_DEBUG
|
||||
ut_a(n_stored < UNIV_PAGE_SIZE);
|
||||
#endif
|
||||
while (buf_pool->n_pend_reads >
|
||||
buf_pool->curr_size / BUF_READ_AHEAD_PEND_LIMIT) {
|
||||
os_thread_sleep(500000);
|
||||
}
|
||||
|
||||
for (i = 0; i < n_stored; i++) {
|
||||
if ((i + 1 == n_stored) && sync) {
|
||||
buf_read_page_low(&err, TRUE, BUF_READ_ANY_PAGE,
|
||||
space_ids[i], space_versions[i], page_nos[i]);
|
||||
} else {
|
||||
buf_read_page_low(&err, FALSE, BUF_READ_ANY_PAGE,
|
||||
space_ids[i], space_versions[i], page_nos[i]);
|
||||
}
|
||||
|
||||
if (err == DB_TABLESPACE_DELETED) {
|
||||
/* We have deleted or are deleting the single-table
|
||||
tablespace: remove the entries for that page */
|
||||
|
||||
ibuf_merge_or_delete_for_page(NULL, space_ids[i],
|
||||
page_nos[i], FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
os_aio_simulated_wake_handler_threads();
|
||||
|
||||
/* Flush pages from the end of the LRU list if necessary */
|
||||
buf_flush_free_margin();
|
||||
|
||||
if (buf_debug_prints) {
|
||||
fprintf(stderr,
|
||||
"Ibuf merge read-ahead space %lu pages %lu\n",
|
||||
(ulong) space_ids[0], (ulong) n_stored);
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Issues read requests for pages which recovery wants to read in. */
|
||||
|
||||
void
|
||||
buf_read_recv_pages(
|
||||
/*================*/
|
||||
ibool sync, /* in: TRUE if the caller wants this function
|
||||
to wait for the highest address page to get
|
||||
read in, before this function returns */
|
||||
ulint space, /* in: space id */
|
||||
ulint* page_nos, /* in: array of page numbers to read, with the
|
||||
highest page number the last in the array */
|
||||
ulint n_stored) /* in: number of page numbers in the array */
|
||||
{
|
||||
ib_longlong tablespace_version;
|
||||
ulint count;
|
||||
ulint err;
|
||||
ulint i;
|
||||
|
||||
tablespace_version = fil_space_get_version(space);
|
||||
|
||||
for (i = 0; i < n_stored; i++) {
|
||||
|
||||
count = 0;
|
||||
|
||||
os_aio_print_debug = FALSE;
|
||||
|
||||
while (buf_pool->n_pend_reads >= recv_n_pool_free_frames / 2) {
|
||||
|
||||
os_aio_simulated_wake_handler_threads();
|
||||
os_thread_sleep(500000);
|
||||
|
||||
count++;
|
||||
|
||||
if (count > 100) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Error: InnoDB has waited for 50 seconds for pending\n"
|
||||
"InnoDB: reads to the buffer pool to be finished.\n"
|
||||
"InnoDB: Number of pending reads %lu, pending pread calls %lu\n",
|
||||
(ulong) buf_pool->n_pend_reads,
|
||||
(ulong)os_file_n_pending_preads);
|
||||
|
||||
os_aio_print_debug = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
os_aio_print_debug = FALSE;
|
||||
|
||||
if ((i + 1 == n_stored) && sync) {
|
||||
buf_read_page_low(&err, TRUE, BUF_READ_ANY_PAGE, space,
|
||||
tablespace_version, page_nos[i]);
|
||||
} else {
|
||||
buf_read_page_low(&err, FALSE, BUF_READ_ANY_PAGE
|
||||
| OS_AIO_SIMULATED_WAKE_LATER,
|
||||
space, tablespace_version, page_nos[i]);
|
||||
}
|
||||
}
|
||||
|
||||
os_aio_simulated_wake_handler_threads();
|
||||
|
||||
/* Flush pages from the end of the LRU list if necessary */
|
||||
buf_flush_free_margin();
|
||||
|
||||
if (buf_debug_prints) {
|
||||
fprintf(stderr,
|
||||
"Recovery applies read-ahead pages %lu\n", (ulong) n_stored);
|
||||
}
|
||||
}
|
||||
20
storage/innobase/buf/makefilewin
Normal file
20
storage/innobase/buf/makefilewin
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
include ..\include\makefile.i
|
||||
|
||||
buf.lib: buf0buf.obj buf0lru.obj buf0flu.obj buf0rea.obj
|
||||
lib -out:..\libs\buf.lib buf0buf.obj buf0lru.obj buf0flu.obj buf0rea.obj
|
||||
|
||||
buf0buf.obj: buf0buf.c
|
||||
$(CCOM) $(CFL) -c buf0buf.c
|
||||
|
||||
buf0lru.obj: buf0lru.c
|
||||
$(CCOM) $(CFL) -c buf0lru.c
|
||||
|
||||
buf0flu.obj: buf0flu.c
|
||||
$(CCOM) $(CFL) -c buf0flu.c
|
||||
|
||||
buf0rea.obj: buf0rea.c
|
||||
$(CCOM) $(CFL) -c buf0rea.c
|
||||
|
||||
|
||||
|
||||
|
||||
130
storage/innobase/configure.in
Normal file
130
storage/innobase/configure.in
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
# Process this file with autoconf to produce a configure script
|
||||
AC_INIT
|
||||
AC_CANONICAL_SYSTEM
|
||||
AM_MAINTAINER_MODE
|
||||
AM_CONFIG_HEADER(ib_config.h)
|
||||
AM_INIT_AUTOMAKE(ib, 0.90)
|
||||
|
||||
# This is need before AC_PROG_CC
|
||||
#
|
||||
|
||||
if test "x${CFLAGS-}" = x ; then
|
||||
cflags_is_set=no
|
||||
else
|
||||
cflags_is_set=yes
|
||||
fi
|
||||
|
||||
if test "x${CPPFLAGS-}" = x ; then
|
||||
cppflags_is_set=no
|
||||
else
|
||||
cppflags_is_set=yes
|
||||
fi
|
||||
|
||||
if test "x${LDFLAGS-}" = x ; then
|
||||
ldflags_is_set=no
|
||||
else
|
||||
ldflags_is_set=yes
|
||||
fi
|
||||
|
||||
# The following hack should ensure that configure doesn't add optimizing
|
||||
# or debugging flags to CFLAGS or CXXFLAGS
|
||||
CFLAGS="$CFLAGS "
|
||||
CXXFLAGS="$CXXFLAGS "
|
||||
|
||||
AC_PROG_CC
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LIBTOOL
|
||||
AC_CHECK_HEADERS(aio.h sched.h)
|
||||
AC_CHECK_SIZEOF(int, 4)
|
||||
AC_CHECK_SIZEOF(long, 4)
|
||||
AC_CHECK_SIZEOF(void*, 4)
|
||||
AC_CHECK_FUNCS(sched_yield)
|
||||
AC_CHECK_FUNCS(fdatasync)
|
||||
AC_CHECK_FUNCS(localtime_r)
|
||||
#AC_CHECK_FUNCS(readdir_r) MySQL checks that it has also the right args.
|
||||
# Some versions of Unix only take 2 arguments.
|
||||
#AC_C_INLINE Already checked in MySQL
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
# Build optimized or debug version ?
|
||||
# First check for gcc and g++
|
||||
if test "$ac_cv_prog_gcc" = "yes"
|
||||
then
|
||||
DEBUG_CFLAGS="-g"
|
||||
DEBUG_OPTIMIZE_CC="-O"
|
||||
OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE"
|
||||
else
|
||||
DEBUG_CFLAGS="-g"
|
||||
DEBUG_OPTIMIZE_CC=""
|
||||
OPTIMIZE_CFLAGS="-O"
|
||||
fi
|
||||
if test "$ac_cv_prog_cxx_g" = "yes"
|
||||
then
|
||||
DEBUG_CXXFLAGS="-g"
|
||||
DEBUG_OPTIMIZE_CXX="-O"
|
||||
OPTIMIZE_CXXFLAGS="-O3"
|
||||
else
|
||||
DEBUG_CXXFLAGS="-g"
|
||||
DEBUG_OPTIMIZE_CXX=""
|
||||
OPTIMIZE_CXXFLAGS="-O"
|
||||
fi
|
||||
AC_ARG_WITH(debug,
|
||||
[ --without-debug Build a production version without debugging code],
|
||||
[with_debug=$withval],
|
||||
[with_debug=no])
|
||||
if test "$with_debug" = "yes"
|
||||
then
|
||||
# Medium debug.
|
||||
CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC -DDBUG_ON -DSAFE_MUTEX $CFLAGS"
|
||||
CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DSAFE_MUTEX $CXXFLAGS"
|
||||
elif test "$with_debug" = "full"
|
||||
then
|
||||
# Full debug. Very slow in some cases
|
||||
CFLAGS="$DEBUG_CFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS"
|
||||
CXXFLAGS="$DEBUG_CXXFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS"
|
||||
else
|
||||
# Optimized version. No debug
|
||||
CFLAGS="$OPTIMIZE_CFLAGS -DDBUG_OFF $CFLAGS -DDEBUG_OFF"
|
||||
CXXFLAGS="$OPTIMIZE_CXXFLAGS -DDBUG_OFF $CXXFLAGS -DDEBUG_OFF"
|
||||
fi
|
||||
|
||||
case "$target_os" in
|
||||
lin*)
|
||||
CFLAGS="$CFLAGS -DUNIV_LINUX";;
|
||||
hpux10*)
|
||||
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX -DUNIV_HPUX10";;
|
||||
hp*)
|
||||
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX";;
|
||||
aix*)
|
||||
CFLAGS="$CFLAGS -DUNIV_AIX";;
|
||||
irix*)
|
||||
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
|
||||
osf*)
|
||||
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
|
||||
sysv5uw7*)
|
||||
# Problem when linking on SCO
|
||||
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
|
||||
openbsd*)
|
||||
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
|
||||
esac
|
||||
|
||||
case "$target" in
|
||||
i[[4567]]86-*-*)
|
||||
CFLAGS="$CFLAGS -DUNIV_INTEL_X86";;
|
||||
# The compiler on Linux/S390 does not seem to have inlining
|
||||
s390-*-*)
|
||||
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
|
||||
esac
|
||||
|
||||
AC_OUTPUT(Makefile os/Makefile ut/Makefile btr/Makefile dnl
|
||||
buf/Makefile data/Makefile dnl
|
||||
dict/Makefile dyn/Makefile dnl
|
||||
eval/Makefile fil/Makefile fsp/Makefile fut/Makefile dnl
|
||||
ha/Makefile ibuf/Makefile include/Makefile dnl
|
||||
lock/Makefile log/Makefile dnl
|
||||
mach/Makefile mem/Makefile mtr/Makefile dnl
|
||||
page/Makefile pars/Makefile que/Makefile dnl
|
||||
read/Makefile rem/Makefile row/Makefile dnl
|
||||
srv/Makefile sync/Makefile thr/Makefile trx/Makefile dnl
|
||||
usr/Makefile)
|
||||
24
storage/innobase/data/Makefile.am
Normal file
24
storage/innobase/data/Makefile.am
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
# & Innobase Oy
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
include ../include/Makefile.i
|
||||
|
||||
noinst_LIBRARIES = libdata.a
|
||||
|
||||
libdata_a_SOURCES = data0data.c data0type.c
|
||||
|
||||
EXTRA_PROGRAMS =
|
||||
662
storage/innobase/data/data0data.c
Normal file
662
storage/innobase/data/data0data.c
Normal file
|
|
@ -0,0 +1,662 @@
|
|||
/************************************************************************
|
||||
SQL data field and tuple
|
||||
|
||||
(c) 1994-1996 Innobase Oy
|
||||
|
||||
Created 5/30/1994 Heikki Tuuri
|
||||
*************************************************************************/
|
||||
|
||||
#include "data0data.h"
|
||||
|
||||
#ifdef UNIV_NONINL
|
||||
#include "data0data.ic"
|
||||
#endif
|
||||
|
||||
#include "rem0rec.h"
|
||||
#include "rem0cmp.h"
|
||||
#include "page0page.h"
|
||||
#include "dict0dict.h"
|
||||
#include "btr0cur.h"
|
||||
|
||||
byte data_error; /* data pointers of tuple fields are initialized
|
||||
to point here for error checking */
|
||||
|
||||
#ifdef UNIV_DEBUG
|
||||
ulint data_dummy; /* this is used to fool the compiler in
|
||||
dtuple_validate */
|
||||
#endif /* UNIV_DEBUG */
|
||||
|
||||
/* Some non-inlined functions used in the MySQL interface: */
|
||||
void
|
||||
dfield_set_data_noninline(
|
||||
dfield_t* field, /* in: field */
|
||||
void* data, /* in: data */
|
||||
ulint len) /* in: length or UNIV_SQL_NULL */
|
||||
{
|
||||
dfield_set_data(field, data, len);
|
||||
}
|
||||
void*
|
||||
dfield_get_data_noninline(
|
||||
dfield_t* field) /* in: field */
|
||||
{
|
||||
return(dfield_get_data(field));
|
||||
}
|
||||
ulint
|
||||
dfield_get_len_noninline(
|
||||
dfield_t* field) /* in: field */
|
||||
{
|
||||
return(dfield_get_len(field));
|
||||
}
|
||||
ulint
|
||||
dtuple_get_n_fields_noninline(
|
||||
dtuple_t* tuple) /* in: tuple */
|
||||
{
|
||||
return(dtuple_get_n_fields(tuple));
|
||||
}
|
||||
dfield_t*
|
||||
dtuple_get_nth_field_noninline(
|
||||
dtuple_t* tuple, /* in: tuple */
|
||||
ulint n) /* in: index of field */
|
||||
{
|
||||
return(dtuple_get_nth_field(tuple, n));
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Tests if dfield data length and content is equal to the given. */
|
||||
|
||||
ibool
|
||||
dfield_data_is_binary_equal(
|
||||
/*========================*/
|
||||
/* out: TRUE if equal */
|
||||
dfield_t* field, /* in: field */
|
||||
ulint len, /* in: data length or UNIV_SQL_NULL */
|
||||
byte* data) /* in: data */
|
||||
{
|
||||
if (len != field->len) {
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
if (len == UNIV_SQL_NULL) {
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
if (0 != ut_memcmp(field->data, data, len)) {
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
Returns TRUE if lengths of two dtuples are equal and respective data fields
|
||||
in them are equal when compared with collation in char fields (not as binary
|
||||
strings). */
|
||||
|
||||
ibool
|
||||
dtuple_datas_are_ordering_equal(
|
||||
/*============================*/
|
||||
/* out: TRUE if length and fieds are equal
|
||||
when compared with cmp_data_data:
|
||||
NOTE: in character type fields some letters
|
||||
are identified with others! (collation) */
|
||||
dtuple_t* tuple1, /* in: tuple 1 */
|
||||
dtuple_t* tuple2) /* in: tuple 2 */
|
||||
{
|
||||
dfield_t* field1;
|
||||
dfield_t* field2;
|
||||
ulint n_fields;
|
||||
ulint i;
|
||||
|
||||
ut_ad(tuple1 && tuple2);
|
||||
ut_ad(tuple1->magic_n == DATA_TUPLE_MAGIC_N);
|
||||
ut_ad(tuple2->magic_n == DATA_TUPLE_MAGIC_N);
|
||||
ut_ad(dtuple_check_typed(tuple1));
|
||||
ut_ad(dtuple_check_typed(tuple2));
|
||||
|
||||
n_fields = dtuple_get_n_fields(tuple1);
|
||||
|
||||
if (n_fields != dtuple_get_n_fields(tuple2)) {
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
for (i = 0; i < n_fields; i++) {
|
||||
|
||||
field1 = dtuple_get_nth_field(tuple1, i);
|
||||
field2 = dtuple_get_nth_field(tuple2, i);
|
||||
|
||||
if (0 != cmp_dfield_dfield(field1, field2)) {
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Creates a dtuple for use in MySQL. */
|
||||
|
||||
dtuple_t*
|
||||
dtuple_create_for_mysql(
|
||||
/*====================*/
|
||||
/* out, own created dtuple */
|
||||
void** heap, /* out: created memory heap */
|
||||
ulint n_fields) /* in: number of fields */
|
||||
{
|
||||
*heap = (void*)mem_heap_create(500);
|
||||
|
||||
return(dtuple_create(*((mem_heap_t**)heap), n_fields));
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Frees a dtuple used in MySQL. */
|
||||
|
||||
void
|
||||
dtuple_free_for_mysql(
|
||||
/*==================*/
|
||||
void* heap) /* in: memory heap where tuple was created */
|
||||
{
|
||||
mem_heap_free((mem_heap_t*)heap);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Sets number of fields used in a tuple. Normally this is set in
|
||||
dtuple_create, but if you want later to set it smaller, you can use this. */
|
||||
|
||||
void
|
||||
dtuple_set_n_fields(
|
||||
/*================*/
|
||||
dtuple_t* tuple, /* in: tuple */
|
||||
ulint n_fields) /* in: number of fields */
|
||||
{
|
||||
ut_ad(tuple);
|
||||
|
||||
tuple->n_fields = n_fields;
|
||||
tuple->n_fields_cmp = n_fields;
|
||||
}
|
||||
|
||||
/**************************************************************
|
||||
Checks that a data field is typed. */
|
||||
static
|
||||
ibool
|
||||
dfield_check_typed_no_assert(
|
||||
/*=========================*/
|
||||
/* out: TRUE if ok */
|
||||
dfield_t* field) /* in: data field */
|
||||
{
|
||||
if (dfield_get_type(field)->mtype > DATA_MYSQL
|
||||
|| dfield_get_type(field)->mtype < DATA_VARCHAR) {
|
||||
|
||||
fprintf(stderr,
|
||||
"InnoDB: Error: data field type %lu, len %lu\n",
|
||||
(ulong) dfield_get_type(field)->mtype,
|
||||
(ulong) dfield_get_len(field));
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
/**************************************************************
|
||||
Checks that a data tuple is typed. */
|
||||
|
||||
ibool
|
||||
dtuple_check_typed_no_assert(
|
||||
/*=========================*/
|
||||
/* out: TRUE if ok */
|
||||
dtuple_t* tuple) /* in: tuple */
|
||||
{
|
||||
dfield_t* field;
|
||||
ulint i;
|
||||
|
||||
if (dtuple_get_n_fields(tuple) > REC_MAX_N_FIELDS) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Error: index entry has %lu fields\n",
|
||||
(ulong) dtuple_get_n_fields(tuple));
|
||||
dump:
|
||||
fputs("InnoDB: Tuple contents: ", stderr);
|
||||
dtuple_print(stderr, tuple);
|
||||
putc('\n', stderr);
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
for (i = 0; i < dtuple_get_n_fields(tuple); i++) {
|
||||
|
||||
field = dtuple_get_nth_field(tuple, i);
|
||||
|
||||
if (!dfield_check_typed_no_assert(field)) {
|
||||
goto dump;
|
||||
}
|
||||
}
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
/**************************************************************
|
||||
Checks that a data field is typed. Asserts an error if not. */
|
||||
|
||||
ibool
|
||||
dfield_check_typed(
|
||||
/*===============*/
|
||||
/* out: TRUE if ok */
|
||||
dfield_t* field) /* in: data field */
|
||||
{
|
||||
if (dfield_get_type(field)->mtype > DATA_MYSQL
|
||||
|| dfield_get_type(field)->mtype < DATA_VARCHAR) {
|
||||
|
||||
fprintf(stderr,
|
||||
"InnoDB: Error: data field type %lu, len %lu\n",
|
||||
(ulong) dfield_get_type(field)->mtype,
|
||||
(ulong) dfield_get_len(field));
|
||||
|
||||
ut_error;
|
||||
}
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
/**************************************************************
|
||||
Checks that a data tuple is typed. Asserts an error if not. */
|
||||
|
||||
ibool
|
||||
dtuple_check_typed(
|
||||
/*===============*/
|
||||
/* out: TRUE if ok */
|
||||
dtuple_t* tuple) /* in: tuple */
|
||||
{
|
||||
dfield_t* field;
|
||||
ulint i;
|
||||
|
||||
for (i = 0; i < dtuple_get_n_fields(tuple); i++) {
|
||||
|
||||
field = dtuple_get_nth_field(tuple, i);
|
||||
|
||||
ut_a(dfield_check_typed(field));
|
||||
}
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
#ifdef UNIV_DEBUG
|
||||
/**************************************************************
|
||||
Validates the consistency of a tuple which must be complete, i.e,
|
||||
all fields must have been set. */
|
||||
|
||||
ibool
|
||||
dtuple_validate(
|
||||
/*============*/
|
||||
/* out: TRUE if ok */
|
||||
dtuple_t* tuple) /* in: tuple */
|
||||
{
|
||||
dfield_t* field;
|
||||
byte* data;
|
||||
ulint n_fields;
|
||||
ulint len;
|
||||
ulint i;
|
||||
ulint j;
|
||||
|
||||
ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N);
|
||||
|
||||
n_fields = dtuple_get_n_fields(tuple);
|
||||
|
||||
/* We dereference all the data of each field to test
|
||||
for memory traps */
|
||||
|
||||
for (i = 0; i < n_fields; i++) {
|
||||
|
||||
field = dtuple_get_nth_field(tuple, i);
|
||||
len = dfield_get_len(field);
|
||||
|
||||
if (len != UNIV_SQL_NULL) {
|
||||
|
||||
data = field->data;
|
||||
|
||||
for (j = 0; j < len; j++) {
|
||||
|
||||
data_dummy += *data; /* fool the compiler not
|
||||
to optimize out this
|
||||
code */
|
||||
data++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ut_a(dtuple_check_typed(tuple));
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
#endif /* UNIV_DEBUG */
|
||||
|
||||
/*****************************************************************
|
||||
Pretty prints a dfield value according to its data type. */
|
||||
|
||||
void
|
||||
dfield_print(
|
||||
/*=========*/
|
||||
dfield_t* dfield) /* in: dfield */
|
||||
{
|
||||
byte* data;
|
||||
ulint len;
|
||||
ulint mtype;
|
||||
ulint i;
|
||||
|
||||
len = dfield_get_len(dfield);
|
||||
data = dfield_get_data(dfield);
|
||||
|
||||
if (len == UNIV_SQL_NULL) {
|
||||
fputs("NULL", stderr);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
mtype = dtype_get_mtype(dfield_get_type(dfield));
|
||||
|
||||
if ((mtype == DATA_CHAR) || (mtype == DATA_VARCHAR)) {
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
int c = *data++;
|
||||
putc(isprint(c) ? c : ' ', stderr);
|
||||
}
|
||||
} else if (mtype == DATA_INT) {
|
||||
ut_a(len == 4); /* only works for 32-bit integers */
|
||||
fprintf(stderr, "%d", (int)mach_read_from_4(data));
|
||||
} else {
|
||||
ut_error;
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
Pretty prints a dfield value according to its data type. Also the hex string
|
||||
is printed if a string contains non-printable characters. */
|
||||
|
||||
void
|
||||
dfield_print_also_hex(
|
||||
/*==================*/
|
||||
dfield_t* dfield) /* in: dfield */
|
||||
{
|
||||
byte* data;
|
||||
ulint len;
|
||||
ulint mtype;
|
||||
ulint i;
|
||||
ibool print_also_hex;
|
||||
|
||||
len = dfield_get_len(dfield);
|
||||
data = dfield_get_data(dfield);
|
||||
|
||||
if (len == UNIV_SQL_NULL) {
|
||||
fputs("NULL", stderr);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
mtype = dtype_get_mtype(dfield_get_type(dfield));
|
||||
|
||||
if ((mtype == DATA_CHAR) || (mtype == DATA_VARCHAR)) {
|
||||
|
||||
print_also_hex = FALSE;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
int c = *data++;
|
||||
if (!isprint(c)) {
|
||||
print_also_hex = TRUE;
|
||||
c = ' ';
|
||||
}
|
||||
putc(c, stderr);
|
||||
}
|
||||
|
||||
if (!print_also_hex) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
fputs(" Hex: ", stderr);
|
||||
|
||||
data = dfield_get_data(dfield);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
fprintf(stderr, "%02lx", (ulint)*data);
|
||||
|
||||
data++;
|
||||
}
|
||||
} else if (mtype == DATA_INT) {
|
||||
ut_a(len == 4); /* only works for 32-bit integers */
|
||||
fprintf(stderr, "%d", (int)mach_read_from_4(data));
|
||||
} else {
|
||||
ut_error;
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************
|
||||
The following function prints the contents of a tuple. */
|
||||
|
||||
void
|
||||
dtuple_print(
|
||||
/*=========*/
|
||||
FILE* f, /* in: output stream */
|
||||
dtuple_t* tuple) /* in: tuple */
|
||||
{
|
||||
dfield_t* field;
|
||||
ulint n_fields;
|
||||
ulint i;
|
||||
|
||||
n_fields = dtuple_get_n_fields(tuple);
|
||||
|
||||
fprintf(f, "DATA TUPLE: %lu fields;\n", (ulong) n_fields);
|
||||
|
||||
for (i = 0; i < n_fields; i++) {
|
||||
fprintf(f, " %lu:", (ulong) i);
|
||||
|
||||
field = dtuple_get_nth_field(tuple, i);
|
||||
|
||||
if (field->len != UNIV_SQL_NULL) {
|
||||
ut_print_buf(f, field->data, field->len);
|
||||
} else {
|
||||
fputs(" SQL NULL", f);
|
||||
}
|
||||
|
||||
putc(';', f);
|
||||
}
|
||||
|
||||
putc('\n', f);
|
||||
ut_ad(dtuple_validate(tuple));
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
Moves parts of long fields in entry to the big record vector so that
|
||||
the size of tuple drops below the maximum record size allowed in the
|
||||
database. Moves data only from those fields which are not necessary
|
||||
to determine uniquely the insertion place of the tuple in the index. */
|
||||
|
||||
big_rec_t*
|
||||
dtuple_convert_big_rec(
|
||||
/*===================*/
|
||||
/* out, own: created big record vector,
|
||||
NULL if we are not able to shorten
|
||||
the entry enough, i.e., if there are
|
||||
too many short fields in entry */
|
||||
dict_index_t* index, /* in: index */
|
||||
dtuple_t* entry, /* in: index entry */
|
||||
ulint* ext_vec,/* in: array of externally stored fields,
|
||||
or NULL: if a field already is externally
|
||||
stored, then we cannot move it to the vector
|
||||
this function returns */
|
||||
ulint n_ext_vec)/* in: number of elements is ext_vec */
|
||||
{
|
||||
mem_heap_t* heap;
|
||||
big_rec_t* vector;
|
||||
dfield_t* dfield;
|
||||
ulint size;
|
||||
ulint n_fields;
|
||||
ulint longest;
|
||||
ulint longest_i = ULINT_MAX;
|
||||
ibool is_externally_stored;
|
||||
ulint i;
|
||||
ulint j;
|
||||
|
||||
ut_a(dtuple_check_typed_no_assert(entry));
|
||||
|
||||
size = rec_get_converted_size(index, entry);
|
||||
|
||||
if (size > 1000000000) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Warning: tuple size very big: %lu\n", (ulong) size);
|
||||
fputs("InnoDB: Tuple contents: ", stderr);
|
||||
dtuple_print(stderr, entry);
|
||||
putc('\n', stderr);
|
||||
}
|
||||
|
||||
heap = mem_heap_create(size + dtuple_get_n_fields(entry)
|
||||
* sizeof(big_rec_field_t) + 1000);
|
||||
|
||||
vector = mem_heap_alloc(heap, sizeof(big_rec_t));
|
||||
|
||||
vector->heap = heap;
|
||||
vector->fields = mem_heap_alloc(heap, dtuple_get_n_fields(entry)
|
||||
* sizeof(big_rec_field_t));
|
||||
|
||||
/* Decide which fields to shorten: the algorithm is to look for
|
||||
the longest field whose type is DATA_BLOB */
|
||||
|
||||
n_fields = 0;
|
||||
|
||||
while (rec_get_converted_size(index, entry)
|
||||
>= ut_min(page_get_free_space_of_empty(
|
||||
index->table->comp) / 2,
|
||||
REC_MAX_DATA_SIZE)) {
|
||||
|
||||
longest = 0;
|
||||
for (i = dict_index_get_n_unique_in_tree(index);
|
||||
i < dtuple_get_n_fields(entry); i++) {
|
||||
|
||||
/* Skip over fields which already are externally
|
||||
stored */
|
||||
|
||||
is_externally_stored = FALSE;
|
||||
|
||||
if (ext_vec) {
|
||||
for (j = 0; j < n_ext_vec; j++) {
|
||||
if (ext_vec[j] == i) {
|
||||
is_externally_stored = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_externally_stored) {
|
||||
|
||||
dfield = dtuple_get_nth_field(entry, i);
|
||||
|
||||
if (dfield->len != UNIV_SQL_NULL &&
|
||||
dfield->len > longest) {
|
||||
|
||||
longest = dfield->len;
|
||||
|
||||
longest_i = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* We do not store externally fields which are smaller than
|
||||
DICT_MAX_COL_PREFIX_LEN */
|
||||
|
||||
ut_a(DICT_MAX_COL_PREFIX_LEN > REC_1BYTE_OFFS_LIMIT);
|
||||
|
||||
if (longest < BTR_EXTERN_FIELD_REF_SIZE + 10
|
||||
+ DICT_MAX_COL_PREFIX_LEN) {
|
||||
/* Cannot shorten more */
|
||||
|
||||
mem_heap_free(heap);
|
||||
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/* Move data from field longest_i to big rec vector;
|
||||
we do not let data size of the remaining entry
|
||||
drop below 128 which is the limit for the 2-byte
|
||||
offset storage format in a physical record. This
|
||||
we accomplish by storing 128 bytes of data in entry
|
||||
itself, and only the remaining part to big rec vec.
|
||||
|
||||
We store the first bytes locally to the record. Then
|
||||
we can calculate all ordering fields in all indexes
|
||||
from locally stored data. */
|
||||
|
||||
dfield = dtuple_get_nth_field(entry, longest_i);
|
||||
vector->fields[n_fields].field_no = longest_i;
|
||||
|
||||
ut_a(dfield->len > DICT_MAX_COL_PREFIX_LEN);
|
||||
|
||||
vector->fields[n_fields].len = dfield->len
|
||||
- DICT_MAX_COL_PREFIX_LEN;
|
||||
|
||||
vector->fields[n_fields].data = mem_heap_alloc(heap,
|
||||
vector->fields[n_fields].len);
|
||||
|
||||
/* Copy data (from the end of field) to big rec vector */
|
||||
|
||||
ut_memcpy(vector->fields[n_fields].data,
|
||||
((byte*)dfield->data) + dfield->len
|
||||
- vector->fields[n_fields].len,
|
||||
vector->fields[n_fields].len);
|
||||
dfield->len = dfield->len - vector->fields[n_fields].len
|
||||
+ BTR_EXTERN_FIELD_REF_SIZE;
|
||||
|
||||
/* Set the extern field reference in dfield to zero */
|
||||
memset(((byte*)dfield->data)
|
||||
+ dfield->len - BTR_EXTERN_FIELD_REF_SIZE,
|
||||
0, BTR_EXTERN_FIELD_REF_SIZE);
|
||||
n_fields++;
|
||||
}
|
||||
|
||||
vector->n_fields = n_fields;
|
||||
return(vector);
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
Puts back to entry the data stored in vector. Note that to ensure the
|
||||
fields in entry can accommodate the data, vector must have been created
|
||||
from entry with dtuple_convert_big_rec. */
|
||||
|
||||
void
|
||||
dtuple_convert_back_big_rec(
|
||||
/*========================*/
|
||||
dict_index_t* index __attribute__((unused)), /* in: index */
|
||||
dtuple_t* entry, /* in: entry whose data was put to vector */
|
||||
big_rec_t* vector) /* in, own: big rec vector; it is
|
||||
freed in this function */
|
||||
{
|
||||
dfield_t* dfield;
|
||||
ulint i;
|
||||
|
||||
for (i = 0; i < vector->n_fields; i++) {
|
||||
|
||||
dfield = dtuple_get_nth_field(entry,
|
||||
vector->fields[i].field_no);
|
||||
/* Copy data from big rec vector */
|
||||
|
||||
ut_memcpy(((byte*)dfield->data)
|
||||
+ dfield->len - BTR_EXTERN_FIELD_REF_SIZE,
|
||||
vector->fields[i].data,
|
||||
vector->fields[i].len);
|
||||
dfield->len = dfield->len + vector->fields[i].len
|
||||
- BTR_EXTERN_FIELD_REF_SIZE;
|
||||
}
|
||||
|
||||
mem_heap_free(vector->heap);
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
Frees the memory in a big rec vector. */
|
||||
|
||||
void
|
||||
dtuple_big_rec_free(
|
||||
/*================*/
|
||||
big_rec_t* vector) /* in, own: big rec vector; it is
|
||||
freed in this function */
|
||||
{
|
||||
mem_heap_free(vector->heap);
|
||||
}
|
||||
260
storage/innobase/data/data0type.c
Normal file
260
storage/innobase/data/data0type.c
Normal file
|
|
@ -0,0 +1,260 @@
|
|||
/******************************************************
|
||||
Data types
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 1/16/1996 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#include "data0type.h"
|
||||
|
||||
#ifdef UNIV_NONINL
|
||||
#include "data0type.ic"
|
||||
#endif
|
||||
|
||||
/**********************************************************************
|
||||
This function is used to find the storage length in bytes of the first n
|
||||
characters for prefix indexes using a multibyte character set. The function
|
||||
finds charset information and returns length of prefix_len characters in the
|
||||
index field in bytes.
|
||||
|
||||
NOTE: the prototype of this function is copied from ha_innodb.cc! If you change
|
||||
this function, you MUST change also the prototype here! */
|
||||
|
||||
ulint
|
||||
innobase_get_at_most_n_mbchars(
|
||||
/*===========================*/
|
||||
/* out: number of bytes occupied by the first
|
||||
n characters */
|
||||
ulint charset_id, /* in: character set id */
|
||||
ulint prefix_len, /* in: prefix length in bytes of the index
|
||||
(this has to be divided by mbmaxlen to get the
|
||||
number of CHARACTERS n in the prefix) */
|
||||
ulint data_len, /* in: length of the string in bytes */
|
||||
const char* str); /* in: character string */
|
||||
|
||||
/* At the database startup we store the default-charset collation number of
|
||||
this MySQL installation to this global variable. If we have < 4.1.2 format
|
||||
column definitions, or records in the insert buffer, we use this
|
||||
charset-collation code for them. */
|
||||
|
||||
ulint data_mysql_default_charset_coll = 99999999;
|
||||
ulint data_mysql_latin1_swedish_charset_coll = 99999999;
|
||||
|
||||
dtype_t dtype_binary_val = {DATA_BINARY, 0, 0, 0, 0, 0};
|
||||
dtype_t* dtype_binary = &dtype_binary_val;
|
||||
|
||||
/*************************************************************************
|
||||
Determine how many bytes the first n characters of the given string occupy.
|
||||
If the string is shorter than n characters, returns the number of bytes
|
||||
the characters in the string occupy. */
|
||||
|
||||
ulint
|
||||
dtype_get_at_most_n_mbchars(
|
||||
/*========================*/
|
||||
/* out: length of the prefix,
|
||||
in bytes */
|
||||
const dtype_t* dtype, /* in: data type */
|
||||
ulint prefix_len, /* in: length of the requested
|
||||
prefix, in characters, multiplied by
|
||||
dtype_get_mbmaxlen(dtype) */
|
||||
ulint data_len, /* in: length of str (in bytes) */
|
||||
const char* str) /* in: the string whose prefix
|
||||
length is being determined */
|
||||
{
|
||||
#ifndef UNIV_HOTBACKUP
|
||||
ut_a(data_len != UNIV_SQL_NULL);
|
||||
ut_a(!(prefix_len % dtype->mbmaxlen));
|
||||
|
||||
if (dtype->mbminlen != dtype->mbmaxlen) {
|
||||
return(innobase_get_at_most_n_mbchars(
|
||||
dtype_get_charset_coll(dtype->prtype),
|
||||
prefix_len, data_len, str));
|
||||
}
|
||||
|
||||
if (prefix_len < data_len) {
|
||||
|
||||
return(prefix_len);
|
||||
|
||||
}
|
||||
|
||||
return(data_len);
|
||||
#else /* UNIV_HOTBACKUP */
|
||||
/* This function depends on MySQL code that is not included in
|
||||
InnoDB Hot Backup builds. Besides, this function should never
|
||||
be called in InnoDB Hot Backup. */
|
||||
ut_error;
|
||||
#endif /* UNIV_HOTBACKUP */
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Checks if a data main type is a string type. Also a BLOB is considered a
|
||||
string type. */
|
||||
|
||||
ibool
|
||||
dtype_is_string_type(
|
||||
/*=================*/
|
||||
/* out: TRUE if string type */
|
||||
ulint mtype) /* in: InnoDB main data type code: DATA_CHAR, ... */
|
||||
{
|
||||
if (mtype <= DATA_BLOB
|
||||
|| mtype == DATA_MYSQL
|
||||
|| mtype == DATA_VARMYSQL) {
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Checks if a type is a binary string type. Note that for tables created with
|
||||
< 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column. For
|
||||
those DATA_BLOB columns this function currently returns FALSE. */
|
||||
|
||||
ibool
|
||||
dtype_is_binary_string_type(
|
||||
/*========================*/
|
||||
/* out: TRUE if binary string type */
|
||||
ulint mtype, /* in: main data type */
|
||||
ulint prtype) /* in: precise type */
|
||||
{
|
||||
if ((mtype == DATA_FIXBINARY)
|
||||
|| (mtype == DATA_BINARY)
|
||||
|| (mtype == DATA_BLOB && (prtype & DATA_BINARY_TYPE))) {
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Checks if a type is a non-binary string type. That is, dtype_is_string_type is
|
||||
TRUE and dtype_is_binary_string_type is FALSE. Note that for tables created
|
||||
with < 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column.
|
||||
For those DATA_BLOB columns this function currently returns TRUE. */
|
||||
|
||||
ibool
|
||||
dtype_is_non_binary_string_type(
|
||||
/*============================*/
|
||||
/* out: TRUE if non-binary string type */
|
||||
ulint mtype, /* in: main data type */
|
||||
ulint prtype) /* in: precise type */
|
||||
{
|
||||
if (dtype_is_string_type(mtype) == TRUE
|
||||
&& dtype_is_binary_string_type(mtype, prtype) == FALSE) {
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the MySQL charset-collation code for MySQL string types. */
|
||||
|
||||
ulint
|
||||
dtype_get_charset_coll_noninline(
|
||||
/*=============================*/
|
||||
ulint prtype) /* in: precise data type */
|
||||
{
|
||||
return(dtype_get_charset_coll(prtype));
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Forms a precise type from the < 4.1.2 format precise type plus the
|
||||
charset-collation code. */
|
||||
|
||||
ulint
|
||||
dtype_form_prtype(
|
||||
/*==============*/
|
||||
ulint old_prtype, /* in: the MySQL type code and the flags
|
||||
DATA_BINARY_TYPE etc. */
|
||||
ulint charset_coll) /* in: MySQL charset-collation code */
|
||||
{
|
||||
ut_a(old_prtype < 256 * 256);
|
||||
ut_a(charset_coll < 256);
|
||||
|
||||
return(old_prtype + (charset_coll << 16));
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Validates a data type structure. */
|
||||
|
||||
ibool
|
||||
dtype_validate(
|
||||
/*===========*/
|
||||
/* out: TRUE if ok */
|
||||
dtype_t* type) /* in: type struct to validate */
|
||||
{
|
||||
ut_a(type);
|
||||
ut_a((type->mtype >= DATA_VARCHAR) && (type->mtype <= DATA_MYSQL));
|
||||
|
||||
if (type->mtype == DATA_SYS) {
|
||||
ut_a((type->prtype & DATA_MYSQL_TYPE_MASK) < DATA_N_SYS_COLS);
|
||||
}
|
||||
|
||||
ut_a(type->mbminlen <= type->mbmaxlen);
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Prints a data type structure. */
|
||||
|
||||
void
|
||||
dtype_print(
|
||||
/*========*/
|
||||
dtype_t* type) /* in: type */
|
||||
{
|
||||
ulint mtype;
|
||||
ulint prtype;
|
||||
ulint len;
|
||||
|
||||
ut_a(type);
|
||||
|
||||
mtype = type->mtype;
|
||||
prtype = type->prtype;
|
||||
if (mtype == DATA_VARCHAR) {
|
||||
fputs("DATA_VARCHAR", stderr);
|
||||
} else if (mtype == DATA_CHAR) {
|
||||
fputs("DATA_CHAR", stderr);
|
||||
} else if (mtype == DATA_BINARY) {
|
||||
fputs("DATA_BINARY", stderr);
|
||||
} else if (mtype == DATA_INT) {
|
||||
fputs("DATA_INT", stderr);
|
||||
} else if (mtype == DATA_MYSQL) {
|
||||
fputs("DATA_MYSQL", stderr);
|
||||
} else if (mtype == DATA_SYS) {
|
||||
fputs("DATA_SYS", stderr);
|
||||
} else {
|
||||
fprintf(stderr, "type %lu", (ulong) mtype);
|
||||
}
|
||||
|
||||
len = type->len;
|
||||
|
||||
if ((type->mtype == DATA_SYS)
|
||||
|| (type->mtype == DATA_VARCHAR)
|
||||
|| (type->mtype == DATA_CHAR)) {
|
||||
putc(' ', stderr);
|
||||
if (prtype == DATA_ROW_ID) {
|
||||
fputs("DATA_ROW_ID", stderr);
|
||||
len = DATA_ROW_ID_LEN;
|
||||
} else if (prtype == DATA_ROLL_PTR) {
|
||||
fputs("DATA_ROLL_PTR", stderr);
|
||||
len = DATA_ROLL_PTR_LEN;
|
||||
} else if (prtype == DATA_TRX_ID) {
|
||||
fputs("DATA_TRX_ID", stderr);
|
||||
len = DATA_TRX_ID_LEN;
|
||||
} else if (prtype == DATA_MIX_ID) {
|
||||
fputs("DATA_MIX_ID", stderr);
|
||||
} else if (prtype == DATA_ENGLISH) {
|
||||
fputs("DATA_ENGLISH", stderr);
|
||||
} else {
|
||||
fprintf(stderr, "prtype %lu", (ulong) mtype);
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, " len %lu prec %lu", (ulong) len, (ulong) type->prec);
|
||||
}
|
||||
11
storage/innobase/data/makefilewin
Normal file
11
storage/innobase/data/makefilewin
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
include ..\include\makefile.i
|
||||
|
||||
data.lib: data0type.obj data0data.obj
|
||||
lib -out:..\libs\data.lib data0type.obj data0data.obj
|
||||
|
||||
data0type.obj: data0type.c
|
||||
$(CCOM) $(CFL) -c data0type.c
|
||||
|
||||
data0data.obj: data0data.c
|
||||
$(CCOM) $(CFL) -c data0data.c
|
||||
|
||||
44
storage/innobase/db/db0err.h
Normal file
44
storage/innobase/db/db0err.h
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
/******************************************************
|
||||
Global error codes for the database
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 5/24/1996 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#ifndef db0err_h
|
||||
#define db0err_h
|
||||
|
||||
|
||||
#define DB_SUCCESS 10
|
||||
|
||||
/* The following are error codes */
|
||||
#define DB_ERROR 11
|
||||
#define DB_OUT_OF_MEMORY 12
|
||||
#define DB_OUT_OF_FILE_SPACE 13
|
||||
#define DB_LOCK_WAIT 14
|
||||
#define DB_DEADLOCK 15
|
||||
#define DB_ROLLBACK 16
|
||||
#define DB_DUPLICATE_KEY 17
|
||||
#define DB_QUE_THR_SUSPENDED 18
|
||||
#define DB_MISSING_HISTORY 19 /* required history data has been
|
||||
deleted due to lack of space in
|
||||
rollback segment */
|
||||
#define DB_CLUSTER_NOT_FOUND 30
|
||||
#define DB_TABLE_NOT_FOUND 31
|
||||
#define DB_MUST_GET_MORE_FILE_SPACE 32 /* the database has to be stopped
|
||||
and restrated with more file space */
|
||||
#define DB_TABLE_IS_BEING_USED 33
|
||||
#define DB_TOO_BIG_RECORD 34 /* a record in an index would become
|
||||
bigger than 1/2 free space in a page
|
||||
frame */
|
||||
|
||||
/* The following are partial failure codes */
|
||||
#define DB_FAIL 1000
|
||||
#define DB_OVERFLOW 1001
|
||||
#define DB_UNDERFLOW 1002
|
||||
#define DB_STRONG_FAIL 1003
|
||||
#define DB_RECORD_NOT_FOUND 1500
|
||||
#define DB_END_OF_INDEX 1501
|
||||
|
||||
#endif
|
||||
25
storage/innobase/dict/Makefile.am
Normal file
25
storage/innobase/dict/Makefile.am
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
# & Innobase Oy
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
include ../include/Makefile.i
|
||||
|
||||
noinst_LIBRARIES = libdict.a
|
||||
|
||||
libdict_a_SOURCES = dict0boot.c dict0crea.c dict0dict.c dict0load.c\
|
||||
dict0mem.c
|
||||
|
||||
EXTRA_PROGRAMS =
|
||||
423
storage/innobase/dict/dict0boot.c
Normal file
423
storage/innobase/dict/dict0boot.c
Normal file
|
|
@ -0,0 +1,423 @@
|
|||
/******************************************************
|
||||
Data dictionary creation and booting
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 4/18/1996 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#include "dict0boot.h"
|
||||
|
||||
#ifdef UNIV_NONINL
|
||||
#include "dict0boot.ic"
|
||||
#endif
|
||||
|
||||
#include "dict0crea.h"
|
||||
#include "btr0btr.h"
|
||||
#include "dict0load.h"
|
||||
#include "dict0load.h"
|
||||
#include "trx0trx.h"
|
||||
#include "srv0srv.h"
|
||||
#include "ibuf0ibuf.h"
|
||||
#include "buf0flu.h"
|
||||
#include "log0recv.h"
|
||||
#include "os0file.h"
|
||||
|
||||
/**************************************************************************
|
||||
Gets a pointer to the dictionary header and x-latches its page. */
|
||||
|
||||
dict_hdr_t*
|
||||
dict_hdr_get(
|
||||
/*=========*/
|
||||
/* out: pointer to the dictionary header,
|
||||
page x-latched */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
dict_hdr_t* header;
|
||||
|
||||
ut_ad(mtr);
|
||||
|
||||
header = DICT_HDR + buf_page_get(DICT_HDR_SPACE, DICT_HDR_PAGE_NO,
|
||||
RW_X_LATCH, mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_page_dbg_add_level(header, SYNC_DICT_HEADER);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
return(header);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Returns a new table, index, or tree id. */
|
||||
|
||||
dulint
|
||||
dict_hdr_get_new_id(
|
||||
/*================*/
|
||||
/* out: the new id */
|
||||
ulint type) /* in: DICT_HDR_ROW_ID, ... */
|
||||
{
|
||||
dict_hdr_t* dict_hdr;
|
||||
dulint id;
|
||||
mtr_t mtr;
|
||||
|
||||
ut_ad((type == DICT_HDR_TABLE_ID) || (type == DICT_HDR_INDEX_ID)
|
||||
|| (type == DICT_HDR_MIX_ID));
|
||||
|
||||
mtr_start(&mtr);
|
||||
|
||||
dict_hdr = dict_hdr_get(&mtr);
|
||||
|
||||
id = mtr_read_dulint(dict_hdr + type, &mtr);
|
||||
|
||||
/* Add some dummy code here because otherwise pgcc seems to
|
||||
compile wrong */
|
||||
|
||||
if (0 == ut_dulint_cmp(id, ut_dulint_max)) {
|
||||
/* TO DO: remove this code, or make it conditional */
|
||||
ut_dbg_null_ptr = 0;
|
||||
}
|
||||
|
||||
id = ut_dulint_add(id, 1);
|
||||
|
||||
mlog_write_dulint(dict_hdr + type, id, &mtr);
|
||||
|
||||
mtr_commit(&mtr);
|
||||
|
||||
return(id);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Writes the current value of the row id counter to the dictionary header file
|
||||
page. */
|
||||
|
||||
void
|
||||
dict_hdr_flush_row_id(void)
|
||||
/*=======================*/
|
||||
{
|
||||
dict_hdr_t* dict_hdr;
|
||||
dulint id;
|
||||
mtr_t mtr;
|
||||
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
||||
id = dict_sys->row_id;
|
||||
|
||||
mtr_start(&mtr);
|
||||
|
||||
dict_hdr = dict_hdr_get(&mtr);
|
||||
|
||||
mlog_write_dulint(dict_hdr + DICT_HDR_ROW_ID, id, &mtr);
|
||||
|
||||
mtr_commit(&mtr);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Creates the file page for the dictionary header. This function is
|
||||
called only at the database creation. */
|
||||
static
|
||||
ibool
|
||||
dict_hdr_create(
|
||||
/*============*/
|
||||
/* out: TRUE if succeed */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
dict_hdr_t* dict_header;
|
||||
ulint hdr_page_no;
|
||||
ulint root_page_no;
|
||||
page_t* page;
|
||||
|
||||
ut_ad(mtr);
|
||||
|
||||
/* Create the dictionary header file block in a new, allocated file
|
||||
segment in the system tablespace */
|
||||
page = fseg_create(DICT_HDR_SPACE, 0,
|
||||
DICT_HDR + DICT_HDR_FSEG_HEADER, mtr);
|
||||
|
||||
hdr_page_no = buf_frame_get_page_no(page);
|
||||
|
||||
ut_a(DICT_HDR_PAGE_NO == hdr_page_no);
|
||||
|
||||
dict_header = dict_hdr_get(mtr);
|
||||
|
||||
/* Start counting row, table, index, and tree ids from
|
||||
DICT_HDR_FIRST_ID */
|
||||
mlog_write_dulint(dict_header + DICT_HDR_ROW_ID,
|
||||
ut_dulint_create(0, DICT_HDR_FIRST_ID), mtr);
|
||||
|
||||
mlog_write_dulint(dict_header + DICT_HDR_TABLE_ID,
|
||||
ut_dulint_create(0, DICT_HDR_FIRST_ID), mtr);
|
||||
|
||||
mlog_write_dulint(dict_header + DICT_HDR_INDEX_ID,
|
||||
ut_dulint_create(0, DICT_HDR_FIRST_ID), mtr);
|
||||
|
||||
mlog_write_dulint(dict_header + DICT_HDR_MIX_ID,
|
||||
ut_dulint_create(0, DICT_HDR_FIRST_ID), mtr);
|
||||
|
||||
/* Create the B-tree roots for the clustered indexes of the basic
|
||||
system tables */
|
||||
|
||||
/*--------------------------*/
|
||||
root_page_no = btr_create(DICT_CLUSTERED | DICT_UNIQUE,
|
||||
DICT_HDR_SPACE, DICT_TABLES_ID, FALSE, mtr);
|
||||
if (root_page_no == FIL_NULL) {
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
mlog_write_ulint(dict_header + DICT_HDR_TABLES, root_page_no,
|
||||
MLOG_4BYTES, mtr);
|
||||
/*--------------------------*/
|
||||
root_page_no = btr_create(DICT_UNIQUE, DICT_HDR_SPACE,
|
||||
DICT_TABLE_IDS_ID, FALSE, mtr);
|
||||
if (root_page_no == FIL_NULL) {
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
mlog_write_ulint(dict_header + DICT_HDR_TABLE_IDS, root_page_no,
|
||||
MLOG_4BYTES, mtr);
|
||||
/*--------------------------*/
|
||||
root_page_no = btr_create(DICT_CLUSTERED | DICT_UNIQUE,
|
||||
DICT_HDR_SPACE, DICT_COLUMNS_ID, FALSE, mtr);
|
||||
if (root_page_no == FIL_NULL) {
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
mlog_write_ulint(dict_header + DICT_HDR_COLUMNS, root_page_no,
|
||||
MLOG_4BYTES, mtr);
|
||||
/*--------------------------*/
|
||||
root_page_no = btr_create(DICT_CLUSTERED | DICT_UNIQUE,
|
||||
DICT_HDR_SPACE, DICT_INDEXES_ID, FALSE, mtr);
|
||||
if (root_page_no == FIL_NULL) {
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
mlog_write_ulint(dict_header + DICT_HDR_INDEXES, root_page_no,
|
||||
MLOG_4BYTES, mtr);
|
||||
/*--------------------------*/
|
||||
root_page_no = btr_create(DICT_CLUSTERED | DICT_UNIQUE,
|
||||
DICT_HDR_SPACE, DICT_FIELDS_ID, FALSE, mtr);
|
||||
if (root_page_no == FIL_NULL) {
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
mlog_write_ulint(dict_header + DICT_HDR_FIELDS, root_page_no,
|
||||
MLOG_4BYTES, mtr);
|
||||
/*--------------------------*/
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Initializes the data dictionary memory structures when the database is
|
||||
started. This function is also called when the data dictionary is created. */
|
||||
|
||||
void
|
||||
dict_boot(void)
|
||||
/*===========*/
|
||||
{
|
||||
dict_table_t* table;
|
||||
dict_index_t* index;
|
||||
dict_hdr_t* dict_hdr;
|
||||
mtr_t mtr;
|
||||
ibool success;
|
||||
|
||||
mtr_start(&mtr);
|
||||
|
||||
/* Create the hash tables etc. */
|
||||
dict_init();
|
||||
|
||||
mutex_enter(&(dict_sys->mutex));
|
||||
|
||||
/* Get the dictionary header */
|
||||
dict_hdr = dict_hdr_get(&mtr);
|
||||
|
||||
/* Because we only write new row ids to disk-based data structure
|
||||
(dictionary header) when it is divisible by
|
||||
DICT_HDR_ROW_ID_WRITE_MARGIN, in recovery we will not recover
|
||||
the latest value of the row id counter. Therefore we advance
|
||||
the counter at the database startup to avoid overlapping values.
|
||||
Note that when a user after database startup first time asks for
|
||||
a new row id, then because the counter is now divisible by
|
||||
..._MARGIN, it will immediately be updated to the disk-based
|
||||
header. */
|
||||
|
||||
dict_sys->row_id = ut_dulint_add(
|
||||
ut_dulint_align_up(
|
||||
mtr_read_dulint(dict_hdr + DICT_HDR_ROW_ID,
|
||||
&mtr),
|
||||
DICT_HDR_ROW_ID_WRITE_MARGIN),
|
||||
DICT_HDR_ROW_ID_WRITE_MARGIN);
|
||||
|
||||
/* Insert into the dictionary cache the descriptions of the basic
|
||||
system tables */
|
||||
/*-------------------------*/
|
||||
table = dict_mem_table_create("SYS_TABLES", DICT_HDR_SPACE, 8, FALSE);
|
||||
|
||||
dict_mem_table_add_col(table, "NAME", DATA_BINARY, 0, 0, 0);
|
||||
dict_mem_table_add_col(table, "ID", DATA_BINARY, 0, 0, 0);
|
||||
dict_mem_table_add_col(table, "N_COLS", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, "TYPE", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, "MIX_ID", DATA_BINARY, 0, 0, 0);
|
||||
dict_mem_table_add_col(table, "MIX_LEN", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, "CLUSTER_NAME", DATA_BINARY, 0, 0, 0);
|
||||
dict_mem_table_add_col(table, "SPACE", DATA_INT, 0, 4, 0);
|
||||
|
||||
table->id = DICT_TABLES_ID;
|
||||
|
||||
dict_table_add_to_cache(table);
|
||||
dict_sys->sys_tables = table;
|
||||
|
||||
index = dict_mem_index_create("SYS_TABLES", "CLUST_IND",
|
||||
DICT_HDR_SPACE, DICT_UNIQUE | DICT_CLUSTERED, 1);
|
||||
|
||||
dict_mem_index_add_field(index, "NAME", 0, 0);
|
||||
|
||||
index->id = DICT_TABLES_ID;
|
||||
|
||||
success = dict_index_add_to_cache(table, index, mtr_read_ulint(
|
||||
dict_hdr + DICT_HDR_TABLES, MLOG_4BYTES, &mtr));
|
||||
ut_a(success);
|
||||
/*-------------------------*/
|
||||
index = dict_mem_index_create("SYS_TABLES", "ID_IND",
|
||||
DICT_HDR_SPACE, DICT_UNIQUE, 1);
|
||||
dict_mem_index_add_field(index, "ID", 0, 0);
|
||||
|
||||
index->id = DICT_TABLE_IDS_ID;
|
||||
success = dict_index_add_to_cache(table, index, mtr_read_ulint(
|
||||
dict_hdr + DICT_HDR_TABLE_IDS, MLOG_4BYTES, &mtr));
|
||||
ut_a(success);
|
||||
/*-------------------------*/
|
||||
table = dict_mem_table_create("SYS_COLUMNS", DICT_HDR_SPACE, 7, FALSE);
|
||||
|
||||
dict_mem_table_add_col(table, "TABLE_ID", DATA_BINARY,0,0,0);
|
||||
dict_mem_table_add_col(table, "POS", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, "NAME", DATA_BINARY, 0, 0, 0);
|
||||
dict_mem_table_add_col(table, "MTYPE", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, "PRTYPE", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, "LEN", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, "PREC", DATA_INT, 0, 4, 0);
|
||||
|
||||
table->id = DICT_COLUMNS_ID;
|
||||
|
||||
dict_table_add_to_cache(table);
|
||||
dict_sys->sys_columns = table;
|
||||
|
||||
index = dict_mem_index_create("SYS_COLUMNS", "CLUST_IND",
|
||||
DICT_HDR_SPACE, DICT_UNIQUE | DICT_CLUSTERED, 2);
|
||||
|
||||
dict_mem_index_add_field(index, "TABLE_ID", 0, 0);
|
||||
dict_mem_index_add_field(index, "POS", 0, 0);
|
||||
|
||||
index->id = DICT_COLUMNS_ID;
|
||||
success = dict_index_add_to_cache(table, index, mtr_read_ulint(
|
||||
dict_hdr + DICT_HDR_COLUMNS, MLOG_4BYTES, &mtr));
|
||||
ut_a(success);
|
||||
/*-------------------------*/
|
||||
table = dict_mem_table_create("SYS_INDEXES", DICT_HDR_SPACE, 7, FALSE);
|
||||
|
||||
dict_mem_table_add_col(table, "TABLE_ID", DATA_BINARY, 0,0,0);
|
||||
dict_mem_table_add_col(table, "ID", DATA_BINARY, 0, 0, 0);
|
||||
dict_mem_table_add_col(table, "NAME", DATA_BINARY, 0, 0, 0);
|
||||
dict_mem_table_add_col(table, "N_FIELDS", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, "TYPE", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, "SPACE", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, "PAGE_NO", DATA_INT, 0, 4, 0);
|
||||
|
||||
/* The '+ 2' below comes from the 2 system fields */
|
||||
#if DICT_SYS_INDEXES_PAGE_NO_FIELD != 6 + 2
|
||||
#error "DICT_SYS_INDEXES_PAGE_NO_FIELD != 6 + 2"
|
||||
#endif
|
||||
#if DICT_SYS_INDEXES_SPACE_NO_FIELD != 5 + 2
|
||||
#error "DICT_SYS_INDEXES_SPACE_NO_FIELD != 5 + 2"
|
||||
#endif
|
||||
#if DICT_SYS_INDEXES_TYPE_FIELD != 4 + 2
|
||||
#error "DICT_SYS_INDEXES_TYPE_FIELD != 4 + 2"
|
||||
#endif
|
||||
|
||||
table->id = DICT_INDEXES_ID;
|
||||
dict_table_add_to_cache(table);
|
||||
dict_sys->sys_indexes = table;
|
||||
|
||||
index = dict_mem_index_create("SYS_INDEXES", "CLUST_IND",
|
||||
DICT_HDR_SPACE, DICT_UNIQUE | DICT_CLUSTERED, 2);
|
||||
|
||||
dict_mem_index_add_field(index, "TABLE_ID", 0, 0);
|
||||
dict_mem_index_add_field(index, "ID", 0, 0);
|
||||
|
||||
index->id = DICT_INDEXES_ID;
|
||||
success = dict_index_add_to_cache(table, index, mtr_read_ulint(
|
||||
dict_hdr + DICT_HDR_INDEXES, MLOG_4BYTES, &mtr));
|
||||
ut_a(success);
|
||||
/*-------------------------*/
|
||||
table = dict_mem_table_create("SYS_FIELDS", DICT_HDR_SPACE, 3, FALSE);
|
||||
|
||||
dict_mem_table_add_col(table, "INDEX_ID", DATA_BINARY, 0,0,0);
|
||||
dict_mem_table_add_col(table, "POS", DATA_INT, 0, 4, 0);
|
||||
dict_mem_table_add_col(table, "COL_NAME", DATA_BINARY, 0,0,0);
|
||||
|
||||
table->id = DICT_FIELDS_ID;
|
||||
dict_table_add_to_cache(table);
|
||||
dict_sys->sys_fields = table;
|
||||
|
||||
index = dict_mem_index_create("SYS_FIELDS", "CLUST_IND",
|
||||
DICT_HDR_SPACE, DICT_UNIQUE | DICT_CLUSTERED, 2);
|
||||
|
||||
dict_mem_index_add_field(index, "INDEX_ID", 0, 0);
|
||||
dict_mem_index_add_field(index, "POS", 0, 0);
|
||||
|
||||
index->id = DICT_FIELDS_ID;
|
||||
success = dict_index_add_to_cache(table, index, mtr_read_ulint(
|
||||
dict_hdr + DICT_HDR_FIELDS, MLOG_4BYTES, &mtr));
|
||||
ut_a(success);
|
||||
|
||||
mtr_commit(&mtr);
|
||||
/*-------------------------*/
|
||||
|
||||
/* Initialize the insert buffer table and index for each tablespace */
|
||||
|
||||
ibuf_init_at_db_start();
|
||||
|
||||
/* Load definitions of other indexes on system tables */
|
||||
|
||||
dict_load_sys_table(dict_sys->sys_tables);
|
||||
dict_load_sys_table(dict_sys->sys_columns);
|
||||
dict_load_sys_table(dict_sys->sys_indexes);
|
||||
dict_load_sys_table(dict_sys->sys_fields);
|
||||
|
||||
mutex_exit(&(dict_sys->mutex));
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Inserts the basic system table data into themselves in the database
|
||||
creation. */
|
||||
static
|
||||
void
|
||||
dict_insert_initial_data(void)
|
||||
/*==========================*/
|
||||
{
|
||||
/* Does nothing yet */
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Creates and initializes the data dictionary at the database creation. */
|
||||
|
||||
void
|
||||
dict_create(void)
|
||||
/*=============*/
|
||||
{
|
||||
mtr_t mtr;
|
||||
|
||||
mtr_start(&mtr);
|
||||
|
||||
dict_hdr_create(&mtr);
|
||||
|
||||
mtr_commit(&mtr);
|
||||
|
||||
dict_boot();
|
||||
|
||||
dict_insert_initial_data();
|
||||
}
|
||||
1468
storage/innobase/dict/dict0crea.c
Normal file
1468
storage/innobase/dict/dict0crea.c
Normal file
File diff suppressed because it is too large
Load diff
4474
storage/innobase/dict/dict0dict.c
Normal file
4474
storage/innobase/dict/dict0dict.c
Normal file
File diff suppressed because it is too large
Load diff
1355
storage/innobase/dict/dict0load.c
Normal file
1355
storage/innobase/dict/dict0load.c
Normal file
File diff suppressed because it is too large
Load diff
293
storage/innobase/dict/dict0mem.c
Normal file
293
storage/innobase/dict/dict0mem.c
Normal file
|
|
@ -0,0 +1,293 @@
|
|||
/**********************************************************************
|
||||
Data dictionary memory object creation
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 1/8/1996 Heikki Tuuri
|
||||
***********************************************************************/
|
||||
|
||||
#include "dict0mem.h"
|
||||
|
||||
#ifdef UNIV_NONINL
|
||||
#include "dict0mem.ic"
|
||||
#endif
|
||||
|
||||
#include "rem0rec.h"
|
||||
#include "data0type.h"
|
||||
#include "mach0data.h"
|
||||
#include "dict0dict.h"
|
||||
#include "que0que.h"
|
||||
#include "pars0pars.h"
|
||||
#include "lock0lock.h"
|
||||
|
||||
#define DICT_HEAP_SIZE 100 /* initial memory heap size when
|
||||
creating a table or index object */
|
||||
|
||||
/**************************************************************************
|
||||
Creates a table memory object. */
|
||||
|
||||
dict_table_t*
|
||||
dict_mem_table_create(
|
||||
/*==================*/
|
||||
/* out, own: table object */
|
||||
const char* name, /* in: table name */
|
||||
ulint space, /* in: space where the clustered index of
|
||||
the table is placed; this parameter is
|
||||
ignored if the table is made a member of
|
||||
a cluster */
|
||||
ulint n_cols, /* in: number of columns */
|
||||
ibool comp) /* in: TRUE=compact page format */
|
||||
{
|
||||
dict_table_t* table;
|
||||
mem_heap_t* heap;
|
||||
|
||||
ut_ad(name);
|
||||
|
||||
heap = mem_heap_create(DICT_HEAP_SIZE);
|
||||
|
||||
table = mem_heap_alloc(heap, sizeof(dict_table_t));
|
||||
|
||||
table->heap = heap;
|
||||
|
||||
table->type = DICT_TABLE_ORDINARY;
|
||||
table->name = mem_heap_strdup(heap, name);
|
||||
table->dir_path_of_temp_table = NULL;
|
||||
table->space = space;
|
||||
table->ibd_file_missing = FALSE;
|
||||
table->tablespace_discarded = FALSE;
|
||||
table->comp = comp;
|
||||
table->n_def = 0;
|
||||
table->n_cols = n_cols + DATA_N_SYS_COLS;
|
||||
table->mem_fix = 0;
|
||||
|
||||
table->n_mysql_handles_opened = 0;
|
||||
table->n_foreign_key_checks_running = 0;
|
||||
|
||||
table->cached = FALSE;
|
||||
|
||||
table->mix_id = ut_dulint_zero;
|
||||
table->mix_len = 0;
|
||||
|
||||
table->cols = mem_heap_alloc(heap, (n_cols + DATA_N_SYS_COLS)
|
||||
* sizeof(dict_col_t));
|
||||
UT_LIST_INIT(table->indexes);
|
||||
|
||||
table->auto_inc_lock = mem_heap_alloc(heap, lock_get_size());
|
||||
|
||||
table->query_cache_inv_trx_id = ut_dulint_zero;
|
||||
|
||||
UT_LIST_INIT(table->locks);
|
||||
UT_LIST_INIT(table->foreign_list);
|
||||
UT_LIST_INIT(table->referenced_list);
|
||||
|
||||
table->does_not_fit_in_memory = FALSE;
|
||||
|
||||
table->stat_initialized = FALSE;
|
||||
|
||||
table->stat_modified_counter = 0;
|
||||
|
||||
mutex_create(&(table->autoinc_mutex));
|
||||
mutex_set_level(&(table->autoinc_mutex), SYNC_DICT_AUTOINC_MUTEX);
|
||||
|
||||
table->autoinc_inited = FALSE;
|
||||
|
||||
table->magic_n = DICT_TABLE_MAGIC_N;
|
||||
|
||||
return(table);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Creates a cluster memory object. */
|
||||
|
||||
dict_table_t*
|
||||
dict_mem_cluster_create(
|
||||
/*====================*/
|
||||
/* out, own: cluster object */
|
||||
const char* name, /* in: cluster name */
|
||||
ulint space, /* in: space where the clustered indexes
|
||||
of the member tables are placed */
|
||||
ulint n_cols, /* in: number of columns */
|
||||
ulint mix_len)/* in: length of the common key prefix in the
|
||||
cluster */
|
||||
{
|
||||
dict_table_t* cluster;
|
||||
|
||||
/* Clustered tables cannot work with the compact record format. */
|
||||
cluster = dict_mem_table_create(name, space, n_cols, FALSE);
|
||||
|
||||
cluster->type = DICT_TABLE_CLUSTER;
|
||||
cluster->mix_len = mix_len;
|
||||
|
||||
return(cluster);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Declares a non-published table as a member in a cluster. */
|
||||
|
||||
void
|
||||
dict_mem_table_make_cluster_member(
|
||||
/*===============================*/
|
||||
dict_table_t* table, /* in: non-published table */
|
||||
const char* cluster_name) /* in: cluster name */
|
||||
{
|
||||
table->type = DICT_TABLE_CLUSTER_MEMBER;
|
||||
table->cluster_name = cluster_name;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Adds a column definition to a table. */
|
||||
|
||||
void
|
||||
dict_mem_table_add_col(
|
||||
/*===================*/
|
||||
dict_table_t* table, /* in: table */
|
||||
const char* name, /* in: column name */
|
||||
ulint mtype, /* in: main datatype */
|
||||
ulint prtype, /* in: precise type */
|
||||
ulint len, /* in: length */
|
||||
ulint prec) /* in: precision */
|
||||
{
|
||||
dict_col_t* col;
|
||||
dtype_t* type;
|
||||
|
||||
ut_ad(table && name);
|
||||
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
|
||||
|
||||
table->n_def++;
|
||||
|
||||
col = dict_table_get_nth_col(table, table->n_def - 1);
|
||||
|
||||
col->ind = table->n_def - 1;
|
||||
col->name = mem_heap_strdup(table->heap, name);
|
||||
col->table = table;
|
||||
col->ord_part = 0;
|
||||
|
||||
col->clust_pos = ULINT_UNDEFINED;
|
||||
|
||||
type = dict_col_get_type(col);
|
||||
|
||||
dtype_set(type, mtype, prtype, len, prec);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Creates an index memory object. */
|
||||
|
||||
dict_index_t*
|
||||
dict_mem_index_create(
|
||||
/*==================*/
|
||||
/* out, own: index object */
|
||||
const char* table_name, /* in: table name */
|
||||
const char* index_name, /* in: index name */
|
||||
ulint space, /* in: space where the index tree is
|
||||
placed, ignored if the index is of
|
||||
the clustered type */
|
||||
ulint type, /* in: DICT_UNIQUE,
|
||||
DICT_CLUSTERED, ... ORed */
|
||||
ulint n_fields) /* in: number of fields */
|
||||
{
|
||||
dict_index_t* index;
|
||||
mem_heap_t* heap;
|
||||
|
||||
ut_ad(table_name && index_name);
|
||||
|
||||
heap = mem_heap_create(DICT_HEAP_SIZE);
|
||||
index = mem_heap_alloc(heap, sizeof(dict_index_t));
|
||||
|
||||
index->heap = heap;
|
||||
|
||||
index->type = type;
|
||||
index->space = space;
|
||||
index->name = mem_heap_strdup(heap, index_name);
|
||||
index->table_name = table_name;
|
||||
index->table = NULL;
|
||||
index->n_def = index->n_nullable = 0;
|
||||
index->n_fields = n_fields;
|
||||
index->fields = mem_heap_alloc(heap, 1 + n_fields
|
||||
* sizeof(dict_field_t));
|
||||
/* The '1 +' above prevents allocation
|
||||
of an empty mem block */
|
||||
index->stat_n_diff_key_vals = NULL;
|
||||
|
||||
index->cached = FALSE;
|
||||
index->magic_n = DICT_INDEX_MAGIC_N;
|
||||
|
||||
return(index);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Creates and initializes a foreign constraint memory object. */
|
||||
|
||||
dict_foreign_t*
|
||||
dict_mem_foreign_create(void)
|
||||
/*=========================*/
|
||||
/* out, own: foreign constraint struct */
|
||||
{
|
||||
dict_foreign_t* foreign;
|
||||
mem_heap_t* heap;
|
||||
|
||||
heap = mem_heap_create(100);
|
||||
|
||||
foreign = mem_heap_alloc(heap, sizeof(dict_foreign_t));
|
||||
|
||||
foreign->heap = heap;
|
||||
|
||||
foreign->id = NULL;
|
||||
|
||||
foreign->type = 0;
|
||||
foreign->foreign_table_name = NULL;
|
||||
foreign->foreign_table = NULL;
|
||||
foreign->foreign_col_names = NULL;
|
||||
|
||||
foreign->referenced_table_name = NULL;
|
||||
foreign->referenced_table = NULL;
|
||||
foreign->referenced_col_names = NULL;
|
||||
|
||||
foreign->n_fields = 0;
|
||||
|
||||
foreign->foreign_index = NULL;
|
||||
foreign->referenced_index = NULL;
|
||||
|
||||
return(foreign);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Adds a field definition to an index. NOTE: does not take a copy
|
||||
of the column name if the field is a column. The memory occupied
|
||||
by the column name may be released only after publishing the index. */
|
||||
|
||||
void
|
||||
dict_mem_index_add_field(
|
||||
/*=====================*/
|
||||
dict_index_t* index, /* in: index */
|
||||
const char* name, /* in: column name */
|
||||
ulint order, /* in: order criterion; 0 means an
|
||||
ascending order */
|
||||
ulint prefix_len) /* in: 0 or the column prefix length
|
||||
in a MySQL index like
|
||||
INDEX (textcol(25)) */
|
||||
{
|
||||
dict_field_t* field;
|
||||
|
||||
ut_ad(index && name);
|
||||
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
|
||||
|
||||
index->n_def++;
|
||||
|
||||
field = dict_index_get_nth_field(index, index->n_def - 1);
|
||||
|
||||
field->name = name;
|
||||
field->order = order;
|
||||
|
||||
field->prefix_len = prefix_len;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Frees an index memory object. */
|
||||
|
||||
void
|
||||
dict_mem_index_free(
|
||||
/*================*/
|
||||
dict_index_t* index) /* in: index */
|
||||
{
|
||||
mem_heap_free(index->heap);
|
||||
}
|
||||
21
storage/innobase/dict/makefilewin
Normal file
21
storage/innobase/dict/makefilewin
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
include ..\include\makefile.i
|
||||
|
||||
dict.lib: dict0dict.obj dict0boot.obj dict0load.obj dict0mem.obj dict0crea.obj
|
||||
lib -out:..\libs\dict.lib dict0dict.obj dict0boot.obj dict0load.obj dict0mem.obj dict0crea.obj
|
||||
|
||||
dict0dict.obj: dict0dict.c
|
||||
$(CCOM) $(CFL) -c dict0dict.c
|
||||
|
||||
dict0boot.obj: dict0boot.c
|
||||
$(CCOM) $(CFL) -c dict0boot.c
|
||||
|
||||
dict0mem.obj: dict0mem.c
|
||||
$(CCOM) $(CFL) -c dict0mem.c
|
||||
|
||||
dict0crea.obj: dict0crea.c
|
||||
$(CCOM) $(CFL) -c dict0crea.c
|
||||
|
||||
dict0load.obj: dict0load.c
|
||||
$(CCOM) $(CFL) -c dict0load.c
|
||||
|
||||
|
||||
24
storage/innobase/dyn/Makefile.am
Normal file
24
storage/innobase/dyn/Makefile.am
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
# & Innobase Oy
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
include ../include/Makefile.i
|
||||
|
||||
noinst_LIBRARIES = libdyn.a
|
||||
|
||||
libdyn_a_SOURCES = dyn0dyn.c
|
||||
|
||||
EXTRA_PROGRAMS =
|
||||
48
storage/innobase/dyn/dyn0dyn.c
Normal file
48
storage/innobase/dyn/dyn0dyn.c
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/******************************************************
|
||||
The dynamically allocated array
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 2/5/1996 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#include "dyn0dyn.h"
|
||||
#ifdef UNIV_NONINL
|
||||
#include "dyn0dyn.ic"
|
||||
#endif
|
||||
|
||||
/****************************************************************
|
||||
Adds a new block to a dyn array. */
|
||||
|
||||
dyn_block_t*
|
||||
dyn_array_add_block(
|
||||
/*================*/
|
||||
/* out: created block */
|
||||
dyn_array_t* arr) /* in: dyn array */
|
||||
{
|
||||
mem_heap_t* heap;
|
||||
dyn_block_t* block;
|
||||
|
||||
ut_ad(arr);
|
||||
ut_ad(arr->magic_n == DYN_BLOCK_MAGIC_N);
|
||||
|
||||
if (arr->heap == NULL) {
|
||||
UT_LIST_INIT(arr->base);
|
||||
UT_LIST_ADD_FIRST(list, arr->base, arr);
|
||||
|
||||
arr->heap = mem_heap_create(sizeof(dyn_block_t));
|
||||
}
|
||||
|
||||
block = dyn_array_get_last_block(arr);
|
||||
block->used = block->used | DYN_BLOCK_FULL_FLAG;
|
||||
|
||||
heap = arr->heap;
|
||||
|
||||
block = mem_heap_alloc(heap, sizeof(dyn_block_t));
|
||||
|
||||
block->used = 0;
|
||||
|
||||
UT_LIST_ADD_LAST(list, arr->base, block);
|
||||
|
||||
return(block);
|
||||
}
|
||||
9
storage/innobase/dyn/makefilewin
Normal file
9
storage/innobase/dyn/makefilewin
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
include ..\include\makefile.i
|
||||
|
||||
dyn.lib: dyn0dyn.obj makefile
|
||||
lib -out:..\libs\dyn.lib dyn0dyn.obj
|
||||
|
||||
dyn0dyn.obj: dyn0dyn.c
|
||||
$(CCOM) $(CFL) -c dyn0dyn.c
|
||||
|
||||
|
||||
24
storage/innobase/eval/Makefile.am
Normal file
24
storage/innobase/eval/Makefile.am
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
# & Innobase Oy
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
include ../include/Makefile.i
|
||||
|
||||
noinst_LIBRARIES = libeval.a
|
||||
|
||||
libeval_a_SOURCES = eval0eval.c eval0proc.c
|
||||
|
||||
EXTRA_PROGRAMS =
|
||||
835
storage/innobase/eval/eval0eval.c
Normal file
835
storage/innobase/eval/eval0eval.c
Normal file
|
|
@ -0,0 +1,835 @@
|
|||
/******************************************************
|
||||
SQL evaluator: evaluates simple data structures, like expressions, in
|
||||
a query graph
|
||||
|
||||
(c) 1997 Innobase Oy
|
||||
|
||||
Created 12/29/1997 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#include "eval0eval.h"
|
||||
|
||||
#ifdef UNIV_NONINL
|
||||
#include "eval0eval.ic"
|
||||
#endif
|
||||
|
||||
#include "data0data.h"
|
||||
#include "row0sel.h"
|
||||
|
||||
/* The RND function seed */
|
||||
ulint eval_rnd = 128367121;
|
||||
|
||||
/* Dummy adress used when we should allocate a buffer of size 0 in
|
||||
the function below */
|
||||
|
||||
byte eval_dummy;
|
||||
|
||||
/*********************************************************************
|
||||
Allocate a buffer from global dynamic memory for a value of a que_node.
|
||||
NOTE that this memory must be explicitly freed when the query graph is
|
||||
freed. If the node already has an allocated buffer, that buffer is freed
|
||||
here. NOTE that this is the only function where dynamic memory should be
|
||||
allocated for a query node val field. */
|
||||
|
||||
byte*
|
||||
eval_node_alloc_val_buf(
|
||||
/*====================*/
|
||||
/* out: pointer to allocated buffer */
|
||||
que_node_t* node, /* in: query graph node; sets the val field
|
||||
data field to point to the new buffer, and
|
||||
len field equal to size */
|
||||
ulint size) /* in: buffer size */
|
||||
{
|
||||
dfield_t* dfield;
|
||||
byte* data;
|
||||
|
||||
ut_ad(que_node_get_type(node) == QUE_NODE_SYMBOL
|
||||
|| que_node_get_type(node) == QUE_NODE_FUNC);
|
||||
|
||||
dfield = que_node_get_val(node);
|
||||
|
||||
data = dfield_get_data(dfield);
|
||||
|
||||
if (data && data != &eval_dummy) {
|
||||
mem_free(data);
|
||||
}
|
||||
|
||||
if (size == 0) {
|
||||
data = &eval_dummy;
|
||||
} else {
|
||||
data = mem_alloc(size);
|
||||
}
|
||||
|
||||
que_node_set_val_buf_size(node, size);
|
||||
|
||||
dfield_set_data(dfield, data, size);
|
||||
|
||||
return(data);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Free the buffer from global dynamic memory for a value of a que_node,
|
||||
if it has been allocated in the above function. The freeing for pushed
|
||||
column values is done in sel_col_prefetch_buf_free. */
|
||||
|
||||
void
|
||||
eval_node_free_val_buf(
|
||||
/*===================*/
|
||||
que_node_t* node) /* in: query graph node */
|
||||
{
|
||||
dfield_t* dfield;
|
||||
byte* data;
|
||||
|
||||
ut_ad(que_node_get_type(node) == QUE_NODE_SYMBOL
|
||||
|| que_node_get_type(node) == QUE_NODE_FUNC);
|
||||
|
||||
dfield = que_node_get_val(node);
|
||||
|
||||
data = dfield_get_data(dfield);
|
||||
|
||||
if (que_node_get_val_buf_size(node) > 0) {
|
||||
ut_a(data);
|
||||
|
||||
mem_free(data);
|
||||
}
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Evaluates a comparison node. */
|
||||
|
||||
ibool
|
||||
eval_cmp(
|
||||
/*=====*/
|
||||
/* out: the result of the comparison */
|
||||
func_node_t* cmp_node) /* in: comparison node */
|
||||
{
|
||||
que_node_t* arg1;
|
||||
que_node_t* arg2;
|
||||
int res;
|
||||
ibool val;
|
||||
int func;
|
||||
|
||||
ut_ad(que_node_get_type(cmp_node) == QUE_NODE_FUNC);
|
||||
|
||||
arg1 = cmp_node->args;
|
||||
arg2 = que_node_get_next(arg1);
|
||||
|
||||
res = cmp_dfield_dfield(que_node_get_val(arg1),
|
||||
que_node_get_val(arg2));
|
||||
val = TRUE;
|
||||
|
||||
func = cmp_node->func;
|
||||
|
||||
if (func == '=') {
|
||||
if (res != 0) {
|
||||
val = FALSE;
|
||||
}
|
||||
} else if (func == '<') {
|
||||
if (res != -1) {
|
||||
val = FALSE;
|
||||
}
|
||||
} else if (func == PARS_LE_TOKEN) {
|
||||
if (res == 1) {
|
||||
val = FALSE;
|
||||
}
|
||||
} else if (func == PARS_NE_TOKEN) {
|
||||
if (res == 0) {
|
||||
val = FALSE;
|
||||
}
|
||||
} else if (func == PARS_GE_TOKEN) {
|
||||
if (res == -1) {
|
||||
val = FALSE;
|
||||
}
|
||||
} else {
|
||||
ut_ad(func == '>');
|
||||
|
||||
if (res != 1) {
|
||||
val = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
eval_node_set_ibool_val(cmp_node, val);
|
||||
|
||||
return(val);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Evaluates a logical operation node. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
eval_logical(
|
||||
/*=========*/
|
||||
func_node_t* logical_node) /* in: logical operation node */
|
||||
{
|
||||
que_node_t* arg1;
|
||||
que_node_t* arg2;
|
||||
ibool val1;
|
||||
ibool val2 = 0; /* remove warning */
|
||||
ibool val = 0; /* remove warning */
|
||||
int func;
|
||||
|
||||
ut_ad(que_node_get_type(logical_node) == QUE_NODE_FUNC);
|
||||
|
||||
arg1 = logical_node->args;
|
||||
arg2 = que_node_get_next(arg1); /* arg2 is NULL if func is 'NOT' */
|
||||
|
||||
val1 = eval_node_get_ibool_val(arg1);
|
||||
|
||||
if (arg2) {
|
||||
val2 = eval_node_get_ibool_val(arg2);
|
||||
}
|
||||
|
||||
func = logical_node->func;
|
||||
|
||||
if (func == PARS_AND_TOKEN) {
|
||||
val = val1 & val2;
|
||||
} else if (func == PARS_OR_TOKEN) {
|
||||
val = val1 | val2;
|
||||
} else if (func == PARS_NOT_TOKEN) {
|
||||
val = TRUE - val1;
|
||||
} else {
|
||||
ut_error;
|
||||
}
|
||||
|
||||
eval_node_set_ibool_val(logical_node, val);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Evaluates an arithmetic operation node. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
eval_arith(
|
||||
/*=======*/
|
||||
func_node_t* arith_node) /* in: arithmetic operation node */
|
||||
{
|
||||
que_node_t* arg1;
|
||||
que_node_t* arg2;
|
||||
lint val1;
|
||||
lint val2 = 0; /* remove warning */
|
||||
lint val;
|
||||
int func;
|
||||
|
||||
ut_ad(que_node_get_type(arith_node) == QUE_NODE_FUNC);
|
||||
|
||||
arg1 = arith_node->args;
|
||||
arg2 = que_node_get_next(arg1); /* arg2 is NULL if func is unary '-' */
|
||||
|
||||
val1 = eval_node_get_int_val(arg1);
|
||||
|
||||
if (arg2) {
|
||||
val2 = eval_node_get_int_val(arg2);
|
||||
}
|
||||
|
||||
func = arith_node->func;
|
||||
|
||||
if (func == '+') {
|
||||
val = val1 + val2;
|
||||
} else if ((func == '-') && arg2) {
|
||||
val = val1 - val2;
|
||||
} else if (func == '-') {
|
||||
val = -val1;
|
||||
} else if (func == '*') {
|
||||
val = val1 * val2;
|
||||
} else {
|
||||
ut_ad(func == '/');
|
||||
val = val1 / val2;
|
||||
}
|
||||
|
||||
eval_node_set_int_val(arith_node, val);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Evaluates an aggregate operation node. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
eval_aggregate(
|
||||
/*===========*/
|
||||
func_node_t* node) /* in: aggregate operation node */
|
||||
{
|
||||
que_node_t* arg;
|
||||
lint val;
|
||||
lint arg_val;
|
||||
int func;
|
||||
|
||||
ut_ad(que_node_get_type(node) == QUE_NODE_FUNC);
|
||||
|
||||
val = eval_node_get_int_val(node);
|
||||
|
||||
func = node->func;
|
||||
|
||||
if (func == PARS_COUNT_TOKEN) {
|
||||
|
||||
val = val + 1;
|
||||
} else {
|
||||
ut_ad(func == PARS_SUM_TOKEN);
|
||||
|
||||
arg = node->args;
|
||||
arg_val = eval_node_get_int_val(arg);
|
||||
|
||||
val = val + arg_val;
|
||||
}
|
||||
|
||||
eval_node_set_int_val(node, val);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Evaluates a predefined function node where the function is not relevant
|
||||
in benchmarks. */
|
||||
static
|
||||
void
|
||||
eval_predefined_2(
|
||||
/*==============*/
|
||||
func_node_t* func_node) /* in: predefined function node */
|
||||
{
|
||||
que_node_t* arg;
|
||||
que_node_t* arg1;
|
||||
que_node_t* arg2 = 0; /* remove warning (??? bug ???) */
|
||||
lint int_val;
|
||||
byte* data;
|
||||
ulint len1;
|
||||
ulint len2;
|
||||
int func;
|
||||
ulint i;
|
||||
|
||||
ut_ad(que_node_get_type(func_node) == QUE_NODE_FUNC);
|
||||
|
||||
arg1 = func_node->args;
|
||||
|
||||
if (arg1) {
|
||||
arg2 = que_node_get_next(arg1);
|
||||
}
|
||||
|
||||
func = func_node->func;
|
||||
|
||||
if (func == PARS_PRINTF_TOKEN) {
|
||||
|
||||
arg = arg1;
|
||||
|
||||
while (arg) {
|
||||
dfield_print(que_node_get_val(arg));
|
||||
|
||||
arg = que_node_get_next(arg);
|
||||
}
|
||||
|
||||
putc('\n', stderr);
|
||||
|
||||
} else if (func == PARS_ASSERT_TOKEN) {
|
||||
|
||||
if (!eval_node_get_ibool_val(arg1)) {
|
||||
fputs("SQL assertion fails in a stored procedure!\n",
|
||||
stderr);
|
||||
}
|
||||
|
||||
ut_a(eval_node_get_ibool_val(arg1));
|
||||
|
||||
/* This function, or more precisely, a debug procedure,
|
||||
returns no value */
|
||||
|
||||
} else if (func == PARS_RND_TOKEN) {
|
||||
|
||||
len1 = (ulint)eval_node_get_int_val(arg1);
|
||||
len2 = (ulint)eval_node_get_int_val(arg2);
|
||||
|
||||
ut_ad(len2 >= len1);
|
||||
|
||||
if (len2 > len1) {
|
||||
int_val = (lint)(len1 +
|
||||
(eval_rnd % (len2 - len1 + 1)));
|
||||
} else {
|
||||
int_val = (lint)len1;
|
||||
}
|
||||
|
||||
eval_rnd = ut_rnd_gen_next_ulint(eval_rnd);
|
||||
|
||||
eval_node_set_int_val(func_node, int_val);
|
||||
|
||||
} else if (func == PARS_RND_STR_TOKEN) {
|
||||
|
||||
len1 = (ulint)eval_node_get_int_val(arg1);
|
||||
|
||||
data = eval_node_ensure_val_buf(func_node, len1);
|
||||
|
||||
for (i = 0; i < len1; i++) {
|
||||
data[i] = (byte)(97 + (eval_rnd % 3));
|
||||
|
||||
eval_rnd = ut_rnd_gen_next_ulint(eval_rnd);
|
||||
}
|
||||
} else {
|
||||
ut_error;
|
||||
}
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Evaluates a notfound-function node. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
eval_notfound(
|
||||
/*==========*/
|
||||
func_node_t* func_node) /* in: function node */
|
||||
{
|
||||
que_node_t* arg1;
|
||||
que_node_t* arg2;
|
||||
sym_node_t* cursor;
|
||||
sel_node_t* sel_node;
|
||||
ibool ibool_val;
|
||||
|
||||
arg1 = func_node->args;
|
||||
arg2 = que_node_get_next(arg1);
|
||||
|
||||
ut_ad(func_node->func == PARS_NOTFOUND_TOKEN);
|
||||
|
||||
cursor = arg1;
|
||||
|
||||
ut_ad(que_node_get_type(cursor) == QUE_NODE_SYMBOL);
|
||||
|
||||
if (cursor->token_type == SYM_LIT) {
|
||||
|
||||
ut_ad(ut_memcmp(dfield_get_data(que_node_get_val(cursor)),
|
||||
"SQL", 3) == 0);
|
||||
|
||||
sel_node = cursor->sym_table->query_graph->last_sel_node;
|
||||
} else {
|
||||
sel_node = cursor->alias->cursor_def;
|
||||
}
|
||||
|
||||
if (sel_node->state == SEL_NODE_NO_MORE_ROWS) {
|
||||
ibool_val = TRUE;
|
||||
} else {
|
||||
ibool_val = FALSE;
|
||||
}
|
||||
|
||||
eval_node_set_ibool_val(func_node, ibool_val);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Evaluates a substr-function node. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
eval_substr(
|
||||
/*========*/
|
||||
func_node_t* func_node) /* in: function node */
|
||||
{
|
||||
que_node_t* arg1;
|
||||
que_node_t* arg2;
|
||||
que_node_t* arg3;
|
||||
dfield_t* dfield;
|
||||
byte* str1;
|
||||
ulint len1;
|
||||
ulint len2;
|
||||
|
||||
arg1 = func_node->args;
|
||||
arg2 = que_node_get_next(arg1);
|
||||
|
||||
ut_ad(func_node->func == PARS_SUBSTR_TOKEN);
|
||||
|
||||
arg3 = que_node_get_next(arg2);
|
||||
|
||||
str1 = dfield_get_data(que_node_get_val(arg1));
|
||||
|
||||
len1 = (ulint)eval_node_get_int_val(arg2);
|
||||
len2 = (ulint)eval_node_get_int_val(arg3);
|
||||
|
||||
dfield = que_node_get_val(func_node);
|
||||
|
||||
dfield_set_data(dfield, str1 + len1, len2);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Evaluates a replstr-procedure node. */
|
||||
static
|
||||
void
|
||||
eval_replstr(
|
||||
/*=========*/
|
||||
func_node_t* func_node) /* in: function node */
|
||||
{
|
||||
que_node_t* arg1;
|
||||
que_node_t* arg2;
|
||||
que_node_t* arg3;
|
||||
que_node_t* arg4;
|
||||
byte* str1;
|
||||
byte* str2;
|
||||
ulint len1;
|
||||
ulint len2;
|
||||
|
||||
arg1 = func_node->args;
|
||||
arg2 = que_node_get_next(arg1);
|
||||
|
||||
ut_ad(que_node_get_type(arg1) == QUE_NODE_SYMBOL);
|
||||
|
||||
arg3 = que_node_get_next(arg2);
|
||||
arg4 = que_node_get_next(arg3);
|
||||
|
||||
str1 = dfield_get_data(que_node_get_val(arg1));
|
||||
str2 = dfield_get_data(que_node_get_val(arg2));
|
||||
|
||||
len1 = (ulint)eval_node_get_int_val(arg3);
|
||||
len2 = (ulint)eval_node_get_int_val(arg4);
|
||||
|
||||
if ((dfield_get_len(que_node_get_val(arg1)) < len1 + len2)
|
||||
|| (dfield_get_len(que_node_get_val(arg2)) < len2)) {
|
||||
|
||||
ut_error;
|
||||
}
|
||||
|
||||
ut_memcpy(str1 + len1, str2, len2);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Evaluates an instr-function node. */
|
||||
static
|
||||
void
|
||||
eval_instr(
|
||||
/*=======*/
|
||||
func_node_t* func_node) /* in: function node */
|
||||
{
|
||||
que_node_t* arg1;
|
||||
que_node_t* arg2;
|
||||
dfield_t* dfield1;
|
||||
dfield_t* dfield2;
|
||||
lint int_val;
|
||||
byte* str1;
|
||||
byte* str2;
|
||||
byte match_char;
|
||||
ulint len1;
|
||||
ulint len2;
|
||||
ulint i;
|
||||
ulint j;
|
||||
|
||||
arg1 = func_node->args;
|
||||
arg2 = que_node_get_next(arg1);
|
||||
|
||||
dfield1 = que_node_get_val(arg1);
|
||||
dfield2 = que_node_get_val(arg2);
|
||||
|
||||
str1 = dfield_get_data(dfield1);
|
||||
str2 = dfield_get_data(dfield2);
|
||||
|
||||
len1 = dfield_get_len(dfield1);
|
||||
len2 = dfield_get_len(dfield2);
|
||||
|
||||
if (len2 == 0) {
|
||||
ut_error;
|
||||
}
|
||||
|
||||
match_char = str2[0];
|
||||
|
||||
for (i = 0; i < len1; i++) {
|
||||
/* In this outer loop, the number of matched characters is 0 */
|
||||
|
||||
if (str1[i] == match_char) {
|
||||
|
||||
if (i + len2 > len1) {
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
for (j = 1;; j++) {
|
||||
/* We have already matched j characters */
|
||||
|
||||
if (j == len2) {
|
||||
int_val = i + 1;
|
||||
|
||||
goto match_found;
|
||||
}
|
||||
|
||||
if (str1[i + j] != str2[j]) {
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int_val = 0;
|
||||
|
||||
match_found:
|
||||
eval_node_set_int_val(func_node, int_val);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Evaluates a predefined function node. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
eval_binary_to_number(
|
||||
/*==================*/
|
||||
func_node_t* func_node) /* in: function node */
|
||||
{
|
||||
que_node_t* arg1;
|
||||
dfield_t* dfield;
|
||||
byte* str1;
|
||||
byte* str2;
|
||||
ulint len1;
|
||||
ulint int_val;
|
||||
|
||||
arg1 = func_node->args;
|
||||
|
||||
dfield = que_node_get_val(arg1);
|
||||
|
||||
str1 = dfield_get_data(dfield);
|
||||
len1 = dfield_get_len(dfield);
|
||||
|
||||
if (len1 > 4) {
|
||||
ut_error;
|
||||
}
|
||||
|
||||
if (len1 == 4) {
|
||||
str2 = str1;
|
||||
} else {
|
||||
int_val = 0;
|
||||
str2 = (byte*)&int_val;
|
||||
|
||||
ut_memcpy(str2 + (4 - len1), str1, len1);
|
||||
}
|
||||
|
||||
eval_node_copy_and_alloc_val(func_node, str2, 4);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Evaluates a predefined function node. */
|
||||
static
|
||||
void
|
||||
eval_concat(
|
||||
/*========*/
|
||||
func_node_t* func_node) /* in: function node */
|
||||
{
|
||||
que_node_t* arg;
|
||||
dfield_t* dfield;
|
||||
byte* data;
|
||||
ulint len;
|
||||
ulint len1;
|
||||
|
||||
arg = func_node->args;
|
||||
len = 0;
|
||||
|
||||
while (arg) {
|
||||
len1 = dfield_get_len(que_node_get_val(arg));
|
||||
|
||||
len += len1;
|
||||
|
||||
arg = que_node_get_next(arg);
|
||||
}
|
||||
|
||||
data = eval_node_ensure_val_buf(func_node, len);
|
||||
|
||||
arg = func_node->args;
|
||||
len = 0;
|
||||
|
||||
while (arg) {
|
||||
dfield = que_node_get_val(arg);
|
||||
len1 = dfield_get_len(dfield);
|
||||
|
||||
ut_memcpy(data + len, dfield_get_data(dfield), len1);
|
||||
|
||||
len += len1;
|
||||
|
||||
arg = que_node_get_next(arg);
|
||||
}
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Evaluates a predefined function node. If the first argument is an integer,
|
||||
this function looks at the second argument which is the integer length in
|
||||
bytes, and converts the integer to a VARCHAR.
|
||||
If the first argument is of some other type, this function converts it to
|
||||
BINARY. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
eval_to_binary(
|
||||
/*===========*/
|
||||
func_node_t* func_node) /* in: function node */
|
||||
{
|
||||
que_node_t* arg1;
|
||||
que_node_t* arg2;
|
||||
dfield_t* dfield;
|
||||
byte* str1;
|
||||
ulint len;
|
||||
ulint len1;
|
||||
|
||||
arg1 = func_node->args;
|
||||
|
||||
str1 = dfield_get_data(que_node_get_val(arg1));
|
||||
|
||||
if (dtype_get_mtype(que_node_get_data_type(arg1)) != DATA_INT) {
|
||||
|
||||
len = dfield_get_len(que_node_get_val(arg1));
|
||||
|
||||
dfield = que_node_get_val(func_node);
|
||||
|
||||
dfield_set_data(dfield, str1, len);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
arg2 = que_node_get_next(arg1);
|
||||
|
||||
len1 = (ulint)eval_node_get_int_val(arg2);
|
||||
|
||||
if (len1 > 4) {
|
||||
|
||||
ut_error;
|
||||
}
|
||||
|
||||
dfield = que_node_get_val(func_node);
|
||||
|
||||
dfield_set_data(dfield, str1 + (4 - len1), len1);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Evaluates a predefined function node. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
eval_predefined(
|
||||
/*============*/
|
||||
func_node_t* func_node) /* in: function node */
|
||||
{
|
||||
que_node_t* arg1;
|
||||
lint int_val;
|
||||
byte* data;
|
||||
int func;
|
||||
|
||||
func = func_node->func;
|
||||
|
||||
arg1 = func_node->args;
|
||||
|
||||
if (func == PARS_LENGTH_TOKEN) {
|
||||
|
||||
int_val = (lint)dfield_get_len(que_node_get_val(arg1));
|
||||
|
||||
} else if (func == PARS_TO_CHAR_TOKEN) {
|
||||
|
||||
/* Convert number to character string as a
|
||||
signed decimal integer. */
|
||||
|
||||
ulint uint_val;
|
||||
int int_len;
|
||||
|
||||
int_val = eval_node_get_int_val(arg1);
|
||||
|
||||
/* Determine the length of the string. */
|
||||
|
||||
if (int_val == 0) {
|
||||
int_len = 1; /* the number 0 occupies 1 byte */
|
||||
} else {
|
||||
int_len = 0;
|
||||
if (int_val < 0) {
|
||||
uint_val = ((ulint) -int_val - 1) + 1;
|
||||
int_len++; /* reserve space for minus sign */
|
||||
} else {
|
||||
uint_val = (ulint) int_val;
|
||||
}
|
||||
for (; uint_val > 0; int_len++) {
|
||||
uint_val /= 10;
|
||||
}
|
||||
}
|
||||
|
||||
/* allocate the string */
|
||||
data = eval_node_ensure_val_buf(func_node, int_len + 1);
|
||||
|
||||
/* add terminating NUL character */
|
||||
data[int_len] = 0;
|
||||
|
||||
/* convert the number */
|
||||
|
||||
if (int_val == 0) {
|
||||
data[0] = '0';
|
||||
} else {
|
||||
int tmp;
|
||||
if (int_val < 0) {
|
||||
data[0] = '-'; /* preceding minus sign */
|
||||
uint_val = ((ulint) -int_val - 1) + 1;
|
||||
} else {
|
||||
uint_val = (ulint) int_val;
|
||||
}
|
||||
for (tmp = int_len; uint_val > 0; uint_val /= 10) {
|
||||
data[--tmp] = (byte) ('0' + (byte)(uint_val % 10));
|
||||
}
|
||||
}
|
||||
|
||||
dfield_set_len((dfield_t*) que_node_get_val(func_node),
|
||||
int_len);
|
||||
|
||||
return;
|
||||
|
||||
} else if (func == PARS_TO_NUMBER_TOKEN) {
|
||||
|
||||
int_val = atoi((char*)
|
||||
dfield_get_data(que_node_get_val(arg1)));
|
||||
|
||||
} else if (func == PARS_SYSDATE_TOKEN) {
|
||||
int_val = (lint)ut_time();
|
||||
} else {
|
||||
eval_predefined_2(func_node);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
eval_node_set_int_val(func_node, int_val);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Evaluates a function node. */
|
||||
|
||||
void
|
||||
eval_func(
|
||||
/*======*/
|
||||
func_node_t* func_node) /* in: function node */
|
||||
{
|
||||
que_node_t* arg;
|
||||
ulint class;
|
||||
ulint func;
|
||||
|
||||
ut_ad(que_node_get_type(func_node) == QUE_NODE_FUNC);
|
||||
|
||||
class = func_node->class;
|
||||
func = func_node->func;
|
||||
|
||||
arg = func_node->args;
|
||||
|
||||
/* Evaluate first the argument list */
|
||||
while (arg) {
|
||||
eval_exp(arg);
|
||||
|
||||
/* The functions are not defined for SQL null argument
|
||||
values, except for eval_cmp and notfound */
|
||||
|
||||
if ((dfield_get_len(que_node_get_val(arg)) == UNIV_SQL_NULL)
|
||||
&& (class != PARS_FUNC_CMP)
|
||||
&& (func != PARS_NOTFOUND_TOKEN)
|
||||
&& (func != PARS_PRINTF_TOKEN)) {
|
||||
ut_error;
|
||||
}
|
||||
|
||||
arg = que_node_get_next(arg);
|
||||
}
|
||||
|
||||
if (class == PARS_FUNC_CMP) {
|
||||
eval_cmp(func_node);
|
||||
} else if (class == PARS_FUNC_ARITH) {
|
||||
eval_arith(func_node);
|
||||
} else if (class == PARS_FUNC_AGGREGATE) {
|
||||
eval_aggregate(func_node);
|
||||
} else if (class == PARS_FUNC_PREDEFINED) {
|
||||
|
||||
if (func == PARS_NOTFOUND_TOKEN) {
|
||||
eval_notfound(func_node);
|
||||
} else if (func == PARS_SUBSTR_TOKEN) {
|
||||
eval_substr(func_node);
|
||||
} else if (func == PARS_REPLSTR_TOKEN) {
|
||||
eval_replstr(func_node);
|
||||
} else if (func == PARS_INSTR_TOKEN) {
|
||||
eval_instr(func_node);
|
||||
} else if (func == PARS_BINARY_TO_NUMBER_TOKEN) {
|
||||
eval_binary_to_number(func_node);
|
||||
} else if (func == PARS_CONCAT_TOKEN) {
|
||||
eval_concat(func_node);
|
||||
} else if (func == PARS_TO_BINARY_TOKEN) {
|
||||
eval_to_binary(func_node);
|
||||
} else {
|
||||
eval_predefined(func_node);
|
||||
}
|
||||
} else {
|
||||
ut_ad(class == PARS_FUNC_LOGICAL);
|
||||
|
||||
eval_logical(func_node);
|
||||
}
|
||||
}
|
||||
245
storage/innobase/eval/eval0proc.c
Normal file
245
storage/innobase/eval/eval0proc.c
Normal file
|
|
@ -0,0 +1,245 @@
|
|||
/******************************************************
|
||||
Executes SQL stored procedures and their control structures
|
||||
|
||||
(c) 1998 Innobase Oy
|
||||
|
||||
Created 1/20/1998 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#include "eval0proc.h"
|
||||
|
||||
#ifdef UNIV_NONINL
|
||||
#include "eval0proc.ic"
|
||||
#endif
|
||||
|
||||
/**************************************************************************
|
||||
Performs an execution step of an if-statement node. */
|
||||
|
||||
que_thr_t*
|
||||
if_step(
|
||||
/*====*/
|
||||
/* out: query thread to run next or NULL */
|
||||
que_thr_t* thr) /* in: query thread */
|
||||
{
|
||||
if_node_t* node;
|
||||
elsif_node_t* elsif_node;
|
||||
|
||||
ut_ad(thr);
|
||||
|
||||
node = thr->run_node;
|
||||
ut_ad(que_node_get_type(node) == QUE_NODE_IF);
|
||||
|
||||
if (thr->prev_node == que_node_get_parent(node)) {
|
||||
|
||||
/* Evaluate the condition */
|
||||
|
||||
eval_exp(node->cond);
|
||||
|
||||
if (eval_node_get_ibool_val(node->cond)) {
|
||||
|
||||
/* The condition evaluated to TRUE: start execution
|
||||
from the first statement in the statement list */
|
||||
|
||||
thr->run_node = node->stat_list;
|
||||
|
||||
} else if (node->else_part) {
|
||||
thr->run_node = node->else_part;
|
||||
|
||||
} else if (node->elsif_list) {
|
||||
elsif_node = node->elsif_list;
|
||||
|
||||
for (;;) {
|
||||
eval_exp(elsif_node->cond);
|
||||
|
||||
if (eval_node_get_ibool_val(elsif_node->cond)) {
|
||||
|
||||
/* The condition evaluated to TRUE:
|
||||
start execution from the first
|
||||
statement in the statement list */
|
||||
|
||||
thr->run_node = elsif_node->stat_list;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
elsif_node = que_node_get_next(elsif_node);
|
||||
|
||||
if (elsif_node == NULL) {
|
||||
thr->run_node = NULL;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
thr->run_node = NULL;
|
||||
}
|
||||
} else {
|
||||
/* Move to the next statement */
|
||||
ut_ad(que_node_get_next(thr->prev_node) == NULL);
|
||||
|
||||
thr->run_node = NULL;
|
||||
}
|
||||
|
||||
if (thr->run_node == NULL) {
|
||||
thr->run_node = que_node_get_parent(node);
|
||||
}
|
||||
|
||||
return(thr);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Performs an execution step of a while-statement node. */
|
||||
|
||||
que_thr_t*
|
||||
while_step(
|
||||
/*=======*/
|
||||
/* out: query thread to run next or NULL */
|
||||
que_thr_t* thr) /* in: query thread */
|
||||
{
|
||||
while_node_t* node;
|
||||
|
||||
ut_ad(thr);
|
||||
|
||||
node = thr->run_node;
|
||||
ut_ad(que_node_get_type(node) == QUE_NODE_WHILE);
|
||||
|
||||
ut_ad((thr->prev_node == que_node_get_parent(node))
|
||||
|| (que_node_get_next(thr->prev_node) == NULL));
|
||||
|
||||
/* Evaluate the condition */
|
||||
|
||||
eval_exp(node->cond);
|
||||
|
||||
if (eval_node_get_ibool_val(node->cond)) {
|
||||
|
||||
/* The condition evaluated to TRUE: start execution
|
||||
from the first statement in the statement list */
|
||||
|
||||
thr->run_node = node->stat_list;
|
||||
} else {
|
||||
thr->run_node = que_node_get_parent(node);
|
||||
}
|
||||
|
||||
return(thr);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Performs an execution step of an assignment statement node. */
|
||||
|
||||
que_thr_t*
|
||||
assign_step(
|
||||
/*========*/
|
||||
/* out: query thread to run next or NULL */
|
||||
que_thr_t* thr) /* in: query thread */
|
||||
{
|
||||
assign_node_t* node;
|
||||
|
||||
ut_ad(thr);
|
||||
|
||||
node = thr->run_node;
|
||||
ut_ad(que_node_get_type(node) == QUE_NODE_ASSIGNMENT);
|
||||
|
||||
/* Evaluate the value to assign */
|
||||
|
||||
eval_exp(node->val);
|
||||
|
||||
eval_node_copy_val(node->var->alias, node->val);
|
||||
|
||||
thr->run_node = que_node_get_parent(node);
|
||||
|
||||
return(thr);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Performs an execution step of a for-loop node. */
|
||||
|
||||
que_thr_t*
|
||||
for_step(
|
||||
/*=====*/
|
||||
/* out: query thread to run next or NULL */
|
||||
que_thr_t* thr) /* in: query thread */
|
||||
{
|
||||
for_node_t* node;
|
||||
que_node_t* parent;
|
||||
lint loop_var_value;
|
||||
|
||||
ut_ad(thr);
|
||||
|
||||
node = thr->run_node;
|
||||
|
||||
ut_ad(que_node_get_type(node) == QUE_NODE_FOR);
|
||||
|
||||
parent = que_node_get_parent(node);
|
||||
|
||||
if (thr->prev_node != parent) {
|
||||
|
||||
/* Move to the next statement */
|
||||
thr->run_node = que_node_get_next(thr->prev_node);
|
||||
|
||||
if (thr->run_node != NULL) {
|
||||
|
||||
return(thr);
|
||||
}
|
||||
|
||||
/* Increment the value of loop_var */
|
||||
|
||||
loop_var_value = 1 + eval_node_get_int_val(node->loop_var);
|
||||
} else {
|
||||
/* Initialize the loop */
|
||||
|
||||
eval_exp(node->loop_start_limit);
|
||||
eval_exp(node->loop_end_limit);
|
||||
|
||||
loop_var_value = eval_node_get_int_val(node->loop_start_limit);
|
||||
|
||||
node->loop_end_value = eval_node_get_int_val(
|
||||
node->loop_end_limit);
|
||||
}
|
||||
|
||||
/* Check if we should do another loop */
|
||||
|
||||
if (loop_var_value > node->loop_end_value) {
|
||||
|
||||
/* Enough loops done */
|
||||
|
||||
thr->run_node = parent;
|
||||
} else {
|
||||
eval_node_set_int_val(node->loop_var, loop_var_value);
|
||||
|
||||
thr->run_node = node->stat_list;
|
||||
}
|
||||
|
||||
return(thr);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Performs an execution step of a return-statement node. */
|
||||
|
||||
que_thr_t*
|
||||
return_step(
|
||||
/*========*/
|
||||
/* out: query thread to run next or NULL */
|
||||
que_thr_t* thr) /* in: query thread */
|
||||
{
|
||||
return_node_t* node;
|
||||
que_node_t* parent;
|
||||
|
||||
ut_ad(thr);
|
||||
|
||||
node = thr->run_node;
|
||||
|
||||
ut_ad(que_node_get_type(node) == QUE_NODE_RETURN);
|
||||
|
||||
parent = node;
|
||||
|
||||
while (que_node_get_type(parent) != QUE_NODE_PROC) {
|
||||
|
||||
parent = que_node_get_parent(parent);
|
||||
}
|
||||
|
||||
ut_a(parent);
|
||||
|
||||
thr->run_node = que_node_get_parent(parent);
|
||||
|
||||
return(thr);
|
||||
}
|
||||
10
storage/innobase/eval/makefilewin
Normal file
10
storage/innobase/eval/makefilewin
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
include ..\include\makefile.i
|
||||
|
||||
eval.lib: eval0eval.obj eval0proc.obj
|
||||
lib -out:..\libs\eval.lib eval0eval.obj eval0proc.obj
|
||||
|
||||
eval0eval.obj: eval0eval.c
|
||||
$(CCOM) $(CFL) -c eval0eval.c
|
||||
|
||||
eval0proc.obj: eval0proc.c
|
||||
$(CCOM) $(CFL) -c eval0proc.c
|
||||
24
storage/innobase/fil/Makefile.am
Normal file
24
storage/innobase/fil/Makefile.am
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
# & Innobase Oy
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
include ../include/Makefile.i
|
||||
|
||||
noinst_LIBRARIES = libfil.a
|
||||
|
||||
libfil_a_SOURCES = fil0fil.c
|
||||
|
||||
EXTRA_PROGRAMS =
|
||||
4298
storage/innobase/fil/fil0fil.c
Normal file
4298
storage/innobase/fil/fil0fil.c
Normal file
File diff suppressed because it is too large
Load diff
10
storage/innobase/fil/makefilewin
Normal file
10
storage/innobase/fil/makefilewin
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
include ..\include\makefile.i
|
||||
|
||||
fil.lib: fil0fil.obj
|
||||
lib -out:..\libs\fil.lib fil0fil.obj
|
||||
|
||||
fil0fil.obj: fil0fil.c
|
||||
$(CCOM) $(CFL) -c fil0fil.c
|
||||
|
||||
|
||||
|
||||
25
storage/innobase/fsp/Makefile.am
Normal file
25
storage/innobase/fsp/Makefile.am
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
# & Innobase Oy
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
include ../include/Makefile.i
|
||||
|
||||
noinst_LIBRARIES = libfsp.a
|
||||
|
||||
libfsp_a_SOURCES = fsp0fsp.c
|
||||
|
||||
EXTRA_PROGRAMS =
|
||||
3943
storage/innobase/fsp/fsp0fsp.c
Normal file
3943
storage/innobase/fsp/fsp0fsp.c
Normal file
File diff suppressed because it is too large
Load diff
9
storage/innobase/fsp/makefilewin
Normal file
9
storage/innobase/fsp/makefilewin
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
include ..\include\makefile.i
|
||||
|
||||
fsp.lib: fsp0fsp.obj
|
||||
lib -out:..\libs\fsp.lib fsp0fsp.obj
|
||||
|
||||
fsp0fsp.obj: fsp0fsp.c
|
||||
$(CCOM) $(CFL) -c fsp0fsp.c
|
||||
|
||||
|
||||
24
storage/innobase/fut/Makefile.am
Normal file
24
storage/innobase/fut/Makefile.am
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
# & Innobase Oy
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
include ../include/Makefile.i
|
||||
|
||||
noinst_LIBRARIES = libfut.a
|
||||
|
||||
libfut_a_SOURCES = fut0fut.c fut0lst.c
|
||||
|
||||
EXTRA_PROGRAMS =
|
||||
14
storage/innobase/fut/fut0fut.c
Normal file
14
storage/innobase/fut/fut0fut.c
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/**********************************************************************
|
||||
File-based utilities
|
||||
|
||||
(c) 1995 Innobase Oy
|
||||
|
||||
Created 12/13/1995 Heikki Tuuri
|
||||
***********************************************************************/
|
||||
|
||||
#include "fut0fut.h"
|
||||
|
||||
#ifdef UNIV_NONINL
|
||||
#include "fut0fut.ic"
|
||||
#endif
|
||||
|
||||
518
storage/innobase/fut/fut0lst.c
Normal file
518
storage/innobase/fut/fut0lst.c
Normal file
|
|
@ -0,0 +1,518 @@
|
|||
/**********************************************************************
|
||||
File-based list utilities
|
||||
|
||||
(c) 1995 Innobase Oy
|
||||
|
||||
Created 11/28/1995 Heikki Tuuri
|
||||
***********************************************************************/
|
||||
|
||||
#include "fut0lst.h"
|
||||
|
||||
#ifdef UNIV_NONINL
|
||||
#include "fut0lst.ic"
|
||||
#endif
|
||||
|
||||
#include "buf0buf.h"
|
||||
|
||||
|
||||
/************************************************************************
|
||||
Adds a node to an empty list. */
|
||||
static
|
||||
void
|
||||
flst_add_to_empty(
|
||||
/*==============*/
|
||||
flst_base_node_t* base, /* in: pointer to base node of
|
||||
empty list */
|
||||
flst_node_t* node, /* in: node to add */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
ulint space;
|
||||
fil_addr_t node_addr;
|
||||
ulint len;
|
||||
|
||||
ut_ad(mtr && base && node);
|
||||
ut_ad(base != node);
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(base),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(node),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
len = flst_get_len(base, mtr);
|
||||
ut_a(len == 0);
|
||||
|
||||
buf_ptr_get_fsp_addr(node, &space, &node_addr);
|
||||
|
||||
/* Update first and last fields of base node */
|
||||
flst_write_addr(base + FLST_FIRST, node_addr, mtr);
|
||||
flst_write_addr(base + FLST_LAST, node_addr, mtr);
|
||||
|
||||
/* Set prev and next fields of node to add */
|
||||
flst_write_addr(node + FLST_PREV, fil_addr_null, mtr);
|
||||
flst_write_addr(node + FLST_NEXT, fil_addr_null, mtr);
|
||||
|
||||
/* Update len of base node */
|
||||
mlog_write_ulint(base + FLST_LEN, len + 1, MLOG_4BYTES, mtr);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Adds a node as the last node in a list. */
|
||||
|
||||
void
|
||||
flst_add_last(
|
||||
/*==========*/
|
||||
flst_base_node_t* base, /* in: pointer to base node of list */
|
||||
flst_node_t* node, /* in: node to add */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
ulint space;
|
||||
fil_addr_t node_addr;
|
||||
ulint len;
|
||||
fil_addr_t last_addr;
|
||||
flst_node_t* last_node;
|
||||
|
||||
ut_ad(mtr && base && node);
|
||||
ut_ad(base != node);
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(base),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(node),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
len = flst_get_len(base, mtr);
|
||||
last_addr = flst_get_last(base, mtr);
|
||||
|
||||
buf_ptr_get_fsp_addr(node, &space, &node_addr);
|
||||
|
||||
/* If the list is not empty, call flst_insert_after */
|
||||
if (len != 0) {
|
||||
if (last_addr.page == node_addr.page) {
|
||||
last_node = buf_frame_align(node) + last_addr.boffset;
|
||||
} else {
|
||||
last_node = fut_get_ptr(space, last_addr, RW_X_LATCH,
|
||||
mtr);
|
||||
}
|
||||
|
||||
flst_insert_after(base, last_node, node, mtr);
|
||||
} else {
|
||||
/* else call flst_add_to_empty */
|
||||
flst_add_to_empty(base, node, mtr);
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Adds a node as the first node in a list. */
|
||||
|
||||
void
|
||||
flst_add_first(
|
||||
/*===========*/
|
||||
flst_base_node_t* base, /* in: pointer to base node of list */
|
||||
flst_node_t* node, /* in: node to add */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
ulint space;
|
||||
fil_addr_t node_addr;
|
||||
ulint len;
|
||||
fil_addr_t first_addr;
|
||||
flst_node_t* first_node;
|
||||
|
||||
ut_ad(mtr && base && node);
|
||||
ut_ad(base != node);
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(base),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(node),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
len = flst_get_len(base, mtr);
|
||||
first_addr = flst_get_first(base, mtr);
|
||||
|
||||
buf_ptr_get_fsp_addr(node, &space, &node_addr);
|
||||
|
||||
/* If the list is not empty, call flst_insert_before */
|
||||
if (len != 0) {
|
||||
if (first_addr.page == node_addr.page) {
|
||||
first_node = buf_frame_align(node)
|
||||
+ first_addr.boffset;
|
||||
} else {
|
||||
first_node = fut_get_ptr(space, first_addr,
|
||||
RW_X_LATCH, mtr);
|
||||
}
|
||||
|
||||
flst_insert_before(base, node, first_node, mtr);
|
||||
} else {
|
||||
/* else call flst_add_to_empty */
|
||||
flst_add_to_empty(base, node, mtr);
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Inserts a node after another in a list. */
|
||||
|
||||
void
|
||||
flst_insert_after(
|
||||
/*==============*/
|
||||
flst_base_node_t* base, /* in: pointer to base node of list */
|
||||
flst_node_t* node1, /* in: node to insert after */
|
||||
flst_node_t* node2, /* in: node to add */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
ulint space;
|
||||
fil_addr_t node1_addr;
|
||||
fil_addr_t node2_addr;
|
||||
flst_node_t* node3;
|
||||
fil_addr_t node3_addr;
|
||||
ulint len;
|
||||
|
||||
ut_ad(mtr && node1 && node2 && base);
|
||||
ut_ad(base != node1);
|
||||
ut_ad(base != node2);
|
||||
ut_ad(node2 != node1);
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(base),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(node1),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(node2),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
|
||||
buf_ptr_get_fsp_addr(node1, &space, &node1_addr);
|
||||
buf_ptr_get_fsp_addr(node2, &space, &node2_addr);
|
||||
|
||||
node3_addr = flst_get_next_addr(node1, mtr);
|
||||
|
||||
/* Set prev and next fields of node2 */
|
||||
flst_write_addr(node2 + FLST_PREV, node1_addr, mtr);
|
||||
flst_write_addr(node2 + FLST_NEXT, node3_addr, mtr);
|
||||
|
||||
if (!fil_addr_is_null(node3_addr)) {
|
||||
/* Update prev field of node3 */
|
||||
node3 = fut_get_ptr(space, node3_addr, RW_X_LATCH, mtr);
|
||||
flst_write_addr(node3 + FLST_PREV, node2_addr, mtr);
|
||||
} else {
|
||||
/* node1 was last in list: update last field in base */
|
||||
flst_write_addr(base + FLST_LAST, node2_addr, mtr);
|
||||
}
|
||||
|
||||
/* Set next field of node1 */
|
||||
flst_write_addr(node1 + FLST_NEXT, node2_addr, mtr);
|
||||
|
||||
/* Update len of base node */
|
||||
len = flst_get_len(base, mtr);
|
||||
mlog_write_ulint(base + FLST_LEN, len + 1, MLOG_4BYTES, mtr);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Inserts a node before another in a list. */
|
||||
|
||||
void
|
||||
flst_insert_before(
|
||||
/*===============*/
|
||||
flst_base_node_t* base, /* in: pointer to base node of list */
|
||||
flst_node_t* node2, /* in: node to insert */
|
||||
flst_node_t* node3, /* in: node to insert before */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
ulint space;
|
||||
flst_node_t* node1;
|
||||
fil_addr_t node1_addr;
|
||||
fil_addr_t node2_addr;
|
||||
fil_addr_t node3_addr;
|
||||
ulint len;
|
||||
|
||||
ut_ad(mtr && node2 && node3 && base);
|
||||
ut_ad(base != node2);
|
||||
ut_ad(base != node3);
|
||||
ut_ad(node2 != node3);
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(base),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(node2),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(node3),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
|
||||
buf_ptr_get_fsp_addr(node2, &space, &node2_addr);
|
||||
buf_ptr_get_fsp_addr(node3, &space, &node3_addr);
|
||||
|
||||
node1_addr = flst_get_prev_addr(node3, mtr);
|
||||
|
||||
/* Set prev and next fields of node2 */
|
||||
flst_write_addr(node2 + FLST_PREV, node1_addr, mtr);
|
||||
flst_write_addr(node2 + FLST_NEXT, node3_addr, mtr);
|
||||
|
||||
if (!fil_addr_is_null(node1_addr)) {
|
||||
/* Update next field of node1 */
|
||||
node1 = fut_get_ptr(space, node1_addr, RW_X_LATCH, mtr);
|
||||
flst_write_addr(node1 + FLST_NEXT, node2_addr, mtr);
|
||||
} else {
|
||||
/* node3 was first in list: update first field in base */
|
||||
flst_write_addr(base + FLST_FIRST, node2_addr, mtr);
|
||||
}
|
||||
|
||||
/* Set prev field of node3 */
|
||||
flst_write_addr(node3 + FLST_PREV, node2_addr, mtr);
|
||||
|
||||
/* Update len of base node */
|
||||
len = flst_get_len(base, mtr);
|
||||
mlog_write_ulint(base + FLST_LEN, len + 1, MLOG_4BYTES, mtr);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Removes a node. */
|
||||
|
||||
void
|
||||
flst_remove(
|
||||
/*========*/
|
||||
flst_base_node_t* base, /* in: pointer to base node of list */
|
||||
flst_node_t* node2, /* in: node to remove */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
ulint space;
|
||||
flst_node_t* node1;
|
||||
fil_addr_t node1_addr;
|
||||
fil_addr_t node2_addr;
|
||||
flst_node_t* node3;
|
||||
fil_addr_t node3_addr;
|
||||
ulint len;
|
||||
|
||||
ut_ad(mtr && node2 && base);
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(base),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(node2),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
|
||||
buf_ptr_get_fsp_addr(node2, &space, &node2_addr);
|
||||
|
||||
node1_addr = flst_get_prev_addr(node2, mtr);
|
||||
node3_addr = flst_get_next_addr(node2, mtr);
|
||||
|
||||
if (!fil_addr_is_null(node1_addr)) {
|
||||
|
||||
/* Update next field of node1 */
|
||||
|
||||
if (node1_addr.page == node2_addr.page) {
|
||||
|
||||
node1 = buf_frame_align(node2) + node1_addr.boffset;
|
||||
} else {
|
||||
node1 = fut_get_ptr(space, node1_addr, RW_X_LATCH,
|
||||
mtr);
|
||||
}
|
||||
|
||||
ut_ad(node1 != node2);
|
||||
|
||||
flst_write_addr(node1 + FLST_NEXT, node3_addr, mtr);
|
||||
} else {
|
||||
/* node2 was first in list: update first field in base */
|
||||
flst_write_addr(base + FLST_FIRST, node3_addr, mtr);
|
||||
}
|
||||
|
||||
if (!fil_addr_is_null(node3_addr)) {
|
||||
/* Update prev field of node3 */
|
||||
|
||||
if (node3_addr.page == node2_addr.page) {
|
||||
|
||||
node3 = buf_frame_align(node2) + node3_addr.boffset;
|
||||
} else {
|
||||
node3 = fut_get_ptr(space, node3_addr, RW_X_LATCH,
|
||||
mtr);
|
||||
}
|
||||
|
||||
ut_ad(node2 != node3);
|
||||
|
||||
flst_write_addr(node3 + FLST_PREV, node1_addr, mtr);
|
||||
} else {
|
||||
/* node2 was last in list: update last field in base */
|
||||
flst_write_addr(base + FLST_LAST, node1_addr, mtr);
|
||||
}
|
||||
|
||||
/* Update len of base node */
|
||||
len = flst_get_len(base, mtr);
|
||||
ut_ad(len > 0);
|
||||
|
||||
mlog_write_ulint(base + FLST_LEN, len - 1, MLOG_4BYTES, mtr);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Cuts off the tail of the list, including the node given. The number of
|
||||
nodes which will be removed must be provided by the caller, as this function
|
||||
does not measure the length of the tail. */
|
||||
|
||||
void
|
||||
flst_cut_end(
|
||||
/*=========*/
|
||||
flst_base_node_t* base, /* in: pointer to base node of list */
|
||||
flst_node_t* node2, /* in: first node to remove */
|
||||
ulint n_nodes,/* in: number of nodes to remove,
|
||||
must be >= 1 */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
ulint space;
|
||||
flst_node_t* node1;
|
||||
fil_addr_t node1_addr;
|
||||
fil_addr_t node2_addr;
|
||||
ulint len;
|
||||
|
||||
ut_ad(mtr && node2 && base);
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(base),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(node2),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
ut_ad(n_nodes > 0);
|
||||
|
||||
buf_ptr_get_fsp_addr(node2, &space, &node2_addr);
|
||||
|
||||
node1_addr = flst_get_prev_addr(node2, mtr);
|
||||
|
||||
if (!fil_addr_is_null(node1_addr)) {
|
||||
|
||||
/* Update next field of node1 */
|
||||
|
||||
if (node1_addr.page == node2_addr.page) {
|
||||
|
||||
node1 = buf_frame_align(node2) + node1_addr.boffset;
|
||||
} else {
|
||||
node1 = fut_get_ptr(space, node1_addr, RW_X_LATCH,
|
||||
mtr);
|
||||
}
|
||||
|
||||
flst_write_addr(node1 + FLST_NEXT, fil_addr_null, mtr);
|
||||
} else {
|
||||
/* node2 was first in list: update the field in base */
|
||||
flst_write_addr(base + FLST_FIRST, fil_addr_null, mtr);
|
||||
}
|
||||
|
||||
flst_write_addr(base + FLST_LAST, node1_addr, mtr);
|
||||
|
||||
/* Update len of base node */
|
||||
len = flst_get_len(base, mtr);
|
||||
ut_ad(len >= n_nodes);
|
||||
|
||||
mlog_write_ulint(base + FLST_LEN, len - n_nodes, MLOG_4BYTES, mtr);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Cuts off the tail of the list, not including the given node. The number of
|
||||
nodes which will be removed must be provided by the caller, as this function
|
||||
does not measure the length of the tail. */
|
||||
|
||||
void
|
||||
flst_truncate_end(
|
||||
/*==============*/
|
||||
flst_base_node_t* base, /* in: pointer to base node of list */
|
||||
flst_node_t* node2, /* in: first node not to remove */
|
||||
ulint n_nodes,/* in: number of nodes to remove */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
fil_addr_t node2_addr;
|
||||
ulint len;
|
||||
ulint space;
|
||||
|
||||
ut_ad(mtr && node2 && base);
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(base),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(node2),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
if (n_nodes == 0) {
|
||||
|
||||
ut_ad(fil_addr_is_null(flst_get_next_addr(node2, mtr)));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
buf_ptr_get_fsp_addr(node2, &space, &node2_addr);
|
||||
|
||||
/* Update next field of node2 */
|
||||
flst_write_addr(node2 + FLST_NEXT, fil_addr_null, mtr);
|
||||
|
||||
flst_write_addr(base + FLST_LAST, node2_addr, mtr);
|
||||
|
||||
/* Update len of base node */
|
||||
len = flst_get_len(base, mtr);
|
||||
ut_ad(len >= n_nodes);
|
||||
|
||||
mlog_write_ulint(base + FLST_LEN, len - n_nodes, MLOG_4BYTES, mtr);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Validates a file-based list. */
|
||||
|
||||
ibool
|
||||
flst_validate(
|
||||
/*==========*/
|
||||
/* out: TRUE if ok */
|
||||
flst_base_node_t* base, /* in: pointer to base node of list */
|
||||
mtr_t* mtr1) /* in: mtr */
|
||||
{
|
||||
ulint space;
|
||||
flst_node_t* node;
|
||||
fil_addr_t node_addr;
|
||||
fil_addr_t base_addr;
|
||||
ulint len;
|
||||
ulint i;
|
||||
mtr_t mtr2;
|
||||
|
||||
ut_ad(base);
|
||||
ut_ad(mtr_memo_contains(mtr1, buf_block_align(base),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
|
||||
/* We use two mini-transaction handles: the first is used to
|
||||
lock the base node, and prevent other threads from modifying the
|
||||
list. The second is used to traverse the list. We cannot run the
|
||||
second mtr without committing it at times, because if the list
|
||||
is long, then the x-locked pages could fill the buffer resulting
|
||||
in a deadlock. */
|
||||
|
||||
/* Find out the space id */
|
||||
buf_ptr_get_fsp_addr(base, &space, &base_addr);
|
||||
|
||||
len = flst_get_len(base, mtr1);
|
||||
node_addr = flst_get_first(base, mtr1);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
mtr_start(&mtr2);
|
||||
|
||||
node = fut_get_ptr(space, node_addr, RW_X_LATCH, &mtr2);
|
||||
node_addr = flst_get_next_addr(node, &mtr2);
|
||||
|
||||
mtr_commit(&mtr2); /* Commit mtr2 each round to prevent buffer
|
||||
becoming full */
|
||||
}
|
||||
|
||||
ut_a(fil_addr_is_null(node_addr));
|
||||
|
||||
node_addr = flst_get_last(base, mtr1);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
mtr_start(&mtr2);
|
||||
|
||||
node = fut_get_ptr(space, node_addr, RW_X_LATCH, &mtr2);
|
||||
node_addr = flst_get_prev_addr(node, &mtr2);
|
||||
|
||||
mtr_commit(&mtr2); /* Commit mtr2 each round to prevent buffer
|
||||
becoming full */
|
||||
}
|
||||
|
||||
ut_a(fil_addr_is_null(node_addr));
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Prints info of a file-based list. */
|
||||
|
||||
void
|
||||
flst_print(
|
||||
/*=======*/
|
||||
flst_base_node_t* base, /* in: pointer to base node of list */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
buf_frame_t* frame;
|
||||
ulint len;
|
||||
|
||||
ut_ad(base && mtr);
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(base),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
frame = buf_frame_align(base);
|
||||
|
||||
len = flst_get_len(base, mtr);
|
||||
|
||||
fprintf(stderr,
|
||||
"FILE-BASED LIST:\n"
|
||||
"Base node in space %lu page %lu byte offset %lu; len %lu\n",
|
||||
(ulong) buf_frame_get_space_id(frame),
|
||||
(ulong) buf_frame_get_page_no(frame),
|
||||
(ulong) (base - frame), (ulong) len);
|
||||
}
|
||||
12
storage/innobase/fut/makefilewin
Normal file
12
storage/innobase/fut/makefilewin
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
include ..\include\makefile.i
|
||||
|
||||
fut.lib: fut0lst.obj fut0fut.obj
|
||||
lib -out:..\libs\fut.lib fut0lst.obj fut0fut.obj
|
||||
|
||||
fut0lst.obj: fut0lst.c
|
||||
$(CCOM) $(CFL) -c fut0lst.c
|
||||
|
||||
fut0fut.obj: fut0fut.c
|
||||
$(CCOM) $(CFL) -c fut0fut.c
|
||||
|
||||
|
||||
24
storage/innobase/ha/Makefile.am
Normal file
24
storage/innobase/ha/Makefile.am
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
# & Innobase Oy
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
include ../include/Makefile.i
|
||||
|
||||
noinst_LIBRARIES = libha.a
|
||||
|
||||
libha_a_SOURCES = ha0ha.c hash0hash.c
|
||||
|
||||
EXTRA_PROGRAMS =
|
||||
357
storage/innobase/ha/ha0ha.c
Normal file
357
storage/innobase/ha/ha0ha.c
Normal file
|
|
@ -0,0 +1,357 @@
|
|||
/************************************************************************
|
||||
The hash table with external chains
|
||||
|
||||
(c) 1994-1997 Innobase Oy
|
||||
|
||||
Created 8/22/1994 Heikki Tuuri
|
||||
*************************************************************************/
|
||||
|
||||
#include "ha0ha.h"
|
||||
#ifdef UNIV_NONINL
|
||||
#include "ha0ha.ic"
|
||||
#endif
|
||||
|
||||
#include "buf0buf.h"
|
||||
|
||||
/*****************************************************************
|
||||
Creates a hash table with >= n array cells. The actual number of cells is
|
||||
chosen to be a prime number slightly bigger than n. */
|
||||
|
||||
hash_table_t*
|
||||
ha_create(
|
||||
/*======*/
|
||||
/* out, own: created table */
|
||||
ibool in_btr_search, /* in: TRUE if the hash table is used in
|
||||
the btr_search module */
|
||||
ulint n, /* in: number of array cells */
|
||||
ulint n_mutexes, /* in: number of mutexes to protect the
|
||||
hash table: must be a power of 2, or 0 */
|
||||
ulint mutex_level) /* in: level of the mutexes in the latching
|
||||
order: this is used in the debug version */
|
||||
{
|
||||
hash_table_t* table;
|
||||
ulint i;
|
||||
|
||||
table = hash_create(n);
|
||||
|
||||
if (in_btr_search) {
|
||||
table->adaptive = TRUE;
|
||||
} else {
|
||||
table->adaptive = FALSE;
|
||||
}
|
||||
|
||||
if (n_mutexes == 0) {
|
||||
if (in_btr_search) {
|
||||
table->heap = mem_heap_create_in_btr_search(4096);
|
||||
} else {
|
||||
table->heap = mem_heap_create_in_buffer(4096);
|
||||
}
|
||||
|
||||
return(table);
|
||||
}
|
||||
|
||||
hash_create_mutexes(table, n_mutexes, mutex_level);
|
||||
|
||||
table->heaps = mem_alloc(n_mutexes * sizeof(void*));
|
||||
|
||||
for (i = 0; i < n_mutexes; i++) {
|
||||
if (in_btr_search) {
|
||||
table->heaps[i] = mem_heap_create_in_btr_search(4096);
|
||||
} else {
|
||||
table->heaps[i] = mem_heap_create_in_buffer(4096);
|
||||
}
|
||||
}
|
||||
|
||||
return(table);
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
Inserts an entry into a hash table. If an entry with the same fold number
|
||||
is found, its node is updated to point to the new data, and no new node
|
||||
is inserted. */
|
||||
|
||||
ibool
|
||||
ha_insert_for_fold(
|
||||
/*===============*/
|
||||
/* out: TRUE if succeed, FALSE if no more
|
||||
memory could be allocated */
|
||||
hash_table_t* table, /* in: hash table */
|
||||
ulint fold, /* in: folded value of data; if a node with
|
||||
the same fold value already exists, it is
|
||||
updated to point to the same data, and no new
|
||||
node is created! */
|
||||
void* data) /* in: data, must not be NULL */
|
||||
{
|
||||
hash_cell_t* cell;
|
||||
ha_node_t* node;
|
||||
ha_node_t* prev_node;
|
||||
buf_block_t* prev_block;
|
||||
ulint hash;
|
||||
|
||||
ut_ad(table && data);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold)));
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
hash = hash_calc_hash(fold, table);
|
||||
|
||||
cell = hash_get_nth_cell(table, hash);
|
||||
|
||||
prev_node = cell->node;
|
||||
|
||||
while (prev_node != NULL) {
|
||||
if (prev_node->fold == fold) {
|
||||
if (table->adaptive) {
|
||||
prev_block = buf_block_align(prev_node->data);
|
||||
ut_a(prev_block->n_pointers > 0);
|
||||
prev_block->n_pointers--;
|
||||
buf_block_align(data)->n_pointers++;
|
||||
}
|
||||
|
||||
prev_node->data = data;
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
prev_node = prev_node->next;
|
||||
}
|
||||
|
||||
/* We have to allocate a new chain node */
|
||||
|
||||
node = mem_heap_alloc(hash_get_heap(table, fold), sizeof(ha_node_t));
|
||||
|
||||
if (node == NULL) {
|
||||
/* It was a btr search type memory heap and at the moment
|
||||
no more memory could be allocated: return */
|
||||
|
||||
ut_ad(hash_get_heap(table, fold)->type & MEM_HEAP_BTR_SEARCH);
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
ha_node_set_data(node, data);
|
||||
|
||||
if (table->adaptive) {
|
||||
buf_block_align(data)->n_pointers++;
|
||||
}
|
||||
|
||||
node->fold = fold;
|
||||
|
||||
node->next = NULL;
|
||||
|
||||
prev_node = cell->node;
|
||||
|
||||
if (prev_node == NULL) {
|
||||
|
||||
cell->node = node;
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
while (prev_node->next != NULL) {
|
||||
|
||||
prev_node = prev_node->next;
|
||||
}
|
||||
|
||||
prev_node->next = node;
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
/***************************************************************
|
||||
Deletes a hash node. */
|
||||
|
||||
void
|
||||
ha_delete_hash_node(
|
||||
/*================*/
|
||||
hash_table_t* table, /* in: hash table */
|
||||
ha_node_t* del_node) /* in: node to be deleted */
|
||||
{
|
||||
if (table->adaptive) {
|
||||
ut_a(buf_block_align(del_node->data)->n_pointers > 0);
|
||||
buf_block_align(del_node->data)->n_pointers--;
|
||||
}
|
||||
|
||||
HASH_DELETE_AND_COMPACT(ha_node_t, next, table, del_node);
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
Deletes an entry from a hash table. */
|
||||
|
||||
void
|
||||
ha_delete(
|
||||
/*======*/
|
||||
hash_table_t* table, /* in: hash table */
|
||||
ulint fold, /* in: folded value of data */
|
||||
void* data) /* in: data, must not be NULL and must exist
|
||||
in the hash table */
|
||||
{
|
||||
ha_node_t* node;
|
||||
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold)));
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
node = ha_search_with_data(table, fold, data);
|
||||
|
||||
ut_a(node);
|
||||
|
||||
ha_delete_hash_node(table, node);
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Looks for an element when we know the pointer to the data, and updates
|
||||
the pointer to data, if found. */
|
||||
|
||||
void
|
||||
ha_search_and_update_if_found(
|
||||
/*==========================*/
|
||||
hash_table_t* table, /* in: hash table */
|
||||
ulint fold, /* in: folded value of the searched data */
|
||||
void* data, /* in: pointer to the data */
|
||||
void* new_data)/* in: new pointer to the data */
|
||||
{
|
||||
ha_node_t* node;
|
||||
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold)));
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
||||
node = ha_search_with_data(table, fold, data);
|
||||
|
||||
if (node) {
|
||||
if (table->adaptive) {
|
||||
ut_a(buf_block_align(node->data)->n_pointers > 0);
|
||||
buf_block_align(node->data)->n_pointers--;
|
||||
buf_block_align(new_data)->n_pointers++;
|
||||
}
|
||||
|
||||
node->data = new_data;
|
||||
}
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Removes from the chain determined by fold all nodes whose data pointer
|
||||
points to the page given. */
|
||||
|
||||
void
|
||||
ha_remove_all_nodes_to_page(
|
||||
/*========================*/
|
||||
hash_table_t* table, /* in: hash table */
|
||||
ulint fold, /* in: fold value */
|
||||
page_t* page) /* in: buffer page */
|
||||
{
|
||||
ha_node_t* node;
|
||||
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold)));
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
node = ha_chain_get_first(table, fold);
|
||||
|
||||
while (node) {
|
||||
if (buf_frame_align(ha_node_get_data(node)) == page) {
|
||||
|
||||
/* Remove the hash node */
|
||||
|
||||
ha_delete_hash_node(table, node);
|
||||
|
||||
/* Start again from the first node in the chain
|
||||
because the deletion may compact the heap of
|
||||
nodes and move other nodes! */
|
||||
|
||||
node = ha_chain_get_first(table, fold);
|
||||
} else {
|
||||
node = ha_chain_get_next(node);
|
||||
}
|
||||
}
|
||||
#ifdef UNIV_DEBUG
|
||||
/* Check that all nodes really got deleted */
|
||||
|
||||
node = ha_chain_get_first(table, fold);
|
||||
|
||||
while (node) {
|
||||
ut_a(buf_frame_align(ha_node_get_data(node)) != page);
|
||||
|
||||
node = ha_chain_get_next(node);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
Validates a hash table. */
|
||||
|
||||
ibool
|
||||
ha_validate(
|
||||
/*========*/
|
||||
/* out: TRUE if ok */
|
||||
hash_table_t* table) /* in: hash table */
|
||||
{
|
||||
hash_cell_t* cell;
|
||||
ha_node_t* node;
|
||||
ibool ok = TRUE;
|
||||
ulint i;
|
||||
|
||||
for (i = 0; i < hash_get_n_cells(table); i++) {
|
||||
|
||||
cell = hash_get_nth_cell(table, i);
|
||||
|
||||
node = cell->node;
|
||||
|
||||
while (node) {
|
||||
if (hash_calc_hash(node->fold, table) != i) {
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr,
|
||||
"InnoDB: Error: hash table node fold value %lu does not\n"
|
||||
"InnoDB: match with the cell number %lu.\n",
|
||||
(ulong) node->fold, (ulong) i);
|
||||
|
||||
ok = FALSE;
|
||||
}
|
||||
|
||||
node = node->next;
|
||||
}
|
||||
}
|
||||
|
||||
return(ok);
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
Prints info of a hash table. */
|
||||
|
||||
void
|
||||
ha_print_info(
|
||||
/*==========*/
|
||||
FILE* file, /* in: file where to print */
|
||||
hash_table_t* table) /* in: hash table */
|
||||
{
|
||||
hash_cell_t* cell;
|
||||
ulint cells = 0;
|
||||
ulint n_bufs;
|
||||
ulint i;
|
||||
|
||||
for (i = 0; i < hash_get_n_cells(table); i++) {
|
||||
|
||||
cell = hash_get_nth_cell(table, i);
|
||||
|
||||
if (cell->node) {
|
||||
|
||||
cells++;
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(file,
|
||||
"Hash table size %lu, used cells %lu",
|
||||
(ulong) hash_get_n_cells(table), (ulong) cells);
|
||||
|
||||
if (table->heaps == NULL && table->heap != NULL) {
|
||||
|
||||
/* This calculation is intended for the adaptive hash
|
||||
index: how many buffer frames we have reserved? */
|
||||
|
||||
n_bufs = UT_LIST_GET_LEN(table->heap->base) - 1;
|
||||
|
||||
if (table->heap->free_block) {
|
||||
n_bufs++;
|
||||
}
|
||||
|
||||
fprintf(file, ", node heap has %lu buffer(s)\n", (ulong) n_bufs);
|
||||
}
|
||||
}
|
||||
153
storage/innobase/ha/hash0hash.c
Normal file
153
storage/innobase/ha/hash0hash.c
Normal file
|
|
@ -0,0 +1,153 @@
|
|||
/******************************************************
|
||||
The simple hash table utility
|
||||
|
||||
(c) 1997 Innobase Oy
|
||||
|
||||
Created 5/20/1997 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#include "hash0hash.h"
|
||||
#ifdef UNIV_NONINL
|
||||
#include "hash0hash.ic"
|
||||
#endif
|
||||
|
||||
#include "mem0mem.h"
|
||||
|
||||
/****************************************************************
|
||||
Reserves the mutex for a fold value in a hash table. */
|
||||
|
||||
void
|
||||
hash_mutex_enter(
|
||||
/*=============*/
|
||||
hash_table_t* table, /* in: hash table */
|
||||
ulint fold) /* in: fold */
|
||||
{
|
||||
mutex_enter(hash_get_mutex(table, fold));
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
Releases the mutex for a fold value in a hash table. */
|
||||
|
||||
void
|
||||
hash_mutex_exit(
|
||||
/*============*/
|
||||
hash_table_t* table, /* in: hash table */
|
||||
ulint fold) /* in: fold */
|
||||
{
|
||||
mutex_exit(hash_get_mutex(table, fold));
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
Reserves all the mutexes of a hash table, in an ascending order. */
|
||||
|
||||
void
|
||||
hash_mutex_enter_all(
|
||||
/*=================*/
|
||||
hash_table_t* table) /* in: hash table */
|
||||
{
|
||||
ulint i;
|
||||
|
||||
for (i = 0; i < table->n_mutexes; i++) {
|
||||
|
||||
mutex_enter(table->mutexes + i);
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
Releases all the mutexes of a hash table. */
|
||||
|
||||
void
|
||||
hash_mutex_exit_all(
|
||||
/*================*/
|
||||
hash_table_t* table) /* in: hash table */
|
||||
{
|
||||
ulint i;
|
||||
|
||||
for (i = 0; i < table->n_mutexes; i++) {
|
||||
|
||||
mutex_exit(table->mutexes + i);
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
Creates a hash table with >= n array cells. The actual number of cells is
|
||||
chosen to be a prime number slightly bigger than n. */
|
||||
|
||||
hash_table_t*
|
||||
hash_create(
|
||||
/*========*/
|
||||
/* out, own: created table */
|
||||
ulint n) /* in: number of array cells */
|
||||
{
|
||||
hash_cell_t* array;
|
||||
ulint prime;
|
||||
hash_table_t* table;
|
||||
ulint i;
|
||||
hash_cell_t* cell;
|
||||
|
||||
prime = ut_find_prime(n);
|
||||
|
||||
table = mem_alloc(sizeof(hash_table_t));
|
||||
|
||||
array = ut_malloc(sizeof(hash_cell_t) * prime);
|
||||
|
||||
table->adaptive = FALSE;
|
||||
table->array = array;
|
||||
table->n_cells = prime;
|
||||
table->n_mutexes = 0;
|
||||
table->mutexes = NULL;
|
||||
table->heaps = NULL;
|
||||
table->heap = NULL;
|
||||
table->magic_n = HASH_TABLE_MAGIC_N;
|
||||
|
||||
/* Initialize the cell array */
|
||||
|
||||
for (i = 0; i < prime; i++) {
|
||||
|
||||
cell = hash_get_nth_cell(table, i);
|
||||
cell->node = NULL;
|
||||
}
|
||||
|
||||
return(table);
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
Frees a hash table. */
|
||||
|
||||
void
|
||||
hash_table_free(
|
||||
/*============*/
|
||||
hash_table_t* table) /* in, own: hash table */
|
||||
{
|
||||
ut_a(table->mutexes == NULL);
|
||||
|
||||
ut_free(table->array);
|
||||
mem_free(table);
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
Creates a mutex array to protect a hash table. */
|
||||
|
||||
void
|
||||
hash_create_mutexes(
|
||||
/*================*/
|
||||
hash_table_t* table, /* in: hash table */
|
||||
ulint n_mutexes, /* in: number of mutexes, must be a
|
||||
power of 2 */
|
||||
ulint sync_level) /* in: latching order level of the
|
||||
mutexes: used in the debug version */
|
||||
{
|
||||
ulint i;
|
||||
|
||||
ut_a(n_mutexes == ut_2_power_up(n_mutexes));
|
||||
|
||||
table->mutexes = mem_alloc(n_mutexes * sizeof(mutex_t));
|
||||
|
||||
for (i = 0; i < n_mutexes; i++) {
|
||||
mutex_create(table->mutexes + i);
|
||||
|
||||
mutex_set_level(table->mutexes + i, sync_level);
|
||||
}
|
||||
|
||||
table->n_mutexes = n_mutexes;
|
||||
}
|
||||
10
storage/innobase/ha/makefilewin
Normal file
10
storage/innobase/ha/makefilewin
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
include ..\include\makefile.i
|
||||
|
||||
ha.lib: ha0ha.obj hash0hash.obj
|
||||
lib -out:..\libs\ha.lib ha0ha.obj hash0hash.obj
|
||||
|
||||
ha0ha.obj: ha0ha.c
|
||||
$(CCOM) $(CFL) -c ha0ha.c
|
||||
|
||||
hash0hash.obj: hash0hash.c
|
||||
$(CCOM) $(CFL) -c hash0hash.c
|
||||
27
storage/innobase/ibuf/Makefile.am
Normal file
27
storage/innobase/ibuf/Makefile.am
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
# & Innobase Oy
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
include ../include/Makefile.i
|
||||
|
||||
noinst_LIBRARIES = libibuf.a
|
||||
|
||||
libibuf_a_SOURCES = ibuf0ibuf.c
|
||||
|
||||
EXTRA_PROGRAMS =
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
3543
storage/innobase/ibuf/ibuf0ibuf.c
Normal file
3543
storage/innobase/ibuf/ibuf0ibuf.c
Normal file
File diff suppressed because it is too large
Load diff
7
storage/innobase/ibuf/makefilewin
Normal file
7
storage/innobase/ibuf/makefilewin
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
include ..\include\makefile.i
|
||||
|
||||
ibuf.lib: ibuf0ibuf.obj
|
||||
lib -out:..\libs\ibuf.lib ibuf0ibuf.obj
|
||||
|
||||
ibuf0ibuf.obj: ibuf0ibuf.c
|
||||
$(CCOM) $(CFL) -c ibuf0ibuf.c
|
||||
60
storage/innobase/include/Makefile.am
Normal file
60
storage/innobase/include/Makefile.am
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
# & Innobase Oy
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
noinst_HEADERS = btr0btr.h btr0btr.ic btr0cur.h btr0cur.ic \
|
||||
btr0pcur.h btr0pcur.ic btr0sea.h btr0sea.ic btr0types.h \
|
||||
buf0buf.h buf0buf.ic buf0flu.h buf0flu.ic buf0lru.h \
|
||||
buf0lru.ic buf0rea.h buf0types.h data0data.h data0data.ic data0type.h \
|
||||
data0type.ic data0types.h db0err.h dict0boot.h \
|
||||
dict0boot.ic dict0crea.h dict0crea.ic dict0dict.h \
|
||||
dict0dict.ic dict0load.h dict0load.ic dict0mem.h \
|
||||
dict0mem.ic dict0types.h dyn0dyn.h dyn0dyn.ic eval0eval.h \
|
||||
eval0eval.ic eval0proc.h eval0proc.ic fil0fil.h fsp0fsp.h \
|
||||
fsp0fsp.ic fut0fut.h fut0fut.ic fut0lst.h fut0lst.ic \
|
||||
ha0ha.h ha0ha.ic hash0hash.h hash0hash.ic \
|
||||
ibuf0ibuf.h ibuf0ibuf.ic ibuf0types.h lock0lock.h \
|
||||
lock0lock.ic lock0types.h log0log.h log0log.ic log0recv.h \
|
||||
log0recv.ic mach0data.h mach0data.ic makefilewin.i \
|
||||
mem0dbg.h mem0dbg.ic mem0mem.h mem0mem.ic mem0pool.h \
|
||||
mem0pool.ic mtr0log.h mtr0log.ic mtr0mtr.h mtr0mtr.ic \
|
||||
mtr0types.h os0file.h os0proc.h os0proc.ic \
|
||||
os0sync.h os0sync.ic os0thread.h \
|
||||
os0thread.ic page0cur.h page0cur.ic page0page.h \
|
||||
page0page.ic page0types.h pars0grm.h pars0opt.h \
|
||||
pars0opt.ic pars0pars.h pars0pars.ic pars0sym.h \
|
||||
pars0sym.ic pars0types.h que0que.h que0que.ic que0types.h \
|
||||
read0read.h read0read.ic read0types.h rem0cmp.h \
|
||||
rem0cmp.ic rem0rec.h rem0rec.ic rem0types.h row0ins.h \
|
||||
row0ins.ic row0mysql.h row0mysql.ic row0purge.h \
|
||||
row0purge.ic row0row.h row0row.ic row0sel.h row0sel.ic \
|
||||
row0types.h row0uins.h row0uins.ic row0umod.h row0umod.ic \
|
||||
row0undo.h row0undo.ic row0upd.h row0upd.ic row0vers.h \
|
||||
row0vers.ic srv0que.h srv0srv.h srv0srv.ic srv0start.h \
|
||||
sync0arr.h sync0arr.ic sync0rw.h \
|
||||
sync0rw.ic sync0sync.h sync0sync.ic sync0types.h \
|
||||
thr0loc.h thr0loc.ic trx0purge.h trx0purge.ic trx0rec.h \
|
||||
trx0rec.ic trx0roll.h trx0roll.ic trx0rseg.h trx0rseg.ic \
|
||||
trx0sys.h trx0sys.ic trx0trx.h trx0trx.ic trx0types.h \
|
||||
trx0undo.h trx0undo.ic trx0xa.h univ.i \
|
||||
usr0sess.h usr0sess.ic usr0types.h ut0byte.h ut0byte.ic \
|
||||
ut0dbg.h ut0lst.h ut0mem.h ut0mem.ic ut0rnd.h ut0rnd.ic \
|
||||
ut0sort.h ut0ut.h ut0ut.ic
|
||||
|
||||
EXTRA_DIST = Makefile.i
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
6
storage/innobase/include/Makefile.i
Normal file
6
storage/innobase/include/Makefile.i
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# Makefile included in Makefile.am in every subdirectory
|
||||
|
||||
INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../../include -I../../include
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
446
storage/innobase/include/btr0btr.h
Normal file
446
storage/innobase/include/btr0btr.h
Normal file
|
|
@ -0,0 +1,446 @@
|
|||
/******************************************************
|
||||
The B-tree
|
||||
|
||||
(c) 1994-1996 Innobase Oy
|
||||
|
||||
Created 6/2/1994 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#ifndef btr0btr_h
|
||||
#define btr0btr_h
|
||||
|
||||
#include "univ.i"
|
||||
|
||||
#include "dict0dict.h"
|
||||
#include "data0data.h"
|
||||
#include "page0cur.h"
|
||||
#include "rem0rec.h"
|
||||
#include "mtr0mtr.h"
|
||||
#include "btr0types.h"
|
||||
|
||||
/* Maximum record size which can be stored on a page, without using the
|
||||
special big record storage structure */
|
||||
|
||||
#define BTR_PAGE_MAX_REC_SIZE (UNIV_PAGE_SIZE / 2 - 200)
|
||||
|
||||
/* Maximum key size in a B-tree: the records on non-leaf levels must be
|
||||
shorter than this */
|
||||
|
||||
#define BTR_PAGE_MAX_KEY_SIZE 1024
|
||||
|
||||
/* If data in page drops below this limit, we try to compress it.
|
||||
NOTE! The value has to be > 2 * BTR_MAX_KEY_SIZE */
|
||||
|
||||
#define BTR_COMPRESS_LIMIT (UNIV_PAGE_SIZE / 4 + 1);
|
||||
|
||||
/* Latching modes for the search function (in btr0cur.*) */
|
||||
#define BTR_SEARCH_LEAF RW_S_LATCH
|
||||
#define BTR_MODIFY_LEAF RW_X_LATCH
|
||||
#define BTR_NO_LATCHES RW_NO_LATCH
|
||||
#define BTR_MODIFY_TREE 33
|
||||
#define BTR_CONT_MODIFY_TREE 34
|
||||
#define BTR_SEARCH_PREV 35
|
||||
#define BTR_MODIFY_PREV 36
|
||||
|
||||
/* If this is ORed to the latch mode, it means that the search tuple will be
|
||||
inserted to the index, at the searched position */
|
||||
#define BTR_INSERT 512
|
||||
|
||||
/* This flag ORed to latch mode says that we do the search in query
|
||||
optimization */
|
||||
#define BTR_ESTIMATE 1024
|
||||
|
||||
/* This flag ORed to latch mode says that we can ignore possible
|
||||
UNIQUE definition on secondary indexes when we decide if we can use the
|
||||
insert buffer to speed up inserts */
|
||||
#define BTR_IGNORE_SEC_UNIQUE 2048
|
||||
|
||||
/******************************************************************
|
||||
Gets the root node of a tree and x-latches it. */
|
||||
|
||||
page_t*
|
||||
btr_root_get(
|
||||
/*=========*/
|
||||
/* out: root page, x-latched */
|
||||
dict_tree_t* tree, /* in: index tree */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/******************************************************************
|
||||
Gets a buffer page and declares its latching order level. */
|
||||
UNIV_INLINE
|
||||
page_t*
|
||||
btr_page_get(
|
||||
/*=========*/
|
||||
ulint space, /* in: space id */
|
||||
ulint page_no, /* in: page number */
|
||||
ulint mode, /* in: latch mode */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/******************************************************************
|
||||
Gets the index id field of a page. */
|
||||
UNIV_INLINE
|
||||
dulint
|
||||
btr_page_get_index_id(
|
||||
/*==================*/
|
||||
/* out: index id */
|
||||
page_t* page); /* in: index page */
|
||||
/************************************************************
|
||||
Gets the node level field in an index page. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
btr_page_get_level_low(
|
||||
/*===================*/
|
||||
/* out: level, leaf level == 0 */
|
||||
page_t* page); /* in: index page */
|
||||
/************************************************************
|
||||
Gets the node level field in an index page. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
btr_page_get_level(
|
||||
/*===============*/
|
||||
/* out: level, leaf level == 0 */
|
||||
page_t* page, /* in: index page */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/************************************************************
|
||||
Gets the next index page number. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
btr_page_get_next(
|
||||
/*==============*/
|
||||
/* out: next page number */
|
||||
page_t* page, /* in: index page */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/************************************************************
|
||||
Gets the previous index page number. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
btr_page_get_prev(
|
||||
/*==============*/
|
||||
/* out: prev page number */
|
||||
page_t* page, /* in: index page */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/*****************************************************************
|
||||
Gets pointer to the previous user record in the tree. It is assumed
|
||||
that the caller has appropriate latches on the page and its neighbor. */
|
||||
|
||||
rec_t*
|
||||
btr_get_prev_user_rec(
|
||||
/*==================*/
|
||||
/* out: previous user record, NULL if there is none */
|
||||
rec_t* rec, /* in: record on leaf level */
|
||||
mtr_t* mtr); /* in: mtr holding a latch on the page, and if
|
||||
needed, also to the previous page */
|
||||
/*****************************************************************
|
||||
Gets pointer to the next user record in the tree. It is assumed
|
||||
that the caller has appropriate latches on the page and its neighbor. */
|
||||
|
||||
rec_t*
|
||||
btr_get_next_user_rec(
|
||||
/*==================*/
|
||||
/* out: next user record, NULL if there is none */
|
||||
rec_t* rec, /* in: record on leaf level */
|
||||
mtr_t* mtr); /* in: mtr holding a latch on the page, and if
|
||||
needed, also to the next page */
|
||||
/******************************************************************
|
||||
Releases the latch on a leaf page and bufferunfixes it. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_leaf_page_release(
|
||||
/*==================*/
|
||||
page_t* page, /* in: page */
|
||||
ulint latch_mode, /* in: BTR_SEARCH_LEAF or BTR_MODIFY_LEAF */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/******************************************************************
|
||||
Gets the child node file address in a node pointer. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
btr_node_ptr_get_child_page_no(
|
||||
/*===========================*/
|
||||
/* out: child node address */
|
||||
rec_t* rec, /* in: node pointer record */
|
||||
const ulint* offsets);/* in: array returned by rec_get_offsets() */
|
||||
/****************************************************************
|
||||
Creates the root node for a new index tree. */
|
||||
|
||||
ulint
|
||||
btr_create(
|
||||
/*=======*/
|
||||
/* out: page number of the created root, FIL_NULL if
|
||||
did not succeed */
|
||||
ulint type, /* in: type of the index */
|
||||
ulint space, /* in: space where created */
|
||||
dulint index_id,/* in: index id */
|
||||
ibool comp, /* in: TRUE=compact page format */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/****************************************************************
|
||||
Frees a B-tree except the root page, which MUST be freed after this
|
||||
by calling btr_free_root. */
|
||||
|
||||
void
|
||||
btr_free_but_not_root(
|
||||
/*==================*/
|
||||
ulint space, /* in: space where created */
|
||||
ulint root_page_no); /* in: root page number */
|
||||
/****************************************************************
|
||||
Frees the B-tree root page. Other tree MUST already have been freed. */
|
||||
|
||||
void
|
||||
btr_free_root(
|
||||
/*==========*/
|
||||
ulint space, /* in: space where created */
|
||||
ulint root_page_no, /* in: root page number */
|
||||
mtr_t* mtr); /* in: a mini-transaction which has already
|
||||
been started */
|
||||
/*****************************************************************
|
||||
Makes tree one level higher by splitting the root, and inserts
|
||||
the tuple. It is assumed that mtr contains an x-latch on the tree.
|
||||
NOTE that the operation of this function must always succeed,
|
||||
we cannot reverse it: therefore enough free disk space must be
|
||||
guaranteed to be available before this function is called. */
|
||||
|
||||
rec_t*
|
||||
btr_root_raise_and_insert(
|
||||
/*======================*/
|
||||
/* out: inserted record */
|
||||
btr_cur_t* cursor, /* in: cursor at which to insert: must be
|
||||
on the root page; when the function returns,
|
||||
the cursor is positioned on the predecessor
|
||||
of the inserted record */
|
||||
dtuple_t* tuple, /* in: tuple to insert */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*****************************************************************
|
||||
Reorganizes an index page. */
|
||||
|
||||
void
|
||||
btr_page_reorganize(
|
||||
/*================*/
|
||||
page_t* page, /* in: page to be reorganized */
|
||||
dict_index_t* index, /* in: record descriptor */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*****************************************************************
|
||||
Decides if the page should be split at the convergence point of
|
||||
inserts converging to left. */
|
||||
|
||||
ibool
|
||||
btr_page_get_split_rec_to_left(
|
||||
/*===========================*/
|
||||
/* out: TRUE if split recommended */
|
||||
btr_cur_t* cursor, /* in: cursor at which to insert */
|
||||
rec_t** split_rec);/* out: if split recommended,
|
||||
the first record on upper half page,
|
||||
or NULL if tuple should be first */
|
||||
/*****************************************************************
|
||||
Decides if the page should be split at the convergence point of
|
||||
inserts converging to right. */
|
||||
|
||||
ibool
|
||||
btr_page_get_split_rec_to_right(
|
||||
/*============================*/
|
||||
/* out: TRUE if split recommended */
|
||||
btr_cur_t* cursor, /* in: cursor at which to insert */
|
||||
rec_t** split_rec);/* out: if split recommended,
|
||||
the first record on upper half page,
|
||||
or NULL if tuple should be first */
|
||||
/*****************************************************************
|
||||
Splits an index page to halves and inserts the tuple. It is assumed
|
||||
that mtr holds an x-latch to the index tree. NOTE: the tree x-latch
|
||||
is released within this function! NOTE that the operation of this
|
||||
function must always succeed, we cannot reverse it: therefore
|
||||
enough free disk space must be guaranteed to be available before
|
||||
this function is called. */
|
||||
|
||||
rec_t*
|
||||
btr_page_split_and_insert(
|
||||
/*======================*/
|
||||
/* out: inserted record; NOTE: the tree
|
||||
x-latch is released! NOTE: 2 free disk
|
||||
pages must be available! */
|
||||
btr_cur_t* cursor, /* in: cursor at which to insert; when the
|
||||
function returns, the cursor is positioned
|
||||
on the predecessor of the inserted record */
|
||||
dtuple_t* tuple, /* in: tuple to insert */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/***********************************************************
|
||||
Inserts a data tuple to a tree on a non-leaf level. It is assumed
|
||||
that mtr holds an x-latch on the tree. */
|
||||
|
||||
void
|
||||
btr_insert_on_non_leaf_level(
|
||||
/*=========================*/
|
||||
dict_tree_t* tree, /* in: tree */
|
||||
ulint level, /* in: level, must be > 0 */
|
||||
dtuple_t* tuple, /* in: the record to be inserted */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/********************************************************************
|
||||
Sets a record as the predefined minimum record. */
|
||||
|
||||
void
|
||||
btr_set_min_rec_mark(
|
||||
/*=================*/
|
||||
rec_t* rec, /* in: record */
|
||||
ibool comp, /* in: TRUE=compact page format */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*****************************************************************
|
||||
Deletes on the upper level the node pointer to a page. */
|
||||
|
||||
void
|
||||
btr_node_ptr_delete(
|
||||
/*================*/
|
||||
dict_tree_t* tree, /* in: index tree */
|
||||
page_t* page, /* in: page whose node pointer is deleted */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/****************************************************************
|
||||
Checks that the node pointer to a page is appropriate. */
|
||||
|
||||
ibool
|
||||
btr_check_node_ptr(
|
||||
/*===============*/
|
||||
/* out: TRUE */
|
||||
dict_tree_t* tree, /* in: index tree */
|
||||
page_t* page, /* in: index page */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*****************************************************************
|
||||
Tries to merge the page first to the left immediate brother if such a
|
||||
brother exists, and the node pointers to the current page and to the
|
||||
brother reside on the same page. If the left brother does not satisfy these
|
||||
conditions, looks at the right brother. If the page is the only one on that
|
||||
level lifts the records of the page to the father page, thus reducing the
|
||||
tree height. It is assumed that mtr holds an x-latch on the tree and on the
|
||||
page. If cursor is on the leaf level, mtr must also hold x-latches to
|
||||
the brothers, if they exist. NOTE: it is assumed that the caller has reserved
|
||||
enough free extents so that the compression will always succeed if done! */
|
||||
void
|
||||
btr_compress(
|
||||
/*=========*/
|
||||
btr_cur_t* cursor, /* in: cursor on the page to merge or lift;
|
||||
the page must not be empty: in record delete
|
||||
use btr_discard_page if the page would become
|
||||
empty */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*****************************************************************
|
||||
Discards a page from a B-tree. This is used to remove the last record from
|
||||
a B-tree page: the whole page must be removed at the same time. This cannot
|
||||
be used for the root page, which is allowed to be empty. */
|
||||
|
||||
void
|
||||
btr_discard_page(
|
||||
/*=============*/
|
||||
btr_cur_t* cursor, /* in: cursor on the page to discard: not on
|
||||
the root page */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/********************************************************************
|
||||
Parses the redo log record for setting an index record as the predefined
|
||||
minimum record. */
|
||||
|
||||
byte*
|
||||
btr_parse_set_min_rec_mark(
|
||||
/*=======================*/
|
||||
/* out: end of log record or NULL */
|
||||
byte* ptr, /* in: buffer */
|
||||
byte* end_ptr,/* in: buffer end */
|
||||
ibool comp, /* in: TRUE=compact page format */
|
||||
page_t* page, /* in: page or NULL */
|
||||
mtr_t* mtr); /* in: mtr or NULL */
|
||||
/***************************************************************
|
||||
Parses a redo log record of reorganizing a page. */
|
||||
|
||||
byte*
|
||||
btr_parse_page_reorganize(
|
||||
/*======================*/
|
||||
/* out: end of log record or NULL */
|
||||
byte* ptr, /* in: buffer */
|
||||
byte* end_ptr,/* in: buffer end */
|
||||
dict_index_t* index, /* in: record descriptor */
|
||||
page_t* page, /* in: page or NULL */
|
||||
mtr_t* mtr); /* in: mtr or NULL */
|
||||
/******************************************************************
|
||||
Gets the number of pages in a B-tree. */
|
||||
|
||||
ulint
|
||||
btr_get_size(
|
||||
/*=========*/
|
||||
/* out: number of pages */
|
||||
dict_index_t* index, /* in: index */
|
||||
ulint flag); /* in: BTR_N_LEAF_PAGES or BTR_TOTAL_SIZE */
|
||||
/******************************************************************
|
||||
Allocates a new file page to be used in an index tree. NOTE: we assume
|
||||
that the caller has made the reservation for free extents! */
|
||||
|
||||
page_t*
|
||||
btr_page_alloc(
|
||||
/*===========*/
|
||||
/* out: new allocated page, x-latched;
|
||||
NULL if out of space */
|
||||
dict_tree_t* tree, /* in: index tree */
|
||||
ulint hint_page_no, /* in: hint of a good page */
|
||||
byte file_direction, /* in: direction where a possible
|
||||
page split is made */
|
||||
ulint level, /* in: level where the page is placed
|
||||
in the tree */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/******************************************************************
|
||||
Frees a file page used in an index tree. NOTE: cannot free field external
|
||||
storage pages because the page must contain info on its level. */
|
||||
|
||||
void
|
||||
btr_page_free(
|
||||
/*==========*/
|
||||
dict_tree_t* tree, /* in: index tree */
|
||||
page_t* page, /* in: page to be freed, x-latched */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/******************************************************************
|
||||
Frees a file page used in an index tree. Can be used also to BLOB
|
||||
external storage pages, because the page level 0 can be given as an
|
||||
argument. */
|
||||
|
||||
void
|
||||
btr_page_free_low(
|
||||
/*==============*/
|
||||
dict_tree_t* tree, /* in: index tree */
|
||||
page_t* page, /* in: page to be freed, x-latched */
|
||||
ulint level, /* in: page level */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*****************************************************************
|
||||
Prints size info of a B-tree. */
|
||||
|
||||
void
|
||||
btr_print_size(
|
||||
/*===========*/
|
||||
dict_tree_t* tree); /* in: index tree */
|
||||
/******************************************************************
|
||||
Prints directories and other info of all nodes in the tree. */
|
||||
|
||||
void
|
||||
btr_print_tree(
|
||||
/*===========*/
|
||||
dict_tree_t* tree, /* in: tree */
|
||||
ulint width); /* in: print this many entries from start
|
||||
and end */
|
||||
/****************************************************************
|
||||
Checks the size and number of fields in a record based on the definition of
|
||||
the index. */
|
||||
|
||||
ibool
|
||||
btr_index_rec_validate(
|
||||
/*====================*/
|
||||
/* out: TRUE if ok */
|
||||
rec_t* rec, /* in: index record */
|
||||
dict_index_t* index, /* in: index */
|
||||
ibool dump_on_error); /* in: TRUE if the function
|
||||
should print hex dump of record
|
||||
and page on error */
|
||||
/******************************************************************
|
||||
Checks the consistency of an index tree. */
|
||||
|
||||
ibool
|
||||
btr_validate_tree(
|
||||
/*==============*/
|
||||
/* out: TRUE if ok */
|
||||
dict_tree_t* tree); /* in: tree */
|
||||
|
||||
#define BTR_N_LEAF_PAGES 1
|
||||
#define BTR_TOTAL_SIZE 2
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
#include "btr0btr.ic"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
233
storage/innobase/include/btr0btr.ic
Normal file
233
storage/innobase/include/btr0btr.ic
Normal file
|
|
@ -0,0 +1,233 @@
|
|||
/******************************************************
|
||||
The B-tree
|
||||
|
||||
(c) 1994-1996 Innobase Oy
|
||||
|
||||
Created 6/2/1994 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#include "mach0data.h"
|
||||
#include "mtr0mtr.h"
|
||||
#include "mtr0log.h"
|
||||
|
||||
#define BTR_MAX_NODE_LEVEL 50 /* used in debug checking */
|
||||
|
||||
/******************************************************************
|
||||
Gets a buffer page and declares its latching order level. */
|
||||
UNIV_INLINE
|
||||
page_t*
|
||||
btr_page_get(
|
||||
/*=========*/
|
||||
ulint space, /* in: space id */
|
||||
ulint page_no, /* in: page number */
|
||||
ulint mode, /* in: latch mode */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
page_t* page;
|
||||
|
||||
page = buf_page_get(space, page_no, mode, mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
if (mode != RW_NO_LATCH) {
|
||||
|
||||
buf_page_dbg_add_level(page, SYNC_TREE_NODE);
|
||||
}
|
||||
#endif
|
||||
return(page);
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
Sets the index id field of a page. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_page_set_index_id(
|
||||
/*==================*/
|
||||
page_t* page, /* in: page to be created */
|
||||
dulint id, /* in: index id */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
mlog_write_dulint(page + PAGE_HEADER + PAGE_INDEX_ID, id, mtr);
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
Gets the index id field of a page. */
|
||||
UNIV_INLINE
|
||||
dulint
|
||||
btr_page_get_index_id(
|
||||
/*==================*/
|
||||
/* out: index id */
|
||||
page_t* page) /* in: index page */
|
||||
{
|
||||
return(mach_read_from_8(page + PAGE_HEADER + PAGE_INDEX_ID));
|
||||
}
|
||||
|
||||
/************************************************************
|
||||
Gets the node level field in an index page. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
btr_page_get_level_low(
|
||||
/*===================*/
|
||||
/* out: level, leaf level == 0 */
|
||||
page_t* page) /* in: index page */
|
||||
{
|
||||
ulint level;
|
||||
|
||||
ut_ad(page);
|
||||
|
||||
level = mach_read_from_2(page + PAGE_HEADER + PAGE_LEVEL);
|
||||
|
||||
ut_ad(level <= BTR_MAX_NODE_LEVEL);
|
||||
|
||||
return(level);
|
||||
}
|
||||
|
||||
/************************************************************
|
||||
Gets the node level field in an index page. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
btr_page_get_level(
|
||||
/*===============*/
|
||||
/* out: level, leaf level == 0 */
|
||||
page_t* page, /* in: index page */
|
||||
mtr_t* mtr __attribute__((unused))) /* in: mini-transaction handle */
|
||||
{
|
||||
ut_ad(page && mtr);
|
||||
|
||||
return(btr_page_get_level_low(page));
|
||||
}
|
||||
|
||||
/************************************************************
|
||||
Sets the node level field in an index page. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_page_set_level(
|
||||
/*===============*/
|
||||
page_t* page, /* in: index page */
|
||||
ulint level, /* in: level, leaf level == 0 */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
ut_ad(page && mtr);
|
||||
ut_ad(level <= BTR_MAX_NODE_LEVEL);
|
||||
|
||||
mlog_write_ulint(page + PAGE_HEADER + PAGE_LEVEL, level,
|
||||
MLOG_2BYTES, mtr);
|
||||
}
|
||||
|
||||
/************************************************************
|
||||
Gets the next index page number. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
btr_page_get_next(
|
||||
/*==============*/
|
||||
/* out: next page number */
|
||||
page_t* page, /* in: index page */
|
||||
mtr_t* mtr __attribute__((unused))) /* in: mini-transaction handle */
|
||||
{
|
||||
ut_ad(page && mtr);
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(page),
|
||||
MTR_MEMO_PAGE_X_FIX)
|
||||
|| mtr_memo_contains(mtr, buf_block_align(page),
|
||||
MTR_MEMO_PAGE_S_FIX));
|
||||
|
||||
return(mach_read_from_4(page + FIL_PAGE_NEXT));
|
||||
}
|
||||
|
||||
/************************************************************
|
||||
Sets the next index page field. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_page_set_next(
|
||||
/*==============*/
|
||||
page_t* page, /* in: index page */
|
||||
ulint next, /* in: next page number */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
ut_ad(page && mtr);
|
||||
|
||||
mlog_write_ulint(page + FIL_PAGE_NEXT, next, MLOG_4BYTES, mtr);
|
||||
}
|
||||
|
||||
/************************************************************
|
||||
Gets the previous index page number. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
btr_page_get_prev(
|
||||
/*==============*/
|
||||
/* out: prev page number */
|
||||
page_t* page, /* in: index page */
|
||||
mtr_t* mtr __attribute__((unused))) /* in: mini-transaction handle */
|
||||
{
|
||||
ut_ad(page && mtr);
|
||||
|
||||
return(mach_read_from_4(page + FIL_PAGE_PREV));
|
||||
}
|
||||
|
||||
/************************************************************
|
||||
Sets the previous index page field. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_page_set_prev(
|
||||
/*==============*/
|
||||
page_t* page, /* in: index page */
|
||||
ulint prev, /* in: previous page number */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
ut_ad(page && mtr);
|
||||
|
||||
mlog_write_ulint(page + FIL_PAGE_PREV, prev, MLOG_4BYTES, mtr);
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
Gets the child node file address in a node pointer. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
btr_node_ptr_get_child_page_no(
|
||||
/*===========================*/
|
||||
/* out: child node address */
|
||||
rec_t* rec, /* in: node pointer record */
|
||||
const ulint* offsets)/* in: array returned by rec_get_offsets() */
|
||||
{
|
||||
byte* field;
|
||||
ulint len;
|
||||
ulint page_no;
|
||||
|
||||
ut_ad(!rec_offs_comp(offsets) || rec_get_node_ptr_flag(rec));
|
||||
|
||||
/* The child address is in the last field */
|
||||
field = rec_get_nth_field(rec, offsets,
|
||||
rec_offs_n_fields(offsets) - 1, &len);
|
||||
|
||||
ut_ad(len == 4);
|
||||
|
||||
page_no = mach_read_from_4(field);
|
||||
|
||||
if (page_no == 0) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: a nonsensical page number 0 in a node ptr record at offset %lu\n",
|
||||
(unsigned long)(rec - buf_frame_align(rec)));
|
||||
buf_page_print(buf_frame_align(rec));
|
||||
}
|
||||
|
||||
return(page_no);
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
Releases the latches on a leaf page and bufferunfixes it. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_leaf_page_release(
|
||||
/*==================*/
|
||||
page_t* page, /* in: page */
|
||||
ulint latch_mode, /* in: BTR_SEARCH_LEAF or BTR_MODIFY_LEAF */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
ut_ad(!mtr_memo_contains(mtr, buf_block_align(page),
|
||||
MTR_MEMO_MODIFY));
|
||||
if (latch_mode == BTR_SEARCH_LEAF) {
|
||||
mtr_memo_release(mtr, buf_block_align(page),
|
||||
MTR_MEMO_PAGE_S_FIX);
|
||||
} else {
|
||||
ut_ad(latch_mode == BTR_MODIFY_LEAF);
|
||||
mtr_memo_release(mtr, buf_block_align(page),
|
||||
MTR_MEMO_PAGE_X_FIX);
|
||||
}
|
||||
}
|
||||
703
storage/innobase/include/btr0cur.h
Normal file
703
storage/innobase/include/btr0cur.h
Normal file
|
|
@ -0,0 +1,703 @@
|
|||
/******************************************************
|
||||
The index tree cursor
|
||||
|
||||
(c) 1994-1996 Innobase Oy
|
||||
|
||||
Created 10/16/1994 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#ifndef btr0cur_h
|
||||
#define btr0cur_h
|
||||
|
||||
#include "univ.i"
|
||||
#include "dict0dict.h"
|
||||
#include "data0data.h"
|
||||
#include "page0cur.h"
|
||||
#include "btr0types.h"
|
||||
#include "que0types.h"
|
||||
#include "row0types.h"
|
||||
#include "ha0ha.h"
|
||||
|
||||
/* Mode flags for btr_cur operations; these can be ORed */
|
||||
#define BTR_NO_UNDO_LOG_FLAG 1 /* do no undo logging */
|
||||
#define BTR_NO_LOCKING_FLAG 2 /* do no record lock checking */
|
||||
#define BTR_KEEP_SYS_FLAG 4 /* sys fields will be found from the
|
||||
update vector or inserted entry */
|
||||
|
||||
#define BTR_CUR_ADAPT
|
||||
#define BTR_CUR_HASH_ADAPT
|
||||
|
||||
/*************************************************************
|
||||
Returns the page cursor component of a tree cursor. */
|
||||
UNIV_INLINE
|
||||
page_cur_t*
|
||||
btr_cur_get_page_cur(
|
||||
/*=================*/
|
||||
/* out: pointer to page cursor component */
|
||||
btr_cur_t* cursor);/* in: tree cursor */
|
||||
/*************************************************************
|
||||
Returns the record pointer of a tree cursor. */
|
||||
UNIV_INLINE
|
||||
rec_t*
|
||||
btr_cur_get_rec(
|
||||
/*============*/
|
||||
/* out: pointer to record */
|
||||
btr_cur_t* cursor);/* in: tree cursor */
|
||||
/*************************************************************
|
||||
Invalidates a tree cursor by setting record pointer to NULL. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_cur_invalidate(
|
||||
/*===============*/
|
||||
btr_cur_t* cursor);/* in: tree cursor */
|
||||
/*************************************************************
|
||||
Returns the page of a tree cursor. */
|
||||
UNIV_INLINE
|
||||
page_t*
|
||||
btr_cur_get_page(
|
||||
/*=============*/
|
||||
/* out: pointer to page */
|
||||
btr_cur_t* cursor);/* in: tree cursor */
|
||||
/*************************************************************
|
||||
Returns the tree of a cursor. */
|
||||
UNIV_INLINE
|
||||
dict_tree_t*
|
||||
btr_cur_get_tree(
|
||||
/*=============*/
|
||||
/* out: tree */
|
||||
btr_cur_t* cursor);/* in: tree cursor */
|
||||
/*************************************************************
|
||||
Positions a tree cursor at a given record. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_cur_position(
|
||||
/*=============*/
|
||||
dict_index_t* index, /* in: index */
|
||||
rec_t* rec, /* in: record in tree */
|
||||
btr_cur_t* cursor);/* in: cursor */
|
||||
/************************************************************************
|
||||
Searches an index tree and positions a tree cursor on a given level.
|
||||
NOTE: n_fields_cmp in tuple must be set so that it cannot be compared
|
||||
to node pointer page number fields on the upper levels of the tree!
|
||||
Note that if mode is PAGE_CUR_LE, which is used in inserts, then
|
||||
cursor->up_match and cursor->low_match both will have sensible values.
|
||||
If mode is PAGE_CUR_GE, then up_match will a have a sensible value. */
|
||||
|
||||
void
|
||||
btr_cur_search_to_nth_level(
|
||||
/*========================*/
|
||||
dict_index_t* index, /* in: index */
|
||||
ulint level, /* in: the tree level of search */
|
||||
dtuple_t* tuple, /* in: data tuple; NOTE: n_fields_cmp in
|
||||
tuple must be set so that it cannot get
|
||||
compared to the node ptr page number field! */
|
||||
ulint mode, /* in: PAGE_CUR_L, ...;
|
||||
NOTE that if the search is made using a unique
|
||||
prefix of a record, mode should be PAGE_CUR_LE,
|
||||
not PAGE_CUR_GE, as the latter may end up on
|
||||
the previous page of the record! Inserts
|
||||
should always be made using PAGE_CUR_LE to
|
||||
search the position! */
|
||||
ulint latch_mode, /* in: BTR_SEARCH_LEAF, ..., ORed with
|
||||
BTR_INSERT and BTR_ESTIMATE;
|
||||
cursor->left_page is used to store a pointer
|
||||
to the left neighbor page, in the cases
|
||||
BTR_SEARCH_PREV and BTR_MODIFY_PREV;
|
||||
NOTE that if has_search_latch
|
||||
is != 0, we maybe do not have a latch set
|
||||
on the cursor page, we assume
|
||||
the caller uses his search latch
|
||||
to protect the record! */
|
||||
btr_cur_t* cursor, /* in/out: tree cursor; the cursor page is
|
||||
s- or x-latched, but see also above! */
|
||||
ulint has_search_latch,/* in: latch mode the caller
|
||||
currently has on btr_search_latch:
|
||||
RW_S_LATCH, or 0 */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*********************************************************************
|
||||
Opens a cursor at either end of an index. */
|
||||
|
||||
void
|
||||
btr_cur_open_at_index_side(
|
||||
/*=======================*/
|
||||
ibool from_left, /* in: TRUE if open to the low end,
|
||||
FALSE if to the high end */
|
||||
dict_index_t* index, /* in: index */
|
||||
ulint latch_mode, /* in: latch mode */
|
||||
btr_cur_t* cursor, /* in: cursor */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/**************************************************************************
|
||||
Positions a cursor at a randomly chosen position within a B-tree. */
|
||||
|
||||
void
|
||||
btr_cur_open_at_rnd_pos(
|
||||
/*====================*/
|
||||
dict_index_t* index, /* in: index */
|
||||
ulint latch_mode, /* in: BTR_SEARCH_LEAF, ... */
|
||||
btr_cur_t* cursor, /* in/out: B-tree cursor */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*****************************************************************
|
||||
Tries to perform an insert to a page in an index tree, next to cursor.
|
||||
It is assumed that mtr holds an x-latch on the page. The operation does
|
||||
not succeed if there is too little space on the page. If there is just
|
||||
one record on the page, the insert will always succeed; this is to
|
||||
prevent trying to split a page with just one record. */
|
||||
|
||||
ulint
|
||||
btr_cur_optimistic_insert(
|
||||
/*======================*/
|
||||
/* out: DB_SUCCESS, DB_WAIT_LOCK,
|
||||
DB_FAIL, or error number */
|
||||
ulint flags, /* in: undo logging and locking flags: if not
|
||||
zero, the parameters index and thr should be
|
||||
specified */
|
||||
btr_cur_t* cursor, /* in: cursor on page after which to insert;
|
||||
cursor stays valid */
|
||||
dtuple_t* entry, /* in: entry to insert */
|
||||
rec_t** rec, /* out: pointer to inserted record if
|
||||
succeed */
|
||||
big_rec_t** big_rec,/* out: big rec vector whose fields have to
|
||||
be stored externally by the caller, or
|
||||
NULL */
|
||||
que_thr_t* thr, /* in: query thread or NULL */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*****************************************************************
|
||||
Performs an insert on a page of an index tree. It is assumed that mtr
|
||||
holds an x-latch on the tree and on the cursor page. If the insert is
|
||||
made on the leaf level, to avoid deadlocks, mtr must also own x-latches
|
||||
to brothers of page, if those brothers exist. */
|
||||
|
||||
ulint
|
||||
btr_cur_pessimistic_insert(
|
||||
/*=======================*/
|
||||
/* out: DB_SUCCESS or error number */
|
||||
ulint flags, /* in: undo logging and locking flags: if not
|
||||
zero, the parameter thr should be
|
||||
specified; if no undo logging is specified,
|
||||
then the caller must have reserved enough
|
||||
free extents in the file space so that the
|
||||
insertion will certainly succeed */
|
||||
btr_cur_t* cursor, /* in: cursor after which to insert;
|
||||
cursor stays valid */
|
||||
dtuple_t* entry, /* in: entry to insert */
|
||||
rec_t** rec, /* out: pointer to inserted record if
|
||||
succeed */
|
||||
big_rec_t** big_rec,/* out: big rec vector whose fields have to
|
||||
be stored externally by the caller, or
|
||||
NULL */
|
||||
que_thr_t* thr, /* in: query thread or NULL */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*****************************************************************
|
||||
Updates a record when the update causes no size changes in its fields. */
|
||||
|
||||
ulint
|
||||
btr_cur_update_in_place(
|
||||
/*====================*/
|
||||
/* out: DB_SUCCESS or error number */
|
||||
ulint flags, /* in: undo logging and locking flags */
|
||||
btr_cur_t* cursor, /* in: cursor on the record to update;
|
||||
cursor stays valid and positioned on the
|
||||
same record */
|
||||
upd_t* update, /* in: update vector */
|
||||
ulint cmpl_info,/* in: compiler info on secondary index
|
||||
updates */
|
||||
que_thr_t* thr, /* in: query thread */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*****************************************************************
|
||||
Tries to update a record on a page in an index tree. It is assumed that mtr
|
||||
holds an x-latch on the page. The operation does not succeed if there is too
|
||||
little space on the page or if the update would result in too empty a page,
|
||||
so that tree compression is recommended. */
|
||||
|
||||
ulint
|
||||
btr_cur_optimistic_update(
|
||||
/*======================*/
|
||||
/* out: DB_SUCCESS, or DB_OVERFLOW if the
|
||||
updated record does not fit, DB_UNDERFLOW
|
||||
if the page would become too empty */
|
||||
ulint flags, /* in: undo logging and locking flags */
|
||||
btr_cur_t* cursor, /* in: cursor on the record to update;
|
||||
cursor stays valid and positioned on the
|
||||
same record */
|
||||
upd_t* update, /* in: update vector; this must also
|
||||
contain trx id and roll ptr fields */
|
||||
ulint cmpl_info,/* in: compiler info on secondary index
|
||||
updates */
|
||||
que_thr_t* thr, /* in: query thread */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*****************************************************************
|
||||
Performs an update of a record on a page of a tree. It is assumed
|
||||
that mtr holds an x-latch on the tree and on the cursor page. If the
|
||||
update is made on the leaf level, to avoid deadlocks, mtr must also
|
||||
own x-latches to brothers of page, if those brothers exist. */
|
||||
|
||||
ulint
|
||||
btr_cur_pessimistic_update(
|
||||
/*=======================*/
|
||||
/* out: DB_SUCCESS or error code */
|
||||
ulint flags, /* in: undo logging, locking, and rollback
|
||||
flags */
|
||||
btr_cur_t* cursor, /* in: cursor on the record to update */
|
||||
big_rec_t** big_rec,/* out: big rec vector whose fields have to
|
||||
be stored externally by the caller, or NULL */
|
||||
upd_t* update, /* in: update vector; this is allowed also
|
||||
contain trx id and roll ptr fields, but
|
||||
the values in update vector have no effect */
|
||||
ulint cmpl_info,/* in: compiler info on secondary index
|
||||
updates */
|
||||
que_thr_t* thr, /* in: query thread */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/***************************************************************
|
||||
Marks a clustered index record deleted. Writes an undo log record to
|
||||
undo log on this delete marking. Writes in the trx id field the id
|
||||
of the deleting transaction, and in the roll ptr field pointer to the
|
||||
undo log record created. */
|
||||
|
||||
ulint
|
||||
btr_cur_del_mark_set_clust_rec(
|
||||
/*===========================*/
|
||||
/* out: DB_SUCCESS, DB_LOCK_WAIT, or error
|
||||
number */
|
||||
ulint flags, /* in: undo logging and locking flags */
|
||||
btr_cur_t* cursor, /* in: cursor */
|
||||
ibool val, /* in: value to set */
|
||||
que_thr_t* thr, /* in: query thread */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/***************************************************************
|
||||
Sets a secondary index record delete mark to TRUE or FALSE. */
|
||||
|
||||
ulint
|
||||
btr_cur_del_mark_set_sec_rec(
|
||||
/*=========================*/
|
||||
/* out: DB_SUCCESS, DB_LOCK_WAIT, or error
|
||||
number */
|
||||
ulint flags, /* in: locking flag */
|
||||
btr_cur_t* cursor, /* in: cursor */
|
||||
ibool val, /* in: value to set */
|
||||
que_thr_t* thr, /* in: query thread */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/***************************************************************
|
||||
Sets a secondary index record delete mark to FALSE. This function is
|
||||
only used by the insert buffer insert merge mechanism. */
|
||||
|
||||
void
|
||||
btr_cur_del_unmark_for_ibuf(
|
||||
/*========================*/
|
||||
rec_t* rec, /* in: record to delete unmark */
|
||||
dict_index_t* index, /* in: record descriptor */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*****************************************************************
|
||||
Tries to compress a page of the tree on the leaf level. It is assumed
|
||||
that mtr holds an x-latch on the tree and on the cursor page. To avoid
|
||||
deadlocks, mtr must also own x-latches to brothers of page, if those
|
||||
brothers exist. NOTE: it is assumed that the caller has reserved enough
|
||||
free extents so that the compression will always succeed if done! */
|
||||
|
||||
void
|
||||
btr_cur_compress(
|
||||
/*=============*/
|
||||
btr_cur_t* cursor, /* in: cursor on the page to compress;
|
||||
cursor does not stay valid */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*****************************************************************
|
||||
Tries to compress a page of the tree if it seems useful. It is assumed
|
||||
that mtr holds an x-latch on the tree and on the cursor page. To avoid
|
||||
deadlocks, mtr must also own x-latches to brothers of page, if those
|
||||
brothers exist. NOTE: it is assumed that the caller has reserved enough
|
||||
free extents so that the compression will always succeed if done! */
|
||||
|
||||
ibool
|
||||
btr_cur_compress_if_useful(
|
||||
/*=======================*/
|
||||
/* out: TRUE if compression occurred */
|
||||
btr_cur_t* cursor, /* in: cursor on the page to compress;
|
||||
cursor does not stay valid if compression
|
||||
occurs */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/***********************************************************
|
||||
Removes the record on which the tree cursor is positioned. It is assumed
|
||||
that the mtr has an x-latch on the page where the cursor is positioned,
|
||||
but no latch on the whole tree. */
|
||||
|
||||
ibool
|
||||
btr_cur_optimistic_delete(
|
||||
/*======================*/
|
||||
/* out: TRUE if success, i.e., the page
|
||||
did not become too empty */
|
||||
btr_cur_t* cursor, /* in: cursor on the record to delete;
|
||||
cursor stays valid: if deletion succeeds,
|
||||
on function exit it points to the successor
|
||||
of the deleted record */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*****************************************************************
|
||||
Removes the record on which the tree cursor is positioned. Tries
|
||||
to compress the page if its fillfactor drops below a threshold
|
||||
or if it is the only page on the level. It is assumed that mtr holds
|
||||
an x-latch on the tree and on the cursor page. To avoid deadlocks,
|
||||
mtr must also own x-latches to brothers of page, if those brothers
|
||||
exist. */
|
||||
|
||||
ibool
|
||||
btr_cur_pessimistic_delete(
|
||||
/*=======================*/
|
||||
/* out: TRUE if compression occurred */
|
||||
ulint* err, /* out: DB_SUCCESS or DB_OUT_OF_FILE_SPACE;
|
||||
the latter may occur because we may have
|
||||
to update node pointers on upper levels,
|
||||
and in the case of variable length keys
|
||||
these may actually grow in size */
|
||||
ibool has_reserved_extents, /* in: TRUE if the
|
||||
caller has already reserved enough free
|
||||
extents so that he knows that the operation
|
||||
will succeed */
|
||||
btr_cur_t* cursor, /* in: cursor on the record to delete;
|
||||
if compression does not occur, the cursor
|
||||
stays valid: it points to successor of
|
||||
deleted record on function exit */
|
||||
ibool in_rollback,/* in: TRUE if called in rollback */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/***************************************************************
|
||||
Parses a redo log record of updating a record in-place. */
|
||||
|
||||
byte*
|
||||
btr_cur_parse_update_in_place(
|
||||
/*==========================*/
|
||||
/* out: end of log record or NULL */
|
||||
byte* ptr, /* in: buffer */
|
||||
byte* end_ptr,/* in: buffer end */
|
||||
page_t* page, /* in: page or NULL */
|
||||
dict_index_t* index); /* in: index corresponding to page */
|
||||
/********************************************************************
|
||||
Parses the redo log record for delete marking or unmarking of a clustered
|
||||
index record. */
|
||||
|
||||
byte*
|
||||
btr_cur_parse_del_mark_set_clust_rec(
|
||||
/*=================================*/
|
||||
/* out: end of log record or NULL */
|
||||
byte* ptr, /* in: buffer */
|
||||
byte* end_ptr,/* in: buffer end */
|
||||
dict_index_t* index, /* in: index corresponding to page */
|
||||
page_t* page); /* in: page or NULL */
|
||||
/********************************************************************
|
||||
Parses the redo log record for delete marking or unmarking of a secondary
|
||||
index record. */
|
||||
|
||||
byte*
|
||||
btr_cur_parse_del_mark_set_sec_rec(
|
||||
/*===============================*/
|
||||
/* out: end of log record or NULL */
|
||||
byte* ptr, /* in: buffer */
|
||||
byte* end_ptr,/* in: buffer end */
|
||||
dict_index_t* index, /* in: index corresponding to page */
|
||||
page_t* page); /* in: page or NULL */
|
||||
/***********************************************************************
|
||||
Estimates the number of rows in a given index range. */
|
||||
|
||||
ib_longlong
|
||||
btr_estimate_n_rows_in_range(
|
||||
/*=========================*/
|
||||
/* out: estimated number of rows */
|
||||
dict_index_t* index, /* in: index */
|
||||
dtuple_t* tuple1, /* in: range start, may also be empty tuple */
|
||||
ulint mode1, /* in: search mode for range start */
|
||||
dtuple_t* tuple2, /* in: range end, may also be empty tuple */
|
||||
ulint mode2); /* in: search mode for range end */
|
||||
/***********************************************************************
|
||||
Estimates the number of different key values in a given index, for
|
||||
each n-column prefix of the index where n <= dict_index_get_n_unique(index).
|
||||
The estimates are stored in the array index->stat_n_diff_key_vals. */
|
||||
|
||||
void
|
||||
btr_estimate_number_of_different_key_vals(
|
||||
/*======================================*/
|
||||
dict_index_t* index); /* in: index */
|
||||
/***********************************************************************
|
||||
Marks not updated extern fields as not-owned by this record. The ownership
|
||||
is transferred to the updated record which is inserted elsewhere in the
|
||||
index tree. In purge only the owner of externally stored field is allowed
|
||||
to free the field. */
|
||||
|
||||
void
|
||||
btr_cur_mark_extern_inherited_fields(
|
||||
/*=================================*/
|
||||
rec_t* rec, /* in: record in a clustered index */
|
||||
const ulint* offsets,/* in: array returned by rec_get_offsets() */
|
||||
upd_t* update, /* in: update vector */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/***********************************************************************
|
||||
The complement of the previous function: in an update entry may inherit
|
||||
some externally stored fields from a record. We must mark them as inherited
|
||||
in entry, so that they are not freed in a rollback. */
|
||||
|
||||
void
|
||||
btr_cur_mark_dtuple_inherited_extern(
|
||||
/*=================================*/
|
||||
dtuple_t* entry, /* in: updated entry to be inserted to
|
||||
clustered index */
|
||||
ulint* ext_vec, /* in: array of extern fields in the
|
||||
original record */
|
||||
ulint n_ext_vec, /* in: number of elements in ext_vec */
|
||||
upd_t* update); /* in: update vector */
|
||||
/***********************************************************************
|
||||
Marks all extern fields in a dtuple as owned by the record. */
|
||||
|
||||
void
|
||||
btr_cur_unmark_dtuple_extern_fields(
|
||||
/*================================*/
|
||||
dtuple_t* entry, /* in: clustered index entry */
|
||||
ulint* ext_vec, /* in: array of numbers of fields
|
||||
which have been stored externally */
|
||||
ulint n_ext_vec); /* in: number of elements in ext_vec */
|
||||
/***********************************************************************
|
||||
Stores the fields in big_rec_vec to the tablespace and puts pointers to
|
||||
them in rec. The fields are stored on pages allocated from leaf node
|
||||
file segment of the index tree. */
|
||||
|
||||
ulint
|
||||
btr_store_big_rec_extern_fields(
|
||||
/*============================*/
|
||||
/* out: DB_SUCCESS or error */
|
||||
dict_index_t* index, /* in: index of rec; the index tree
|
||||
MUST be X-latched */
|
||||
rec_t* rec, /* in: record */
|
||||
const ulint* offsets, /* in: rec_get_offsets(rec, index) */
|
||||
big_rec_t* big_rec_vec, /* in: vector containing fields
|
||||
to be stored externally */
|
||||
mtr_t* local_mtr); /* in: mtr containing the latch to
|
||||
rec and to the tree */
|
||||
/***********************************************************************
|
||||
Frees the space in an externally stored field to the file space
|
||||
management if the field in data is owned the externally stored field,
|
||||
in a rollback we may have the additional condition that the field must
|
||||
not be inherited. */
|
||||
|
||||
void
|
||||
btr_free_externally_stored_field(
|
||||
/*=============================*/
|
||||
dict_index_t* index, /* in: index of the data, the index
|
||||
tree MUST be X-latched; if the tree
|
||||
height is 1, then also the root page
|
||||
must be X-latched! (this is relevant
|
||||
in the case this function is called
|
||||
from purge where 'data' is located on
|
||||
an undo log page, not an index
|
||||
page) */
|
||||
byte* data, /* in: internally stored data
|
||||
+ reference to the externally
|
||||
stored part */
|
||||
ulint local_len, /* in: length of data */
|
||||
ibool do_not_free_inherited,/* in: TRUE if called in a
|
||||
rollback and we do not want to free
|
||||
inherited fields */
|
||||
mtr_t* local_mtr); /* in: mtr containing the latch to
|
||||
data an an X-latch to the index
|
||||
tree */
|
||||
/***************************************************************
|
||||
Frees the externally stored fields for a record. */
|
||||
|
||||
void
|
||||
btr_rec_free_externally_stored_fields(
|
||||
/*==================================*/
|
||||
dict_index_t* index, /* in: index of the data, the index
|
||||
tree MUST be X-latched */
|
||||
rec_t* rec, /* in: record */
|
||||
const ulint* offsets,/* in: rec_get_offsets(rec, index) */
|
||||
ibool do_not_free_inherited,/* in: TRUE if called in a
|
||||
rollback and we do not want to free
|
||||
inherited fields */
|
||||
mtr_t* mtr); /* in: mini-transaction handle which contains
|
||||
an X-latch to record page and to the index
|
||||
tree */
|
||||
/***********************************************************************
|
||||
Copies an externally stored field of a record to mem heap. */
|
||||
|
||||
byte*
|
||||
btr_rec_copy_externally_stored_field(
|
||||
/*=================================*/
|
||||
/* out: the field copied to heap */
|
||||
rec_t* rec, /* in: record */
|
||||
const ulint* offsets,/* in: array returned by rec_get_offsets() */
|
||||
ulint no, /* in: field number */
|
||||
ulint* len, /* out: length of the field */
|
||||
mem_heap_t* heap); /* in: mem heap */
|
||||
/***********************************************************************
|
||||
Copies an externally stored field of a record to mem heap. Parameter
|
||||
data contains a pointer to 'internally' stored part of the field:
|
||||
possibly some data, and the reference to the externally stored part in
|
||||
the last 20 bytes of data. */
|
||||
|
||||
byte*
|
||||
btr_copy_externally_stored_field(
|
||||
/*=============================*/
|
||||
/* out: the whole field copied to heap */
|
||||
ulint* len, /* out: length of the whole field */
|
||||
byte* data, /* in: 'internally' stored part of the
|
||||
field containing also the reference to
|
||||
the external part */
|
||||
ulint local_len,/* in: length of data */
|
||||
mem_heap_t* heap); /* in: mem heap */
|
||||
/***********************************************************************
|
||||
Stores the positions of the fields marked as extern storage in the update
|
||||
vector, and also those fields who are marked as extern storage in rec
|
||||
and not mentioned in updated fields. We use this function to remember
|
||||
which fields we must mark as extern storage in a record inserted for an
|
||||
update. */
|
||||
|
||||
ulint
|
||||
btr_push_update_extern_fields(
|
||||
/*==========================*/
|
||||
/* out: number of values stored in ext_vect */
|
||||
ulint* ext_vect,/* in: array of ulints, must be preallocated
|
||||
to have space for all fields in rec */
|
||||
const ulint* offsets,/* in: array returned by rec_get_offsets() */
|
||||
upd_t* update);/* in: update vector or NULL */
|
||||
|
||||
|
||||
/*######################################################################*/
|
||||
|
||||
/* In the pessimistic delete, if the page data size drops below this
|
||||
limit, merging it to a neighbor is tried */
|
||||
|
||||
#define BTR_CUR_PAGE_COMPRESS_LIMIT (UNIV_PAGE_SIZE / 2)
|
||||
|
||||
/* A slot in the path array. We store here info on a search path down the
|
||||
tree. Each slot contains data on a single level of the tree. */
|
||||
|
||||
typedef struct btr_path_struct btr_path_t;
|
||||
struct btr_path_struct{
|
||||
ulint nth_rec; /* index of the record
|
||||
where the page cursor stopped on
|
||||
this level (index in alphabetical
|
||||
order); value ULINT_UNDEFINED
|
||||
denotes array end */
|
||||
ulint n_recs; /* number of records on the page */
|
||||
};
|
||||
|
||||
#define BTR_PATH_ARRAY_N_SLOTS 250 /* size of path array (in slots) */
|
||||
|
||||
/* The tree cursor: the definition appears here only for the compiler
|
||||
to know struct size! */
|
||||
|
||||
struct btr_cur_struct {
|
||||
dict_index_t* index; /* index where positioned */
|
||||
page_cur_t page_cur; /* page cursor */
|
||||
page_t* left_page; /* this field is used to store a pointer
|
||||
to the left neighbor page, in the cases
|
||||
BTR_SEARCH_PREV and BTR_MODIFY_PREV */
|
||||
/*------------------------------*/
|
||||
que_thr_t* thr; /* this field is only used when
|
||||
btr_cur_search_... is called for an
|
||||
index entry insertion: the calling
|
||||
query thread is passed here to be
|
||||
used in the insert buffer */
|
||||
/*------------------------------*/
|
||||
/* The following fields are used in btr_cur_search... to pass
|
||||
information: */
|
||||
ulint flag; /* BTR_CUR_HASH, BTR_CUR_HASH_FAIL,
|
||||
BTR_CUR_BINARY, or
|
||||
BTR_CUR_INSERT_TO_IBUF */
|
||||
ulint tree_height; /* Tree height if the search is done
|
||||
for a pessimistic insert or update
|
||||
operation */
|
||||
ulint up_match; /* If the search mode was PAGE_CUR_LE,
|
||||
the number of matched fields to the
|
||||
the first user record to the right of
|
||||
the cursor record after
|
||||
btr_cur_search_...;
|
||||
for the mode PAGE_CUR_GE, the matched
|
||||
fields to the first user record AT THE
|
||||
CURSOR or to the right of it;
|
||||
NOTE that the up_match and low_match
|
||||
values may exceed the correct values
|
||||
for comparison to the adjacent user
|
||||
record if that record is on a
|
||||
different leaf page! (See the note in
|
||||
row_ins_duplicate_key.) */
|
||||
ulint up_bytes; /* number of matched bytes to the
|
||||
right at the time cursor positioned;
|
||||
only used internally in searches: not
|
||||
defined after the search */
|
||||
ulint low_match; /* if search mode was PAGE_CUR_LE,
|
||||
the number of matched fields to the
|
||||
first user record AT THE CURSOR or
|
||||
to the left of it after
|
||||
btr_cur_search_...;
|
||||
NOT defined for PAGE_CUR_GE or any
|
||||
other search modes; see also the NOTE
|
||||
in up_match! */
|
||||
ulint low_bytes; /* number of matched bytes to the
|
||||
right at the time cursor positioned;
|
||||
only used internally in searches: not
|
||||
defined after the search */
|
||||
ulint n_fields; /* prefix length used in a hash
|
||||
search if hash_node != NULL */
|
||||
ulint n_bytes; /* hash prefix bytes if hash_node !=
|
||||
NULL */
|
||||
ulint fold; /* fold value used in the search if
|
||||
flag is BTR_CUR_HASH */
|
||||
/*------------------------------*/
|
||||
btr_path_t* path_arr; /* in estimating the number of
|
||||
rows in range, we store in this array
|
||||
information of the path through
|
||||
the tree */
|
||||
};
|
||||
|
||||
/* Values for the flag documenting the used search method */
|
||||
#define BTR_CUR_HASH 1 /* successful shortcut using the hash
|
||||
index */
|
||||
#define BTR_CUR_HASH_FAIL 2 /* failure using hash, success using
|
||||
binary search: the misleading hash
|
||||
reference is stored in the field
|
||||
hash_node, and might be necessary to
|
||||
update */
|
||||
#define BTR_CUR_BINARY 3 /* success using the binary search */
|
||||
#define BTR_CUR_INSERT_TO_IBUF 4 /* performed the intended insert to
|
||||
the insert buffer */
|
||||
|
||||
/* If pessimistic delete fails because of lack of file space,
|
||||
there is still a good change of success a little later: try this many times,
|
||||
and sleep this many microseconds in between */
|
||||
#define BTR_CUR_RETRY_DELETE_N_TIMES 100
|
||||
#define BTR_CUR_RETRY_SLEEP_TIME 50000
|
||||
|
||||
/* The reference in a field for which data is stored on a different page.
|
||||
The reference is at the end of the 'locally' stored part of the field.
|
||||
'Locally' means storage in the index record.
|
||||
We store locally a long enough prefix of each column so that we can determine
|
||||
the ordering parts of each index record without looking into the externally
|
||||
stored part. */
|
||||
|
||||
/*--------------------------------------*/
|
||||
#define BTR_EXTERN_SPACE_ID 0 /* space id where stored */
|
||||
#define BTR_EXTERN_PAGE_NO 4 /* page no where stored */
|
||||
#define BTR_EXTERN_OFFSET 8 /* offset of BLOB header
|
||||
on that page */
|
||||
#define BTR_EXTERN_LEN 12 /* 8 bytes containing the
|
||||
length of the externally
|
||||
stored part of the BLOB.
|
||||
The 2 highest bits are
|
||||
reserved to the flags below. */
|
||||
/*--------------------------------------*/
|
||||
#define BTR_EXTERN_FIELD_REF_SIZE 20
|
||||
|
||||
/* The highest bit of BTR_EXTERN_LEN (i.e., the highest bit of the byte
|
||||
at lowest address) is set to 1 if this field does not 'own' the externally
|
||||
stored field; only the owner field is allowed to free the field in purge!
|
||||
If the 2nd highest bit is 1 then it means that the externally stored field
|
||||
was inherited from an earlier version of the row. In rollback we are not
|
||||
allowed to free an inherited external field. */
|
||||
|
||||
#define BTR_EXTERN_OWNER_FLAG 128
|
||||
#define BTR_EXTERN_INHERITED_FLAG 64
|
||||
|
||||
extern ulint btr_cur_n_non_sea;
|
||||
extern ulint btr_cur_n_sea;
|
||||
extern ulint btr_cur_n_non_sea_old;
|
||||
extern ulint btr_cur_n_sea_old;
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
#include "btr0cur.ic"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
170
storage/innobase/include/btr0cur.ic
Normal file
170
storage/innobase/include/btr0cur.ic
Normal file
|
|
@ -0,0 +1,170 @@
|
|||
/******************************************************
|
||||
The index tree cursor
|
||||
|
||||
(c) 1994-1996 Innobase Oy
|
||||
|
||||
Created 10/16/1994 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#include "btr0btr.h"
|
||||
|
||||
/*************************************************************
|
||||
Returns the page cursor component of a tree cursor. */
|
||||
UNIV_INLINE
|
||||
page_cur_t*
|
||||
btr_cur_get_page_cur(
|
||||
/*=================*/
|
||||
/* out: pointer to page cursor component */
|
||||
btr_cur_t* cursor) /* in: tree cursor */
|
||||
{
|
||||
return(&(cursor->page_cur));
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Returns the record pointer of a tree cursor. */
|
||||
UNIV_INLINE
|
||||
rec_t*
|
||||
btr_cur_get_rec(
|
||||
/*============*/
|
||||
/* out: pointer to record */
|
||||
btr_cur_t* cursor) /* in: tree cursor */
|
||||
{
|
||||
return(page_cur_get_rec(&(cursor->page_cur)));
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Invalidates a tree cursor by setting record pointer to NULL. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_cur_invalidate(
|
||||
/*===============*/
|
||||
btr_cur_t* cursor) /* in: tree cursor */
|
||||
{
|
||||
page_cur_invalidate(&(cursor->page_cur));
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Returns the page of a tree cursor. */
|
||||
UNIV_INLINE
|
||||
page_t*
|
||||
btr_cur_get_page(
|
||||
/*=============*/
|
||||
/* out: pointer to page */
|
||||
btr_cur_t* cursor) /* in: tree cursor */
|
||||
{
|
||||
return(buf_frame_align(page_cur_get_rec(&(cursor->page_cur))));
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Returns the tree of a cursor. */
|
||||
UNIV_INLINE
|
||||
dict_tree_t*
|
||||
btr_cur_get_tree(
|
||||
/*=============*/
|
||||
/* out: tree */
|
||||
btr_cur_t* cursor) /* in: tree cursor */
|
||||
{
|
||||
return((cursor->index)->tree);
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Positions a tree cursor at a given record. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_cur_position(
|
||||
/*=============*/
|
||||
dict_index_t* index, /* in: index */
|
||||
rec_t* rec, /* in: record in tree */
|
||||
btr_cur_t* cursor) /* in: cursor */
|
||||
{
|
||||
page_cur_position(rec, btr_cur_get_page_cur(cursor));
|
||||
|
||||
cursor->index = index;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Checks if compressing an index page where a btr cursor is placed makes
|
||||
sense. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
btr_cur_compress_recommendation(
|
||||
/*============================*/
|
||||
/* out: TRUE if compression is recommended */
|
||||
btr_cur_t* cursor, /* in: btr cursor */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
page_t* page;
|
||||
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(
|
||||
btr_cur_get_page(cursor)),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
|
||||
page = btr_cur_get_page(cursor);
|
||||
|
||||
if ((page_get_data_size(page) < BTR_CUR_PAGE_COMPRESS_LIMIT)
|
||||
|| ((btr_page_get_next(page, mtr) == FIL_NULL)
|
||||
&& (btr_page_get_prev(page, mtr) == FIL_NULL))) {
|
||||
|
||||
/* The page fillfactor has dropped below a predefined
|
||||
minimum value OR the level in the B-tree contains just
|
||||
one page: we recommend compression if this is not the
|
||||
root page. */
|
||||
|
||||
if (dict_tree_get_page((cursor->index)->tree)
|
||||
== buf_frame_get_page_no(page)) {
|
||||
|
||||
/* It is the root page */
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Checks if the record on which the cursor is placed can be deleted without
|
||||
making tree compression necessary (or, recommended). */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
btr_cur_can_delete_without_compress(
|
||||
/*================================*/
|
||||
/* out: TRUE if can be deleted without
|
||||
recommended compression */
|
||||
btr_cur_t* cursor, /* in: btr cursor */
|
||||
ulint rec_size,/* in: rec_get_size(btr_cur_get_rec(cursor))*/
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
page_t* page;
|
||||
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(
|
||||
btr_cur_get_page(cursor)),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
|
||||
page = btr_cur_get_page(cursor);
|
||||
|
||||
if ((page_get_data_size(page) - rec_size < BTR_CUR_PAGE_COMPRESS_LIMIT)
|
||||
|| ((btr_page_get_next(page, mtr) == FIL_NULL)
|
||||
&& (btr_page_get_prev(page, mtr) == FIL_NULL))
|
||||
|| (page_get_n_recs(page) < 2)) {
|
||||
|
||||
/* The page fillfactor will drop below a predefined
|
||||
minimum value, OR the level in the B-tree contains just
|
||||
one page, OR the page will become empty: we recommend
|
||||
compression if this is not the root page. */
|
||||
|
||||
if (dict_tree_get_page((cursor->index)->tree)
|
||||
== buf_frame_get_page_no(page)) {
|
||||
|
||||
/* It is the root page */
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
512
storage/innobase/include/btr0pcur.h
Normal file
512
storage/innobase/include/btr0pcur.h
Normal file
|
|
@ -0,0 +1,512 @@
|
|||
/******************************************************
|
||||
The index tree persistent cursor
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 2/23/1996 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#ifndef btr0pcur_h
|
||||
#define btr0pcur_h
|
||||
|
||||
#include "univ.i"
|
||||
#include "dict0dict.h"
|
||||
#include "data0data.h"
|
||||
#include "mtr0mtr.h"
|
||||
#include "page0cur.h"
|
||||
#include "btr0cur.h"
|
||||
#include "btr0btr.h"
|
||||
#include "btr0types.h"
|
||||
|
||||
/* Relative positions for a stored cursor position */
|
||||
#define BTR_PCUR_ON 1
|
||||
#define BTR_PCUR_BEFORE 2
|
||||
#define BTR_PCUR_AFTER 3
|
||||
/* Note that if the tree is not empty, btr_pcur_store_position does not
|
||||
use the following, but only uses the above three alternatives, where the
|
||||
position is stored relative to a specific record: this makes implementation
|
||||
of a scroll cursor easier */
|
||||
#define BTR_PCUR_BEFORE_FIRST_IN_TREE 4 /* in an empty tree */
|
||||
#define BTR_PCUR_AFTER_LAST_IN_TREE 5 /* in an empty tree */
|
||||
|
||||
/******************************************************************
|
||||
Allocates memory for a persistent cursor object and initializes the cursor. */
|
||||
|
||||
btr_pcur_t*
|
||||
btr_pcur_create_for_mysql(void);
|
||||
/*============================*/
|
||||
/* out, own: persistent cursor */
|
||||
/******************************************************************
|
||||
Frees the memory for a persistent cursor object. */
|
||||
|
||||
void
|
||||
btr_pcur_free_for_mysql(
|
||||
/*====================*/
|
||||
btr_pcur_t* cursor); /* in, own: persistent cursor */
|
||||
/******************************************************************
|
||||
Copies the stored position of a pcur to another pcur. */
|
||||
|
||||
void
|
||||
btr_pcur_copy_stored_position(
|
||||
/*==========================*/
|
||||
btr_pcur_t* pcur_receive, /* in: pcur which will receive the
|
||||
position info */
|
||||
btr_pcur_t* pcur_donate); /* in: pcur from which the info is
|
||||
copied */
|
||||
/******************************************************************
|
||||
Sets the old_rec_buf field to NULL. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_init(
|
||||
/*==========*/
|
||||
btr_pcur_t* pcur); /* in: persistent cursor */
|
||||
/******************************************************************
|
||||
Initializes and opens a persistent cursor to an index tree. It should be
|
||||
closed with btr_pcur_close. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_open(
|
||||
/*==========*/
|
||||
dict_index_t* index, /* in: index */
|
||||
dtuple_t* tuple, /* in: tuple on which search done */
|
||||
ulint mode, /* in: PAGE_CUR_L, ...;
|
||||
NOTE that if the search is made using a unique
|
||||
prefix of a record, mode should be
|
||||
PAGE_CUR_LE, not PAGE_CUR_GE, as the latter
|
||||
may end up on the previous page from the
|
||||
record! */
|
||||
ulint latch_mode,/* in: BTR_SEARCH_LEAF, ... */
|
||||
btr_pcur_t* cursor, /* in: memory buffer for persistent cursor */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/******************************************************************
|
||||
Opens an persistent cursor to an index tree without initializing the
|
||||
cursor. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_open_with_no_init(
|
||||
/*=======================*/
|
||||
dict_index_t* index, /* in: index */
|
||||
dtuple_t* tuple, /* in: tuple on which search done */
|
||||
ulint mode, /* in: PAGE_CUR_L, ...;
|
||||
NOTE that if the search is made using a unique
|
||||
prefix of a record, mode should be
|
||||
PAGE_CUR_LE, not PAGE_CUR_GE, as the latter
|
||||
may end up on the previous page of the
|
||||
record! */
|
||||
ulint latch_mode,/* in: BTR_SEARCH_LEAF, ...;
|
||||
NOTE that if has_search_latch != 0 then
|
||||
we maybe do not acquire a latch on the cursor
|
||||
page, but assume that the caller uses his
|
||||
btr search latch to protect the record! */
|
||||
btr_pcur_t* cursor, /* in: memory buffer for persistent cursor */
|
||||
ulint has_search_latch,/* in: latch mode the caller
|
||||
currently has on btr_search_latch:
|
||||
RW_S_LATCH, or 0 */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*********************************************************************
|
||||
Opens a persistent cursor at either end of an index. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_open_at_index_side(
|
||||
/*========================*/
|
||||
ibool from_left, /* in: TRUE if open to the low end,
|
||||
FALSE if to the high end */
|
||||
dict_index_t* index, /* in: index */
|
||||
ulint latch_mode, /* in: latch mode */
|
||||
btr_pcur_t* pcur, /* in: cursor */
|
||||
ibool do_init, /* in: TRUE if should be initialized */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/******************************************************************
|
||||
Gets the up_match value for a pcur after a search. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
btr_pcur_get_up_match(
|
||||
/*==================*/
|
||||
/* out: number of matched fields at the cursor
|
||||
or to the right if search mode was PAGE_CUR_GE,
|
||||
otherwise undefined */
|
||||
btr_pcur_t* cursor); /* in: memory buffer for persistent cursor */
|
||||
/******************************************************************
|
||||
Gets the low_match value for a pcur after a search. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
btr_pcur_get_low_match(
|
||||
/*===================*/
|
||||
/* out: number of matched fields at the cursor
|
||||
or to the right if search mode was PAGE_CUR_LE,
|
||||
otherwise undefined */
|
||||
btr_pcur_t* cursor); /* in: memory buffer for persistent cursor */
|
||||
/******************************************************************
|
||||
If mode is PAGE_CUR_G or PAGE_CUR_GE, opens a persistent cursor on the first
|
||||
user record satisfying the search condition, in the case PAGE_CUR_L or
|
||||
PAGE_CUR_LE, on the last user record. If no such user record exists, then
|
||||
in the first case sets the cursor after last in tree, and in the latter case
|
||||
before first in tree. The latching mode must be BTR_SEARCH_LEAF or
|
||||
BTR_MODIFY_LEAF. */
|
||||
|
||||
void
|
||||
btr_pcur_open_on_user_rec(
|
||||
/*======================*/
|
||||
dict_index_t* index, /* in: index */
|
||||
dtuple_t* tuple, /* in: tuple on which search done */
|
||||
ulint mode, /* in: PAGE_CUR_L, ... */
|
||||
ulint latch_mode, /* in: BTR_SEARCH_LEAF or
|
||||
BTR_MODIFY_LEAF */
|
||||
btr_pcur_t* cursor, /* in: memory buffer for persistent
|
||||
cursor */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/**************************************************************************
|
||||
Positions a cursor at a randomly chosen position within a B-tree. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_open_at_rnd_pos(
|
||||
/*=====================*/
|
||||
dict_index_t* index, /* in: index */
|
||||
ulint latch_mode, /* in: BTR_SEARCH_LEAF, ... */
|
||||
btr_pcur_t* cursor, /* in/out: B-tree pcur */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/******************************************************************
|
||||
Frees the possible old_rec_buf buffer of a persistent cursor and sets the
|
||||
latch mode of the persistent cursor to BTR_NO_LATCHES. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_close(
|
||||
/*===========*/
|
||||
btr_pcur_t* cursor); /* in: persistent cursor */
|
||||
/******************************************************************
|
||||
The position of the cursor is stored by taking an initial segment of the
|
||||
record the cursor is positioned on, before, or after, and copying it to the
|
||||
cursor data structure, or just setting a flag if the cursor id before the
|
||||
first in an EMPTY tree, or after the last in an EMPTY tree. NOTE that the
|
||||
page where the cursor is positioned must not be empty if the index tree is
|
||||
not totally empty! */
|
||||
|
||||
void
|
||||
btr_pcur_store_position(
|
||||
/*====================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/******************************************************************
|
||||
Restores the stored position of a persistent cursor bufferfixing the page and
|
||||
obtaining the specified latches. If the cursor position was saved when the
|
||||
(1) cursor was positioned on a user record: this function restores the position
|
||||
to the last record LESS OR EQUAL to the stored record;
|
||||
(2) cursor was positioned on a page infimum record: restores the position to
|
||||
the last record LESS than the user record which was the successor of the page
|
||||
infimum;
|
||||
(3) cursor was positioned on the page supremum: restores to the first record
|
||||
GREATER than the user record which was the predecessor of the supremum.
|
||||
(4) cursor was positioned before the first or after the last in an empty tree:
|
||||
restores to before first or after the last in the tree. */
|
||||
|
||||
ibool
|
||||
btr_pcur_restore_position(
|
||||
/*======================*/
|
||||
/* out: TRUE if the cursor position
|
||||
was stored when it was on a user record
|
||||
and it can be restored on a user record
|
||||
whose ordering fields are identical to
|
||||
the ones of the original user record */
|
||||
ulint latch_mode, /* in: BTR_SEARCH_LEAF, ... */
|
||||
btr_pcur_t* cursor, /* in: detached persistent cursor */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/******************************************************************
|
||||
If the latch mode of the cursor is BTR_LEAF_SEARCH or BTR_LEAF_MODIFY,
|
||||
releases the page latch and bufferfix reserved by the cursor.
|
||||
NOTE! In the case of BTR_LEAF_MODIFY, there should not exist changes
|
||||
made by the current mini-transaction to the data protected by the
|
||||
cursor latch, as then the latch must not be released until mtr_commit. */
|
||||
|
||||
void
|
||||
btr_pcur_release_leaf(
|
||||
/*==================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*************************************************************
|
||||
Gets the rel_pos field for a cursor whose position has been stored. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
btr_pcur_get_rel_pos(
|
||||
/*=================*/
|
||||
/* out: BTR_PCUR_ON, ... */
|
||||
btr_pcur_t* cursor);/* in: persistent cursor */
|
||||
/*************************************************************
|
||||
Sets the mtr field for a pcur. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_set_mtr(
|
||||
/*=============*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor */
|
||||
mtr_t* mtr); /* in, own: mtr */
|
||||
/*************************************************************
|
||||
Gets the mtr field for a pcur. */
|
||||
UNIV_INLINE
|
||||
mtr_t*
|
||||
btr_pcur_get_mtr(
|
||||
/*=============*/
|
||||
/* out: mtr */
|
||||
btr_pcur_t* cursor); /* in: persistent cursor */
|
||||
/******************************************************************
|
||||
Commits the pcur mtr and sets the pcur latch mode to BTR_NO_LATCHES,
|
||||
that is, the cursor becomes detached. If there have been modifications
|
||||
to the page where pcur is positioned, this can be used instead of
|
||||
btr_pcur_release_leaf. Function btr_pcur_store_position should be used
|
||||
before calling this, if restoration of cursor is wanted later. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_commit(
|
||||
/*============*/
|
||||
btr_pcur_t* pcur); /* in: persistent cursor */
|
||||
/******************************************************************
|
||||
Differs from btr_pcur_commit in that we can specify the mtr to commit. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_commit_specify_mtr(
|
||||
/*========================*/
|
||||
btr_pcur_t* pcur, /* in: persistent cursor */
|
||||
mtr_t* mtr); /* in: mtr to commit */
|
||||
/******************************************************************
|
||||
Tests if a cursor is detached: that is the latch mode is BTR_NO_LATCHES. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
btr_pcur_is_detached(
|
||||
/*=================*/
|
||||
/* out: TRUE if detached */
|
||||
btr_pcur_t* pcur); /* in: persistent cursor */
|
||||
/*************************************************************
|
||||
Moves the persistent cursor to the next record in the tree. If no records are
|
||||
left, the cursor stays 'after last in tree'. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
btr_pcur_move_to_next(
|
||||
/*==================*/
|
||||
/* out: TRUE if the cursor was not after last
|
||||
in tree */
|
||||
btr_pcur_t* cursor, /* in: persistent cursor; NOTE that the
|
||||
function may release the page latch */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*************************************************************
|
||||
Moves the persistent cursor to the previous record in the tree. If no records
|
||||
are left, the cursor stays 'before first in tree'. */
|
||||
|
||||
ibool
|
||||
btr_pcur_move_to_prev(
|
||||
/*==================*/
|
||||
/* out: TRUE if the cursor was not before first
|
||||
in tree */
|
||||
btr_pcur_t* cursor, /* in: persistent cursor; NOTE that the
|
||||
function may release the page latch */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*************************************************************
|
||||
Moves the persistent cursor to the last record on the same page. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_move_to_last_on_page(
|
||||
/*==========================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*************************************************************
|
||||
Moves the persistent cursor to the next user record in the tree. If no user
|
||||
records are left, the cursor ends up 'after last in tree'. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
btr_pcur_move_to_next_user_rec(
|
||||
/*===========================*/
|
||||
/* out: TRUE if the cursor moved forward,
|
||||
ending on a user record */
|
||||
btr_pcur_t* cursor, /* in: persistent cursor; NOTE that the
|
||||
function may release the page latch */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*************************************************************
|
||||
Moves the persistent cursor to the first record on the next page.
|
||||
Releases the latch on the current page, and bufferunfixes it.
|
||||
Note that there must not be modifications on the current page,
|
||||
as then the x-latch can be released only in mtr_commit. */
|
||||
|
||||
void
|
||||
btr_pcur_move_to_next_page(
|
||||
/*=======================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor; must be on the
|
||||
last record of the current page */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*************************************************************
|
||||
Moves the persistent cursor backward if it is on the first record
|
||||
of the page. Releases the latch on the current page, and bufferunfixes
|
||||
it. Note that to prevent a possible deadlock, the operation first
|
||||
stores the position of the cursor, releases the leaf latch, acquires
|
||||
necessary latches and restores the cursor position again before returning.
|
||||
The alphabetical position of the cursor is guaranteed to be sensible
|
||||
on return, but it may happen that the cursor is not positioned on the
|
||||
last record of any page, because the structure of the tree may have
|
||||
changed while the cursor had no latches. */
|
||||
|
||||
void
|
||||
btr_pcur_move_backward_from_page(
|
||||
/*=============================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor, must be on the
|
||||
first record of the current page */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*************************************************************
|
||||
Returns the btr cursor component of a persistent cursor. */
|
||||
UNIV_INLINE
|
||||
btr_cur_t*
|
||||
btr_pcur_get_btr_cur(
|
||||
/*=================*/
|
||||
/* out: pointer to btr cursor component */
|
||||
btr_pcur_t* cursor); /* in: persistent cursor */
|
||||
/*************************************************************
|
||||
Returns the page cursor component of a persistent cursor. */
|
||||
UNIV_INLINE
|
||||
page_cur_t*
|
||||
btr_pcur_get_page_cur(
|
||||
/*==================*/
|
||||
/* out: pointer to page cursor component */
|
||||
btr_pcur_t* cursor); /* in: persistent cursor */
|
||||
/*************************************************************
|
||||
Returns the page of a persistent cursor. */
|
||||
UNIV_INLINE
|
||||
page_t*
|
||||
btr_pcur_get_page(
|
||||
/*==============*/
|
||||
/* out: pointer to the page */
|
||||
btr_pcur_t* cursor);/* in: persistent cursor */
|
||||
/*************************************************************
|
||||
Returns the record of a persistent cursor. */
|
||||
UNIV_INLINE
|
||||
rec_t*
|
||||
btr_pcur_get_rec(
|
||||
/*=============*/
|
||||
/* out: pointer to the record */
|
||||
btr_pcur_t* cursor);/* in: persistent cursor */
|
||||
/*************************************************************
|
||||
Checks if the persistent cursor is on a user record. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
btr_pcur_is_on_user_rec(
|
||||
/*====================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*************************************************************
|
||||
Checks if the persistent cursor is after the last user record on
|
||||
a page. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
btr_pcur_is_after_last_on_page(
|
||||
/*===========================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*************************************************************
|
||||
Checks if the persistent cursor is before the first user record on
|
||||
a page. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
btr_pcur_is_before_first_on_page(
|
||||
/*=============================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*************************************************************
|
||||
Checks if the persistent cursor is before the first user record in
|
||||
the index tree. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
btr_pcur_is_before_first_in_tree(
|
||||
/*=============================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*************************************************************
|
||||
Checks if the persistent cursor is after the last user record in
|
||||
the index tree. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
btr_pcur_is_after_last_in_tree(
|
||||
/*===========================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*************************************************************
|
||||
Moves the persistent cursor to the next record on the same page. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_move_to_next_on_page(
|
||||
/*==========================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*************************************************************
|
||||
Moves the persistent cursor to the previous record on the same page. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_move_to_prev_on_page(
|
||||
/*==========================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
|
||||
|
||||
/* The persistent B-tree cursor structure. This is used mainly for SQL
|
||||
selects, updates, and deletes. */
|
||||
|
||||
struct btr_pcur_struct{
|
||||
btr_cur_t btr_cur; /* a B-tree cursor */
|
||||
ulint latch_mode; /* see FIXME note below!
|
||||
BTR_SEARCH_LEAF, BTR_MODIFY_LEAF,
|
||||
BTR_MODIFY_TREE, or BTR_NO_LATCHES,
|
||||
depending on the latching state of
|
||||
the page and tree where the cursor is
|
||||
positioned; the last value means that
|
||||
the cursor is not currently positioned:
|
||||
we say then that the cursor is
|
||||
detached; it can be restored to
|
||||
attached if the old position was
|
||||
stored in old_rec */
|
||||
ulint old_stored; /* BTR_PCUR_OLD_STORED
|
||||
or BTR_PCUR_OLD_NOT_STORED */
|
||||
rec_t* old_rec; /* if cursor position is stored,
|
||||
contains an initial segment of the
|
||||
latest record cursor was positioned
|
||||
either on, before, or after */
|
||||
ulint old_n_fields; /* number of fields in old_rec */
|
||||
ulint rel_pos; /* BTR_PCUR_ON, BTR_PCUR_BEFORE, or
|
||||
BTR_PCUR_AFTER, depending on whether
|
||||
cursor was on, before, or after the
|
||||
old_rec record */
|
||||
buf_block_t* block_when_stored;/* buffer block when the position was
|
||||
stored; note that if AWE is on, frames
|
||||
may move */
|
||||
dulint modify_clock; /* the modify clock value of the
|
||||
buffer block when the cursor position
|
||||
was stored */
|
||||
ulint pos_state; /* see FIXME note below!
|
||||
BTR_PCUR_IS_POSITIONED,
|
||||
BTR_PCUR_WAS_POSITIONED,
|
||||
BTR_PCUR_NOT_POSITIONED */
|
||||
ulint search_mode; /* PAGE_CUR_G, ... */
|
||||
/*-----------------------------*/
|
||||
/* NOTE that the following fields may possess dynamically allocated
|
||||
memory which should be freed if not needed anymore! */
|
||||
|
||||
mtr_t* mtr; /* NULL, or this field may contain
|
||||
a mini-transaction which holds the
|
||||
latch on the cursor page */
|
||||
byte* old_rec_buf; /* NULL, or a dynamically allocated
|
||||
buffer for old_rec */
|
||||
ulint buf_size; /* old_rec_buf size if old_rec_buf
|
||||
is not NULL */
|
||||
};
|
||||
|
||||
#define BTR_PCUR_IS_POSITIONED 1997660512 /* FIXME: currently, the state
|
||||
can be BTR_PCUR_IS_POSITIONED,
|
||||
though it really should be
|
||||
BTR_PCUR_WAS_POSITIONED,
|
||||
because we have no obligation
|
||||
to commit the cursor with
|
||||
mtr; similarly latch_mode may
|
||||
be out of date */
|
||||
#define BTR_PCUR_WAS_POSITIONED 1187549791
|
||||
#define BTR_PCUR_NOT_POSITIONED 1328997689
|
||||
|
||||
#define BTR_PCUR_OLD_STORED 908467085
|
||||
#define BTR_PCUR_OLD_NOT_STORED 122766467
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
#include "btr0pcur.ic"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
620
storage/innobase/include/btr0pcur.ic
Normal file
620
storage/innobase/include/btr0pcur.ic
Normal file
|
|
@ -0,0 +1,620 @@
|
|||
/******************************************************
|
||||
The index tree persistent cursor
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 2/23/1996 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
|
||||
/*************************************************************
|
||||
Gets the rel_pos field for a cursor whose position has been stored. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
btr_pcur_get_rel_pos(
|
||||
/*=================*/
|
||||
/* out: BTR_PCUR_ON, ... */
|
||||
btr_pcur_t* cursor) /* in: persistent cursor */
|
||||
{
|
||||
ut_ad(cursor);
|
||||
ut_ad(cursor->old_rec);
|
||||
ut_ad(cursor->old_stored == BTR_PCUR_OLD_STORED);
|
||||
ut_ad(cursor->pos_state == BTR_PCUR_WAS_POSITIONED
|
||||
|| cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||
|
||||
return(cursor->rel_pos);
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Sets the mtr field for a pcur. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_set_mtr(
|
||||
/*=============*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor */
|
||||
mtr_t* mtr) /* in, own: mtr */
|
||||
{
|
||||
ut_ad(cursor);
|
||||
|
||||
cursor->mtr = mtr;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Gets the mtr field for a pcur. */
|
||||
UNIV_INLINE
|
||||
mtr_t*
|
||||
btr_pcur_get_mtr(
|
||||
/*=============*/
|
||||
/* out: mtr */
|
||||
btr_pcur_t* cursor) /* in: persistent cursor */
|
||||
{
|
||||
ut_ad(cursor);
|
||||
|
||||
return(cursor->mtr);
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Returns the btr cursor component of a persistent cursor. */
|
||||
UNIV_INLINE
|
||||
btr_cur_t*
|
||||
btr_pcur_get_btr_cur(
|
||||
/*=================*/
|
||||
/* out: pointer to btr cursor component */
|
||||
btr_pcur_t* cursor) /* in: persistent cursor */
|
||||
{
|
||||
return(&(cursor->btr_cur));
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Returns the page cursor component of a persistent cursor. */
|
||||
UNIV_INLINE
|
||||
page_cur_t*
|
||||
btr_pcur_get_page_cur(
|
||||
/*==================*/
|
||||
/* out: pointer to page cursor component */
|
||||
btr_pcur_t* cursor) /* in: persistent cursor */
|
||||
{
|
||||
return(btr_cur_get_page_cur(&(cursor->btr_cur)));
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Returns the page of a persistent cursor. */
|
||||
UNIV_INLINE
|
||||
page_t*
|
||||
btr_pcur_get_page(
|
||||
/*==============*/
|
||||
/* out: pointer to the page */
|
||||
btr_pcur_t* cursor) /* in: persistent cursor */
|
||||
{
|
||||
ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||
|
||||
return(page_cur_get_page(btr_pcur_get_page_cur(cursor)));
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Returns the record of a persistent cursor. */
|
||||
UNIV_INLINE
|
||||
rec_t*
|
||||
btr_pcur_get_rec(
|
||||
/*=============*/
|
||||
/* out: pointer to the record */
|
||||
btr_pcur_t* cursor) /* in: persistent cursor */
|
||||
{
|
||||
ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||
ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
|
||||
|
||||
return(page_cur_get_rec(btr_pcur_get_page_cur(cursor)));
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
Gets the up_match value for a pcur after a search. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
btr_pcur_get_up_match(
|
||||
/*==================*/
|
||||
/* out: number of matched fields at the cursor
|
||||
or to the right if search mode was PAGE_CUR_GE,
|
||||
otherwise undefined */
|
||||
btr_pcur_t* cursor) /* in: memory buffer for persistent cursor */
|
||||
{
|
||||
btr_cur_t* btr_cursor;
|
||||
|
||||
ut_ad((cursor->pos_state == BTR_PCUR_WAS_POSITIONED)
|
||||
|| (cursor->pos_state == BTR_PCUR_IS_POSITIONED));
|
||||
|
||||
btr_cursor = btr_pcur_get_btr_cur(cursor);
|
||||
|
||||
ut_ad(btr_cursor->up_match != ULINT_UNDEFINED);
|
||||
|
||||
return(btr_cursor->up_match);
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
Gets the low_match value for a pcur after a search. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
btr_pcur_get_low_match(
|
||||
/*===================*/
|
||||
/* out: number of matched fields at the cursor
|
||||
or to the right if search mode was PAGE_CUR_LE,
|
||||
otherwise undefined */
|
||||
btr_pcur_t* cursor) /* in: memory buffer for persistent cursor */
|
||||
{
|
||||
btr_cur_t* btr_cursor;
|
||||
|
||||
ut_ad((cursor->pos_state == BTR_PCUR_WAS_POSITIONED)
|
||||
|| (cursor->pos_state == BTR_PCUR_IS_POSITIONED));
|
||||
|
||||
btr_cursor = btr_pcur_get_btr_cur(cursor);
|
||||
ut_ad(btr_cursor->low_match != ULINT_UNDEFINED);
|
||||
|
||||
return(btr_cursor->low_match);
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Checks if the persistent cursor is after the last user record on
|
||||
a page. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
btr_pcur_is_after_last_on_page(
|
||||
/*===========================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
UT_NOT_USED(mtr);
|
||||
ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||
ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
|
||||
|
||||
return(page_cur_is_after_last(btr_pcur_get_page_cur(cursor)));
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Checks if the persistent cursor is before the first user record on
|
||||
a page. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
btr_pcur_is_before_first_on_page(
|
||||
/*=============================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
UT_NOT_USED(mtr);
|
||||
ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||
ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
|
||||
|
||||
return(page_cur_is_before_first(btr_pcur_get_page_cur(cursor)));
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Checks if the persistent cursor is on a user record. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
btr_pcur_is_on_user_rec(
|
||||
/*====================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||
ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
|
||||
|
||||
if ((btr_pcur_is_before_first_on_page(cursor, mtr))
|
||||
|| (btr_pcur_is_after_last_on_page(cursor, mtr))) {
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Checks if the persistent cursor is before the first user record in
|
||||
the index tree. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
btr_pcur_is_before_first_in_tree(
|
||||
/*=============================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||
ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
|
||||
|
||||
if (btr_page_get_prev(btr_pcur_get_page(cursor), mtr) != FIL_NULL) {
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
return(page_cur_is_before_first(btr_pcur_get_page_cur(cursor)));
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Checks if the persistent cursor is after the last user record in
|
||||
the index tree. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
btr_pcur_is_after_last_in_tree(
|
||||
/*===========================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||
ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
|
||||
|
||||
if (btr_page_get_next(btr_pcur_get_page(cursor), mtr) != FIL_NULL) {
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
return(page_cur_is_after_last(btr_pcur_get_page_cur(cursor)));
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Moves the persistent cursor to the next record on the same page. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_move_to_next_on_page(
|
||||
/*==========================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
UT_NOT_USED(mtr);
|
||||
ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||
ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
|
||||
|
||||
page_cur_move_to_next(btr_pcur_get_page_cur(cursor));
|
||||
|
||||
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Moves the persistent cursor to the previous record on the same page. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_move_to_prev_on_page(
|
||||
/*==========================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
UT_NOT_USED(mtr);
|
||||
ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||
ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
|
||||
|
||||
page_cur_move_to_prev(btr_pcur_get_page_cur(cursor));
|
||||
|
||||
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Moves the persistent cursor to the last record on the same page. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_move_to_last_on_page(
|
||||
/*==========================*/
|
||||
btr_pcur_t* cursor, /* in: persistent cursor */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
UT_NOT_USED(mtr);
|
||||
ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
|
||||
|
||||
page_cur_set_after_last(buf_frame_align(btr_pcur_get_rec(cursor)),
|
||||
btr_pcur_get_page_cur(cursor));
|
||||
|
||||
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Moves the persistent cursor to the next user record in the tree. If no user
|
||||
records are left, the cursor ends up 'after last in tree'. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
btr_pcur_move_to_next_user_rec(
|
||||
/*===========================*/
|
||||
/* out: TRUE if the cursor moved forward,
|
||||
ending on a user record */
|
||||
btr_pcur_t* cursor, /* in: persistent cursor; NOTE that the
|
||||
function may release the page latch */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||
ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
|
||||
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
||||
loop:
|
||||
if (btr_pcur_is_after_last_on_page(cursor, mtr)) {
|
||||
|
||||
if (btr_pcur_is_after_last_in_tree(cursor, mtr)) {
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
btr_pcur_move_to_next_page(cursor, mtr);
|
||||
} else {
|
||||
btr_pcur_move_to_next_on_page(cursor, mtr);
|
||||
}
|
||||
|
||||
if (btr_pcur_is_on_user_rec(cursor, mtr)) {
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
goto loop;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Moves the persistent cursor to the next record in the tree. If no records are
|
||||
left, the cursor stays 'after last in tree'. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
btr_pcur_move_to_next(
|
||||
/*==================*/
|
||||
/* out: TRUE if the cursor was not after last
|
||||
in tree */
|
||||
btr_pcur_t* cursor, /* in: persistent cursor; NOTE that the
|
||||
function may release the page latch */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||
ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
|
||||
|
||||
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
||||
|
||||
if (btr_pcur_is_after_last_on_page(cursor, mtr)) {
|
||||
|
||||
if (btr_pcur_is_after_last_in_tree(cursor, mtr)) {
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
btr_pcur_move_to_next_page(cursor, mtr);
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
btr_pcur_move_to_next_on_page(cursor, mtr);
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
Commits the pcur mtr and sets the pcur latch mode to BTR_NO_LATCHES,
|
||||
that is, the cursor becomes detached. If there have been modifications
|
||||
to the page where pcur is positioned, this can be used instead of
|
||||
btr_pcur_release_leaf. Function btr_pcur_store_position should be used
|
||||
before calling this, if restoration of cursor is wanted later. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_commit(
|
||||
/*============*/
|
||||
btr_pcur_t* pcur) /* in: persistent cursor */
|
||||
{
|
||||
ut_a(pcur->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||
|
||||
pcur->latch_mode = BTR_NO_LATCHES;
|
||||
|
||||
mtr_commit(pcur->mtr);
|
||||
|
||||
pcur->pos_state = BTR_PCUR_WAS_POSITIONED;
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
Differs from btr_pcur_commit in that we can specify the mtr to commit. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_commit_specify_mtr(
|
||||
/*========================*/
|
||||
btr_pcur_t* pcur, /* in: persistent cursor */
|
||||
mtr_t* mtr) /* in: mtr to commit */
|
||||
{
|
||||
ut_a(pcur->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||
|
||||
pcur->latch_mode = BTR_NO_LATCHES;
|
||||
|
||||
mtr_commit(mtr);
|
||||
|
||||
pcur->pos_state = BTR_PCUR_WAS_POSITIONED;
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
Sets the pcur latch mode to BTR_NO_LATCHES. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_detach(
|
||||
/*============*/
|
||||
btr_pcur_t* pcur) /* in: persistent cursor */
|
||||
{
|
||||
ut_a(pcur->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||
|
||||
pcur->latch_mode = BTR_NO_LATCHES;
|
||||
|
||||
pcur->pos_state = BTR_PCUR_WAS_POSITIONED;
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
Tests if a cursor is detached: that is the latch mode is BTR_NO_LATCHES. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
btr_pcur_is_detached(
|
||||
/*=================*/
|
||||
/* out: TRUE if detached */
|
||||
btr_pcur_t* pcur) /* in: persistent cursor */
|
||||
{
|
||||
if (pcur->latch_mode == BTR_NO_LATCHES) {
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
Sets the old_rec_buf field to NULL. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_init(
|
||||
/*==========*/
|
||||
btr_pcur_t* pcur) /* in: persistent cursor */
|
||||
{
|
||||
pcur->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
||||
pcur->old_rec_buf = NULL;
|
||||
pcur->old_rec = NULL;
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
Initializes and opens a persistent cursor to an index tree. It should be
|
||||
closed with btr_pcur_close. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_open(
|
||||
/*==========*/
|
||||
dict_index_t* index, /* in: index */
|
||||
dtuple_t* tuple, /* in: tuple on which search done */
|
||||
ulint mode, /* in: PAGE_CUR_L, ...;
|
||||
NOTE that if the search is made using a unique
|
||||
prefix of a record, mode should be
|
||||
PAGE_CUR_LE, not PAGE_CUR_GE, as the latter
|
||||
may end up on the previous page from the
|
||||
record! */
|
||||
ulint latch_mode,/* in: BTR_SEARCH_LEAF, ... */
|
||||
btr_pcur_t* cursor, /* in: memory buffer for persistent cursor */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
btr_cur_t* btr_cursor;
|
||||
|
||||
/* Initialize the cursor */
|
||||
|
||||
btr_pcur_init(cursor);
|
||||
|
||||
cursor->latch_mode = latch_mode;
|
||||
cursor->search_mode = mode;
|
||||
|
||||
/* Search with the tree cursor */
|
||||
|
||||
btr_cursor = btr_pcur_get_btr_cur(cursor);
|
||||
|
||||
btr_cur_search_to_nth_level(index, 0, tuple, mode, latch_mode,
|
||||
btr_cursor, 0, mtr);
|
||||
cursor->pos_state = BTR_PCUR_IS_POSITIONED;
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
Opens an persistent cursor to an index tree without initializing the
|
||||
cursor. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_open_with_no_init(
|
||||
/*=======================*/
|
||||
dict_index_t* index, /* in: index */
|
||||
dtuple_t* tuple, /* in: tuple on which search done */
|
||||
ulint mode, /* in: PAGE_CUR_L, ...;
|
||||
NOTE that if the search is made using a unique
|
||||
prefix of a record, mode should be
|
||||
PAGE_CUR_LE, not PAGE_CUR_GE, as the latter
|
||||
may end up on the previous page of the
|
||||
record! */
|
||||
ulint latch_mode,/* in: BTR_SEARCH_LEAF, ...;
|
||||
NOTE that if has_search_latch != 0 then
|
||||
we maybe do not acquire a latch on the cursor
|
||||
page, but assume that the caller uses his
|
||||
btr search latch to protect the record! */
|
||||
btr_pcur_t* cursor, /* in: memory buffer for persistent cursor */
|
||||
ulint has_search_latch,/* in: latch mode the caller
|
||||
currently has on btr_search_latch:
|
||||
RW_S_LATCH, or 0 */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
btr_cur_t* btr_cursor;
|
||||
|
||||
cursor->latch_mode = latch_mode;
|
||||
cursor->search_mode = mode;
|
||||
|
||||
/* Search with the tree cursor */
|
||||
|
||||
btr_cursor = btr_pcur_get_btr_cur(cursor);
|
||||
|
||||
btr_cur_search_to_nth_level(index, 0, tuple, mode, latch_mode,
|
||||
btr_cursor, has_search_latch, mtr);
|
||||
cursor->pos_state = BTR_PCUR_IS_POSITIONED;
|
||||
|
||||
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Opens a persistent cursor at either end of an index. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_open_at_index_side(
|
||||
/*========================*/
|
||||
ibool from_left, /* in: TRUE if open to the low end,
|
||||
FALSE if to the high end */
|
||||
dict_index_t* index, /* in: index */
|
||||
ulint latch_mode, /* in: latch mode */
|
||||
btr_pcur_t* pcur, /* in: cursor */
|
||||
ibool do_init, /* in: TRUE if should be initialized */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
pcur->latch_mode = latch_mode;
|
||||
|
||||
if (from_left) {
|
||||
pcur->search_mode = PAGE_CUR_G;
|
||||
} else {
|
||||
pcur->search_mode = PAGE_CUR_L;
|
||||
}
|
||||
|
||||
if (do_init) {
|
||||
btr_pcur_init(pcur);
|
||||
}
|
||||
|
||||
btr_cur_open_at_index_side(from_left, index, latch_mode,
|
||||
btr_pcur_get_btr_cur(pcur), mtr);
|
||||
pcur->pos_state = BTR_PCUR_IS_POSITIONED;
|
||||
|
||||
pcur->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Positions a cursor at a randomly chosen position within a B-tree. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_open_at_rnd_pos(
|
||||
/*=====================*/
|
||||
dict_index_t* index, /* in: index */
|
||||
ulint latch_mode, /* in: BTR_SEARCH_LEAF, ... */
|
||||
btr_pcur_t* cursor, /* in/out: B-tree pcur */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
/* Initialize the cursor */
|
||||
|
||||
cursor->latch_mode = latch_mode;
|
||||
cursor->search_mode = PAGE_CUR_G;
|
||||
|
||||
btr_pcur_init(cursor);
|
||||
|
||||
btr_cur_open_at_rnd_pos(index, latch_mode,
|
||||
btr_pcur_get_btr_cur(cursor), mtr);
|
||||
cursor->pos_state = BTR_PCUR_IS_POSITIONED;
|
||||
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
Frees the possible memory heap of a persistent cursor and sets the latch
|
||||
mode of the persistent cursor to BTR_NO_LATCHES. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_pcur_close(
|
||||
/*===========*/
|
||||
btr_pcur_t* cursor) /* in: persistent cursor */
|
||||
{
|
||||
if (cursor->old_rec_buf != NULL) {
|
||||
|
||||
mem_free(cursor->old_rec_buf);
|
||||
|
||||
cursor->old_rec = NULL;
|
||||
cursor->old_rec_buf = NULL;
|
||||
}
|
||||
|
||||
cursor->btr_cur.page_cur.rec = NULL;
|
||||
cursor->old_rec = NULL;
|
||||
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
||||
|
||||
cursor->latch_mode = BTR_NO_LATCHES;
|
||||
cursor->pos_state = BTR_PCUR_NOT_POSITIONED;
|
||||
}
|
||||
253
storage/innobase/include/btr0sea.h
Normal file
253
storage/innobase/include/btr0sea.h
Normal file
|
|
@ -0,0 +1,253 @@
|
|||
/************************************************************************
|
||||
The index tree adaptive search
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 2/17/1996 Heikki Tuuri
|
||||
*************************************************************************/
|
||||
|
||||
#ifndef btr0sea_h
|
||||
#define btr0sea_h
|
||||
|
||||
#include "univ.i"
|
||||
|
||||
#include "rem0rec.h"
|
||||
#include "dict0dict.h"
|
||||
#include "btr0types.h"
|
||||
#include "mtr0mtr.h"
|
||||
#include "ha0ha.h"
|
||||
|
||||
/*********************************************************************
|
||||
Creates and initializes the adaptive search system at a database start. */
|
||||
|
||||
void
|
||||
btr_search_sys_create(
|
||||
/*==================*/
|
||||
ulint hash_size); /* in: hash index hash table size */
|
||||
/************************************************************************
|
||||
Returns search info for an index. */
|
||||
UNIV_INLINE
|
||||
btr_search_t*
|
||||
btr_search_get_info(
|
||||
/*================*/
|
||||
/* out: search info; search mutex reserved */
|
||||
dict_index_t* index); /* in: index */
|
||||
/*********************************************************************
|
||||
Creates and initializes a search info struct. */
|
||||
|
||||
btr_search_t*
|
||||
btr_search_info_create(
|
||||
/*===================*/
|
||||
/* out, own: search info struct */
|
||||
mem_heap_t* heap); /* in: heap where created */
|
||||
/*************************************************************************
|
||||
Updates the search info. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_search_info_update(
|
||||
/*===================*/
|
||||
dict_index_t* index, /* in: index of the cursor */
|
||||
btr_cur_t* cursor);/* in: cursor which was just positioned */
|
||||
/**********************************************************************
|
||||
Tries to guess the right search position based on the hash search info
|
||||
of the index. Note that if mode is PAGE_CUR_LE, which is used in inserts,
|
||||
and the function returns TRUE, then cursor->up_match and cursor->low_match
|
||||
both have sensible values. */
|
||||
|
||||
ibool
|
||||
btr_search_guess_on_hash(
|
||||
/*=====================*/
|
||||
/* out: TRUE if succeeded */
|
||||
dict_index_t* index, /* in: index */
|
||||
btr_search_t* info, /* in: index search info */
|
||||
dtuple_t* tuple, /* in: logical record */
|
||||
ulint mode, /* in: PAGE_CUR_L, ... */
|
||||
ulint latch_mode, /* in: BTR_SEARCH_LEAF, ... */
|
||||
btr_cur_t* cursor, /* out: tree cursor */
|
||||
ulint has_search_latch,/* in: latch mode the caller
|
||||
currently has on btr_search_latch:
|
||||
RW_S_LATCH, RW_X_LATCH, or 0 */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/************************************************************************
|
||||
Moves or deletes hash entries for moved records. If new_page is already hashed,
|
||||
then the hash index for page, if any, is dropped. If new_page is not hashed,
|
||||
and page is hashed, then a new hash index is built to new_page with the same
|
||||
parameters as page (this often happens when a page is split). */
|
||||
|
||||
void
|
||||
btr_search_move_or_delete_hash_entries(
|
||||
/*===================================*/
|
||||
page_t* new_page, /* in: records are copied
|
||||
to this page */
|
||||
page_t* page, /* in: index page */
|
||||
dict_index_t* index); /* in: record descriptor */
|
||||
/************************************************************************
|
||||
Drops a page hash index. */
|
||||
|
||||
void
|
||||
btr_search_drop_page_hash_index(
|
||||
/*============================*/
|
||||
page_t* page); /* in: index page, s- or x-latched */
|
||||
/************************************************************************
|
||||
Drops a page hash index when a page is freed from a fseg to the file system.
|
||||
Drops possible hash index if the page happens to be in the buffer pool. */
|
||||
|
||||
void
|
||||
btr_search_drop_page_hash_when_freed(
|
||||
/*=================================*/
|
||||
ulint space, /* in: space id */
|
||||
ulint page_no); /* in: page number */
|
||||
/************************************************************************
|
||||
Updates the page hash index when a single record is inserted on a page. */
|
||||
|
||||
void
|
||||
btr_search_update_hash_node_on_insert(
|
||||
/*==================================*/
|
||||
btr_cur_t* cursor);/* in: cursor which was positioned to the
|
||||
place to insert using btr_cur_search_...,
|
||||
and the new record has been inserted next
|
||||
to the cursor */
|
||||
/************************************************************************
|
||||
Updates the page hash index when a single record is inserted on a page. */
|
||||
|
||||
void
|
||||
btr_search_update_hash_on_insert(
|
||||
/*=============================*/
|
||||
btr_cur_t* cursor);/* in: cursor which was positioned to the
|
||||
place to insert using btr_cur_search_...,
|
||||
and the new record has been inserted next
|
||||
to the cursor */
|
||||
/************************************************************************
|
||||
Updates the page hash index when a single record is deleted from a page. */
|
||||
|
||||
void
|
||||
btr_search_update_hash_on_delete(
|
||||
/*=============================*/
|
||||
btr_cur_t* cursor);/* in: cursor which was positioned on the
|
||||
record to delete using btr_cur_search_...,
|
||||
the record is not yet deleted */
|
||||
/************************************************************************
|
||||
Validates the search system. */
|
||||
|
||||
ibool
|
||||
btr_search_validate(void);
|
||||
/*======================*/
|
||||
/* out: TRUE if ok */
|
||||
|
||||
/* Search info directions */
|
||||
#define BTR_SEA_NO_DIRECTION 1
|
||||
#define BTR_SEA_LEFT 2
|
||||
#define BTR_SEA_RIGHT 3
|
||||
#define BTR_SEA_SAME_REC 4
|
||||
|
||||
/* The search info struct in an index */
|
||||
|
||||
struct btr_search_struct{
|
||||
ulint magic_n; /* magic number */
|
||||
/* The following 4 fields are currently not used: */
|
||||
rec_t* last_search; /* pointer to the lower limit record of the
|
||||
previous search; NULL if not known */
|
||||
ulint n_direction; /* number of consecutive searches in the
|
||||
same direction */
|
||||
ulint direction; /* BTR_SEA_NO_DIRECTION, BTR_SEA_LEFT,
|
||||
BTR_SEA_RIGHT, BTR_SEA_SAME_REC,
|
||||
or BTR_SEA_SAME_PAGE */
|
||||
dulint modify_clock; /* value of modify clock at the time
|
||||
last_search was stored */
|
||||
/*----------------------*/
|
||||
/* The following 4 fields are not protected by any latch: */
|
||||
page_t* root_guess; /* the root page frame when it was last time
|
||||
fetched, or NULL */
|
||||
ulint hash_analysis; /* when this exceeds a certain value, the
|
||||
hash analysis starts; this is reset if no
|
||||
success noticed */
|
||||
ibool last_hash_succ; /* TRUE if the last search would have
|
||||
succeeded, or did succeed, using the hash
|
||||
index; NOTE that the value here is not exact:
|
||||
it is not calculated for every search, and the
|
||||
calculation itself is not always accurate! */
|
||||
ulint n_hash_potential;/* number of consecutive searches which would
|
||||
have succeeded, or did succeed, using the hash
|
||||
index */
|
||||
/*----------------------*/
|
||||
ulint n_fields; /* recommended prefix length for hash search:
|
||||
number of full fields */
|
||||
ulint n_bytes; /* recommended prefix: number of bytes in
|
||||
an incomplete field */
|
||||
ulint side; /* BTR_SEARCH_LEFT_SIDE or
|
||||
BTR_SEARCH_RIGHT_SIDE, depending on whether
|
||||
the leftmost record of several records with
|
||||
the same prefix should be indexed in the
|
||||
hash index */
|
||||
/*----------------------*/
|
||||
ulint n_hash_succ; /* number of successful hash searches thus
|
||||
far */
|
||||
ulint n_hash_fail; /* number of failed hash searches */
|
||||
ulint n_patt_succ; /* number of successful pattern searches thus
|
||||
far */
|
||||
ulint n_searches; /* number of searches */
|
||||
};
|
||||
|
||||
#define BTR_SEARCH_MAGIC_N 1112765
|
||||
|
||||
/* The hash index system */
|
||||
|
||||
typedef struct btr_search_sys_struct btr_search_sys_t;
|
||||
|
||||
struct btr_search_sys_struct{
|
||||
hash_table_t* hash_index;
|
||||
};
|
||||
|
||||
extern btr_search_sys_t* btr_search_sys;
|
||||
|
||||
/* The latch protecting the adaptive search system: this latch protects the
|
||||
(1) hash index;
|
||||
(2) columns of a record to which we have a pointer in the hash index;
|
||||
|
||||
but does NOT protect:
|
||||
|
||||
(3) next record offset field in a record;
|
||||
(4) next or previous records on the same page.
|
||||
|
||||
Bear in mind (3) and (4) when using the hash index.
|
||||
*/
|
||||
|
||||
extern rw_lock_t* btr_search_latch_temp;
|
||||
|
||||
#define btr_search_latch (*btr_search_latch_temp)
|
||||
|
||||
#ifdef UNIV_SEARCH_PERF_STAT
|
||||
extern ulint btr_search_n_succ;
|
||||
#endif /* UNIV_SEARCH_PERF_STAT */
|
||||
extern ulint btr_search_n_hash_fail;
|
||||
|
||||
/* After change in n_fields or n_bytes in info, this many rounds are waited
|
||||
before starting the hash analysis again: this is to save CPU time when there
|
||||
is no hope in building a hash index. */
|
||||
|
||||
#define BTR_SEARCH_HASH_ANALYSIS 17
|
||||
|
||||
#define BTR_SEARCH_LEFT_SIDE 1
|
||||
#define BTR_SEARCH_RIGHT_SIDE 2
|
||||
|
||||
/* Limit of consecutive searches for trying a search shortcut on the search
|
||||
pattern */
|
||||
|
||||
#define BTR_SEARCH_ON_PATTERN_LIMIT 3
|
||||
|
||||
/* Limit of consecutive searches for trying a search shortcut using the hash
|
||||
index */
|
||||
|
||||
#define BTR_SEARCH_ON_HASH_LIMIT 3
|
||||
|
||||
/* We do this many searches before trying to keep the search latch over calls
|
||||
from MySQL. If we notice someone waiting for the latch, we again set this
|
||||
much timeout. This is to reduce contention. */
|
||||
|
||||
#define BTR_SEA_TIMEOUT 10000
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
#include "btr0sea.ic"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
67
storage/innobase/include/btr0sea.ic
Normal file
67
storage/innobase/include/btr0sea.ic
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
/************************************************************************
|
||||
The index tree adaptive search
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 2/17/1996 Heikki Tuuri
|
||||
*************************************************************************/
|
||||
|
||||
#include "dict0mem.h"
|
||||
#include "btr0cur.h"
|
||||
#include "buf0buf.h"
|
||||
|
||||
/*************************************************************************
|
||||
Updates the search info. */
|
||||
|
||||
void
|
||||
btr_search_info_update_slow(
|
||||
/*========================*/
|
||||
btr_search_t* info, /* in: search info */
|
||||
btr_cur_t* cursor);/* in: cursor which was just positioned */
|
||||
|
||||
/************************************************************************
|
||||
Returns search info for an index. */
|
||||
UNIV_INLINE
|
||||
btr_search_t*
|
||||
btr_search_get_info(
|
||||
/*================*/
|
||||
/* out: search info; search mutex reserved */
|
||||
dict_index_t* index) /* in: index */
|
||||
{
|
||||
ut_ad(index);
|
||||
|
||||
return(index->search_info);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Updates the search info. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
btr_search_info_update(
|
||||
/*===================*/
|
||||
dict_index_t* index, /* in: index of the cursor */
|
||||
btr_cur_t* cursor) /* in: cursor which was just positioned */
|
||||
{
|
||||
btr_search_t* info;
|
||||
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_SHARED));
|
||||
ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_EX));
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
||||
info = btr_search_get_info(index);
|
||||
|
||||
info->hash_analysis++;
|
||||
|
||||
if (info->hash_analysis < BTR_SEARCH_HASH_ANALYSIS) {
|
||||
|
||||
/* Do nothing */
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
ut_ad(cursor->flag != BTR_CUR_HASH);
|
||||
|
||||
btr_search_info_update_slow(info, cursor);
|
||||
}
|
||||
21
storage/innobase/include/btr0types.h
Normal file
21
storage/innobase/include/btr0types.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/************************************************************************
|
||||
The index tree general types
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 2/17/1996 Heikki Tuuri
|
||||
*************************************************************************/
|
||||
|
||||
#ifndef btr0types_h
|
||||
#define btr0types_h
|
||||
|
||||
#include "univ.i"
|
||||
|
||||
#include "rem0types.h"
|
||||
#include "page0types.h"
|
||||
|
||||
typedef struct btr_pcur_struct btr_pcur_t;
|
||||
typedef struct btr_cur_struct btr_cur_t;
|
||||
typedef struct btr_search_struct btr_search_t;
|
||||
|
||||
#endif
|
||||
1048
storage/innobase/include/buf0buf.h
Normal file
1048
storage/innobase/include/buf0buf.h
Normal file
File diff suppressed because it is too large
Load diff
672
storage/innobase/include/buf0buf.ic
Normal file
672
storage/innobase/include/buf0buf.ic
Normal file
|
|
@ -0,0 +1,672 @@
|
|||
/******************************************************
|
||||
The database buffer buf_pool
|
||||
|
||||
(c) 1995 Innobase Oy
|
||||
|
||||
Created 11/5/1995 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#include "buf0flu.h"
|
||||
#include "buf0lru.h"
|
||||
#include "buf0rea.h"
|
||||
#include "mtr0mtr.h"
|
||||
|
||||
extern ulint buf_dbg_counter; /* This is used to insert validation
|
||||
operations in execution in the
|
||||
debug version */
|
||||
|
||||
/************************************************************************
|
||||
Recommends a move of a block to the start of the LRU list if there is danger
|
||||
of dropping from the buffer pool. NOTE: does not reserve the buffer pool
|
||||
mutex. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
buf_block_peek_if_too_old(
|
||||
/*======================*/
|
||||
/* out: TRUE if should be made younger */
|
||||
buf_block_t* block) /* in: block to make younger */
|
||||
{
|
||||
if (buf_pool->freed_page_clock >= block->freed_page_clock
|
||||
+ 1 + (buf_pool->curr_size / 1024)) {
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the current size of buffer buf_pool in bytes. In the case of AWE, the
|
||||
size of AWE window (= the frames). */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
buf_pool_get_curr_size(void)
|
||||
/*========================*/
|
||||
/* out: size in bytes */
|
||||
{
|
||||
return((buf_pool->n_frames) * UNIV_PAGE_SIZE);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the maximum size of buffer buf_pool in bytes. In the case of AWE, the
|
||||
size of AWE window (= the frames). */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
buf_pool_get_max_size(void)
|
||||
/*=======================*/
|
||||
/* out: size in bytes */
|
||||
{
|
||||
return((buf_pool->n_frames) * UNIV_PAGE_SIZE);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
Accessor function for block array. */
|
||||
UNIV_INLINE
|
||||
buf_block_t*
|
||||
buf_pool_get_nth_block(
|
||||
/*===================*/
|
||||
/* out: pointer to block */
|
||||
buf_pool_t* buf_pool,/* in: buf_pool */
|
||||
ulint i) /* in: index of the block */
|
||||
{
|
||||
ut_ad(buf_pool);
|
||||
ut_ad(i < buf_pool->max_size);
|
||||
|
||||
return(i + buf_pool->blocks);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
Checks if a pointer points to the block array of the buffer pool (blocks, not
|
||||
the frames). */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
buf_pool_is_block(
|
||||
/*==============*/
|
||||
/* out: TRUE if pointer to block */
|
||||
void* ptr) /* in: pointer to memory */
|
||||
{
|
||||
if ((buf_pool->blocks <= (buf_block_t*)ptr)
|
||||
&& ((buf_block_t*)ptr < buf_pool->blocks + buf_pool->max_size)) {
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets the smallest oldest_modification lsn for any page in the pool. Returns
|
||||
ut_dulint_zero if all modified pages have been flushed to disk. */
|
||||
UNIV_INLINE
|
||||
dulint
|
||||
buf_pool_get_oldest_modification(void)
|
||||
/*==================================*/
|
||||
/* out: oldest modification in pool,
|
||||
ut_dulint_zero if none */
|
||||
{
|
||||
buf_block_t* block;
|
||||
dulint lsn;
|
||||
|
||||
mutex_enter(&(buf_pool->mutex));
|
||||
|
||||
block = UT_LIST_GET_LAST(buf_pool->flush_list);
|
||||
|
||||
if (block == NULL) {
|
||||
lsn = ut_dulint_zero;
|
||||
} else {
|
||||
lsn = block->oldest_modification;
|
||||
}
|
||||
|
||||
mutex_exit(&(buf_pool->mutex));
|
||||
|
||||
return(lsn);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
Increments the buf_pool clock by one and returns its new value. Remember
|
||||
that in the 32 bit version the clock wraps around at 4 billion! */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
buf_pool_clock_tic(void)
|
||||
/*====================*/
|
||||
/* out: new clock value */
|
||||
{
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
ut_ad(mutex_own(&(buf_pool->mutex)));
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
||||
buf_pool->ulint_clock++;
|
||||
|
||||
return(buf_pool->ulint_clock);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets a pointer to the memory frame of a block. */
|
||||
UNIV_INLINE
|
||||
buf_frame_t*
|
||||
buf_block_get_frame(
|
||||
/*================*/
|
||||
/* out: pointer to the frame */
|
||||
buf_block_t* block) /* in: pointer to the control block */
|
||||
{
|
||||
ut_ad(block);
|
||||
ut_ad(block >= buf_pool->blocks);
|
||||
ut_ad(block < buf_pool->blocks + buf_pool->max_size);
|
||||
ut_ad(block->state != BUF_BLOCK_NOT_USED);
|
||||
ut_ad((block->state != BUF_BLOCK_FILE_PAGE)
|
||||
|| (block->buf_fix_count > 0));
|
||||
|
||||
return(block->frame);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the space id of a block. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
buf_block_get_space(
|
||||
/*================*/
|
||||
/* out: space id */
|
||||
buf_block_t* block) /* in: pointer to the control block */
|
||||
{
|
||||
ut_ad(block);
|
||||
ut_ad(block >= buf_pool->blocks);
|
||||
ut_ad(block < buf_pool->blocks + buf_pool->max_size);
|
||||
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
|
||||
ut_ad(block->buf_fix_count > 0);
|
||||
|
||||
return(block->space);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the page number of a block. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
buf_block_get_page_no(
|
||||
/*==================*/
|
||||
/* out: page number */
|
||||
buf_block_t* block) /* in: pointer to the control block */
|
||||
{
|
||||
ut_ad(block);
|
||||
ut_ad(block >= buf_pool->blocks);
|
||||
ut_ad(block < buf_pool->blocks + buf_pool->max_size);
|
||||
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
|
||||
ut_ad(block->buf_fix_count > 0);
|
||||
|
||||
return(block->offset);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
Gets the block to whose frame the pointer is pointing to. */
|
||||
UNIV_INLINE
|
||||
buf_block_t*
|
||||
buf_block_align(
|
||||
/*============*/
|
||||
/* out: pointer to block */
|
||||
byte* ptr) /* in: pointer to a frame */
|
||||
{
|
||||
buf_block_t* block;
|
||||
buf_frame_t* frame_zero;
|
||||
|
||||
ut_ad(ptr);
|
||||
|
||||
frame_zero = buf_pool->frame_zero;
|
||||
|
||||
if ((ulint)ptr < (ulint)frame_zero
|
||||
|| (ulint)ptr > (ulint)(buf_pool->high_end)) {
|
||||
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr,
|
||||
"InnoDB: Error: trying to access a stray pointer %p\n"
|
||||
"InnoDB: buf pool start is at %p, end at %p\n"
|
||||
"InnoDB: Probable reason is database corruption or memory\n"
|
||||
"InnoDB: corruption. If this happens in an InnoDB database recovery,\n"
|
||||
"InnoDB: you can look from section 6.1 at http://www.innodb.com/ibman.html\n"
|
||||
"InnoDB: how to force recovery.\n",
|
||||
ptr, frame_zero,
|
||||
buf_pool->high_end);
|
||||
ut_error;
|
||||
}
|
||||
|
||||
block = *(buf_pool->blocks_of_frames + (((ulint)(ptr - frame_zero))
|
||||
>> UNIV_PAGE_SIZE_SHIFT));
|
||||
return(block);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
Gets the frame the pointer is pointing to. */
|
||||
UNIV_INLINE
|
||||
buf_frame_t*
|
||||
buf_frame_align(
|
||||
/*============*/
|
||||
/* out: pointer to frame */
|
||||
byte* ptr) /* in: pointer to a frame */
|
||||
{
|
||||
buf_frame_t* frame;
|
||||
|
||||
ut_ad(ptr);
|
||||
|
||||
frame = ut_align_down(ptr, UNIV_PAGE_SIZE);
|
||||
|
||||
if (((ulint)frame < (ulint)(buf_pool->frame_zero))
|
||||
|| (ulint)frame >= (ulint)(buf_pool->high_end)) {
|
||||
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr,
|
||||
"InnoDB: Error: trying to access a stray pointer %p\n"
|
||||
"InnoDB: buf pool start is at %p, end at %p\n"
|
||||
"InnoDB: Probable reason is database corruption or memory\n"
|
||||
"InnoDB: corruption. If this happens in an InnoDB database recovery,\n"
|
||||
"InnoDB: you can look from section 6.1 at http://www.innodb.com/ibman.html\n"
|
||||
"InnoDB: how to force recovery.\n",
|
||||
ptr, buf_pool->frame_zero,
|
||||
buf_pool->high_end);
|
||||
ut_error;
|
||||
}
|
||||
|
||||
return(frame);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Gets the page number of a pointer pointing within a buffer frame containing
|
||||
a file page. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
buf_frame_get_page_no(
|
||||
/*==================*/
|
||||
/* out: page number */
|
||||
byte* ptr) /* in: pointer to within a buffer frame */
|
||||
{
|
||||
return(buf_block_get_page_no(buf_block_align(ptr)));
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Gets the space id of a pointer pointing within a buffer frame containing a
|
||||
file page. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
buf_frame_get_space_id(
|
||||
/*===================*/
|
||||
/* out: space id */
|
||||
byte* ptr) /* in: pointer to within a buffer frame */
|
||||
{
|
||||
return(buf_block_get_space(buf_block_align(ptr)));
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Gets the space id, page offset, and byte offset within page of a
|
||||
pointer pointing to a buffer frame containing a file page. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
buf_ptr_get_fsp_addr(
|
||||
/*=================*/
|
||||
byte* ptr, /* in: pointer to a buffer frame */
|
||||
ulint* space, /* out: space id */
|
||||
fil_addr_t* addr) /* out: page offset and byte offset */
|
||||
{
|
||||
buf_block_t* block;
|
||||
|
||||
block = buf_block_align(ptr);
|
||||
|
||||
*space = buf_block_get_space(block);
|
||||
addr->page = buf_block_get_page_no(block);
|
||||
addr->boffset = ptr - buf_frame_align(ptr);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Gets the hash value of the page the pointer is pointing to. This can be used
|
||||
in searches in the lock hash table. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
buf_frame_get_lock_hash_val(
|
||||
/*========================*/
|
||||
/* out: lock hash value */
|
||||
byte* ptr) /* in: pointer to within a buffer frame */
|
||||
{
|
||||
buf_block_t* block;
|
||||
|
||||
block = buf_block_align(ptr);
|
||||
|
||||
return(block->lock_hash_val);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Gets the mutex number protecting the page record lock hash chain in the lock
|
||||
table. */
|
||||
UNIV_INLINE
|
||||
mutex_t*
|
||||
buf_frame_get_lock_mutex(
|
||||
/*=====================*/
|
||||
/* out: mutex */
|
||||
byte* ptr) /* in: pointer to within a buffer frame */
|
||||
{
|
||||
buf_block_t* block;
|
||||
|
||||
block = buf_block_align(ptr);
|
||||
|
||||
return(block->lock_mutex);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Copies contents of a buffer frame to a given buffer. */
|
||||
UNIV_INLINE
|
||||
byte*
|
||||
buf_frame_copy(
|
||||
/*===========*/
|
||||
/* out: buf */
|
||||
byte* buf, /* in: buffer to copy to */
|
||||
buf_frame_t* frame) /* in: buffer frame */
|
||||
{
|
||||
ut_ad(buf && frame);
|
||||
|
||||
ut_memcpy(buf, frame, UNIV_PAGE_SIZE);
|
||||
|
||||
return(buf);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Calculates a folded value of a file page address to use in the page hash
|
||||
table. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
buf_page_address_fold(
|
||||
/*==================*/
|
||||
/* out: the folded value */
|
||||
ulint space, /* in: space id */
|
||||
ulint offset) /* in: offset of the page within space */
|
||||
{
|
||||
return((space << 20) + space + offset);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
This function is used to get info if there is an io operation
|
||||
going on on a buffer page. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
buf_page_io_query(
|
||||
/*==============*/
|
||||
/* out: TRUE if io going on */
|
||||
buf_block_t* block) /* in: buf_pool block, must be bufferfixed */
|
||||
{
|
||||
mutex_enter(&(buf_pool->mutex));
|
||||
|
||||
ut_ad(block->state == BUF_BLOCK_FILE_PAGE);
|
||||
ut_ad(block->buf_fix_count > 0);
|
||||
|
||||
if (block->io_fix != 0) {
|
||||
mutex_exit(&(buf_pool->mutex));
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
mutex_exit(&(buf_pool->mutex));
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets the youngest modification log sequence number for a frame. Returns zero
|
||||
if not a file page or no modification occurred yet. */
|
||||
UNIV_INLINE
|
||||
dulint
|
||||
buf_frame_get_newest_modification(
|
||||
/*==============================*/
|
||||
/* out: newest modification to the page */
|
||||
buf_frame_t* frame) /* in: pointer to a frame */
|
||||
{
|
||||
buf_block_t* block;
|
||||
dulint lsn;
|
||||
|
||||
ut_ad(frame);
|
||||
|
||||
block = buf_block_align(frame);
|
||||
|
||||
mutex_enter(&(buf_pool->mutex));
|
||||
|
||||
if (block->state == BUF_BLOCK_FILE_PAGE) {
|
||||
lsn = block->newest_modification;
|
||||
} else {
|
||||
lsn = ut_dulint_zero;
|
||||
}
|
||||
|
||||
mutex_exit(&(buf_pool->mutex));
|
||||
|
||||
return(lsn);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Increments the modify clock of a frame by 1. The caller must (1) own the
|
||||
buf_pool mutex and block bufferfix count has to be zero, (2) or own an x-lock
|
||||
on the block. */
|
||||
UNIV_INLINE
|
||||
dulint
|
||||
buf_frame_modify_clock_inc(
|
||||
/*=======================*/
|
||||
/* out: new value */
|
||||
buf_frame_t* frame) /* in: pointer to a frame */
|
||||
{
|
||||
buf_block_t* block;
|
||||
|
||||
ut_ad(frame);
|
||||
|
||||
block = buf_block_align(frame);
|
||||
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
ut_ad((mutex_own(&(buf_pool->mutex)) && (block->buf_fix_count == 0))
|
||||
|| rw_lock_own(&(block->lock), RW_LOCK_EXCLUSIVE));
|
||||
#endif /*UNIV_SYNC_DEBUG */
|
||||
|
||||
UT_DULINT_INC(block->modify_clock);
|
||||
|
||||
return(block->modify_clock);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Increments the modify clock of a frame by 1. The caller must (1) own the
|
||||
buf_pool mutex and block bufferfix count has to be zero, (2) or own an x-lock
|
||||
on the block. */
|
||||
UNIV_INLINE
|
||||
dulint
|
||||
buf_block_modify_clock_inc(
|
||||
/*=======================*/
|
||||
/* out: new value */
|
||||
buf_block_t* block) /* in: block */
|
||||
{
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
ut_ad((mutex_own(&(buf_pool->mutex)) && (block->buf_fix_count == 0))
|
||||
|| rw_lock_own(&(block->lock), RW_LOCK_EXCLUSIVE));
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
||||
UT_DULINT_INC(block->modify_clock);
|
||||
|
||||
return(block->modify_clock);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Returns the value of the modify clock. The caller must have an s-lock
|
||||
or x-lock on the block. */
|
||||
UNIV_INLINE
|
||||
dulint
|
||||
buf_frame_get_modify_clock(
|
||||
/*=======================*/
|
||||
/* out: value */
|
||||
buf_frame_t* frame) /* in: pointer to a frame */
|
||||
{
|
||||
buf_block_t* block;
|
||||
|
||||
ut_ad(frame);
|
||||
|
||||
block = buf_block_align(frame);
|
||||
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
ut_ad(rw_lock_own(&(block->lock), RW_LOCK_SHARED)
|
||||
|| rw_lock_own(&(block->lock), RW_LOCK_EXCLUSIVE));
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
||||
return(block->modify_clock);
|
||||
}
|
||||
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
/***********************************************************************
|
||||
Increments the bufferfix count. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
buf_block_buf_fix_inc_debug(
|
||||
/*========================*/
|
||||
buf_block_t* block, /* in: block to bufferfix */
|
||||
const char* file __attribute__ ((unused)), /* in: file name */
|
||||
ulint line __attribute__ ((unused))) /* in: line */
|
||||
{
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
ibool ret;
|
||||
|
||||
ret = rw_lock_s_lock_func_nowait(&(block->debug_latch), file, line);
|
||||
|
||||
ut_ad(ret == TRUE);
|
||||
#endif
|
||||
block->buf_fix_count++;
|
||||
}
|
||||
#else /* UNIV_SYNC_DEBUG */
|
||||
/***********************************************************************
|
||||
Increments the bufferfix count. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
buf_block_buf_fix_inc(
|
||||
/*==================*/
|
||||
buf_block_t* block) /* in: block to bufferfix */
|
||||
{
|
||||
block->buf_fix_count++;
|
||||
}
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
/**********************************************************************
|
||||
Returns the control block of a file page, NULL if not found. */
|
||||
UNIV_INLINE
|
||||
buf_block_t*
|
||||
buf_page_hash_get(
|
||||
/*==============*/
|
||||
/* out: block, NULL if not found */
|
||||
ulint space, /* in: space id */
|
||||
ulint offset) /* in: offset of the page within space */
|
||||
{
|
||||
buf_block_t* block;
|
||||
ulint fold;
|
||||
|
||||
ut_ad(buf_pool);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
ut_ad(mutex_own(&(buf_pool->mutex)));
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
||||
/* Look for the page in the hash table */
|
||||
|
||||
fold = buf_page_address_fold(space, offset);
|
||||
|
||||
HASH_SEARCH(hash, buf_pool->page_hash, fold, block,
|
||||
(block->space == space) && (block->offset == offset));
|
||||
ut_a(block == NULL || block->state == BUF_BLOCK_FILE_PAGE);
|
||||
|
||||
return(block);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Tries to get the page, but if file io is required, releases all latches
|
||||
in mtr down to the given savepoint. If io is required, this function
|
||||
retrieves the page to buffer buf_pool, but does not bufferfix it or latch
|
||||
it. */
|
||||
UNIV_INLINE
|
||||
buf_frame_t*
|
||||
buf_page_get_release_on_io(
|
||||
/*=======================*/
|
||||
/* out: pointer to the frame, or NULL
|
||||
if not in buffer buf_pool */
|
||||
ulint space, /* in: space id */
|
||||
ulint offset, /* in: offset of the page within space
|
||||
in units of a page */
|
||||
buf_frame_t* guess, /* in: guessed frame or NULL */
|
||||
ulint rw_latch, /* in: RW_X_LATCH, RW_S_LATCH,
|
||||
or RW_NO_LATCH */
|
||||
ulint savepoint, /* in: mtr savepoint */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
buf_frame_t* frame;
|
||||
|
||||
frame = buf_page_get_gen(space, offset, rw_latch, guess,
|
||||
BUF_GET_IF_IN_POOL,
|
||||
__FILE__, __LINE__,
|
||||
mtr);
|
||||
if (frame != NULL) {
|
||||
|
||||
return(frame);
|
||||
}
|
||||
|
||||
/* The page was not in the buffer buf_pool: release the latches
|
||||
down to the savepoint */
|
||||
|
||||
mtr_rollback_to_savepoint(mtr, savepoint);
|
||||
|
||||
buf_page_get(space, offset, RW_S_LATCH, mtr);
|
||||
|
||||
/* When we get here, the page is in buffer, but we release
|
||||
the latches again down to the savepoint, before returning */
|
||||
|
||||
mtr_rollback_to_savepoint(mtr, savepoint);
|
||||
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Decrements the bufferfix count of a buffer control block and releases
|
||||
a latch, if specified. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
buf_page_release(
|
||||
/*=============*/
|
||||
buf_block_t* block, /* in: buffer block */
|
||||
ulint rw_latch, /* in: RW_S_LATCH, RW_X_LATCH,
|
||||
RW_NO_LATCH */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
ulint buf_fix_count;
|
||||
|
||||
ut_ad(block);
|
||||
|
||||
mutex_enter_fast(&(buf_pool->mutex));
|
||||
|
||||
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
|
||||
ut_a(block->buf_fix_count > 0);
|
||||
|
||||
if (rw_latch == RW_X_LATCH && mtr->modifications) {
|
||||
|
||||
buf_flush_note_modification(block, mtr);
|
||||
}
|
||||
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
rw_lock_s_unlock(&(block->debug_latch));
|
||||
#endif
|
||||
buf_fix_count = block->buf_fix_count;
|
||||
block->buf_fix_count = buf_fix_count - 1;
|
||||
|
||||
mutex_exit(&(buf_pool->mutex));
|
||||
|
||||
if (rw_latch == RW_S_LATCH) {
|
||||
rw_lock_s_unlock(&(block->lock));
|
||||
} else if (rw_latch == RW_X_LATCH) {
|
||||
rw_lock_x_unlock(&(block->lock));
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
/*************************************************************************
|
||||
Adds latch level info for the rw-lock protecting the buffer frame. This
|
||||
should be called in the debug version after a successful latching of a
|
||||
page if we know the latching order level of the acquired latch. If
|
||||
UNIV_SYNC_DEBUG is not defined, compiles to an empty function. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
buf_page_dbg_add_level(
|
||||
/*===================*/
|
||||
buf_frame_t* frame __attribute__((unused)), /* in: buffer page
|
||||
where we have acquired latch */
|
||||
ulint level __attribute__((unused))) /* in: latching order
|
||||
level */
|
||||
{
|
||||
sync_thread_add_level(&(buf_block_align(frame)->lock), level);
|
||||
}
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
120
storage/innobase/include/buf0flu.h
Normal file
120
storage/innobase/include/buf0flu.h
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
/******************************************************
|
||||
The database buffer pool flush algorithm
|
||||
|
||||
(c) 1995 Innobase Oy
|
||||
|
||||
Created 11/5/1995 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#ifndef buf0flu_h
|
||||
#define buf0flu_h
|
||||
|
||||
#include "univ.i"
|
||||
#include "buf0types.h"
|
||||
#include "ut0byte.h"
|
||||
#include "mtr0types.h"
|
||||
|
||||
/************************************************************************
|
||||
Updates the flush system data structures when a write is completed. */
|
||||
|
||||
void
|
||||
buf_flush_write_complete(
|
||||
/*=====================*/
|
||||
buf_block_t* block); /* in: pointer to the block in question */
|
||||
/*************************************************************************
|
||||
Flushes pages from the end of the LRU list if there is too small
|
||||
a margin of replaceable pages there. */
|
||||
|
||||
void
|
||||
buf_flush_free_margin(void);
|
||||
/*=======================*/
|
||||
/************************************************************************
|
||||
Initializes a page for writing to the tablespace. */
|
||||
|
||||
void
|
||||
buf_flush_init_for_writing(
|
||||
/*=======================*/
|
||||
byte* page, /* in: page */
|
||||
dulint newest_lsn, /* in: newest modification lsn to the page */
|
||||
ulint space, /* in: space id */
|
||||
ulint page_no); /* in: page number */
|
||||
/***********************************************************************
|
||||
This utility flushes dirty blocks from the end of the LRU list or flush_list.
|
||||
NOTE 1: in the case of an LRU flush the calling thread may own latches to
|
||||
pages: to avoid deadlocks, this function must be written so that it cannot
|
||||
end up waiting for these latches! NOTE 2: in the case of a flush list flush,
|
||||
the calling thread is not allowed to own any latches on pages! */
|
||||
|
||||
ulint
|
||||
buf_flush_batch(
|
||||
/*============*/
|
||||
/* out: number of blocks for which the write
|
||||
request was queued */
|
||||
ulint flush_type, /* in: BUF_FLUSH_LRU or BUF_FLUSH_LIST; if
|
||||
BUF_FLUSH_LIST, then the caller must not own
|
||||
any latches on pages */
|
||||
ulint min_n, /* in: wished minimum mumber of blocks flushed
|
||||
(it is not guaranteed that the actual number
|
||||
is that big, though) */
|
||||
dulint lsn_limit); /* in the case BUF_FLUSH_LIST all blocks whose
|
||||
oldest_modification is smaller than this
|
||||
should be flushed (if their number does not
|
||||
exceed min_n), otherwise ignored */
|
||||
/**********************************************************************
|
||||
Waits until a flush batch of the given type ends */
|
||||
|
||||
void
|
||||
buf_flush_wait_batch_end(
|
||||
/*=====================*/
|
||||
ulint type); /* in: BUF_FLUSH_LRU or BUF_FLUSH_LIST */
|
||||
/************************************************************************
|
||||
This function should be called at a mini-transaction commit, if a page was
|
||||
modified in it. Puts the block to the list of modified blocks, if it not
|
||||
already in it. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
buf_flush_note_modification(
|
||||
/*========================*/
|
||||
buf_block_t* block, /* in: block which is modified */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/************************************************************************
|
||||
This function should be called when recovery has modified a buffer page. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
buf_flush_recv_note_modification(
|
||||
/*=============================*/
|
||||
buf_block_t* block, /* in: block which is modified */
|
||||
dulint start_lsn, /* in: start lsn of the first mtr in a
|
||||
set of mtr's */
|
||||
dulint end_lsn); /* in: end lsn of the last mtr in the
|
||||
set of mtr's */
|
||||
/************************************************************************
|
||||
Returns TRUE if the file page block is immediately suitable for replacement,
|
||||
i.e., transition FILE_PAGE => NOT_USED allowed. */
|
||||
ibool
|
||||
buf_flush_ready_for_replace(
|
||||
/*========================*/
|
||||
/* out: TRUE if can replace immediately */
|
||||
buf_block_t* block); /* in: buffer control block, must be in state
|
||||
BUF_BLOCK_FILE_PAGE and in the LRU list */
|
||||
/**********************************************************************
|
||||
Validates the flush list. */
|
||||
|
||||
ibool
|
||||
buf_flush_validate(void);
|
||||
/*====================*/
|
||||
/* out: TRUE if ok */
|
||||
|
||||
/* When buf_flush_free_margin is called, it tries to make this many blocks
|
||||
available to replacement in the free list and at the end of the LRU list (to
|
||||
make sure that a read-ahead batch can be read efficiently in a single
|
||||
sweep). */
|
||||
|
||||
#define BUF_FLUSH_FREE_BLOCK_MARGIN (5 + BUF_READ_AHEAD_AREA)
|
||||
#define BUF_FLUSH_EXTRA_MARGIN (BUF_FLUSH_FREE_BLOCK_MARGIN / 4 + 100)
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
#include "buf0flu.ic"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
106
storage/innobase/include/buf0flu.ic
Normal file
106
storage/innobase/include/buf0flu.ic
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
/******************************************************
|
||||
The database buffer pool flush algorithm
|
||||
|
||||
(c) 1995 Innobase Oy
|
||||
|
||||
Created 11/5/1995 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#include "buf0buf.h"
|
||||
#include "mtr0mtr.h"
|
||||
|
||||
/************************************************************************
|
||||
Inserts a modified block into the flush list. */
|
||||
|
||||
void
|
||||
buf_flush_insert_into_flush_list(
|
||||
/*=============================*/
|
||||
buf_block_t* block); /* in: block which is modified */
|
||||
/************************************************************************
|
||||
Inserts a modified block into the flush list in the right sorted position.
|
||||
This function is used by recovery, because there the modifications do not
|
||||
necessarily come in the order of lsn's. */
|
||||
|
||||
void
|
||||
buf_flush_insert_sorted_into_flush_list(
|
||||
/*====================================*/
|
||||
buf_block_t* block); /* in: block which is modified */
|
||||
|
||||
/************************************************************************
|
||||
This function should be called at a mini-transaction commit, if a page was
|
||||
modified in it. Puts the block to the list of modified blocks, if it is not
|
||||
already in it. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
buf_flush_note_modification(
|
||||
/*========================*/
|
||||
buf_block_t* block, /* in: block which is modified */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
ut_ad(block);
|
||||
ut_ad(block->state == BUF_BLOCK_FILE_PAGE);
|
||||
ut_ad(block->buf_fix_count > 0);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
ut_ad(rw_lock_own(&(block->lock), RW_LOCK_EX));
|
||||
ut_ad(mutex_own(&(buf_pool->mutex)));
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
||||
ut_ad(ut_dulint_cmp(mtr->start_lsn, ut_dulint_zero) != 0);
|
||||
ut_ad(mtr->modifications);
|
||||
ut_ad(ut_dulint_cmp(block->newest_modification, mtr->end_lsn) <= 0);
|
||||
|
||||
block->newest_modification = mtr->end_lsn;
|
||||
|
||||
if (ut_dulint_is_zero(block->oldest_modification)) {
|
||||
|
||||
block->oldest_modification = mtr->start_lsn;
|
||||
ut_ad(!ut_dulint_is_zero(block->oldest_modification));
|
||||
|
||||
buf_flush_insert_into_flush_list(block);
|
||||
} else {
|
||||
ut_ad(ut_dulint_cmp(block->oldest_modification,
|
||||
mtr->start_lsn) <= 0);
|
||||
}
|
||||
|
||||
++srv_buf_pool_write_requests;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
This function should be called when recovery has modified a buffer page. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
buf_flush_recv_note_modification(
|
||||
/*=============================*/
|
||||
buf_block_t* block, /* in: block which is modified */
|
||||
dulint start_lsn, /* in: start lsn of the first mtr in a
|
||||
set of mtr's */
|
||||
dulint end_lsn) /* in: end lsn of the last mtr in the
|
||||
set of mtr's */
|
||||
{
|
||||
ut_ad(block);
|
||||
ut_ad(block->state == BUF_BLOCK_FILE_PAGE);
|
||||
ut_ad(block->buf_fix_count > 0);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
ut_ad(rw_lock_own(&(block->lock), RW_LOCK_EX));
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
||||
mutex_enter(&(buf_pool->mutex));
|
||||
|
||||
ut_ad(ut_dulint_cmp(block->newest_modification, end_lsn) <= 0);
|
||||
|
||||
block->newest_modification = end_lsn;
|
||||
|
||||
if (ut_dulint_is_zero(block->oldest_modification)) {
|
||||
|
||||
block->oldest_modification = start_lsn;
|
||||
|
||||
ut_ad(!ut_dulint_is_zero(block->oldest_modification));
|
||||
|
||||
buf_flush_insert_sorted_into_flush_list(block);
|
||||
} else {
|
||||
ut_ad(ut_dulint_cmp(block->oldest_modification,
|
||||
start_lsn) <= 0);
|
||||
}
|
||||
|
||||
mutex_exit(&(buf_pool->mutex));
|
||||
}
|
||||
142
storage/innobase/include/buf0lru.h
Normal file
142
storage/innobase/include/buf0lru.h
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
/******************************************************
|
||||
The database buffer pool LRU replacement algorithm
|
||||
|
||||
(c) 1995 Innobase Oy
|
||||
|
||||
Created 11/5/1995 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#ifndef buf0lru_h
|
||||
#define buf0lru_h
|
||||
|
||||
#include "univ.i"
|
||||
#include "ut0byte.h"
|
||||
#include "buf0types.h"
|
||||
|
||||
/**********************************************************************
|
||||
Tries to remove LRU flushed blocks from the end of the LRU list and put them
|
||||
to the free list. This is beneficial for the efficiency of the insert buffer
|
||||
operation, as flushed pages from non-unique non-clustered indexes are here
|
||||
taken out of the buffer pool, and their inserts redirected to the insert
|
||||
buffer. Otherwise, the flushed blocks could get modified again before read
|
||||
operations need new buffer blocks, and the i/o work done in flushing would be
|
||||
wasted. */
|
||||
|
||||
void
|
||||
buf_LRU_try_free_flushed_blocks(void);
|
||||
/*==================================*/
|
||||
/**********************************************************************
|
||||
Returns TRUE if less than 15 % of the buffer pool is available. This can be
|
||||
used in heuristics to prevent huge transactions eating up the whole buffer
|
||||
pool for their locks. */
|
||||
|
||||
ibool
|
||||
buf_LRU_buf_pool_running_out(void);
|
||||
/*==============================*/
|
||||
/* out: TRUE if less than 15 % of buffer pool
|
||||
left */
|
||||
|
||||
/*#######################################################################
|
||||
These are low-level functions
|
||||
#########################################################################*/
|
||||
|
||||
/* Minimum LRU list length for which the LRU_old pointer is defined */
|
||||
|
||||
#define BUF_LRU_OLD_MIN_LEN 80
|
||||
|
||||
#define BUF_LRU_FREE_SEARCH_LEN (5 + 2 * BUF_READ_AHEAD_AREA)
|
||||
|
||||
/**********************************************************************
|
||||
Invalidates all pages belonging to a given tablespace when we are deleting
|
||||
the data file(s) of that tablespace. A PROBLEM: if readahead is being started,
|
||||
what guarantees that it will not try to read in pages after this operation has
|
||||
completed? */
|
||||
|
||||
void
|
||||
buf_LRU_invalidate_tablespace(
|
||||
/*==========================*/
|
||||
ulint id); /* in: space id */
|
||||
/**********************************************************************
|
||||
Gets the minimum LRU_position field for the blocks in an initial segment
|
||||
(determined by BUF_LRU_INITIAL_RATIO) of the LRU list. The limit is not
|
||||
guaranteed to be precise, because the ulint_clock may wrap around. */
|
||||
|
||||
ulint
|
||||
buf_LRU_get_recent_limit(void);
|
||||
/*==========================*/
|
||||
/* out: the limit; zero if could not determine it */
|
||||
/**********************************************************************
|
||||
Look for a replaceable block from the end of the LRU list and put it to
|
||||
the free list if found. */
|
||||
|
||||
ibool
|
||||
buf_LRU_search_and_free_block(
|
||||
/*==========================*/
|
||||
/* out: TRUE if freed */
|
||||
ulint n_iterations); /* in: how many times this has been called
|
||||
repeatedly without result: a high value means
|
||||
that we should search farther; if value is
|
||||
k < 10, then we only search k/10 * number
|
||||
of pages in the buffer pool from the end
|
||||
of the LRU list */
|
||||
/**********************************************************************
|
||||
Returns a free block from the buf_pool. The block is taken off the
|
||||
free list. If it is empty, blocks are moved from the end of the
|
||||
LRU list to the free list. */
|
||||
|
||||
buf_block_t*
|
||||
buf_LRU_get_free_block(void);
|
||||
/*=========================*/
|
||||
/* out: the free control block; also if AWE is
|
||||
used, it is guaranteed that the block has its
|
||||
page mapped to a frame when we return */
|
||||
/**********************************************************************
|
||||
Puts a block back to the free list. */
|
||||
|
||||
void
|
||||
buf_LRU_block_free_non_file_page(
|
||||
/*=============================*/
|
||||
buf_block_t* block); /* in: block, must not contain a file page */
|
||||
/**********************************************************************
|
||||
Adds a block to the LRU list. */
|
||||
|
||||
void
|
||||
buf_LRU_add_block(
|
||||
/*==============*/
|
||||
buf_block_t* block, /* in: control block */
|
||||
ibool old); /* in: TRUE if should be put to the old
|
||||
blocks in the LRU list, else put to the
|
||||
start; if the LRU list is very short, added to
|
||||
the start regardless of this parameter */
|
||||
/**********************************************************************
|
||||
Moves a block to the start of the LRU list. */
|
||||
|
||||
void
|
||||
buf_LRU_make_block_young(
|
||||
/*=====================*/
|
||||
buf_block_t* block); /* in: control block */
|
||||
/**********************************************************************
|
||||
Moves a block to the end of the LRU list. */
|
||||
|
||||
void
|
||||
buf_LRU_make_block_old(
|
||||
/*===================*/
|
||||
buf_block_t* block); /* in: control block */
|
||||
/**************************************************************************
|
||||
Validates the LRU list. */
|
||||
|
||||
ibool
|
||||
buf_LRU_validate(void);
|
||||
/*==================*/
|
||||
/**************************************************************************
|
||||
Prints the LRU list. */
|
||||
|
||||
void
|
||||
buf_LRU_print(void);
|
||||
/*===============*/
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
#include "buf0lru.ic"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
8
storage/innobase/include/buf0lru.ic
Normal file
8
storage/innobase/include/buf0lru.ic
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
/******************************************************
|
||||
The database buffer replacement algorithm
|
||||
|
||||
(c) 1995 Innobase Oy
|
||||
|
||||
Created 11/5/1995 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
103
storage/innobase/include/buf0rea.h
Normal file
103
storage/innobase/include/buf0rea.h
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
/******************************************************
|
||||
The database buffer read
|
||||
|
||||
(c) 1995 Innobase Oy
|
||||
|
||||
Created 11/5/1995 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#ifndef buf0rea_h
|
||||
#define buf0rea_h
|
||||
|
||||
#include "univ.i"
|
||||
#include "buf0types.h"
|
||||
|
||||
/************************************************************************
|
||||
High-level function which reads a page asynchronously from a file to the
|
||||
buffer buf_pool if it is not already there. Sets the io_fix flag and sets
|
||||
an exclusive lock on the buffer frame. The flag is cleared and the x-lock
|
||||
released by the i/o-handler thread. Does a random read-ahead if it seems
|
||||
sensible. */
|
||||
|
||||
ulint
|
||||
buf_read_page(
|
||||
/*==========*/
|
||||
/* out: number of page read requests issued: this can
|
||||
be > 1 if read-ahead occurred */
|
||||
ulint space, /* in: space id */
|
||||
ulint offset);/* in: page number */
|
||||
/************************************************************************
|
||||
Applies linear read-ahead if in the buf_pool the page is a border page of
|
||||
a linear read-ahead area and all the pages in the area have been accessed.
|
||||
Does not read any page if the read-ahead mechanism is not activated. Note
|
||||
that the the algorithm looks at the 'natural' adjacent successor and
|
||||
predecessor of the page, which on the leaf level of a B-tree are the next
|
||||
and previous page in the chain of leaves. To know these, the page specified
|
||||
in (space, offset) must already be present in the buf_pool. Thus, the
|
||||
natural way to use this function is to call it when a page in the buf_pool
|
||||
is accessed the first time, calling this function just after it has been
|
||||
bufferfixed.
|
||||
NOTE 1: as this function looks at the natural predecessor and successor
|
||||
fields on the page, what happens, if these are not initialized to any
|
||||
sensible value? No problem, before applying read-ahead we check that the
|
||||
area to read is within the span of the space, if not, read-ahead is not
|
||||
applied. An uninitialized value may result in a useless read operation, but
|
||||
only very improbably.
|
||||
NOTE 2: the calling thread may own latches on pages: to avoid deadlocks this
|
||||
function must be written such that it cannot end up waiting for these
|
||||
latches!
|
||||
NOTE 3: the calling thread must want access to the page given: this rule is
|
||||
set to prevent unintended read-aheads performed by ibuf routines, a situation
|
||||
which could result in a deadlock if the OS does not support asynchronous io. */
|
||||
|
||||
ulint
|
||||
buf_read_ahead_linear(
|
||||
/*==================*/
|
||||
/* out: number of page read requests issued */
|
||||
ulint space, /* in: space id */
|
||||
ulint offset);/* in: page number of a page; NOTE: the current thread
|
||||
must want access to this page (see NOTE 3 above) */
|
||||
/************************************************************************
|
||||
Issues read requests for pages which the ibuf module wants to read in, in
|
||||
order to contract the insert buffer tree. Technically, this function is like
|
||||
a read-ahead function. */
|
||||
|
||||
void
|
||||
buf_read_ibuf_merge_pages(
|
||||
/*======================*/
|
||||
ibool sync, /* in: TRUE if the caller wants this function
|
||||
to wait for the highest address page to get
|
||||
read in, before this function returns */
|
||||
ulint* space_ids, /* in: array of space ids */
|
||||
ib_longlong* space_versions,/* in: the spaces must have this version
|
||||
number (timestamp), otherwise we discard the
|
||||
read; we use this to cancel reads if
|
||||
DISCARD + IMPORT may have changed the
|
||||
tablespace size */
|
||||
ulint* page_nos, /* in: array of page numbers to read, with the
|
||||
highest page number the last in the array */
|
||||
ulint n_stored); /* in: number of page numbers in the array */
|
||||
/************************************************************************
|
||||
Issues read requests for pages which recovery wants to read in. */
|
||||
|
||||
void
|
||||
buf_read_recv_pages(
|
||||
/*================*/
|
||||
ibool sync, /* in: TRUE if the caller wants this function
|
||||
to wait for the highest address page to get
|
||||
read in, before this function returns */
|
||||
ulint space, /* in: space id */
|
||||
ulint* page_nos, /* in: array of page numbers to read, with the
|
||||
highest page number the last in the array */
|
||||
ulint n_stored); /* in: number of page numbers in the array */
|
||||
|
||||
/* The size in pages of the area which the read-ahead algorithms read if
|
||||
invoked */
|
||||
|
||||
#define BUF_READ_AHEAD_AREA ut_min(64, ut_2_power_up(buf_pool->curr_size / 32))
|
||||
|
||||
/* Modes used in read-ahead */
|
||||
#define BUF_READ_IBUF_PAGES_ONLY 131
|
||||
#define BUF_READ_ANY_PAGE 132
|
||||
|
||||
#endif
|
||||
20
storage/innobase/include/buf0types.h
Normal file
20
storage/innobase/include/buf0types.h
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/******************************************************
|
||||
The database buffer pool global types for the directory
|
||||
|
||||
(c) 1995 Innobase Oy
|
||||
|
||||
Created 11/17/1995 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#ifndef buf0types_h
|
||||
#define buf0types_h
|
||||
|
||||
typedef struct buf_block_struct buf_block_t;
|
||||
typedef struct buf_pool_struct buf_pool_t;
|
||||
|
||||
/* The 'type' used of a buffer frame */
|
||||
typedef byte buf_frame_t;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
424
storage/innobase/include/data0data.h
Normal file
424
storage/innobase/include/data0data.h
Normal file
|
|
@ -0,0 +1,424 @@
|
|||
/************************************************************************
|
||||
SQL data field and tuple
|
||||
|
||||
(c) 1994-1996 Innobase Oy
|
||||
|
||||
Created 5/30/1994 Heikki Tuuri
|
||||
*************************************************************************/
|
||||
|
||||
#ifndef data0data_h
|
||||
#define data0data_h
|
||||
|
||||
#include "univ.i"
|
||||
|
||||
#include "data0types.h"
|
||||
#include "data0type.h"
|
||||
#include "mem0mem.h"
|
||||
#include "dict0types.h"
|
||||
|
||||
typedef struct big_rec_struct big_rec_t;
|
||||
|
||||
/* Some non-inlined functions used in the MySQL interface: */
|
||||
void
|
||||
dfield_set_data_noninline(
|
||||
dfield_t* field, /* in: field */
|
||||
void* data, /* in: data */
|
||||
ulint len); /* in: length or UNIV_SQL_NULL */
|
||||
void*
|
||||
dfield_get_data_noninline(
|
||||
dfield_t* field); /* in: field */
|
||||
ulint
|
||||
dfield_get_len_noninline(
|
||||
dfield_t* field); /* in: field */
|
||||
ulint
|
||||
dtuple_get_n_fields_noninline(
|
||||
dtuple_t* tuple); /* in: tuple */
|
||||
dfield_t*
|
||||
dtuple_get_nth_field_noninline(
|
||||
dtuple_t* tuple, /* in: tuple */
|
||||
ulint n); /* in: index of field */
|
||||
|
||||
/*************************************************************************
|
||||
Gets pointer to the type struct of SQL data field. */
|
||||
UNIV_INLINE
|
||||
dtype_t*
|
||||
dfield_get_type(
|
||||
/*============*/
|
||||
/* out: pointer to the type struct */
|
||||
dfield_t* field); /* in: SQL data field */
|
||||
/*************************************************************************
|
||||
Sets the type struct of SQL data field. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dfield_set_type(
|
||||
/*============*/
|
||||
dfield_t* field, /* in: SQL data field */
|
||||
dtype_t* type); /* in: pointer to data type struct */
|
||||
/*************************************************************************
|
||||
Gets pointer to the data in a field. */
|
||||
UNIV_INLINE
|
||||
void*
|
||||
dfield_get_data(
|
||||
/*============*/
|
||||
/* out: pointer to data */
|
||||
dfield_t* field); /* in: field */
|
||||
/*************************************************************************
|
||||
Gets length of field data. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dfield_get_len(
|
||||
/*===========*/
|
||||
/* out: length of data; UNIV_SQL_NULL if
|
||||
SQL null data */
|
||||
dfield_t* field); /* in: field */
|
||||
/*************************************************************************
|
||||
Sets length in a field. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dfield_set_len(
|
||||
/*===========*/
|
||||
dfield_t* field, /* in: field */
|
||||
ulint len); /* in: length or UNIV_SQL_NULL */
|
||||
/*************************************************************************
|
||||
Sets pointer to the data and length in a field. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dfield_set_data(
|
||||
/*============*/
|
||||
dfield_t* field, /* in: field */
|
||||
const void* data, /* in: data */
|
||||
ulint len); /* in: length or UNIV_SQL_NULL */
|
||||
/**************************************************************************
|
||||
Writes an SQL null field full of zeros. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
data_write_sql_null(
|
||||
/*================*/
|
||||
byte* data, /* in: pointer to a buffer of size len */
|
||||
ulint len); /* in: SQL null size in bytes */
|
||||
/*************************************************************************
|
||||
Copies the data and len fields. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dfield_copy_data(
|
||||
/*=============*/
|
||||
dfield_t* field1, /* in: field to copy to */
|
||||
dfield_t* field2);/* in: field to copy from */
|
||||
/*************************************************************************
|
||||
Copies a data field to another. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dfield_copy(
|
||||
/*========*/
|
||||
dfield_t* field1, /* in: field to copy to */
|
||||
dfield_t* field2);/* in: field to copy from */
|
||||
/*************************************************************************
|
||||
Tests if data length and content is equal for two dfields. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
dfield_datas_are_binary_equal(
|
||||
/*==========================*/
|
||||
/* out: TRUE if equal */
|
||||
dfield_t* field1, /* in: field */
|
||||
dfield_t* field2);/* in: field */
|
||||
/*************************************************************************
|
||||
Tests if dfield data length and content is equal to the given. */
|
||||
|
||||
ibool
|
||||
dfield_data_is_binary_equal(
|
||||
/*========================*/
|
||||
/* out: TRUE if equal */
|
||||
dfield_t* field, /* in: field */
|
||||
ulint len, /* in: data length or UNIV_SQL_NULL */
|
||||
byte* data); /* in: data */
|
||||
/*************************************************************************
|
||||
Gets number of fields in a data tuple. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtuple_get_n_fields(
|
||||
/*================*/
|
||||
/* out: number of fields */
|
||||
dtuple_t* tuple); /* in: tuple */
|
||||
/*************************************************************************
|
||||
Gets nth field of a tuple. */
|
||||
UNIV_INLINE
|
||||
dfield_t*
|
||||
dtuple_get_nth_field(
|
||||
/*=================*/
|
||||
/* out: nth field */
|
||||
dtuple_t* tuple, /* in: tuple */
|
||||
ulint n); /* in: index of field */
|
||||
/*************************************************************************
|
||||
Gets info bits in a data tuple. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtuple_get_info_bits(
|
||||
/*=================*/
|
||||
/* out: info bits */
|
||||
dtuple_t* tuple); /* in: tuple */
|
||||
/*************************************************************************
|
||||
Sets info bits in a data tuple. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dtuple_set_info_bits(
|
||||
/*=================*/
|
||||
dtuple_t* tuple, /* in: tuple */
|
||||
ulint info_bits); /* in: info bits */
|
||||
/*************************************************************************
|
||||
Gets number of fields used in record comparisons. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtuple_get_n_fields_cmp(
|
||||
/*====================*/
|
||||
/* out: number of fields used in comparisons
|
||||
in rem0cmp.* */
|
||||
dtuple_t* tuple); /* in: tuple */
|
||||
/*************************************************************************
|
||||
Gets number of fields used in record comparisons. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dtuple_set_n_fields_cmp(
|
||||
/*====================*/
|
||||
dtuple_t* tuple, /* in: tuple */
|
||||
ulint n_fields_cmp); /* in: number of fields used in
|
||||
comparisons in rem0cmp.* */
|
||||
/**************************************************************
|
||||
Creates a data tuple to a memory heap. The default value for number
|
||||
of fields used in record comparisons for this tuple is n_fields. */
|
||||
UNIV_INLINE
|
||||
dtuple_t*
|
||||
dtuple_create(
|
||||
/*==========*/
|
||||
/* out, own: created tuple */
|
||||
mem_heap_t* heap, /* in: memory heap where the tuple
|
||||
is created */
|
||||
ulint n_fields); /* in: number of fields */
|
||||
|
||||
/*************************************************************************
|
||||
Creates a dtuple for use in MySQL. */
|
||||
|
||||
dtuple_t*
|
||||
dtuple_create_for_mysql(
|
||||
/*====================*/
|
||||
/* out, own created dtuple */
|
||||
void** heap, /* out: created memory heap */
|
||||
ulint n_fields); /* in: number of fields */
|
||||
/*************************************************************************
|
||||
Frees a dtuple used in MySQL. */
|
||||
|
||||
void
|
||||
dtuple_free_for_mysql(
|
||||
/*==================*/
|
||||
void* heap);
|
||||
/*************************************************************************
|
||||
Sets number of fields used in a tuple. Normally this is set in
|
||||
dtuple_create, but if you want later to set it smaller, you can use this. */
|
||||
|
||||
void
|
||||
dtuple_set_n_fields(
|
||||
/*================*/
|
||||
dtuple_t* tuple, /* in: tuple */
|
||||
ulint n_fields); /* in: number of fields */
|
||||
/**************************************************************
|
||||
The following function returns the sum of data lengths of a tuple. The space
|
||||
occupied by the field structs or the tuple struct is not counted. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtuple_get_data_size(
|
||||
/*=================*/
|
||||
/* out: sum of data lens */
|
||||
dtuple_t* tuple); /* in: typed data tuple */
|
||||
/****************************************************************
|
||||
Returns TRUE if lengths of two dtuples are equal and respective data fields
|
||||
in them are equal when compared with collation in char fields (not as binary
|
||||
strings). */
|
||||
|
||||
ibool
|
||||
dtuple_datas_are_ordering_equal(
|
||||
/*============================*/
|
||||
/* out: TRUE if length and fieds are equal
|
||||
when compared with cmp_data_data:
|
||||
NOTE: in character type fields some letters
|
||||
are identified with others! (collation) */
|
||||
dtuple_t* tuple1, /* in: tuple 1 */
|
||||
dtuple_t* tuple2);/* in: tuple 2 */
|
||||
/****************************************************************
|
||||
Folds a prefix given as the number of fields of a tuple. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtuple_fold(
|
||||
/*========*/
|
||||
/* out: the folded value */
|
||||
dtuple_t* tuple, /* in: the tuple */
|
||||
ulint n_fields,/* in: number of complete fields to fold */
|
||||
ulint n_bytes,/* in: number of bytes to fold in an
|
||||
incomplete last field */
|
||||
dulint tree_id);/* in: index tree id */
|
||||
/***********************************************************************
|
||||
Sets types of fields binary in a tuple. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dtuple_set_types_binary(
|
||||
/*====================*/
|
||||
dtuple_t* tuple, /* in: data tuple */
|
||||
ulint n); /* in: number of fields to set */
|
||||
/**************************************************************************
|
||||
Checks if a dtuple contains an SQL null value. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
dtuple_contains_null(
|
||||
/*=================*/
|
||||
/* out: TRUE if some field is SQL null */
|
||||
dtuple_t* tuple); /* in: dtuple */
|
||||
/**************************************************************
|
||||
Checks that a data field is typed. Asserts an error if not. */
|
||||
|
||||
ibool
|
||||
dfield_check_typed(
|
||||
/*===============*/
|
||||
/* out: TRUE if ok */
|
||||
dfield_t* field); /* in: data field */
|
||||
/**************************************************************
|
||||
Checks that a data tuple is typed. Asserts an error if not. */
|
||||
|
||||
ibool
|
||||
dtuple_check_typed(
|
||||
/*===============*/
|
||||
/* out: TRUE if ok */
|
||||
dtuple_t* tuple); /* in: tuple */
|
||||
/**************************************************************
|
||||
Checks that a data tuple is typed. */
|
||||
|
||||
ibool
|
||||
dtuple_check_typed_no_assert(
|
||||
/*=========================*/
|
||||
/* out: TRUE if ok */
|
||||
dtuple_t* tuple); /* in: tuple */
|
||||
#ifdef UNIV_DEBUG
|
||||
/**************************************************************
|
||||
Validates the consistency of a tuple which must be complete, i.e,
|
||||
all fields must have been set. */
|
||||
|
||||
ibool
|
||||
dtuple_validate(
|
||||
/*============*/
|
||||
/* out: TRUE if ok */
|
||||
dtuple_t* tuple); /* in: tuple */
|
||||
#endif /* UNIV_DEBUG */
|
||||
/*****************************************************************
|
||||
Pretty prints a dfield value according to its data type. */
|
||||
|
||||
void
|
||||
dfield_print(
|
||||
/*=========*/
|
||||
dfield_t* dfield);/* in: dfield */
|
||||
/*****************************************************************
|
||||
Pretty prints a dfield value according to its data type. Also the hex string
|
||||
is printed if a string contains non-printable characters. */
|
||||
|
||||
void
|
||||
dfield_print_also_hex(
|
||||
/*==================*/
|
||||
dfield_t* dfield); /* in: dfield */
|
||||
/**************************************************************
|
||||
The following function prints the contents of a tuple. */
|
||||
|
||||
void
|
||||
dtuple_print(
|
||||
/*=========*/
|
||||
FILE* f, /* in: output stream */
|
||||
dtuple_t* tuple); /* in: tuple */
|
||||
/******************************************************************
|
||||
Moves parts of long fields in entry to the big record vector so that
|
||||
the size of tuple drops below the maximum record size allowed in the
|
||||
database. Moves data only from those fields which are not necessary
|
||||
to determine uniquely the insertion place of the tuple in the index. */
|
||||
|
||||
big_rec_t*
|
||||
dtuple_convert_big_rec(
|
||||
/*===================*/
|
||||
/* out, own: created big record vector,
|
||||
NULL if we are not able to shorten
|
||||
the entry enough, i.e., if there are
|
||||
too many short fields in entry */
|
||||
dict_index_t* index, /* in: index */
|
||||
dtuple_t* entry, /* in: index entry */
|
||||
ulint* ext_vec,/* in: array of externally stored fields,
|
||||
or NULL: if a field already is externally
|
||||
stored, then we cannot move it to the vector
|
||||
this function returns */
|
||||
ulint n_ext_vec);/* in: number of elements is ext_vec */
|
||||
/******************************************************************
|
||||
Puts back to entry the data stored in vector. Note that to ensure the
|
||||
fields in entry can accommodate the data, vector must have been created
|
||||
from entry with dtuple_convert_big_rec. */
|
||||
|
||||
void
|
||||
dtuple_convert_back_big_rec(
|
||||
/*========================*/
|
||||
dict_index_t* index, /* in: index */
|
||||
dtuple_t* entry, /* in: entry whose data was put to vector */
|
||||
big_rec_t* vector);/* in, own: big rec vector; it is
|
||||
freed in this function */
|
||||
/******************************************************************
|
||||
Frees the memory in a big rec vector. */
|
||||
|
||||
void
|
||||
dtuple_big_rec_free(
|
||||
/*================*/
|
||||
big_rec_t* vector); /* in, own: big rec vector; it is
|
||||
freed in this function */
|
||||
|
||||
/*######################################################################*/
|
||||
|
||||
/* Structure for an SQL data field */
|
||||
struct dfield_struct{
|
||||
void* data; /* pointer to data */
|
||||
ulint len; /* data length; UNIV_SQL_NULL if SQL null; */
|
||||
dtype_t type; /* type of data */
|
||||
};
|
||||
|
||||
struct dtuple_struct {
|
||||
ulint info_bits; /* info bits of an index record:
|
||||
the default is 0; this field is used
|
||||
if an index record is built from
|
||||
a data tuple */
|
||||
ulint n_fields; /* number of fields in dtuple */
|
||||
ulint n_fields_cmp; /* number of fields which should
|
||||
be used in comparison services
|
||||
of rem0cmp.*; the index search
|
||||
is performed by comparing only these
|
||||
fields, others are ignored; the
|
||||
default value in dtuple creation is
|
||||
the same value as n_fields */
|
||||
dfield_t* fields; /* fields */
|
||||
UT_LIST_NODE_T(dtuple_t) tuple_list;
|
||||
/* data tuples can be linked into a
|
||||
list using this field */
|
||||
ulint magic_n;
|
||||
};
|
||||
#define DATA_TUPLE_MAGIC_N 65478679
|
||||
|
||||
/* A slot for a field in a big rec vector */
|
||||
|
||||
typedef struct big_rec_field_struct big_rec_field_t;
|
||||
struct big_rec_field_struct {
|
||||
ulint field_no; /* field number in record */
|
||||
ulint len; /* stored data len */
|
||||
byte* data; /* stored data */
|
||||
};
|
||||
|
||||
/* Storage format for overflow data in a big record, that is, a record
|
||||
which needs external storage of data fields */
|
||||
|
||||
struct big_rec_struct {
|
||||
mem_heap_t* heap; /* memory heap from which allocated */
|
||||
ulint n_fields; /* number of stored fields */
|
||||
big_rec_field_t* fields; /* stored fields */
|
||||
};
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
#include "data0data.ic"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
433
storage/innobase/include/data0data.ic
Normal file
433
storage/innobase/include/data0data.ic
Normal file
|
|
@ -0,0 +1,433 @@
|
|||
/************************************************************************
|
||||
SQL data field and tuple
|
||||
|
||||
(c) 1994-1996 Innobase Oy
|
||||
|
||||
Created 5/30/1994 Heikki Tuuri
|
||||
*************************************************************************/
|
||||
|
||||
#include "mem0mem.h"
|
||||
#include "ut0rnd.h"
|
||||
|
||||
extern byte data_error;
|
||||
|
||||
/*************************************************************************
|
||||
Gets pointer to the type struct of SQL data field. */
|
||||
UNIV_INLINE
|
||||
dtype_t*
|
||||
dfield_get_type(
|
||||
/*============*/
|
||||
/* out: pointer to the type struct */
|
||||
dfield_t* field) /* in: SQL data field */
|
||||
{
|
||||
ut_ad(field);
|
||||
|
||||
return(&(field->type));
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Sets the type struct of SQL data field. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dfield_set_type(
|
||||
/*============*/
|
||||
dfield_t* field, /* in: SQL data field */
|
||||
dtype_t* type) /* in: pointer to data type struct */
|
||||
{
|
||||
ut_ad(field && type);
|
||||
|
||||
field->type = *type;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets pointer to the data in a field. */
|
||||
UNIV_INLINE
|
||||
void*
|
||||
dfield_get_data(
|
||||
/*============*/
|
||||
/* out: pointer to data */
|
||||
dfield_t* field) /* in: field */
|
||||
{
|
||||
ut_ad(field);
|
||||
ut_ad((field->len == UNIV_SQL_NULL)
|
||||
|| (field->data != &data_error));
|
||||
|
||||
return(field->data);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets length of field data. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dfield_get_len(
|
||||
/*===========*/
|
||||
/* out: length of data; UNIV_SQL_NULL if
|
||||
SQL null data */
|
||||
dfield_t* field) /* in: field */
|
||||
{
|
||||
ut_ad(field);
|
||||
ut_ad((field->len == UNIV_SQL_NULL)
|
||||
|| (field->data != &data_error));
|
||||
|
||||
return(field->len);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Sets length in a field. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dfield_set_len(
|
||||
/*===========*/
|
||||
dfield_t* field, /* in: field */
|
||||
ulint len) /* in: length or UNIV_SQL_NULL */
|
||||
{
|
||||
ut_ad(field);
|
||||
|
||||
field->len = len;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Sets pointer to the data and length in a field. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dfield_set_data(
|
||||
/*============*/
|
||||
dfield_t* field, /* in: field */
|
||||
const void* data, /* in: data */
|
||||
ulint len) /* in: length or UNIV_SQL_NULL */
|
||||
{
|
||||
ut_ad(field);
|
||||
|
||||
field->data = (void*) data;
|
||||
field->len = len;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Copies the data and len fields. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dfield_copy_data(
|
||||
/*=============*/
|
||||
dfield_t* field1, /* in: field to copy to */
|
||||
dfield_t* field2) /* in: field to copy from */
|
||||
{
|
||||
ut_ad(field1 && field2);
|
||||
|
||||
field1->data = field2->data;
|
||||
field1->len = field2->len;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Copies a data field to another. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dfield_copy(
|
||||
/*========*/
|
||||
dfield_t* field1, /* in: field to copy to */
|
||||
dfield_t* field2) /* in: field to copy from */
|
||||
{
|
||||
*field1 = *field2;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Tests if data length and content is equal for two dfields. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
dfield_datas_are_binary_equal(
|
||||
/*==========================*/
|
||||
/* out: TRUE if equal */
|
||||
dfield_t* field1, /* in: field */
|
||||
dfield_t* field2) /* in: field */
|
||||
{
|
||||
ulint len;
|
||||
|
||||
len = field1->len;
|
||||
|
||||
if ((len != field2->len)
|
||||
|| ((len != UNIV_SQL_NULL)
|
||||
&& (0 != ut_memcmp(field1->data, field2->data, len)))) {
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets info bits in a data tuple. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtuple_get_info_bits(
|
||||
/*=================*/
|
||||
/* out: info bits */
|
||||
dtuple_t* tuple) /* in: tuple */
|
||||
{
|
||||
ut_ad(tuple);
|
||||
|
||||
return(tuple->info_bits);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Sets info bits in a data tuple. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dtuple_set_info_bits(
|
||||
/*=================*/
|
||||
dtuple_t* tuple, /* in: tuple */
|
||||
ulint info_bits) /* in: info bits */
|
||||
{
|
||||
ut_ad(tuple);
|
||||
|
||||
tuple->info_bits = info_bits;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets number of fields used in record comparisons. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtuple_get_n_fields_cmp(
|
||||
/*====================*/
|
||||
/* out: number of fields used in comparisons
|
||||
in rem0cmp.* */
|
||||
dtuple_t* tuple) /* in: tuple */
|
||||
{
|
||||
ut_ad(tuple);
|
||||
|
||||
return(tuple->n_fields_cmp);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Sets number of fields used in record comparisons. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dtuple_set_n_fields_cmp(
|
||||
/*====================*/
|
||||
dtuple_t* tuple, /* in: tuple */
|
||||
ulint n_fields_cmp) /* in: number of fields used in
|
||||
comparisons in rem0cmp.* */
|
||||
{
|
||||
ut_ad(tuple);
|
||||
ut_ad(n_fields_cmp <= tuple->n_fields);
|
||||
|
||||
tuple->n_fields_cmp = n_fields_cmp;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets number of fields in a data tuple. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtuple_get_n_fields(
|
||||
/*================*/
|
||||
/* out: number of fields */
|
||||
dtuple_t* tuple) /* in: tuple */
|
||||
{
|
||||
ut_ad(tuple);
|
||||
|
||||
return(tuple->n_fields);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets nth field of a tuple. */
|
||||
UNIV_INLINE
|
||||
dfield_t*
|
||||
dtuple_get_nth_field(
|
||||
/*=================*/
|
||||
/* out: nth field */
|
||||
dtuple_t* tuple, /* in: tuple */
|
||||
ulint n) /* in: index of field */
|
||||
{
|
||||
ut_ad(tuple);
|
||||
ut_ad(n < tuple->n_fields);
|
||||
|
||||
return(tuple->fields + n);
|
||||
}
|
||||
|
||||
/**************************************************************
|
||||
Creates a data tuple to a memory heap. The default value for number
|
||||
of fields used in record comparisons for this tuple is n_fields. */
|
||||
UNIV_INLINE
|
||||
dtuple_t*
|
||||
dtuple_create(
|
||||
/*==========*/
|
||||
/* out, own: created tuple */
|
||||
mem_heap_t* heap, /* in: memory heap where the tuple
|
||||
is created */
|
||||
ulint n_fields) /* in: number of fields */
|
||||
{
|
||||
dtuple_t* tuple;
|
||||
|
||||
ut_ad(heap);
|
||||
|
||||
tuple = (dtuple_t*) mem_heap_alloc(heap, sizeof(dtuple_t)
|
||||
+ n_fields * sizeof(dfield_t));
|
||||
tuple->info_bits = 0;
|
||||
tuple->n_fields = n_fields;
|
||||
tuple->n_fields_cmp = n_fields;
|
||||
tuple->fields = (dfield_t*)(((byte*)tuple) + sizeof(dtuple_t));
|
||||
|
||||
#ifdef UNIV_DEBUG
|
||||
tuple->magic_n = DATA_TUPLE_MAGIC_N;
|
||||
|
||||
{ /* In the debug version, initialize fields to an error value */
|
||||
ulint i;
|
||||
|
||||
for (i = 0; i < n_fields; i++) {
|
||||
(tuple->fields + i)->data = &data_error;
|
||||
dfield_get_type(tuple->fields + i)->mtype = DATA_ERROR;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return(tuple);
|
||||
}
|
||||
|
||||
/**************************************************************
|
||||
The following function returns the sum of data lengths of a tuple. The space
|
||||
occupied by the field structs or the tuple struct is not counted. Neither
|
||||
is possible space in externally stored parts of the field. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtuple_get_data_size(
|
||||
/*=================*/
|
||||
/* out: sum of data lengths */
|
||||
dtuple_t* tuple) /* in: typed data tuple */
|
||||
{
|
||||
dfield_t* field;
|
||||
ulint n_fields;
|
||||
ulint len;
|
||||
ulint i;
|
||||
ulint sum = 0;
|
||||
|
||||
ut_ad(tuple);
|
||||
ut_ad(dtuple_check_typed(tuple));
|
||||
ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N);
|
||||
|
||||
n_fields = tuple->n_fields;
|
||||
|
||||
for (i = 0; i < n_fields; i++) {
|
||||
field = dtuple_get_nth_field(tuple, i);
|
||||
len = dfield_get_len(field);
|
||||
|
||||
if (len == UNIV_SQL_NULL) {
|
||||
len = dtype_get_sql_null_size(dfield_get_type(field));
|
||||
}
|
||||
|
||||
sum += len;
|
||||
}
|
||||
|
||||
return(sum);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
Sets types of fields binary in a tuple. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dtuple_set_types_binary(
|
||||
/*====================*/
|
||||
dtuple_t* tuple, /* in: data tuple */
|
||||
ulint n) /* in: number of fields to set */
|
||||
{
|
||||
dtype_t* dfield_type;
|
||||
ulint i;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
dfield_type = dfield_get_type(dtuple_get_nth_field(tuple, i));
|
||||
dtype_set(dfield_type, DATA_BINARY, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
Folds a prefix given as the number of fields of a tuple. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtuple_fold(
|
||||
/*========*/
|
||||
/* out: the folded value */
|
||||
dtuple_t* tuple, /* in: the tuple */
|
||||
ulint n_fields,/* in: number of complete fields to fold */
|
||||
ulint n_bytes,/* in: number of bytes to fold in an
|
||||
incomplete last field */
|
||||
dulint tree_id)/* in: index tree id */
|
||||
{
|
||||
dfield_t* field;
|
||||
ulint i;
|
||||
byte* data;
|
||||
ulint len;
|
||||
ulint fold;
|
||||
|
||||
ut_ad(tuple);
|
||||
ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N);
|
||||
ut_ad(dtuple_check_typed(tuple));
|
||||
|
||||
fold = ut_fold_dulint(tree_id);
|
||||
|
||||
for (i = 0; i < n_fields; i++) {
|
||||
field = dtuple_get_nth_field(tuple, i);
|
||||
|
||||
data = (byte*) dfield_get_data(field);
|
||||
len = dfield_get_len(field);
|
||||
|
||||
if (len != UNIV_SQL_NULL) {
|
||||
fold = ut_fold_ulint_pair(fold,
|
||||
ut_fold_binary(data, len));
|
||||
}
|
||||
}
|
||||
|
||||
if (n_bytes > 0) {
|
||||
field = dtuple_get_nth_field(tuple, i);
|
||||
|
||||
data = (byte*) dfield_get_data(field);
|
||||
len = dfield_get_len(field);
|
||||
|
||||
if (len != UNIV_SQL_NULL) {
|
||||
if (len > n_bytes) {
|
||||
len = n_bytes;
|
||||
}
|
||||
|
||||
fold = ut_fold_ulint_pair(fold,
|
||||
ut_fold_binary(data, len));
|
||||
}
|
||||
}
|
||||
|
||||
return(fold);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Writes an SQL null field full of zeros. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
data_write_sql_null(
|
||||
/*================*/
|
||||
byte* data, /* in: pointer to a buffer of size len */
|
||||
ulint len) /* in: SQL null size in bytes */
|
||||
{
|
||||
ulint j;
|
||||
|
||||
for (j = 0; j < len; j++) {
|
||||
data[j] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Checks if a dtuple contains an SQL null value. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
dtuple_contains_null(
|
||||
/*=================*/
|
||||
/* out: TRUE if some field is SQL null */
|
||||
dtuple_t* tuple) /* in: dtuple */
|
||||
{
|
||||
ulint n;
|
||||
ulint i;
|
||||
|
||||
n = dtuple_get_n_fields(tuple);
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
if (dfield_get_len(dtuple_get_nth_field(tuple, i))
|
||||
== UNIV_SQL_NULL) {
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
430
storage/innobase/include/data0type.h
Normal file
430
storage/innobase/include/data0type.h
Normal file
|
|
@ -0,0 +1,430 @@
|
|||
/******************************************************
|
||||
Data types
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 1/16/1996 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#ifndef data0type_h
|
||||
#define data0type_h
|
||||
|
||||
#include "univ.i"
|
||||
|
||||
extern ulint data_mysql_default_charset_coll;
|
||||
extern ulint data_mysql_latin1_swedish_charset_coll;
|
||||
|
||||
/* SQL data type struct */
|
||||
typedef struct dtype_struct dtype_t;
|
||||
|
||||
/* This variable is initialized as the standard binary variable length
|
||||
data type */
|
||||
extern dtype_t* dtype_binary;
|
||||
|
||||
/*-------------------------------------------*/
|
||||
/* The 'MAIN TYPE' of a column */
|
||||
#define DATA_VARCHAR 1 /* character varying of the
|
||||
latin1_swedish_ci charset-collation; note
|
||||
that the MySQL format for this, DATA_BINARY,
|
||||
DATA_VARMYSQL, is also affected by whether the
|
||||
'precise type' contains
|
||||
DATA_MYSQL_TRUE_VARCHAR */
|
||||
#define DATA_CHAR 2 /* fixed length character of the
|
||||
latin1_swedish_ci charset-collation */
|
||||
#define DATA_FIXBINARY 3 /* binary string of fixed length */
|
||||
#define DATA_BINARY 4 /* binary string */
|
||||
#define DATA_BLOB 5 /* binary large object, or a TEXT type;
|
||||
if prtype & DATA_BINARY_TYPE == 0, then this is
|
||||
actually a TEXT column (or a BLOB created
|
||||
with < 4.0.14; since column prefix indexes
|
||||
came only in 4.0.14, the missing flag in BLOBs
|
||||
created before that does not cause any harm) */
|
||||
#define DATA_INT 6 /* integer: can be any size 1 - 8 bytes */
|
||||
#define DATA_SYS_CHILD 7 /* address of the child page in node pointer */
|
||||
#define DATA_SYS 8 /* system column */
|
||||
|
||||
/* Data types >= DATA_FLOAT must be compared using the whole field, not as
|
||||
binary strings */
|
||||
|
||||
#define DATA_FLOAT 9
|
||||
#define DATA_DOUBLE 10
|
||||
#define DATA_DECIMAL 11 /* decimal number stored as an ASCII string */
|
||||
#define DATA_VARMYSQL 12 /* any charset varying length char */
|
||||
#define DATA_MYSQL 13 /* any charset fixed length char */
|
||||
/* NOTE that 4.1.1 used DATA_MYSQL and
|
||||
DATA_VARMYSQL for all character sets, and the
|
||||
charset-collation for tables created with it
|
||||
can also be latin1_swedish_ci */
|
||||
#define DATA_MTYPE_MAX 63 /* dtype_store_for_order_and_null_size()
|
||||
requires the values are <= 63 */
|
||||
/*-------------------------------------------*/
|
||||
/* The 'PRECISE TYPE' of a column */
|
||||
/*
|
||||
Tables created by a MySQL user have the following convention:
|
||||
|
||||
- In the least significant byte in the precise type we store the MySQL type
|
||||
code (not applicable for system columns).
|
||||
|
||||
- In the second least significant byte we OR flags DATA_NOT_NULL,
|
||||
DATA_UNSIGNED, DATA_BINARY_TYPE.
|
||||
|
||||
- In the third least significant byte of the precise type of string types we
|
||||
store the MySQL charset-collation code. In DATA_BLOB columns created with
|
||||
< 4.0.14 we do not actually know if it is a BLOB or a TEXT column. Since there
|
||||
are no indexes on prefixes of BLOB or TEXT columns in < 4.0.14, this is no
|
||||
problem, though.
|
||||
|
||||
Note that versions < 4.1.2 or < 5.0.1 did not store the charset code to the
|
||||
precise type, since the charset was always the default charset of the MySQL
|
||||
installation. If the stored charset code is 0 in the system table SYS_COLUMNS
|
||||
of InnoDB, that means that the default charset of this MySQL installation
|
||||
should be used.
|
||||
|
||||
When loading a table definition from the system tables to the InnoDB data
|
||||
dictionary cache in main memory, InnoDB versions >= 4.1.2 and >= 5.0.1 check
|
||||
if the stored charset-collation is 0, and if that is the case and the type is
|
||||
a non-binary string, replace that 0 by the default charset-collation code of
|
||||
this MySQL installation. In short, in old tables, the charset-collation code
|
||||
in the system tables on disk can be 0, but in in-memory data structures
|
||||
(dtype_t), the charset-collation code is always != 0 for non-binary string
|
||||
types.
|
||||
|
||||
In new tables, in binary string types, the charset-collation code is the
|
||||
MySQL code for the 'binary charset', that is, != 0.
|
||||
|
||||
For binary string types and for DATA_CHAR, DATA_VARCHAR, and for those
|
||||
DATA_BLOB which are binary or have the charset-collation latin1_swedish_ci,
|
||||
InnoDB performs all comparisons internally, without resorting to the MySQL
|
||||
comparison functions. This is to save CPU time.
|
||||
|
||||
InnoDB's own internal system tables have different precise types for their
|
||||
columns, and for them the precise type is usually not used at all.
|
||||
*/
|
||||
|
||||
#define DATA_ENGLISH 4 /* English language character string: this
|
||||
is a relic from pre-MySQL time and only used
|
||||
for InnoDB's own system tables */
|
||||
#define DATA_ERROR 111 /* another relic from pre-MySQL time */
|
||||
|
||||
#define DATA_MYSQL_TYPE_MASK 255 /* AND with this mask to extract the MySQL
|
||||
type from the precise type */
|
||||
#define DATA_MYSQL_TRUE_VARCHAR 15 /* MySQL type code for the >= 5.0.3
|
||||
format true VARCHAR */
|
||||
|
||||
/* Precise data types for system columns and the length of those columns;
|
||||
NOTE: the values must run from 0 up in the order given! All codes must
|
||||
be less than 256 */
|
||||
#define DATA_ROW_ID 0 /* row id: a dulint */
|
||||
#define DATA_ROW_ID_LEN 6 /* stored length for row id */
|
||||
|
||||
#define DATA_TRX_ID 1 /* transaction id: 6 bytes */
|
||||
#define DATA_TRX_ID_LEN 6
|
||||
|
||||
#define DATA_ROLL_PTR 2 /* rollback data pointer: 7 bytes */
|
||||
#define DATA_ROLL_PTR_LEN 7
|
||||
|
||||
#define DATA_MIX_ID 3 /* mixed index label: a dulint, stored in
|
||||
a row in a compressed form */
|
||||
#define DATA_MIX_ID_LEN 9 /* maximum stored length for mix id (in a
|
||||
compressed dulint form) */
|
||||
#define DATA_N_SYS_COLS 4 /* number of system columns defined above */
|
||||
|
||||
/* Flags ORed to the precise data type */
|
||||
#define DATA_NOT_NULL 256 /* this is ORed to the precise type when
|
||||
the column is declared as NOT NULL */
|
||||
#define DATA_UNSIGNED 512 /* this id ORed to the precise type when
|
||||
we have an unsigned integer type */
|
||||
#define DATA_BINARY_TYPE 1024 /* if the data type is a binary character
|
||||
string, this is ORed to the precise type:
|
||||
this only holds for tables created with
|
||||
>= MySQL-4.0.14 */
|
||||
/* #define DATA_NONLATIN1 2048 This is a relic from < 4.1.2 and < 5.0.1.
|
||||
In earlier versions this was set for some
|
||||
BLOB columns.
|
||||
*/
|
||||
#define DATA_LONG_TRUE_VARCHAR 4096 /* this is ORed to the precise data
|
||||
type when the column is true VARCHAR where
|
||||
MySQL uses 2 bytes to store the data len;
|
||||
for shorter VARCHARs MySQL uses only 1 byte */
|
||||
/*-------------------------------------------*/
|
||||
|
||||
/* This many bytes we need to store the type information affecting the
|
||||
alphabetical order for a single field and decide the storage size of an
|
||||
SQL null*/
|
||||
#define DATA_ORDER_NULL_TYPE_BUF_SIZE 4
|
||||
/* In the >= 4.1.x storage format we add 2 bytes more so that we can also
|
||||
store the charset-collation number; one byte is left unused, though */
|
||||
#define DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE 6
|
||||
|
||||
/*************************************************************************
|
||||
Gets the MySQL type code from a dtype. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_mysql_type(
|
||||
/*=================*/
|
||||
/* out: MySQL type code; this is NOT an InnoDB
|
||||
type code! */
|
||||
dtype_t* type); /* in: type struct */
|
||||
/*************************************************************************
|
||||
Determine how many bytes the first n characters of the given string occupy.
|
||||
If the string is shorter than n characters, returns the number of bytes
|
||||
the characters in the string occupy. */
|
||||
|
||||
ulint
|
||||
dtype_get_at_most_n_mbchars(
|
||||
/*========================*/
|
||||
/* out: length of the prefix,
|
||||
in bytes */
|
||||
const dtype_t* dtype, /* in: data type */
|
||||
ulint prefix_len, /* in: length of the requested
|
||||
prefix, in characters, multiplied by
|
||||
dtype_get_mbmaxlen(dtype) */
|
||||
ulint data_len, /* in: length of str (in bytes) */
|
||||
const char* str); /* in: the string whose prefix
|
||||
length is being determined */
|
||||
/*************************************************************************
|
||||
Checks if a data main type is a string type. Also a BLOB is considered a
|
||||
string type. */
|
||||
|
||||
ibool
|
||||
dtype_is_string_type(
|
||||
/*=================*/
|
||||
/* out: TRUE if string type */
|
||||
ulint mtype); /* in: InnoDB main data type code: DATA_CHAR, ... */
|
||||
/*************************************************************************
|
||||
Checks if a type is a binary string type. Note that for tables created with
|
||||
< 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column. For
|
||||
those DATA_BLOB columns this function currently returns FALSE. */
|
||||
|
||||
ibool
|
||||
dtype_is_binary_string_type(
|
||||
/*========================*/
|
||||
/* out: TRUE if binary string type */
|
||||
ulint mtype, /* in: main data type */
|
||||
ulint prtype);/* in: precise type */
|
||||
/*************************************************************************
|
||||
Checks if a type is a non-binary string type. That is, dtype_is_string_type is
|
||||
TRUE and dtype_is_binary_string_type is FALSE. Note that for tables created
|
||||
with < 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column.
|
||||
For those DATA_BLOB columns this function currently returns TRUE. */
|
||||
|
||||
ibool
|
||||
dtype_is_non_binary_string_type(
|
||||
/*============================*/
|
||||
/* out: TRUE if non-binary string type */
|
||||
ulint mtype, /* in: main data type */
|
||||
ulint prtype);/* in: precise type */
|
||||
/*************************************************************************
|
||||
Sets a data type structure. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dtype_set(
|
||||
/*======*/
|
||||
dtype_t* type, /* in: type struct to init */
|
||||
ulint mtype, /* in: main data type */
|
||||
ulint prtype, /* in: precise type */
|
||||
ulint len, /* in: length of type */
|
||||
ulint prec); /* in: precision of type */
|
||||
/*************************************************************************
|
||||
Copies a data type structure. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dtype_copy(
|
||||
/*=======*/
|
||||
dtype_t* type1, /* in: type struct to copy to */
|
||||
dtype_t* type2); /* in: type struct to copy from */
|
||||
/*************************************************************************
|
||||
Gets the SQL main data type. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_mtype(
|
||||
/*============*/
|
||||
dtype_t* type);
|
||||
/*************************************************************************
|
||||
Gets the precise data type. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_prtype(
|
||||
/*=============*/
|
||||
dtype_t* type);
|
||||
/*************************************************************************
|
||||
Gets the MySQL charset-collation code for MySQL string types. */
|
||||
|
||||
ulint
|
||||
dtype_get_charset_coll_noninline(
|
||||
/*=============================*/
|
||||
ulint prtype);/* in: precise data type */
|
||||
/*************************************************************************
|
||||
Gets the MySQL charset-collation code for MySQL string types. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_charset_coll(
|
||||
/*===================*/
|
||||
ulint prtype);/* in: precise data type */
|
||||
/*************************************************************************
|
||||
Forms a precise type from the < 4.1.2 format precise type plus the
|
||||
charset-collation code. */
|
||||
|
||||
ulint
|
||||
dtype_form_prtype(
|
||||
/*==============*/
|
||||
ulint old_prtype, /* in: the MySQL type code and the flags
|
||||
DATA_BINARY_TYPE etc. */
|
||||
ulint charset_coll); /* in: MySQL charset-collation code */
|
||||
/*************************************************************************
|
||||
Gets the type length. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_len(
|
||||
/*==========*/
|
||||
dtype_t* type);
|
||||
/*************************************************************************
|
||||
Gets the type precision. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_prec(
|
||||
/*===========*/
|
||||
dtype_t* type);
|
||||
/*************************************************************************
|
||||
Gets the minimum length of a character, in bytes. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_mbminlen(
|
||||
/*===============*/
|
||||
/* out: minimum length of a char, in bytes,
|
||||
or 0 if this is not a character type */
|
||||
const dtype_t* type); /* in: type */
|
||||
/*************************************************************************
|
||||
Gets the maximum length of a character, in bytes. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_mbmaxlen(
|
||||
/*===============*/
|
||||
/* out: maximum length of a char, in bytes,
|
||||
or 0 if this is not a character type */
|
||||
const dtype_t* type); /* in: type */
|
||||
/*************************************************************************
|
||||
Gets the padding character code for the type. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_pad_char(
|
||||
/*===============*/
|
||||
/* out: padding character code, or
|
||||
ULINT_UNDEFINED if no padding specified */
|
||||
dtype_t* type); /* in: type */
|
||||
/***************************************************************************
|
||||
Returns the size of a fixed size data type, 0 if not a fixed size type. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_fixed_size(
|
||||
/*=================*/
|
||||
/* out: fixed size, or 0 */
|
||||
dtype_t* type); /* in: type */
|
||||
/***************************************************************************
|
||||
Returns the minimum size of a data type. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_min_size(
|
||||
/*===============*/
|
||||
/* out: minimum size */
|
||||
const dtype_t* type); /* in: type */
|
||||
/***************************************************************************
|
||||
Returns a stored SQL NULL size for a type. For fixed length types it is
|
||||
the fixed length of the type, otherwise 0. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_sql_null_size(
|
||||
/*====================*/
|
||||
/* out: SQL null storage size */
|
||||
dtype_t* type); /* in: type */
|
||||
/***************************************************************************
|
||||
Returns TRUE if a type is of a fixed size. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
dtype_is_fixed_size(
|
||||
/*================*/
|
||||
/* out: TRUE if fixed size */
|
||||
dtype_t* type); /* in: type */
|
||||
/**************************************************************************
|
||||
Reads to a type the stored information which determines its alphabetical
|
||||
ordering and the storage size of an SQL NULL value. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dtype_read_for_order_and_null_size(
|
||||
/*===============================*/
|
||||
dtype_t* type, /* in: type struct */
|
||||
byte* buf); /* in: buffer for the stored order info */
|
||||
/**************************************************************************
|
||||
Stores for a type the information which determines its alphabetical ordering
|
||||
and the storage size of an SQL NULL value. This is the >= 4.1.x storage
|
||||
format. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dtype_new_store_for_order_and_null_size(
|
||||
/*====================================*/
|
||||
byte* buf, /* in: buffer for
|
||||
DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE
|
||||
bytes where we store the info */
|
||||
dtype_t* type); /* in: type struct */
|
||||
/**************************************************************************
|
||||
Reads to a type the stored information which determines its alphabetical
|
||||
ordering and the storage size of an SQL NULL value. This is the 4.1.x storage
|
||||
format. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dtype_new_read_for_order_and_null_size(
|
||||
/*===================================*/
|
||||
dtype_t* type, /* in: type struct */
|
||||
byte* buf); /* in: buffer for stored type order info */
|
||||
|
||||
/*************************************************************************
|
||||
Validates a data type structure. */
|
||||
|
||||
ibool
|
||||
dtype_validate(
|
||||
/*===========*/
|
||||
/* out: TRUE if ok */
|
||||
dtype_t* type); /* in: type struct to validate */
|
||||
/*************************************************************************
|
||||
Prints a data type structure. */
|
||||
|
||||
void
|
||||
dtype_print(
|
||||
/*========*/
|
||||
dtype_t* type); /* in: type */
|
||||
|
||||
/* Structure for an SQL data type.
|
||||
If you add fields to this structure, be sure to initialize them everywhere.
|
||||
This structure is initialized in the following functions:
|
||||
dtype_set()
|
||||
dtype_read_for_order_and_null_size()
|
||||
dtype_new_read_for_order_and_null_size()
|
||||
sym_tab_add_null_lit() */
|
||||
|
||||
struct dtype_struct{
|
||||
ulint mtype; /* main data type */
|
||||
ulint prtype; /* precise type; MySQL data type, charset code,
|
||||
flags to indicate nullability, signedness,
|
||||
whether this is a binary string, whether this
|
||||
is a true VARCHAR where MySQL uses 2 bytes to
|
||||
store the length */
|
||||
|
||||
/* the remaining fields do not affect alphabetical ordering: */
|
||||
|
||||
ulint len; /* length; for MySQL data this is
|
||||
field->pack_length(), except that for a
|
||||
>= 5.0.3 type true VARCHAR this is the
|
||||
maximum byte length of the string data
|
||||
(in addition to the string, MySQL uses 1 or
|
||||
2 bytes to store the string length) */
|
||||
ulint prec; /* precision */
|
||||
|
||||
ulint mbminlen; /* minimum length of a character, in bytes */
|
||||
ulint mbmaxlen; /* maximum length of a character, in bytes */
|
||||
};
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
#include "data0type.ic"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
512
storage/innobase/include/data0type.ic
Normal file
512
storage/innobase/include/data0type.ic
Normal file
|
|
@ -0,0 +1,512 @@
|
|||
/******************************************************
|
||||
Data types
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 1/16/1996 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#include "mach0data.h"
|
||||
|
||||
/**********************************************************************
|
||||
Get the variable length bounds of the given character set.
|
||||
|
||||
NOTE: the prototype of this function is copied from ha_innodb.cc! If you change
|
||||
this function, you MUST change also the prototype here! */
|
||||
extern
|
||||
void
|
||||
innobase_get_cset_width(
|
||||
/*====================*/
|
||||
ulint cset, /* in: MySQL charset-collation code */
|
||||
ulint* mbminlen, /* out: minimum length of a char (in bytes) */
|
||||
ulint* mbmaxlen); /* out: maximum length of a char (in bytes) */
|
||||
|
||||
/*************************************************************************
|
||||
Gets the MySQL charset-collation code for MySQL string types. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_charset_coll(
|
||||
/*===================*/
|
||||
ulint prtype) /* in: precise data type */
|
||||
{
|
||||
return((prtype >> 16) & 0xFFUL);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the MySQL type code from a dtype. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_mysql_type(
|
||||
/*=================*/
|
||||
/* out: MySQL type code; this is NOT an InnoDB
|
||||
type code! */
|
||||
dtype_t* type) /* in: type struct */
|
||||
{
|
||||
return(type->prtype & 0xFFUL);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Sets the mbminlen and mbmaxlen members of a data type structure. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dtype_set_mblen(
|
||||
/*============*/
|
||||
dtype_t* type) /* in/out: type struct */
|
||||
{
|
||||
ut_ad(type);
|
||||
if (dtype_is_string_type(type->mtype)) {
|
||||
innobase_get_cset_width(dtype_get_charset_coll(type->prtype),
|
||||
&type->mbminlen, &type->mbmaxlen);
|
||||
ut_ad(type->mbminlen <= type->mbmaxlen);
|
||||
} else {
|
||||
type->mbminlen = type->mbmaxlen = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Sets a data type structure. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dtype_set(
|
||||
/*======*/
|
||||
dtype_t* type, /* in: type struct to init */
|
||||
ulint mtype, /* in: main data type */
|
||||
ulint prtype, /* in: precise type */
|
||||
ulint len, /* in: length of type */
|
||||
ulint prec) /* in: precision of type */
|
||||
{
|
||||
ut_ad(type);
|
||||
ut_ad(mtype <= DATA_MTYPE_MAX);
|
||||
|
||||
type->mtype = mtype;
|
||||
type->prtype = prtype;
|
||||
type->len = len;
|
||||
type->prec = prec;
|
||||
|
||||
dtype_set_mblen(type);
|
||||
ut_ad(dtype_validate(type));
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Copies a data type structure. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dtype_copy(
|
||||
/*=======*/
|
||||
dtype_t* type1, /* in: type struct to copy to */
|
||||
dtype_t* type2) /* in: type struct to copy from */
|
||||
{
|
||||
*type1 = *type2;
|
||||
|
||||
ut_ad(dtype_validate(type1));
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the SQL main data type. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_mtype(
|
||||
/*============*/
|
||||
dtype_t* type)
|
||||
{
|
||||
ut_ad(type);
|
||||
|
||||
return(type->mtype);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the precise data type. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_prtype(
|
||||
/*=============*/
|
||||
dtype_t* type)
|
||||
{
|
||||
ut_ad(type);
|
||||
|
||||
return(type->prtype);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the type length. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_len(
|
||||
/*==========*/
|
||||
dtype_t* type)
|
||||
{
|
||||
ut_ad(type);
|
||||
|
||||
return(type->len);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the type precision. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_prec(
|
||||
/*===========*/
|
||||
dtype_t* type)
|
||||
{
|
||||
ut_ad(type);
|
||||
|
||||
return(type->prec);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the minimum length of a character, in bytes. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_mbminlen(
|
||||
/*===============*/
|
||||
/* out: minimum length of a char, in bytes,
|
||||
or 0 if this is not a character type */
|
||||
const dtype_t* type) /* in: type */
|
||||
{
|
||||
ut_ad(type);
|
||||
return(type->mbminlen);
|
||||
}
|
||||
/*************************************************************************
|
||||
Gets the maximum length of a character, in bytes. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_mbmaxlen(
|
||||
/*===============*/
|
||||
/* out: maximum length of a char, in bytes,
|
||||
or 0 if this is not a character type */
|
||||
const dtype_t* type) /* in: type */
|
||||
{
|
||||
ut_ad(type);
|
||||
return(type->mbmaxlen);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the padding character code for the type. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_pad_char(
|
||||
/*===============*/
|
||||
/* out: padding character code, or
|
||||
ULINT_UNDEFINED if no padding specified */
|
||||
dtype_t* type) /* in: type */
|
||||
{
|
||||
if (type->mtype == DATA_CHAR
|
||||
|| type->mtype == DATA_VARCHAR
|
||||
|| type->mtype == DATA_BINARY
|
||||
|| type->mtype == DATA_FIXBINARY
|
||||
|| type->mtype == DATA_MYSQL
|
||||
|| type->mtype == DATA_VARMYSQL
|
||||
|| (type->mtype == DATA_BLOB
|
||||
&& (type->prtype & DATA_BINARY_TYPE) == 0)) {
|
||||
|
||||
/* Space is the padding character for all char and binary
|
||||
strings, and starting from 5.0.3, also for TEXT strings. */
|
||||
|
||||
return((ulint)' ');
|
||||
}
|
||||
|
||||
/* No padding specified */
|
||||
|
||||
return(ULINT_UNDEFINED);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Stores for a type the information which determines its alphabetical ordering
|
||||
and the storage size of an SQL NULL value. This is the >= 4.1.x storage
|
||||
format. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dtype_new_store_for_order_and_null_size(
|
||||
/*====================================*/
|
||||
byte* buf, /* in: buffer for
|
||||
DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE
|
||||
bytes where we store the info */
|
||||
dtype_t* type) /* in: type struct */
|
||||
{
|
||||
#if 6 != DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE
|
||||
#error "6 != DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE"
|
||||
#endif
|
||||
|
||||
buf[0] = (byte)(type->mtype & 0xFFUL);
|
||||
|
||||
if (type->prtype & DATA_BINARY_TYPE) {
|
||||
buf[0] = buf[0] | 128;
|
||||
}
|
||||
|
||||
/* In versions < 4.1.2 we had: if (type->prtype & DATA_NONLATIN1) {
|
||||
buf[0] = buf[0] | 64;
|
||||
}
|
||||
*/
|
||||
|
||||
buf[1] = (byte)(type->prtype & 0xFFUL);
|
||||
|
||||
mach_write_to_2(buf + 2, type->len & 0xFFFFUL);
|
||||
|
||||
ut_ad(dtype_get_charset_coll(type->prtype) < 256);
|
||||
mach_write_to_2(buf + 4, dtype_get_charset_coll(type->prtype));
|
||||
|
||||
if (type->prtype & DATA_NOT_NULL) {
|
||||
buf[4] |= 128;
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Reads to a type the stored information which determines its alphabetical
|
||||
ordering and the storage size of an SQL NULL value. This is the < 4.1.x
|
||||
storage format. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dtype_read_for_order_and_null_size(
|
||||
/*===============================*/
|
||||
dtype_t* type, /* in: type struct */
|
||||
byte* buf) /* in: buffer for stored type order info */
|
||||
{
|
||||
ut_ad(4 == DATA_ORDER_NULL_TYPE_BUF_SIZE);
|
||||
|
||||
type->mtype = buf[0] & 63;
|
||||
type->prtype = buf[1];
|
||||
|
||||
if (buf[0] & 128) {
|
||||
type->prtype = type->prtype | DATA_BINARY_TYPE;
|
||||
}
|
||||
|
||||
type->len = mach_read_from_2(buf + 2);
|
||||
|
||||
type->prtype = dtype_form_prtype(type->prtype,
|
||||
data_mysql_default_charset_coll);
|
||||
dtype_set_mblen(type);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Reads to a type the stored information which determines its alphabetical
|
||||
ordering and the storage size of an SQL NULL value. This is the >= 4.1.x
|
||||
storage format. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dtype_new_read_for_order_and_null_size(
|
||||
/*===================================*/
|
||||
dtype_t* type, /* in: type struct */
|
||||
byte* buf) /* in: buffer for stored type order info */
|
||||
{
|
||||
ulint charset_coll;
|
||||
|
||||
#if 6 != DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE
|
||||
#error "6 != DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE"
|
||||
#endif
|
||||
|
||||
type->mtype = buf[0] & 63;
|
||||
type->prtype = buf[1];
|
||||
|
||||
if (buf[0] & 128) {
|
||||
type->prtype |= DATA_BINARY_TYPE;
|
||||
}
|
||||
|
||||
if (buf[4] & 128) {
|
||||
type->prtype |= DATA_NOT_NULL;
|
||||
}
|
||||
|
||||
type->len = mach_read_from_2(buf + 2);
|
||||
|
||||
mach_read_from_2(buf + 4);
|
||||
|
||||
charset_coll = mach_read_from_2(buf + 4) & 0x7fff;
|
||||
|
||||
if (dtype_is_string_type(type->mtype)) {
|
||||
ut_a(charset_coll < 256);
|
||||
|
||||
if (charset_coll == 0) {
|
||||
/* This insert buffer record was inserted with MySQL
|
||||
version < 4.1.2, and the charset-collation code was not
|
||||
explicitly stored to dtype->prtype at that time. It
|
||||
must be the default charset-collation of this MySQL
|
||||
installation. */
|
||||
|
||||
charset_coll = data_mysql_default_charset_coll;
|
||||
}
|
||||
|
||||
type->prtype = dtype_form_prtype(type->prtype, charset_coll);
|
||||
}
|
||||
dtype_set_mblen(type);
|
||||
}
|
||||
|
||||
#ifndef UNIV_HOTBACKUP
|
||||
/***************************************************************************
|
||||
Returns the size of a fixed size data type, 0 if not a fixed size type. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_fixed_size(
|
||||
/*=================*/
|
||||
/* out: fixed size, or 0 */
|
||||
dtype_t* type) /* in: type */
|
||||
{
|
||||
ulint mtype;
|
||||
|
||||
mtype = dtype_get_mtype(type);
|
||||
|
||||
switch (mtype) {
|
||||
case DATA_SYS:
|
||||
#ifdef UNIV_DEBUG
|
||||
switch (type->prtype & DATA_MYSQL_TYPE_MASK) {
|
||||
default:
|
||||
ut_ad(0);
|
||||
return(0);
|
||||
case DATA_ROW_ID:
|
||||
ut_ad(type->len == DATA_ROW_ID_LEN);
|
||||
break;
|
||||
case DATA_TRX_ID:
|
||||
ut_ad(type->len == DATA_TRX_ID_LEN);
|
||||
break;
|
||||
case DATA_ROLL_PTR:
|
||||
ut_ad(type->len == DATA_ROLL_PTR_LEN);
|
||||
break;
|
||||
case DATA_MIX_ID:
|
||||
ut_ad(type->len == DATA_MIX_ID_LEN);
|
||||
break;
|
||||
}
|
||||
#endif /* UNIV_DEBUG */
|
||||
case DATA_CHAR:
|
||||
case DATA_FIXBINARY:
|
||||
case DATA_INT:
|
||||
case DATA_FLOAT:
|
||||
case DATA_DOUBLE:
|
||||
return(dtype_get_len(type));
|
||||
case DATA_MYSQL:
|
||||
if (type->prtype & DATA_BINARY_TYPE) {
|
||||
return(dtype_get_len(type));
|
||||
} else {
|
||||
/* We play it safe here and ask MySQL for
|
||||
mbminlen and mbmaxlen. Although
|
||||
type->mbminlen and type->mbmaxlen are
|
||||
initialized if and only if type->prtype
|
||||
is (in one of the 3 functions in this file),
|
||||
it could be that none of these functions
|
||||
has been called. */
|
||||
|
||||
ulint mbminlen, mbmaxlen;
|
||||
|
||||
innobase_get_cset_width(
|
||||
dtype_get_charset_coll(type->prtype),
|
||||
&mbminlen, &mbmaxlen);
|
||||
|
||||
if (type->mbminlen != mbminlen
|
||||
|| type->mbmaxlen != mbmaxlen) {
|
||||
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr, " InnoDB: "
|
||||
"mbminlen=%lu, "
|
||||
"mbmaxlen=%lu, "
|
||||
"type->mbminlen=%lu, "
|
||||
"type->mbmaxlen=%lu\n",
|
||||
(ulong) mbminlen,
|
||||
(ulong) mbmaxlen,
|
||||
(ulong) type->mbminlen,
|
||||
(ulong) type->mbmaxlen);
|
||||
}
|
||||
if (mbminlen == mbmaxlen) {
|
||||
return(dtype_get_len(type));
|
||||
}
|
||||
}
|
||||
/* fall through for variable-length charsets */
|
||||
case DATA_VARCHAR:
|
||||
case DATA_BINARY:
|
||||
case DATA_DECIMAL:
|
||||
case DATA_VARMYSQL:
|
||||
case DATA_BLOB:
|
||||
return(0);
|
||||
default: ut_error;
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
Returns the size of a fixed size data type, 0 if not a fixed size type. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_min_size(
|
||||
/*===============*/
|
||||
/* out: minimum size */
|
||||
const dtype_t* type) /* in: type */
|
||||
{
|
||||
switch (type->mtype) {
|
||||
case DATA_SYS:
|
||||
#ifdef UNIV_DEBUG
|
||||
switch (type->prtype & DATA_MYSQL_TYPE_MASK) {
|
||||
default:
|
||||
ut_ad(0);
|
||||
return(0);
|
||||
case DATA_ROW_ID:
|
||||
ut_ad(type->len == DATA_ROW_ID_LEN);
|
||||
break;
|
||||
case DATA_TRX_ID:
|
||||
ut_ad(type->len == DATA_TRX_ID_LEN);
|
||||
break;
|
||||
case DATA_ROLL_PTR:
|
||||
ut_ad(type->len == DATA_ROLL_PTR_LEN);
|
||||
break;
|
||||
case DATA_MIX_ID:
|
||||
ut_ad(type->len == DATA_MIX_ID_LEN);
|
||||
break;
|
||||
}
|
||||
#endif /* UNIV_DEBUG */
|
||||
case DATA_CHAR:
|
||||
case DATA_FIXBINARY:
|
||||
case DATA_INT:
|
||||
case DATA_FLOAT:
|
||||
case DATA_DOUBLE:
|
||||
return(type->len);
|
||||
case DATA_MYSQL:
|
||||
if ((type->prtype & DATA_BINARY_TYPE)
|
||||
|| type->mbminlen == type->mbmaxlen) {
|
||||
return(type->len);
|
||||
}
|
||||
/* this is a variable-length character set */
|
||||
ut_a(type->mbminlen > 0);
|
||||
ut_a(type->mbmaxlen > type->mbminlen);
|
||||
ut_a(type->len % type->mbmaxlen == 0);
|
||||
return(type->len * type->mbminlen / type->mbmaxlen);
|
||||
case DATA_VARCHAR:
|
||||
case DATA_BINARY:
|
||||
case DATA_DECIMAL:
|
||||
case DATA_VARMYSQL:
|
||||
case DATA_BLOB:
|
||||
return(0);
|
||||
default: ut_error;
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
#endif /* !UNIV_HOTBACKUP */
|
||||
|
||||
/***************************************************************************
|
||||
Returns a stored SQL NULL size for a type. For fixed length types it is
|
||||
the fixed length of the type, otherwise 0. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dtype_get_sql_null_size(
|
||||
/*====================*/
|
||||
/* out: SQL null storage size */
|
||||
dtype_t* type) /* in: type */
|
||||
{
|
||||
return(dtype_get_fixed_size(type));
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
Returns TRUE if a type is of a fixed size. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
dtype_is_fixed_size(
|
||||
/*================*/
|
||||
/* out: TRUE if fixed size */
|
||||
dtype_t* type) /* in: type */
|
||||
{
|
||||
ulint size;
|
||||
|
||||
size = dtype_get_fixed_size(type);
|
||||
|
||||
if (size) {
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
19
storage/innobase/include/data0types.h
Normal file
19
storage/innobase/include/data0types.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/************************************************************************
|
||||
Some type definitions
|
||||
|
||||
(c) 1994-2000 Innobase Oy
|
||||
|
||||
Created 9/21/2000 Heikki Tuuri
|
||||
*************************************************************************/
|
||||
|
||||
#ifndef data0types_h
|
||||
#define data0types_h
|
||||
|
||||
/* SQL data field struct */
|
||||
typedef struct dfield_struct dfield_t;
|
||||
|
||||
/* SQL data tuple struct */
|
||||
typedef struct dtuple_struct dtuple_t;
|
||||
|
||||
#endif
|
||||
|
||||
69
storage/innobase/include/db0err.h
Normal file
69
storage/innobase/include/db0err.h
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
/******************************************************
|
||||
Global error codes for the database
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 5/24/1996 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#ifndef db0err_h
|
||||
#define db0err_h
|
||||
|
||||
|
||||
#define DB_SUCCESS 10
|
||||
|
||||
/* The following are error codes */
|
||||
#define DB_ERROR 11
|
||||
#define DB_OUT_OF_MEMORY 12
|
||||
#define DB_OUT_OF_FILE_SPACE 13
|
||||
#define DB_LOCK_WAIT 14
|
||||
#define DB_DEADLOCK 15
|
||||
#define DB_ROLLBACK 16
|
||||
#define DB_DUPLICATE_KEY 17
|
||||
#define DB_QUE_THR_SUSPENDED 18
|
||||
#define DB_MISSING_HISTORY 19 /* required history data has been
|
||||
deleted due to lack of space in
|
||||
rollback segment */
|
||||
#define DB_CLUSTER_NOT_FOUND 30
|
||||
#define DB_TABLE_NOT_FOUND 31
|
||||
#define DB_MUST_GET_MORE_FILE_SPACE 32 /* the database has to be stopped
|
||||
and restarted with more file space */
|
||||
#define DB_TABLE_IS_BEING_USED 33
|
||||
#define DB_TOO_BIG_RECORD 34 /* a record in an index would become
|
||||
bigger than 1/2 free space in a page
|
||||
frame */
|
||||
#define DB_LOCK_WAIT_TIMEOUT 35 /* lock wait lasted too long */
|
||||
#define DB_NO_REFERENCED_ROW 36 /* referenced key value not found
|
||||
for a foreign key in an insert or
|
||||
update of a row */
|
||||
#define DB_ROW_IS_REFERENCED 37 /* cannot delete or update a row
|
||||
because it contains a key value
|
||||
which is referenced */
|
||||
#define DB_CANNOT_ADD_CONSTRAINT 38 /* adding a foreign key constraint
|
||||
to a table failed */
|
||||
#define DB_CORRUPTION 39 /* data structure corruption noticed */
|
||||
#define DB_COL_APPEARS_TWICE_IN_INDEX 40 /* InnoDB cannot handle an index
|
||||
where same column appears twice */
|
||||
#define DB_CANNOT_DROP_CONSTRAINT 41 /* dropping a foreign key constraint
|
||||
from a table failed */
|
||||
#define DB_NO_SAVEPOINT 42 /* no savepoint exists with the given
|
||||
name */
|
||||
#define DB_TABLESPACE_ALREADY_EXISTS 43 /* we cannot create a new single-table
|
||||
tablespace because a file of the same
|
||||
name already exists */
|
||||
#define DB_TABLESPACE_DELETED 44 /* tablespace does not exist or is
|
||||
being dropped right now */
|
||||
#define DB_LOCK_TABLE_FULL 45 /* lock structs have exhausted the
|
||||
buffer pool (for big transactions,
|
||||
InnoDB stores the lock structs in the
|
||||
buffer pool) */
|
||||
|
||||
/* The following are partial failure codes */
|
||||
#define DB_FAIL 1000
|
||||
#define DB_OVERFLOW 1001
|
||||
#define DB_UNDERFLOW 1002
|
||||
#define DB_STRONG_FAIL 1003
|
||||
#define DB_RECORD_NOT_FOUND 1500
|
||||
#define DB_END_OF_INDEX 1501
|
||||
|
||||
#endif
|
||||
133
storage/innobase/include/dict0boot.h
Normal file
133
storage/innobase/include/dict0boot.h
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
/******************************************************
|
||||
Data dictionary creation and booting
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 4/18/1996 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#ifndef dict0boot_h
|
||||
#define dict0boot_h
|
||||
|
||||
#include "univ.i"
|
||||
|
||||
#include "mtr0mtr.h"
|
||||
#include "mtr0log.h"
|
||||
#include "ut0byte.h"
|
||||
#include "buf0buf.h"
|
||||
#include "fsp0fsp.h"
|
||||
#include "dict0dict.h"
|
||||
|
||||
typedef byte dict_hdr_t;
|
||||
|
||||
/**************************************************************************
|
||||
Gets a pointer to the dictionary header and x-latches its page. */
|
||||
|
||||
dict_hdr_t*
|
||||
dict_hdr_get(
|
||||
/*=========*/
|
||||
/* out: pointer to the dictionary header,
|
||||
page x-latched */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/**************************************************************************
|
||||
Returns a new row, table, index, or tree id. */
|
||||
|
||||
dulint
|
||||
dict_hdr_get_new_id(
|
||||
/*================*/
|
||||
/* out: the new id */
|
||||
ulint type); /* in: DICT_HDR_ROW_ID, ... */
|
||||
/**************************************************************************
|
||||
Returns a new row id. */
|
||||
UNIV_INLINE
|
||||
dulint
|
||||
dict_sys_get_new_row_id(void);
|
||||
/*=========================*/
|
||||
/* out: the new id */
|
||||
/**************************************************************************
|
||||
Reads a row id from a record or other 6-byte stored form. */
|
||||
UNIV_INLINE
|
||||
dulint
|
||||
dict_sys_read_row_id(
|
||||
/*=================*/
|
||||
/* out: row id */
|
||||
byte* field); /* in: record field */
|
||||
/**************************************************************************
|
||||
Writes a row id to a record or other 6-byte stored form. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dict_sys_write_row_id(
|
||||
/*==================*/
|
||||
byte* field, /* in: record field */
|
||||
dulint row_id);/* in: row id */
|
||||
/*********************************************************************
|
||||
Initializes the data dictionary memory structures when the database is
|
||||
started. This function is also called when the data dictionary is created. */
|
||||
|
||||
void
|
||||
dict_boot(void);
|
||||
/*===========*/
|
||||
/*********************************************************************
|
||||
Creates and initializes the data dictionary at the database creation. */
|
||||
|
||||
void
|
||||
dict_create(void);
|
||||
/*=============*/
|
||||
|
||||
|
||||
/* Space id and page no where the dictionary header resides */
|
||||
#define DICT_HDR_SPACE 0 /* the SYSTEM tablespace */
|
||||
#define DICT_HDR_PAGE_NO FSP_DICT_HDR_PAGE_NO
|
||||
|
||||
/* The ids for the basic system tables and their indexes */
|
||||
#define DICT_TABLES_ID ut_dulint_create(0, 1)
|
||||
#define DICT_COLUMNS_ID ut_dulint_create(0, 2)
|
||||
#define DICT_INDEXES_ID ut_dulint_create(0, 3)
|
||||
#define DICT_FIELDS_ID ut_dulint_create(0, 4)
|
||||
/* The following is a secondary index on SYS_TABLES */
|
||||
#define DICT_TABLE_IDS_ID ut_dulint_create(0, 5)
|
||||
|
||||
#define DICT_HDR_FIRST_ID 10 /* the ids for tables etc. start
|
||||
from this number, except for basic
|
||||
system tables and their above defined
|
||||
indexes; ibuf tables and indexes are
|
||||
assigned as the id the number
|
||||
DICT_IBUF_ID_MIN plus the space id */
|
||||
#define DICT_IBUF_ID_MIN ut_dulint_create(0xFFFFFFFFUL, 0)
|
||||
|
||||
/* The offset of the dictionary header on the page */
|
||||
#define DICT_HDR FSEG_PAGE_DATA
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/* Dictionary header offsets */
|
||||
#define DICT_HDR_ROW_ID 0 /* The latest assigned row id */
|
||||
#define DICT_HDR_TABLE_ID 8 /* The latest assigned table id */
|
||||
#define DICT_HDR_INDEX_ID 16 /* The latest assigned index id */
|
||||
#define DICT_HDR_MIX_ID 24 /* The latest assigned mix id */
|
||||
#define DICT_HDR_TABLES 32 /* Root of the table index tree */
|
||||
#define DICT_HDR_TABLE_IDS 36 /* Root of the table index tree */
|
||||
#define DICT_HDR_COLUMNS 40 /* Root of the column index tree */
|
||||
#define DICT_HDR_INDEXES 44 /* Root of the index index tree */
|
||||
#define DICT_HDR_FIELDS 48 /* Root of the index field index tree */
|
||||
|
||||
#define DICT_HDR_FSEG_HEADER 56 /* Segment header for the tablespace
|
||||
segment into which the dictionary
|
||||
header is created */
|
||||
/*-------------------------------------------------------------*/
|
||||
|
||||
/* The field number of the page number field in the sys_indexes table
|
||||
clustered index */
|
||||
#define DICT_SYS_INDEXES_PAGE_NO_FIELD 8
|
||||
#define DICT_SYS_INDEXES_SPACE_NO_FIELD 7
|
||||
#define DICT_SYS_INDEXES_TYPE_FIELD 6
|
||||
|
||||
/* When a row id which is zero modulo this number (which must be a power of
|
||||
two) is assigned, the field DICT_HDR_ROW_ID on the dictionary header page is
|
||||
updated */
|
||||
#define DICT_HDR_ROW_ID_WRITE_MARGIN 256
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
#include "dict0boot.ic"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
72
storage/innobase/include/dict0boot.ic
Normal file
72
storage/innobase/include/dict0boot.ic
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
/******************************************************
|
||||
Data dictionary creation and booting
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 4/18/1996 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
Writes the current value of the row id counter to the dictionary header file
|
||||
page. */
|
||||
|
||||
void
|
||||
dict_hdr_flush_row_id(void);
|
||||
/*=======================*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
Returns a new row id. */
|
||||
UNIV_INLINE
|
||||
dulint
|
||||
dict_sys_get_new_row_id(void)
|
||||
/*=========================*/
|
||||
/* out: the new id */
|
||||
{
|
||||
dulint id;
|
||||
|
||||
mutex_enter(&(dict_sys->mutex));
|
||||
|
||||
id = dict_sys->row_id;
|
||||
|
||||
if (0 == (ut_dulint_get_low(id) % DICT_HDR_ROW_ID_WRITE_MARGIN)) {
|
||||
|
||||
dict_hdr_flush_row_id();
|
||||
}
|
||||
|
||||
UT_DULINT_INC(dict_sys->row_id);
|
||||
|
||||
mutex_exit(&(dict_sys->mutex));
|
||||
|
||||
return(id);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Reads a row id from a record or other 6-byte stored form. */
|
||||
UNIV_INLINE
|
||||
dulint
|
||||
dict_sys_read_row_id(
|
||||
/*=================*/
|
||||
/* out: row id */
|
||||
byte* field) /* in: record field */
|
||||
{
|
||||
ut_ad(DATA_ROW_ID_LEN == 6);
|
||||
|
||||
return(mach_read_from_6(field));
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Writes a row id to a record or other 6-byte stored form. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dict_sys_write_row_id(
|
||||
/*==================*/
|
||||
byte* field, /* in: record field */
|
||||
dulint row_id) /* in: row id */
|
||||
{
|
||||
ut_ad(DATA_ROW_ID_LEN == 6);
|
||||
|
||||
mach_write_to_6(field, row_id);
|
||||
}
|
||||
|
||||
|
||||
177
storage/innobase/include/dict0crea.h
Normal file
177
storage/innobase/include/dict0crea.h
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
/******************************************************
|
||||
Database object creation
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 1/8/1996 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#ifndef dict0crea_h
|
||||
#define dict0crea_h
|
||||
|
||||
#include "univ.i"
|
||||
#include "dict0types.h"
|
||||
#include "dict0dict.h"
|
||||
#include "que0types.h"
|
||||
#include "row0types.h"
|
||||
#include "mtr0mtr.h"
|
||||
|
||||
/*************************************************************************
|
||||
Creates a table create graph. */
|
||||
|
||||
tab_node_t*
|
||||
tab_create_graph_create(
|
||||
/*====================*/
|
||||
/* out, own: table create node */
|
||||
dict_table_t* table, /* in: table to create, built as a memory data
|
||||
structure */
|
||||
mem_heap_t* heap); /* in: heap where created */
|
||||
/*************************************************************************
|
||||
Creates an index create graph. */
|
||||
|
||||
ind_node_t*
|
||||
ind_create_graph_create(
|
||||
/*====================*/
|
||||
/* out, own: index create node */
|
||||
dict_index_t* index, /* in: index to create, built as a memory data
|
||||
structure */
|
||||
mem_heap_t* heap); /* in: heap where created */
|
||||
/***************************************************************
|
||||
Creates a table. This is a high-level function used in SQL execution graphs. */
|
||||
|
||||
que_thr_t*
|
||||
dict_create_table_step(
|
||||
/*===================*/
|
||||
/* out: query thread to run next or NULL */
|
||||
que_thr_t* thr); /* in: query thread */
|
||||
/***************************************************************
|
||||
Creates an index. This is a high-level function used in SQL execution
|
||||
graphs. */
|
||||
|
||||
que_thr_t*
|
||||
dict_create_index_step(
|
||||
/*===================*/
|
||||
/* out: query thread to run next or NULL */
|
||||
que_thr_t* thr); /* in: query thread */
|
||||
/***********************************************************************
|
||||
Truncates the index tree associated with a row in SYS_INDEXES table. */
|
||||
|
||||
ulint
|
||||
dict_truncate_index_tree(
|
||||
/*=====================*/
|
||||
/* out: new root page number, or
|
||||
FIL_NULL on failure */
|
||||
dict_table_t* table, /* in: the table the index belongs to */
|
||||
rec_t* rec, /* in: record in the clustered index of
|
||||
SYS_INDEXES table */
|
||||
mtr_t* mtr); /* in: mtr having the latch
|
||||
on the record page. The mtr may be
|
||||
committed and restarted in this call. */
|
||||
/***********************************************************************
|
||||
Drops the index tree associated with a row in SYS_INDEXES table. */
|
||||
|
||||
void
|
||||
dict_drop_index_tree(
|
||||
/*=================*/
|
||||
rec_t* rec, /* in: record in the clustered index of SYS_INDEXES
|
||||
table */
|
||||
mtr_t* mtr); /* in: mtr having the latch on the record page */
|
||||
/********************************************************************
|
||||
Creates the foreign key constraints system tables inside InnoDB
|
||||
at database creation or database start if they are not found or are
|
||||
not of the right form. */
|
||||
|
||||
ulint
|
||||
dict_create_or_check_foreign_constraint_tables(void);
|
||||
/*================================================*/
|
||||
/* out: DB_SUCCESS or error code */
|
||||
/************************************************************************
|
||||
Adds foreign key definitions to data dictionary tables in the database. We
|
||||
look at table->foreign_list, and also generate names to constraints that were
|
||||
not named by the user. A generated constraint has a name of the format
|
||||
databasename/tablename_ibfk_<number>, where the numbers start from 1, and are
|
||||
given locally for this table, that is, the number is not global, as in the
|
||||
old format constraints < 4.0.18 it used to be. */
|
||||
|
||||
ulint
|
||||
dict_create_add_foreigns_to_dictionary(
|
||||
/*===================================*/
|
||||
/* out: error code or DB_SUCCESS */
|
||||
ulint start_id,/* in: if we are actually doing ALTER TABLE
|
||||
ADD CONSTRAINT, we want to generate constraint
|
||||
numbers which are bigger than in the table so
|
||||
far; we number the constraints from
|
||||
start_id + 1 up; start_id should be set to 0 if
|
||||
we are creating a new table, or if the table
|
||||
so far has no constraints for which the name
|
||||
was generated here */
|
||||
dict_table_t* table, /* in: table */
|
||||
trx_t* trx); /* in: transaction */
|
||||
|
||||
|
||||
/* Table create node structure */
|
||||
|
||||
struct tab_node_struct{
|
||||
que_common_t common; /* node type: QUE_NODE_TABLE_CREATE */
|
||||
dict_table_t* table; /* table to create, built as a memory data
|
||||
structure with dict_mem_... functions */
|
||||
ins_node_t* tab_def; /* child node which does the insert of
|
||||
the table definition; the row to be inserted
|
||||
is built by the parent node */
|
||||
ins_node_t* col_def; /* child node which does the inserts of
|
||||
the column definitions; the row to be inserted
|
||||
is built by the parent node */
|
||||
commit_node_t* commit_node;
|
||||
/* child node which performs a commit after
|
||||
a successful table creation */
|
||||
/*----------------------*/
|
||||
/* Local storage for this graph node */
|
||||
ulint state; /* node execution state */
|
||||
ulint col_no; /* next column definition to insert */
|
||||
mem_heap_t* heap; /* memory heap used as auxiliary storage */
|
||||
};
|
||||
|
||||
/* Table create node states */
|
||||
#define TABLE_BUILD_TABLE_DEF 1
|
||||
#define TABLE_BUILD_COL_DEF 2
|
||||
#define TABLE_COMMIT_WORK 3
|
||||
#define TABLE_ADD_TO_CACHE 4
|
||||
#define TABLE_COMPLETED 5
|
||||
|
||||
/* Index create node struct */
|
||||
|
||||
struct ind_node_struct{
|
||||
que_common_t common; /* node type: QUE_NODE_INDEX_CREATE */
|
||||
dict_index_t* index; /* index to create, built as a memory data
|
||||
structure with dict_mem_... functions */
|
||||
ins_node_t* ind_def; /* child node which does the insert of
|
||||
the index definition; the row to be inserted
|
||||
is built by the parent node */
|
||||
ins_node_t* field_def; /* child node which does the inserts of
|
||||
the field definitions; the row to be inserted
|
||||
is built by the parent node */
|
||||
commit_node_t* commit_node;
|
||||
/* child node which performs a commit after
|
||||
a successful index creation */
|
||||
/*----------------------*/
|
||||
/* Local storage for this graph node */
|
||||
ulint state; /* node execution state */
|
||||
ulint page_no;/* root page number of the index */
|
||||
dict_table_t* table; /* table which owns the index */
|
||||
dtuple_t* ind_row;/* index definition row built */
|
||||
ulint field_no;/* next field definition to insert */
|
||||
mem_heap_t* heap; /* memory heap used as auxiliary storage */
|
||||
};
|
||||
|
||||
/* Index create node states */
|
||||
#define INDEX_BUILD_INDEX_DEF 1
|
||||
#define INDEX_BUILD_FIELD_DEF 2
|
||||
#define INDEX_CREATE_INDEX_TREE 3
|
||||
#define INDEX_COMMIT_WORK 4
|
||||
#define INDEX_ADD_TO_CACHE 5
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
#include "dict0crea.ic"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
8
storage/innobase/include/dict0crea.ic
Normal file
8
storage/innobase/include/dict0crea.ic
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
/******************************************************
|
||||
Database object creation
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 1/8/1996 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
951
storage/innobase/include/dict0dict.h
Normal file
951
storage/innobase/include/dict0dict.h
Normal file
|
|
@ -0,0 +1,951 @@
|
|||
/******************************************************
|
||||
Data dictionary system
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 1/8/1996 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#ifndef dict0dict_h
|
||||
#define dict0dict_h
|
||||
|
||||
#include "univ.i"
|
||||
#include "dict0types.h"
|
||||
#include "dict0mem.h"
|
||||
#include "data0type.h"
|
||||
#include "data0data.h"
|
||||
#include "sync0sync.h"
|
||||
#include "sync0rw.h"
|
||||
#include "mem0mem.h"
|
||||
#include "rem0types.h"
|
||||
#include "btr0types.h"
|
||||
#include "ut0mem.h"
|
||||
#include "ut0lst.h"
|
||||
#include "hash0hash.h"
|
||||
#include "ut0rnd.h"
|
||||
#include "ut0byte.h"
|
||||
#include "trx0types.h"
|
||||
|
||||
/************************************************************************
|
||||
Get the database name length in a table name. */
|
||||
|
||||
ulint
|
||||
dict_get_db_name_len(
|
||||
/*=================*/
|
||||
/* out: database name length */
|
||||
const char* name); /* in: table name in the form
|
||||
dbname '/' tablename */
|
||||
/*************************************************************************
|
||||
Accepts a specified string. Comparisons are case-insensitive. */
|
||||
|
||||
const char*
|
||||
dict_accept(
|
||||
/*========*/
|
||||
/* out: if string was accepted, the pointer
|
||||
is moved after that, else ptr is returned */
|
||||
const char* ptr, /* in: scan from this */
|
||||
const char* string, /* in: accept only this string as the next
|
||||
non-whitespace string */
|
||||
ibool* success);/* out: TRUE if accepted */
|
||||
/************************************************************************
|
||||
Decrements the count of open MySQL handles to a table. */
|
||||
|
||||
void
|
||||
dict_table_decrement_handle_count(
|
||||
/*==============================*/
|
||||
dict_table_t* table); /* in: table */
|
||||
/**************************************************************************
|
||||
Inits the data dictionary module. */
|
||||
|
||||
void
|
||||
dict_init(void);
|
||||
/*===========*/
|
||||
/************************************************************************
|
||||
Gets the space id of every table of the data dictionary and makes a linear
|
||||
list and a hash table of them to the data dictionary cache. This function
|
||||
can be called at database startup if we did not need to do a crash recovery.
|
||||
In crash recovery we must scan the space id's from the .ibd files in MySQL
|
||||
database directories. */
|
||||
|
||||
void
|
||||
dict_load_space_id_list(void);
|
||||
/*=========================*/
|
||||
/*************************************************************************
|
||||
Gets the column data type. */
|
||||
UNIV_INLINE
|
||||
dtype_t*
|
||||
dict_col_get_type(
|
||||
/*==============*/
|
||||
dict_col_t* col);
|
||||
/*************************************************************************
|
||||
Gets the column number. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_col_get_no(
|
||||
/*============*/
|
||||
dict_col_t* col);
|
||||
/*************************************************************************
|
||||
Gets the column position in the clustered index. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_col_get_clust_pos(
|
||||
/*===================*/
|
||||
dict_col_t* col);
|
||||
/************************************************************************
|
||||
Initializes the autoinc counter. It is not an error to initialize an already
|
||||
initialized counter. */
|
||||
|
||||
void
|
||||
dict_table_autoinc_initialize(
|
||||
/*==========================*/
|
||||
dict_table_t* table, /* in: table */
|
||||
ib_longlong value); /* in: next value to assign to a row */
|
||||
/************************************************************************
|
||||
Gets the next autoinc value (== autoinc counter value), 0 if not yet
|
||||
initialized. If initialized, increments the counter by 1. */
|
||||
|
||||
ib_longlong
|
||||
dict_table_autoinc_get(
|
||||
/*===================*/
|
||||
/* out: value for a new row, or 0 */
|
||||
dict_table_t* table); /* in: table */
|
||||
/************************************************************************
|
||||
Decrements the autoinc counter value by 1. */
|
||||
|
||||
void
|
||||
dict_table_autoinc_decrement(
|
||||
/*=========================*/
|
||||
dict_table_t* table); /* in: table */
|
||||
/************************************************************************
|
||||
Reads the next autoinc value (== autoinc counter value), 0 if not yet
|
||||
initialized. */
|
||||
|
||||
ib_longlong
|
||||
dict_table_autoinc_read(
|
||||
/*====================*/
|
||||
/* out: value for a new row, or 0 */
|
||||
dict_table_t* table); /* in: table */
|
||||
/************************************************************************
|
||||
Peeks the autoinc counter value, 0 if not yet initialized. Does not
|
||||
increment the counter. The read not protected by any mutex! */
|
||||
|
||||
ib_longlong
|
||||
dict_table_autoinc_peek(
|
||||
/*====================*/
|
||||
/* out: value of the counter */
|
||||
dict_table_t* table); /* in: table */
|
||||
/************************************************************************
|
||||
Updates the autoinc counter if the value supplied is equal or bigger than the
|
||||
current value. If not inited, does nothing. */
|
||||
|
||||
void
|
||||
dict_table_autoinc_update(
|
||||
/*======================*/
|
||||
|
||||
dict_table_t* table, /* in: table */
|
||||
ib_longlong value); /* in: value which was assigned to a row */
|
||||
/**************************************************************************
|
||||
Adds a table object to the dictionary cache. */
|
||||
|
||||
void
|
||||
dict_table_add_to_cache(
|
||||
/*====================*/
|
||||
dict_table_t* table); /* in: table */
|
||||
/**************************************************************************
|
||||
Removes a table object from the dictionary cache. */
|
||||
|
||||
void
|
||||
dict_table_remove_from_cache(
|
||||
/*=========================*/
|
||||
dict_table_t* table); /* in, own: table */
|
||||
/**************************************************************************
|
||||
Renames a table object. */
|
||||
|
||||
ibool
|
||||
dict_table_rename_in_cache(
|
||||
/*=======================*/
|
||||
/* out: TRUE if success */
|
||||
dict_table_t* table, /* in: table */
|
||||
const char* new_name, /* in: new name */
|
||||
ibool rename_also_foreigns);/* in: in ALTER TABLE we want
|
||||
to preserve the original table name
|
||||
in constraints which reference it */
|
||||
/**************************************************************************
|
||||
Change the id of a table object in the dictionary cache. This is used in
|
||||
DISCARD TABLESPACE. */
|
||||
|
||||
void
|
||||
dict_table_change_id_in_cache(
|
||||
/*==========================*/
|
||||
dict_table_t* table, /* in: table object already in cache */
|
||||
dulint new_id);/* in: new id to set */
|
||||
/**************************************************************************
|
||||
Adds a foreign key constraint object to the dictionary cache. May free
|
||||
the object if there already is an object with the same identifier in.
|
||||
At least one of foreign table or referenced table must already be in
|
||||
the dictionary cache! */
|
||||
|
||||
ulint
|
||||
dict_foreign_add_to_cache(
|
||||
/*======================*/
|
||||
/* out: DB_SUCCESS or error code */
|
||||
dict_foreign_t* foreign); /* in, own: foreign key constraint */
|
||||
/*************************************************************************
|
||||
Checks if a table is referenced by foreign keys. */
|
||||
|
||||
ibool
|
||||
dict_table_referenced_by_foreign_key(
|
||||
/*=================================*/
|
||||
/* out: TRUE if table is referenced by a
|
||||
foreign key */
|
||||
dict_table_t* table); /* in: InnoDB table */
|
||||
/*************************************************************************
|
||||
Scans a table create SQL string and adds to the data dictionary
|
||||
the foreign key constraints declared in the string. This function
|
||||
should be called after the indexes for a table have been created.
|
||||
Each foreign key constraint must be accompanied with indexes in
|
||||
bot participating tables. The indexes are allowed to contain more
|
||||
fields than mentioned in the constraint. */
|
||||
|
||||
ulint
|
||||
dict_create_foreign_constraints(
|
||||
/*============================*/
|
||||
/* out: error code or DB_SUCCESS */
|
||||
trx_t* trx, /* in: transaction */
|
||||
const char* sql_string, /* in: table create statement where
|
||||
foreign keys are declared like:
|
||||
FOREIGN KEY (a, b) REFERENCES
|
||||
table2(c, d), table2 can be written
|
||||
also with the database
|
||||
name before it: test.table2; the
|
||||
default database id the database of
|
||||
parameter name */
|
||||
const char* name); /* in: table full name in the
|
||||
normalized form
|
||||
database_name/table_name */
|
||||
/**************************************************************************
|
||||
Parses the CONSTRAINT id's to be dropped in an ALTER TABLE statement. */
|
||||
|
||||
ulint
|
||||
dict_foreign_parse_drop_constraints(
|
||||
/*================================*/
|
||||
/* out: DB_SUCCESS or
|
||||
DB_CANNOT_DROP_CONSTRAINT if
|
||||
syntax error or the constraint
|
||||
id does not match */
|
||||
mem_heap_t* heap, /* in: heap from which we can
|
||||
allocate memory */
|
||||
trx_t* trx, /* in: transaction */
|
||||
dict_table_t* table, /* in: table */
|
||||
ulint* n, /* out: number of constraints
|
||||
to drop */
|
||||
const char*** constraints_to_drop); /* out: id's of the
|
||||
constraints to drop */
|
||||
/**************************************************************************
|
||||
Returns a table object and memoryfixes it. NOTE! This is a high-level
|
||||
function to be used mainly from outside the 'dict' directory. Inside this
|
||||
directory dict_table_get_low is usually the appropriate function. */
|
||||
|
||||
dict_table_t*
|
||||
dict_table_get(
|
||||
/*===========*/
|
||||
/* out: table, NULL if
|
||||
does not exist */
|
||||
const char* table_name, /* in: table name */
|
||||
trx_t* trx); /* in: transaction handle */
|
||||
/**************************************************************************
|
||||
Returns a table object and increments MySQL open handle count on the table.
|
||||
*/
|
||||
|
||||
dict_table_t*
|
||||
dict_table_get_and_increment_handle_count(
|
||||
/*======================================*/
|
||||
/* out: table, NULL if
|
||||
does not exist */
|
||||
const char* table_name, /* in: table name */
|
||||
trx_t* trx); /* in: transaction handle or NULL */
|
||||
/**************************************************************************
|
||||
Returns a table object, based on table id, and memoryfixes it. */
|
||||
|
||||
dict_table_t*
|
||||
dict_table_get_on_id(
|
||||
/*=================*/
|
||||
/* out: table, NULL if does not exist */
|
||||
dulint table_id, /* in: table id */
|
||||
trx_t* trx); /* in: transaction handle */
|
||||
/**************************************************************************
|
||||
Returns a table object, based on table id, and memoryfixes it. */
|
||||
UNIV_INLINE
|
||||
dict_table_t*
|
||||
dict_table_get_on_id_low(
|
||||
/*=====================*/
|
||||
/* out: table, NULL if does not exist */
|
||||
dulint table_id, /* in: table id */
|
||||
trx_t* trx); /* in: transaction handle */
|
||||
/**************************************************************************
|
||||
Releases a table from being memoryfixed. Currently this has no relevance. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dict_table_release(
|
||||
/*===============*/
|
||||
dict_table_t* table); /* in: table to be released */
|
||||
/**************************************************************************
|
||||
Checks if a table is in the dictionary cache. */
|
||||
UNIV_INLINE
|
||||
dict_table_t*
|
||||
dict_table_check_if_in_cache_low(
|
||||
/*==============================*/
|
||||
/* out: table, NULL if not found */
|
||||
const char* table_name); /* in: table name */
|
||||
/**************************************************************************
|
||||
Gets a table; loads it to the dictionary cache if necessary. A low-level
|
||||
function. */
|
||||
UNIV_INLINE
|
||||
dict_table_t*
|
||||
dict_table_get_low(
|
||||
/*===============*/
|
||||
/* out: table, NULL if not found */
|
||||
const char* table_name); /* in: table name */
|
||||
/**************************************************************************
|
||||
Returns an index object. */
|
||||
UNIV_INLINE
|
||||
dict_index_t*
|
||||
dict_table_get_index(
|
||||
/*=================*/
|
||||
/* out: index, NULL if does not exist */
|
||||
dict_table_t* table, /* in: table */
|
||||
const char* name); /* in: index name */
|
||||
/**************************************************************************
|
||||
Returns an index object. */
|
||||
|
||||
dict_index_t*
|
||||
dict_table_get_index_noninline(
|
||||
/*===========================*/
|
||||
/* out: index, NULL if does not exist */
|
||||
dict_table_t* table, /* in: table */
|
||||
const char* name); /* in: index name */
|
||||
/**************************************************************************
|
||||
Prints a table definition. */
|
||||
|
||||
void
|
||||
dict_table_print(
|
||||
/*=============*/
|
||||
dict_table_t* table); /* in: table */
|
||||
/**************************************************************************
|
||||
Prints a table data. */
|
||||
|
||||
void
|
||||
dict_table_print_low(
|
||||
/*=================*/
|
||||
dict_table_t* table); /* in: table */
|
||||
/**************************************************************************
|
||||
Prints a table data when we know the table name. */
|
||||
|
||||
void
|
||||
dict_table_print_by_name(
|
||||
/*=====================*/
|
||||
const char* name);
|
||||
/**************************************************************************
|
||||
Outputs info on foreign keys of a table. */
|
||||
|
||||
void
|
||||
dict_print_info_on_foreign_keys(
|
||||
/*============================*/
|
||||
ibool create_table_format, /* in: if TRUE then print in
|
||||
a format suitable to be inserted into
|
||||
a CREATE TABLE, otherwise in the format
|
||||
of SHOW TABLE STATUS */
|
||||
FILE* file, /* in: file where to print */
|
||||
trx_t* trx, /* in: transaction */
|
||||
dict_table_t* table); /* in: table */
|
||||
/**************************************************************************
|
||||
Outputs info on a foreign key of a table in a format suitable for
|
||||
CREATE TABLE. */
|
||||
void
|
||||
dict_print_info_on_foreign_key_in_create_format(
|
||||
/*============================================*/
|
||||
FILE* file, /* in: file where to print */
|
||||
trx_t* trx, /* in: transaction */
|
||||
dict_foreign_t* foreign);/* in: foreign key constraint */
|
||||
/************************************************************************
|
||||
Displays the names of the index and the table. */
|
||||
void
|
||||
dict_index_name_print(
|
||||
/*==================*/
|
||||
FILE* file, /* in: output stream */
|
||||
trx_t* trx, /* in: transaction */
|
||||
const dict_index_t* index); /* in: index to print */
|
||||
/************************************************************************
|
||||
Gets the first index on the table (the clustered index). */
|
||||
UNIV_INLINE
|
||||
dict_index_t*
|
||||
dict_table_get_first_index(
|
||||
/*=======================*/
|
||||
/* out: index, NULL if none exists */
|
||||
dict_table_t* table); /* in: table */
|
||||
/************************************************************************
|
||||
Gets the first index on the table (the clustered index). */
|
||||
|
||||
dict_index_t*
|
||||
dict_table_get_first_index_noninline(
|
||||
/*=================================*/
|
||||
/* out: index, NULL if none exists */
|
||||
dict_table_t* table); /* in: table */
|
||||
/************************************************************************
|
||||
Gets the next index on the table. */
|
||||
UNIV_INLINE
|
||||
dict_index_t*
|
||||
dict_table_get_next_index(
|
||||
/*======================*/
|
||||
/* out: index, NULL if none left */
|
||||
dict_index_t* index); /* in: index */
|
||||
/************************************************************************
|
||||
Gets the next index on the table. */
|
||||
|
||||
dict_index_t*
|
||||
dict_table_get_next_index_noninline(
|
||||
/*================================*/
|
||||
/* out: index, NULL if none left */
|
||||
dict_index_t* index); /* in: index */
|
||||
/************************************************************************
|
||||
Gets the number of user-defined columns in a table in the dictionary
|
||||
cache. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_table_get_n_user_cols(
|
||||
/*=======================*/
|
||||
/* out: number of user-defined (e.g., not
|
||||
ROW_ID) columns of a table */
|
||||
dict_table_t* table); /* in: table */
|
||||
/************************************************************************
|
||||
Gets the number of system columns in a table in the dictionary cache. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_table_get_n_sys_cols(
|
||||
/*======================*/
|
||||
/* out: number of system (e.g.,
|
||||
ROW_ID) columns of a table */
|
||||
dict_table_t* table); /* in: table */
|
||||
/************************************************************************
|
||||
Gets the number of all columns (also system) in a table in the dictionary
|
||||
cache. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_table_get_n_cols(
|
||||
/*==================*/
|
||||
/* out: number of columns of a table */
|
||||
dict_table_t* table); /* in: table */
|
||||
/************************************************************************
|
||||
Gets the nth column of a table. */
|
||||
UNIV_INLINE
|
||||
dict_col_t*
|
||||
dict_table_get_nth_col(
|
||||
/*===================*/
|
||||
/* out: pointer to column object */
|
||||
dict_table_t* table, /* in: table */
|
||||
ulint pos); /* in: position of column */
|
||||
/************************************************************************
|
||||
Gets the nth column of a table. */
|
||||
|
||||
dict_col_t*
|
||||
dict_table_get_nth_col_noninline(
|
||||
/*=============================*/
|
||||
/* out: pointer to column object */
|
||||
dict_table_t* table, /* in: table */
|
||||
ulint pos); /* in: position of column */
|
||||
/************************************************************************
|
||||
Gets the given system column of a table. */
|
||||
UNIV_INLINE
|
||||
dict_col_t*
|
||||
dict_table_get_sys_col(
|
||||
/*===================*/
|
||||
/* out: pointer to column object */
|
||||
dict_table_t* table, /* in: table */
|
||||
ulint sys); /* in: DATA_ROW_ID, ... */
|
||||
/************************************************************************
|
||||
Gets the given system column number of a table. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_table_get_sys_col_no(
|
||||
/*======================*/
|
||||
/* out: column number */
|
||||
dict_table_t* table, /* in: table */
|
||||
ulint sys); /* in: DATA_ROW_ID, ... */
|
||||
/************************************************************************
|
||||
Checks if a column is in the ordering columns of the clustered index of a
|
||||
table. Column prefixes are treated like whole columns. */
|
||||
|
||||
ibool
|
||||
dict_table_col_in_clustered_key(
|
||||
/*============================*/
|
||||
/* out: TRUE if the column, or its prefix, is
|
||||
in the clustered key */
|
||||
dict_table_t* table, /* in: table */
|
||||
ulint n); /* in: column number */
|
||||
/***********************************************************************
|
||||
Copies types of columns contained in table to tuple. */
|
||||
|
||||
void
|
||||
dict_table_copy_types(
|
||||
/*==================*/
|
||||
dtuple_t* tuple, /* in: data tuple */
|
||||
dict_table_t* table); /* in: index */
|
||||
/**************************************************************************
|
||||
Looks for an index with the given id. NOTE that we do not reserve
|
||||
the dictionary mutex: this function is for emergency purposes like
|
||||
printing info of a corrupt database page! */
|
||||
|
||||
dict_index_t*
|
||||
dict_index_find_on_id_low(
|
||||
/*======================*/
|
||||
/* out: index or NULL if not found from cache */
|
||||
dulint id); /* in: index id */
|
||||
/**************************************************************************
|
||||
Adds an index to dictionary cache. */
|
||||
|
||||
ibool
|
||||
dict_index_add_to_cache(
|
||||
/*====================*/
|
||||
/* out: TRUE if success */
|
||||
dict_table_t* table, /* in: table on which the index is */
|
||||
dict_index_t* index, /* in, own: index; NOTE! The index memory
|
||||
object is freed in this function! */
|
||||
ulint page_no);/* in: root page number of the index */
|
||||
/************************************************************************
|
||||
Gets the number of fields in the internal representation of an index,
|
||||
including fields added by the dictionary system. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_index_get_n_fields(
|
||||
/*====================*/
|
||||
/* out: number of fields */
|
||||
dict_index_t* index); /* in: an internal representation of index
|
||||
(in the dictionary cache) */
|
||||
/************************************************************************
|
||||
Gets the number of fields in the internal representation of an index
|
||||
that uniquely determine the position of an index entry in the index, if
|
||||
we do not take multiversioning into account: in the B-tree use the value
|
||||
returned by dict_index_get_n_unique_in_tree. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_index_get_n_unique(
|
||||
/*====================*/
|
||||
/* out: number of fields */
|
||||
dict_index_t* index); /* in: an internal representation of index
|
||||
(in the dictionary cache) */
|
||||
/************************************************************************
|
||||
Gets the number of fields in the internal representation of an index
|
||||
which uniquely determine the position of an index entry in the index, if
|
||||
we also take multiversioning into account. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_index_get_n_unique_in_tree(
|
||||
/*============================*/
|
||||
/* out: number of fields */
|
||||
dict_index_t* index); /* in: an internal representation of index
|
||||
(in the dictionary cache) */
|
||||
/************************************************************************
|
||||
Gets the number of user-defined ordering fields in the index. In the internal
|
||||
representation we add the row id to the ordering fields to make all indexes
|
||||
unique, but this function returns the number of fields the user defined
|
||||
in the index as ordering fields. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_index_get_n_ordering_defined_by_user(
|
||||
/*======================================*/
|
||||
/* out: number of fields */
|
||||
dict_index_t* index); /* in: an internal representation of index
|
||||
(in the dictionary cache) */
|
||||
/************************************************************************
|
||||
Gets the nth field of an index. */
|
||||
UNIV_INLINE
|
||||
dict_field_t*
|
||||
dict_index_get_nth_field(
|
||||
/*=====================*/
|
||||
/* out: pointer to field object */
|
||||
dict_index_t* index, /* in: index */
|
||||
ulint pos); /* in: position of field */
|
||||
/************************************************************************
|
||||
Gets pointer to the nth field data type in an index. */
|
||||
UNIV_INLINE
|
||||
dtype_t*
|
||||
dict_index_get_nth_type(
|
||||
/*====================*/
|
||||
/* out: data type */
|
||||
dict_index_t* index, /* in: index */
|
||||
ulint pos); /* in: position of the field */
|
||||
/************************************************************************
|
||||
Gets the column number of the nth field in an index. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_index_get_nth_col_no(
|
||||
/*======================*/
|
||||
/* out: column number */
|
||||
dict_index_t* index, /* in: index */
|
||||
ulint pos); /* in: position of the field */
|
||||
/************************************************************************
|
||||
Looks for column n in an index. */
|
||||
|
||||
ulint
|
||||
dict_index_get_nth_col_pos(
|
||||
/*=======================*/
|
||||
/* out: position in internal representation
|
||||
of the index; if not contained, returns
|
||||
ULINT_UNDEFINED */
|
||||
dict_index_t* index, /* in: index */
|
||||
ulint n); /* in: column number */
|
||||
/************************************************************************
|
||||
Returns TRUE if the index contains a column or a prefix of that column. */
|
||||
|
||||
ibool
|
||||
dict_index_contains_col_or_prefix(
|
||||
/*==============================*/
|
||||
/* out: TRUE if contains the column or its
|
||||
prefix */
|
||||
dict_index_t* index, /* in: index */
|
||||
ulint n); /* in: column number */
|
||||
/************************************************************************
|
||||
Looks for a matching field in an index. The column has to be the same. The
|
||||
column in index must be complete, or must contain a prefix longer than the
|
||||
column in index2. That is, we must be able to construct the prefix in index2
|
||||
from the prefix in index. */
|
||||
|
||||
ulint
|
||||
dict_index_get_nth_field_pos(
|
||||
/*=========================*/
|
||||
/* out: position in internal representation
|
||||
of the index; if not contained, returns
|
||||
ULINT_UNDEFINED */
|
||||
dict_index_t* index, /* in: index from which to search */
|
||||
dict_index_t* index2, /* in: index */
|
||||
ulint n); /* in: field number in index2 */
|
||||
/************************************************************************
|
||||
Looks for column n position in the clustered index. */
|
||||
|
||||
ulint
|
||||
dict_table_get_nth_col_pos(
|
||||
/*=======================*/
|
||||
/* out: position in internal representation
|
||||
of the clustered index */
|
||||
dict_table_t* table, /* in: table */
|
||||
ulint n); /* in: column number */
|
||||
/************************************************************************
|
||||
Returns the position of a system column in an index. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_index_get_sys_col_pos(
|
||||
/*=======================*/
|
||||
/* out: position, ULINT_UNDEFINED if not
|
||||
contained */
|
||||
dict_index_t* index, /* in: index */
|
||||
ulint type); /* in: DATA_ROW_ID, ... */
|
||||
/***********************************************************************
|
||||
Adds a column to index. */
|
||||
|
||||
void
|
||||
dict_index_add_col(
|
||||
/*===============*/
|
||||
dict_index_t* index, /* in: index */
|
||||
dict_col_t* col, /* in: column */
|
||||
ulint order, /* in: order criterion */
|
||||
ulint prefix_len); /* in: column prefix length */
|
||||
/***********************************************************************
|
||||
Copies types of fields contained in index to tuple. */
|
||||
|
||||
void
|
||||
dict_index_copy_types(
|
||||
/*==================*/
|
||||
dtuple_t* tuple, /* in: data tuple */
|
||||
dict_index_t* index, /* in: index */
|
||||
ulint n_fields); /* in: number of field types to copy */
|
||||
/*************************************************************************
|
||||
Gets the index tree where the index is stored. */
|
||||
UNIV_INLINE
|
||||
dict_tree_t*
|
||||
dict_index_get_tree(
|
||||
/*================*/
|
||||
/* out: index tree */
|
||||
dict_index_t* index); /* in: index */
|
||||
/*************************************************************************
|
||||
Gets the field order criterion. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_field_get_order(
|
||||
/*=================*/
|
||||
dict_field_t* field);
|
||||
/*************************************************************************
|
||||
Gets the field column. */
|
||||
UNIV_INLINE
|
||||
dict_col_t*
|
||||
dict_field_get_col(
|
||||
/*===============*/
|
||||
dict_field_t* field);
|
||||
/**************************************************************************
|
||||
Creates an index tree struct. */
|
||||
|
||||
dict_tree_t*
|
||||
dict_tree_create(
|
||||
/*=============*/
|
||||
/* out, own: created tree */
|
||||
dict_index_t* index, /* in: the index for which to create: in the
|
||||
case of a mixed tree, this should be the
|
||||
index of the cluster object */
|
||||
ulint page_no);/* in: root page number of the index */
|
||||
/**************************************************************************
|
||||
Frees an index tree struct. */
|
||||
|
||||
void
|
||||
dict_tree_free(
|
||||
/*===========*/
|
||||
dict_tree_t* tree); /* in, own: index tree */
|
||||
/**************************************************************************
|
||||
In an index tree, finds the index corresponding to a record in the tree. */
|
||||
|
||||
dict_index_t*
|
||||
dict_tree_find_index(
|
||||
/*=================*/
|
||||
/* out: index */
|
||||
dict_tree_t* tree, /* in: index tree */
|
||||
rec_t* rec); /* in: record for which to find correct index */
|
||||
/**************************************************************************
|
||||
In an index tree, finds the index corresponding to a dtuple which is used
|
||||
in a search to a tree. */
|
||||
|
||||
dict_index_t*
|
||||
dict_tree_find_index_for_tuple(
|
||||
/*===========================*/
|
||||
/* out: index; NULL if the tuple does not
|
||||
contain the mix id field in a mixed tree */
|
||||
dict_tree_t* tree, /* in: index tree */
|
||||
dtuple_t* tuple); /* in: tuple for which to find index */
|
||||
/***********************************************************************
|
||||
Checks if a table which is a mixed cluster member owns a record. */
|
||||
|
||||
ibool
|
||||
dict_is_mixed_table_rec(
|
||||
/*====================*/
|
||||
/* out: TRUE if the record belongs to this
|
||||
table */
|
||||
dict_table_t* table, /* in: table in a mixed cluster */
|
||||
rec_t* rec); /* in: user record in the clustered index */
|
||||
/**************************************************************************
|
||||
Returns an index object if it is found in the dictionary cache. */
|
||||
|
||||
dict_index_t*
|
||||
dict_index_get_if_in_cache(
|
||||
/*=======================*/
|
||||
/* out: index, NULL if not found */
|
||||
dulint index_id); /* in: index id */
|
||||
/**************************************************************************
|
||||
Checks that a tuple has n_fields_cmp value in a sensible range, so that
|
||||
no comparison can occur with the page number field in a node pointer. */
|
||||
|
||||
ibool
|
||||
dict_tree_check_search_tuple(
|
||||
/*=========================*/
|
||||
/* out: TRUE if ok */
|
||||
dict_tree_t* tree, /* in: index tree */
|
||||
dtuple_t* tuple); /* in: tuple used in a search */
|
||||
/**************************************************************************
|
||||
Builds a node pointer out of a physical record and a page number. */
|
||||
|
||||
dtuple_t*
|
||||
dict_tree_build_node_ptr(
|
||||
/*=====================*/
|
||||
/* out, own: node pointer */
|
||||
dict_tree_t* tree, /* in: index tree */
|
||||
rec_t* rec, /* in: record for which to build node
|
||||
pointer */
|
||||
ulint page_no,/* in: page number to put in node pointer */
|
||||
mem_heap_t* heap, /* in: memory heap where pointer created */
|
||||
ulint level); /* in: level of rec in tree: 0 means leaf
|
||||
level */
|
||||
/**************************************************************************
|
||||
Copies an initial segment of a physical record, long enough to specify an
|
||||
index entry uniquely. */
|
||||
|
||||
rec_t*
|
||||
dict_tree_copy_rec_order_prefix(
|
||||
/*============================*/
|
||||
/* out: pointer to the prefix record */
|
||||
dict_tree_t* tree, /* in: index tree */
|
||||
rec_t* rec, /* in: record for which to copy prefix */
|
||||
ulint* n_fields,/* out: number of fields copied */
|
||||
byte** buf, /* in/out: memory buffer for the copied prefix,
|
||||
or NULL */
|
||||
ulint* buf_size);/* in/out: buffer size */
|
||||
/**************************************************************************
|
||||
Builds a typed data tuple out of a physical record. */
|
||||
|
||||
dtuple_t*
|
||||
dict_tree_build_data_tuple(
|
||||
/*=======================*/
|
||||
/* out, own: data tuple */
|
||||
dict_tree_t* tree, /* in: index tree */
|
||||
rec_t* rec, /* in: record for which to build data tuple */
|
||||
ulint n_fields,/* in: number of data fields */
|
||||
mem_heap_t* heap); /* in: memory heap where tuple created */
|
||||
/*************************************************************************
|
||||
Gets the space id of the root of the index tree. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_tree_get_space(
|
||||
/*================*/
|
||||
/* out: space id */
|
||||
dict_tree_t* tree); /* in: tree */
|
||||
/*************************************************************************
|
||||
Sets the space id of the root of the index tree. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dict_tree_set_space(
|
||||
/*================*/
|
||||
dict_tree_t* tree, /* in: tree */
|
||||
ulint space); /* in: space id */
|
||||
/*************************************************************************
|
||||
Gets the page number of the root of the index tree. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_tree_get_page(
|
||||
/*===============*/
|
||||
/* out: page number */
|
||||
dict_tree_t* tree); /* in: tree */
|
||||
/*************************************************************************
|
||||
Sets the page number of the root of index tree. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dict_tree_set_page(
|
||||
/*===============*/
|
||||
dict_tree_t* tree, /* in: tree */
|
||||
ulint page); /* in: page number */
|
||||
/*************************************************************************
|
||||
Gets the type of the index tree. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_tree_get_type(
|
||||
/*===============*/
|
||||
/* out: type */
|
||||
dict_tree_t* tree); /* in: tree */
|
||||
/*************************************************************************
|
||||
Gets the read-write lock of the index tree. */
|
||||
UNIV_INLINE
|
||||
rw_lock_t*
|
||||
dict_tree_get_lock(
|
||||
/*===============*/
|
||||
/* out: read-write lock */
|
||||
dict_tree_t* tree); /* in: tree */
|
||||
/************************************************************************
|
||||
Returns free space reserved for future updates of records. This is
|
||||
relevant only in the case of many consecutive inserts, as updates
|
||||
which make the records bigger might fragment the index. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_tree_get_space_reserve(
|
||||
/*========================*/
|
||||
/* out: number of free bytes on page,
|
||||
reserved for updates */
|
||||
dict_tree_t* tree); /* in: a tree */
|
||||
/*************************************************************************
|
||||
Calculates the minimum record length in an index. */
|
||||
|
||||
ulint
|
||||
dict_index_calc_min_rec_len(
|
||||
/*========================*/
|
||||
dict_index_t* index); /* in: index */
|
||||
/*************************************************************************
|
||||
Calculates new estimates for table and index statistics. The statistics
|
||||
are used in query optimization. */
|
||||
|
||||
void
|
||||
dict_update_statistics_low(
|
||||
/*=======================*/
|
||||
dict_table_t* table, /* in: table */
|
||||
ibool has_dict_mutex);/* in: TRUE if the caller has the
|
||||
dictionary mutex */
|
||||
/*************************************************************************
|
||||
Calculates new estimates for table and index statistics. The statistics
|
||||
are used in query optimization. */
|
||||
|
||||
void
|
||||
dict_update_statistics(
|
||||
/*===================*/
|
||||
dict_table_t* table); /* in: table */
|
||||
/************************************************************************
|
||||
Reserves the dictionary system mutex for MySQL. */
|
||||
|
||||
void
|
||||
dict_mutex_enter_for_mysql(void);
|
||||
/*============================*/
|
||||
/************************************************************************
|
||||
Releases the dictionary system mutex for MySQL. */
|
||||
|
||||
void
|
||||
dict_mutex_exit_for_mysql(void);
|
||||
/*===========================*/
|
||||
/************************************************************************
|
||||
Checks if the database name in two table names is the same. */
|
||||
|
||||
ibool
|
||||
dict_tables_have_same_db(
|
||||
/*=====================*/
|
||||
/* out: TRUE if same db name */
|
||||
const char* name1, /* in: table name in the form
|
||||
dbname '/' tablename */
|
||||
const char* name2); /* in: table name in the form
|
||||
dbname '/' tablename */
|
||||
|
||||
/*************************************************************************
|
||||
Scans from pointer onwards. Stops if is at the start of a copy of
|
||||
'string' where characters are compared without case sensitivity. Stops
|
||||
also at '\0'. */
|
||||
|
||||
const char*
|
||||
dict_scan_to(
|
||||
/*=========*/
|
||||
/* out: scanned up to this */
|
||||
const char* ptr, /* in: scan from */
|
||||
const char* string);/* in: look for this */
|
||||
|
||||
/* Buffers for storing detailed information about the latest foreign key
|
||||
and unique key errors */
|
||||
extern FILE* dict_foreign_err_file;
|
||||
extern mutex_t dict_foreign_err_mutex; /* mutex protecting the buffers */
|
||||
|
||||
extern dict_sys_t* dict_sys; /* the dictionary system */
|
||||
extern rw_lock_t dict_operation_lock;
|
||||
|
||||
/* Dictionary system struct */
|
||||
struct dict_sys_struct{
|
||||
mutex_t mutex; /* mutex protecting the data
|
||||
dictionary; protects also the
|
||||
disk-based dictionary system tables;
|
||||
this mutex serializes CREATE TABLE
|
||||
and DROP TABLE, as well as reading
|
||||
the dictionary data for a table from
|
||||
system tables */
|
||||
dulint row_id; /* the next row id to assign;
|
||||
NOTE that at a checkpoint this
|
||||
must be written to the dict system
|
||||
header and flushed to a file; in
|
||||
recovery this must be derived from
|
||||
the log records */
|
||||
hash_table_t* table_hash; /* hash table of the tables, based
|
||||
on name */
|
||||
hash_table_t* table_id_hash; /* hash table of the tables, based
|
||||
on id */
|
||||
hash_table_t* col_hash; /* hash table of the columns */
|
||||
UT_LIST_BASE_NODE_T(dict_table_t)
|
||||
table_LRU; /* LRU list of tables */
|
||||
ulint size; /* varying space in bytes occupied
|
||||
by the data dictionary table and
|
||||
index objects */
|
||||
dict_table_t* sys_tables; /* SYS_TABLES table */
|
||||
dict_table_t* sys_columns; /* SYS_COLUMNS table */
|
||||
dict_table_t* sys_indexes; /* SYS_INDEXES table */
|
||||
dict_table_t* sys_fields; /* SYS_FIELDS table */
|
||||
};
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
#include "dict0dict.ic"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
620
storage/innobase/include/dict0dict.ic
Normal file
620
storage/innobase/include/dict0dict.ic
Normal file
|
|
@ -0,0 +1,620 @@
|
|||
/**********************************************************************
|
||||
Data dictionary system
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 1/8/1996 Heikki Tuuri
|
||||
***********************************************************************/
|
||||
|
||||
#include "dict0load.h"
|
||||
#include "trx0undo.h"
|
||||
#include "trx0sys.h"
|
||||
|
||||
/*************************************************************************
|
||||
Gets the column data type. */
|
||||
UNIV_INLINE
|
||||
dtype_t*
|
||||
dict_col_get_type(
|
||||
/*==============*/
|
||||
dict_col_t* col)
|
||||
{
|
||||
ut_ad(col);
|
||||
|
||||
return(&col->type);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the column number. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_col_get_no(
|
||||
/*============*/
|
||||
dict_col_t* col)
|
||||
{
|
||||
ut_ad(col);
|
||||
|
||||
return(col->ind);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the column position in the clustered index. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_col_get_clust_pos(
|
||||
/*===================*/
|
||||
dict_col_t* col)
|
||||
{
|
||||
ut_ad(col);
|
||||
|
||||
return(col->clust_pos);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets the first index on the table (the clustered index). */
|
||||
UNIV_INLINE
|
||||
dict_index_t*
|
||||
dict_table_get_first_index(
|
||||
/*=======================*/
|
||||
/* out: index, NULL if none exists */
|
||||
dict_table_t* table) /* in: table */
|
||||
{
|
||||
ut_ad(table);
|
||||
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
|
||||
|
||||
return(UT_LIST_GET_FIRST(table->indexes));
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets the next index on the table. */
|
||||
UNIV_INLINE
|
||||
dict_index_t*
|
||||
dict_table_get_next_index(
|
||||
/*======================*/
|
||||
/* out: index, NULL if none left */
|
||||
dict_index_t* index) /* in: index */
|
||||
{
|
||||
ut_ad(index);
|
||||
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
|
||||
|
||||
return(UT_LIST_GET_NEXT(indexes, index));
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets the number of user-defined columns in a table in the dictionary
|
||||
cache. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_table_get_n_user_cols(
|
||||
/*=======================*/
|
||||
/* out: number of user-defined (e.g., not
|
||||
ROW_ID) columns of a table */
|
||||
dict_table_t* table) /* in: table */
|
||||
{
|
||||
ut_ad(table);
|
||||
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
|
||||
ut_ad(table->cached);
|
||||
|
||||
return(table->n_cols - DATA_N_SYS_COLS);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets the number of system columns in a table in the dictionary cache. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_table_get_n_sys_cols(
|
||||
/*======================*/
|
||||
/* out: number of system (e.g.,
|
||||
ROW_ID) columns of a table */
|
||||
dict_table_t* table __attribute__((unused))) /* in: table */
|
||||
{
|
||||
ut_ad(table);
|
||||
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
|
||||
ut_ad(table->cached);
|
||||
|
||||
return(DATA_N_SYS_COLS);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets the number of all columns (also system) in a table in the dictionary
|
||||
cache. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_table_get_n_cols(
|
||||
/*==================*/
|
||||
/* out: number of columns of a table */
|
||||
dict_table_t* table) /* in: table */
|
||||
{
|
||||
ut_ad(table);
|
||||
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
|
||||
ut_ad(table->cached);
|
||||
|
||||
return(table->n_cols);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets the nth column of a table. */
|
||||
UNIV_INLINE
|
||||
dict_col_t*
|
||||
dict_table_get_nth_col(
|
||||
/*===================*/
|
||||
/* out: pointer to column object */
|
||||
dict_table_t* table, /* in: table */
|
||||
ulint pos) /* in: position of column */
|
||||
{
|
||||
ut_ad(table);
|
||||
ut_ad(pos < table->n_def);
|
||||
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
|
||||
|
||||
return((table->cols) + pos);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets the given system column of a table. */
|
||||
UNIV_INLINE
|
||||
dict_col_t*
|
||||
dict_table_get_sys_col(
|
||||
/*===================*/
|
||||
/* out: pointer to column object */
|
||||
dict_table_t* table, /* in: table */
|
||||
ulint sys) /* in: DATA_ROW_ID, ... */
|
||||
{
|
||||
dict_col_t* col;
|
||||
|
||||
ut_ad(table);
|
||||
ut_ad(sys < DATA_N_SYS_COLS);
|
||||
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
|
||||
|
||||
col = dict_table_get_nth_col(table, table->n_cols
|
||||
- DATA_N_SYS_COLS + sys);
|
||||
ut_ad(col->type.mtype == DATA_SYS);
|
||||
ut_ad(col->type.prtype == (sys | DATA_NOT_NULL));
|
||||
|
||||
return(col);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets the given system column number of a table. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_table_get_sys_col_no(
|
||||
/*======================*/
|
||||
/* out: column number */
|
||||
dict_table_t* table, /* in: table */
|
||||
ulint sys) /* in: DATA_ROW_ID, ... */
|
||||
{
|
||||
ut_ad(table);
|
||||
ut_ad(sys < DATA_N_SYS_COLS);
|
||||
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
|
||||
|
||||
return(table->n_cols - DATA_N_SYS_COLS + sys);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets the number of fields in the internal representation of an index,
|
||||
including fields added by the dictionary system. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_index_get_n_fields(
|
||||
/*====================*/
|
||||
/* out: number of fields */
|
||||
dict_index_t* index) /* in: an internal representation of index
|
||||
(in the dictionary cache) */
|
||||
{
|
||||
ut_ad(index);
|
||||
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
|
||||
|
||||
return(index->n_fields);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets the number of fields in the internal representation of an index
|
||||
that uniquely determine the position of an index entry in the index, if
|
||||
we do not take multiversioning into account: in the B-tree use the value
|
||||
returned by dict_index_get_n_unique_in_tree. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_index_get_n_unique(
|
||||
/*====================*/
|
||||
/* out: number of fields */
|
||||
dict_index_t* index) /* in: an internal representation of index
|
||||
(in the dictionary cache) */
|
||||
{
|
||||
ut_ad(index);
|
||||
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
|
||||
ut_ad(index->cached);
|
||||
|
||||
return(index->n_uniq);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets the number of fields in the internal representation of an index
|
||||
which uniquely determine the position of an index entry in the index, if
|
||||
we also take multiversioning into account. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_index_get_n_unique_in_tree(
|
||||
/*============================*/
|
||||
/* out: number of fields */
|
||||
dict_index_t* index) /* in: an internal representation of index
|
||||
(in the dictionary cache) */
|
||||
{
|
||||
ut_ad(index);
|
||||
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
|
||||
ut_ad(index->cached);
|
||||
|
||||
if (index->type & DICT_CLUSTERED) {
|
||||
|
||||
return(dict_index_get_n_unique(index));
|
||||
}
|
||||
|
||||
return(dict_index_get_n_fields(index));
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets the number of user-defined ordering fields in the index. In the internal
|
||||
representation of clustered indexes we add the row id to the ordering fields
|
||||
to make a clustered index unique, but this function returns the number of
|
||||
fields the user defined in the index as ordering fields. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_index_get_n_ordering_defined_by_user(
|
||||
/*======================================*/
|
||||
/* out: number of fields */
|
||||
dict_index_t* index) /* in: an internal representation of index
|
||||
(in the dictionary cache) */
|
||||
{
|
||||
return(index->n_user_defined_cols);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets the nth field of an index. */
|
||||
UNIV_INLINE
|
||||
dict_field_t*
|
||||
dict_index_get_nth_field(
|
||||
/*=====================*/
|
||||
/* out: pointer to field object */
|
||||
dict_index_t* index, /* in: index */
|
||||
ulint pos) /* in: position of field */
|
||||
{
|
||||
ut_ad(index);
|
||||
ut_ad(pos < index->n_def);
|
||||
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
|
||||
|
||||
return((index->fields) + pos);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Returns the position of a system column in an index. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_index_get_sys_col_pos(
|
||||
/*=======================*/
|
||||
/* out: position, ULINT_UNDEFINED if not
|
||||
contained */
|
||||
dict_index_t* index, /* in: index */
|
||||
ulint type) /* in: DATA_ROW_ID, ... */
|
||||
{
|
||||
dict_col_t* col;
|
||||
|
||||
ut_ad(index);
|
||||
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
|
||||
ut_ad(!(index->type & DICT_UNIVERSAL));
|
||||
|
||||
col = dict_table_get_sys_col(index->table, type);
|
||||
|
||||
if (index->type & DICT_CLUSTERED) {
|
||||
|
||||
return(col->clust_pos);
|
||||
}
|
||||
|
||||
return(dict_index_get_nth_col_pos(index,
|
||||
dict_table_get_sys_col_no(index->table, type)));
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the index tree where the index is stored. */
|
||||
UNIV_INLINE
|
||||
dict_tree_t*
|
||||
dict_index_get_tree(
|
||||
/*================*/
|
||||
/* out: index tree */
|
||||
dict_index_t* index) /* in: index */
|
||||
{
|
||||
ut_ad(index);
|
||||
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
|
||||
|
||||
return(index->tree);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the field order criterion. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_field_get_order(
|
||||
/*=================*/
|
||||
dict_field_t* field)
|
||||
{
|
||||
ut_ad(field);
|
||||
|
||||
return(field->order);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the field column. */
|
||||
UNIV_INLINE
|
||||
dict_col_t*
|
||||
dict_field_get_col(
|
||||
/*===============*/
|
||||
dict_field_t* field)
|
||||
{
|
||||
ut_ad(field);
|
||||
|
||||
return(field->col);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets pointer to the nth field data type in an index. */
|
||||
UNIV_INLINE
|
||||
dtype_t*
|
||||
dict_index_get_nth_type(
|
||||
/*====================*/
|
||||
/* out: data type */
|
||||
dict_index_t* index, /* in: index */
|
||||
ulint pos) /* in: position of the field */
|
||||
{
|
||||
return(dict_col_get_type(dict_field_get_col(
|
||||
dict_index_get_nth_field(index, pos))));
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets the column number the nth field in an index. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_index_get_nth_col_no(
|
||||
/*======================*/
|
||||
/* out: column number */
|
||||
dict_index_t* index, /* in: index */
|
||||
ulint pos) /* in: position of the field */
|
||||
{
|
||||
return(dict_col_get_no(dict_field_get_col(
|
||||
dict_index_get_nth_field(index, pos))));
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the space id of the root of the index tree. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_tree_get_space(
|
||||
/*================*/
|
||||
/* out: space id */
|
||||
dict_tree_t* tree) /* in: tree */
|
||||
{
|
||||
ut_ad(tree);
|
||||
ut_ad(tree->magic_n == DICT_TREE_MAGIC_N);
|
||||
|
||||
return(tree->space);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Sets the space id of the root of the index tree. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dict_tree_set_space(
|
||||
/*================*/
|
||||
dict_tree_t* tree, /* in: tree */
|
||||
ulint space) /* in: space id */
|
||||
{
|
||||
ut_ad(tree);
|
||||
ut_ad(tree->magic_n == DICT_TREE_MAGIC_N);
|
||||
|
||||
tree->space = space;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the page number of the root of the index tree. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_tree_get_page(
|
||||
/*===============*/
|
||||
/* out: page number */
|
||||
dict_tree_t* tree) /* in: tree */
|
||||
{
|
||||
ut_ad(tree);
|
||||
ut_ad(tree->magic_n == DICT_TREE_MAGIC_N);
|
||||
|
||||
return(tree->page);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Sets the page number of the root of index tree. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dict_tree_set_page(
|
||||
/*===============*/
|
||||
dict_tree_t* tree, /* in: tree */
|
||||
ulint page) /* in: page number */
|
||||
{
|
||||
ut_ad(tree);
|
||||
ut_ad(tree->magic_n == DICT_TREE_MAGIC_N);
|
||||
|
||||
tree->page = page;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the type of the index tree. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_tree_get_type(
|
||||
/*===============*/
|
||||
/* out: type */
|
||||
dict_tree_t* tree) /* in: tree */
|
||||
{
|
||||
ut_ad(tree);
|
||||
ut_ad(tree->magic_n == DICT_TREE_MAGIC_N);
|
||||
|
||||
return(tree->type);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the read-write lock of the index tree. */
|
||||
UNIV_INLINE
|
||||
rw_lock_t*
|
||||
dict_tree_get_lock(
|
||||
/*===============*/
|
||||
/* out: read-write lock */
|
||||
dict_tree_t* tree) /* in: tree */
|
||||
{
|
||||
ut_ad(tree);
|
||||
ut_ad(tree->magic_n == DICT_TREE_MAGIC_N);
|
||||
|
||||
return(&(tree->lock));
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Returns free space reserved for future updates of records. This is
|
||||
relevant only in the case of many consecutive inserts, as updates
|
||||
which make the records bigger might fragment the index. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dict_tree_get_space_reserve(
|
||||
/*========================*/
|
||||
/* out: number of free bytes on page,
|
||||
reserved for updates */
|
||||
dict_tree_t* tree) /* in: a tree */
|
||||
{
|
||||
ut_ad(tree);
|
||||
|
||||
UT_NOT_USED(tree);
|
||||
|
||||
return(UNIV_PAGE_SIZE / 16);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Checks if a table is in the dictionary cache. */
|
||||
UNIV_INLINE
|
||||
dict_table_t*
|
||||
dict_table_check_if_in_cache_low(
|
||||
/*==============================*/
|
||||
/* out: table, NULL if not found */
|
||||
const char* table_name) /* in: table name */
|
||||
{
|
||||
dict_table_t* table;
|
||||
ulint table_fold;
|
||||
|
||||
ut_ad(table_name);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
||||
/* Look for the table name in the hash table */
|
||||
table_fold = ut_fold_string(table_name);
|
||||
|
||||
HASH_SEARCH(name_hash, dict_sys->table_hash, table_fold, table,
|
||||
ut_strcmp(table->name, table_name) == 0);
|
||||
return(table);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Gets a table; loads it to the dictionary cache if necessary. A low-level
|
||||
function. */
|
||||
UNIV_INLINE
|
||||
dict_table_t*
|
||||
dict_table_get_low(
|
||||
/*===============*/
|
||||
/* out: table, NULL if not found */
|
||||
const char* table_name) /* in: table name */
|
||||
{
|
||||
dict_table_t* table;
|
||||
|
||||
ut_ad(table_name);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
||||
table = dict_table_check_if_in_cache_low(table_name);
|
||||
|
||||
if (table == NULL) {
|
||||
table = dict_load_table(table_name);
|
||||
}
|
||||
|
||||
return(table);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Returns a table object, based on table id, and memoryfixes it. */
|
||||
UNIV_INLINE
|
||||
dict_table_t*
|
||||
dict_table_get_on_id_low(
|
||||
/*=====================*/
|
||||
/* out: table, NULL if does not exist */
|
||||
dulint table_id, /* in: table id */
|
||||
trx_t* trx) /* in: transaction handle */
|
||||
{
|
||||
dict_table_t* table;
|
||||
ulint fold;
|
||||
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
UT_NOT_USED(trx);
|
||||
|
||||
/* Look for the table name in the hash table */
|
||||
fold = ut_fold_dulint(table_id);
|
||||
|
||||
HASH_SEARCH(id_hash, dict_sys->table_id_hash, fold, table,
|
||||
ut_dulint_cmp(table->id, table_id) == 0);
|
||||
if (table == NULL) {
|
||||
table = dict_load_table_on_id(table_id);
|
||||
}
|
||||
|
||||
if (table != NULL) {
|
||||
table->mem_fix++;
|
||||
|
||||
/* lock_push(trx, table, LOCK_DICT_MEM_FIX) */
|
||||
}
|
||||
|
||||
/* TODO: should get the type information from MySQL */
|
||||
|
||||
return(table);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Releases a table from being memoryfixed. Currently this has no relevance. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dict_table_release(
|
||||
/*===============*/
|
||||
dict_table_t* table) /* in: table to be released */
|
||||
{
|
||||
mutex_enter(&(dict_sys->mutex));
|
||||
|
||||
table->mem_fix--;
|
||||
|
||||
mutex_exit(&(dict_sys->mutex));
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Returns an index object. */
|
||||
UNIV_INLINE
|
||||
dict_index_t*
|
||||
dict_table_get_index(
|
||||
/*=================*/
|
||||
/* out: index, NULL if does not exist */
|
||||
dict_table_t* table, /* in: table */
|
||||
const char* name) /* in: index name */
|
||||
{
|
||||
dict_index_t* index = NULL;
|
||||
|
||||
index = dict_table_get_first_index(table);
|
||||
|
||||
while (index != NULL) {
|
||||
if (ut_strcmp(name, index->name) == 0) {
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
index = dict_table_get_next_index(index);
|
||||
}
|
||||
|
||||
return(index);
|
||||
}
|
||||
98
storage/innobase/include/dict0load.h
Normal file
98
storage/innobase/include/dict0load.h
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
/******************************************************
|
||||
Loads to the memory cache database object definitions
|
||||
from dictionary tables
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 4/24/1996 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#ifndef dict0load_h
|
||||
#define dict0load_h
|
||||
|
||||
#include "univ.i"
|
||||
#include "dict0types.h"
|
||||
#include "ut0byte.h"
|
||||
|
||||
/************************************************************************
|
||||
In a crash recovery we already have all the tablespace objects created.
|
||||
This function compares the space id information in the InnoDB data dictionary
|
||||
to what we already read with fil_load_single_table_tablespaces().
|
||||
|
||||
In a normal startup, we create the tablespace objects for every table in
|
||||
InnoDB's data dictionary, if the corresponding .ibd file exists.
|
||||
We also scan the biggest space id, and store it to fil_system. */
|
||||
|
||||
void
|
||||
dict_check_tablespaces_and_store_max_id(
|
||||
/*====================================*/
|
||||
ibool in_crash_recovery); /* in: are we doing a crash recovery */
|
||||
/************************************************************************
|
||||
Finds the first table name in the given database. */
|
||||
|
||||
char*
|
||||
dict_get_first_table_name_in_db(
|
||||
/*============================*/
|
||||
/* out, own: table name, NULL if
|
||||
does not exist; the caller must free
|
||||
the memory in the string! */
|
||||
const char* name); /* in: database name which ends to '/' */
|
||||
/************************************************************************
|
||||
Loads a table definition and also all its index definitions, and also
|
||||
the cluster definition if the table is a member in a cluster. Also loads
|
||||
all foreign key constraints where the foreign key is in the table or where
|
||||
a foreign key references columns in this table. */
|
||||
|
||||
dict_table_t*
|
||||
dict_load_table(
|
||||
/*============*/
|
||||
/* out: table, NULL if does not exist;
|
||||
if the table is stored in an .ibd file,
|
||||
but the file does not exist,
|
||||
then we set the ibd_file_missing flag TRUE
|
||||
in the table object we return */
|
||||
const char* name); /* in: table name in the
|
||||
databasename/tablename format */
|
||||
/***************************************************************************
|
||||
Loads a table object based on the table id. */
|
||||
|
||||
dict_table_t*
|
||||
dict_load_table_on_id(
|
||||
/*==================*/
|
||||
/* out: table; NULL if table does not exist */
|
||||
dulint table_id); /* in: table id */
|
||||
/************************************************************************
|
||||
This function is called when the database is booted.
|
||||
Loads system table index definitions except for the clustered index which
|
||||
is added to the dictionary cache at booting before calling this function. */
|
||||
|
||||
void
|
||||
dict_load_sys_table(
|
||||
/*================*/
|
||||
dict_table_t* table); /* in: system table */
|
||||
/***************************************************************************
|
||||
Loads foreign key constraints where the table is either the foreign key
|
||||
holder or where the table is referenced by a foreign key. Adds these
|
||||
constraints to the data dictionary. Note that we know that the dictionary
|
||||
cache already contains all constraints where the other relevant table is
|
||||
already in the dictionary cache. */
|
||||
|
||||
ulint
|
||||
dict_load_foreigns(
|
||||
/*===============*/
|
||||
/* out: DB_SUCCESS or error code */
|
||||
const char* table_name); /* in: table name */
|
||||
/************************************************************************
|
||||
Prints to the standard output information on all tables found in the data
|
||||
dictionary system table. */
|
||||
|
||||
void
|
||||
dict_print(void);
|
||||
/*============*/
|
||||
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
#include "dict0load.ic"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
9
storage/innobase/include/dict0load.ic
Normal file
9
storage/innobase/include/dict0load.ic
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
/******************************************************
|
||||
Loads to the memory cache database object definitions
|
||||
from dictionary tables
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 4/24/1996 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
444
storage/innobase/include/dict0mem.h
Normal file
444
storage/innobase/include/dict0mem.h
Normal file
|
|
@ -0,0 +1,444 @@
|
|||
/******************************************************
|
||||
Data dictionary memory object creation
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 1/8/1996 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#ifndef dict0mem_h
|
||||
#define dict0mem_h
|
||||
|
||||
#include "univ.i"
|
||||
#include "dict0types.h"
|
||||
#include "data0type.h"
|
||||
#include "data0data.h"
|
||||
#include "mem0mem.h"
|
||||
#include "rem0types.h"
|
||||
#include "btr0types.h"
|
||||
#include "ut0mem.h"
|
||||
#include "ut0lst.h"
|
||||
#include "ut0rnd.h"
|
||||
#include "ut0byte.h"
|
||||
#include "sync0rw.h"
|
||||
#include "lock0types.h"
|
||||
#include "hash0hash.h"
|
||||
#include "que0types.h"
|
||||
|
||||
/* Type flags of an index: OR'ing of the flags is allowed to define a
|
||||
combination of types */
|
||||
#define DICT_CLUSTERED 1 /* clustered index */
|
||||
#define DICT_UNIQUE 2 /* unique index */
|
||||
#define DICT_UNIVERSAL 4 /* index which can contain records from any
|
||||
other index */
|
||||
#define DICT_IBUF 8 /* insert buffer tree */
|
||||
|
||||
/* Flags for ordering an index field: OR'ing of the flags allowed */
|
||||
#define DICT_DESCEND 1 /* in descending order (default ascending) */
|
||||
|
||||
/* Types for a table object */
|
||||
#define DICT_TABLE_ORDINARY 1
|
||||
#define DICT_TABLE_CLUSTER_MEMBER 2
|
||||
#define DICT_TABLE_CLUSTER 3 /* this means that the table is
|
||||
really a cluster definition */
|
||||
|
||||
/**************************************************************************
|
||||
Creates a table memory object. */
|
||||
|
||||
dict_table_t*
|
||||
dict_mem_table_create(
|
||||
/*==================*/
|
||||
/* out, own: table object */
|
||||
const char* name, /* in: table name */
|
||||
ulint space, /* in: space where the clustered index
|
||||
of the table is placed; this parameter
|
||||
is ignored if the table is made
|
||||
a member of a cluster */
|
||||
ulint n_cols, /* in: number of columns */
|
||||
ibool comp); /* in: TRUE=compact page format */
|
||||
/**************************************************************************
|
||||
Creates a cluster memory object. */
|
||||
|
||||
dict_cluster_t*
|
||||
dict_mem_cluster_create(
|
||||
/*====================*/
|
||||
/* out, own: cluster object (where the
|
||||
type dict_cluster_t == dict_table_t) */
|
||||
const char* name, /* in: cluster name */
|
||||
ulint space, /* in: space where the clustered
|
||||
indexes of the member tables are
|
||||
placed */
|
||||
ulint n_cols, /* in: number of columns */
|
||||
ulint mix_len); /* in: length of the common key prefix
|
||||
in the cluster */
|
||||
/**************************************************************************
|
||||
Declares a non-published table as a member in a cluster. */
|
||||
|
||||
void
|
||||
dict_mem_table_make_cluster_member(
|
||||
/*===============================*/
|
||||
dict_table_t* table, /* in: non-published table */
|
||||
const char* cluster_name); /* in: cluster name */
|
||||
/**************************************************************************
|
||||
Adds a column definition to a table. */
|
||||
|
||||
void
|
||||
dict_mem_table_add_col(
|
||||
/*===================*/
|
||||
dict_table_t* table, /* in: table */
|
||||
const char* name, /* in: column name */
|
||||
ulint mtype, /* in: main datatype */
|
||||
ulint prtype, /* in: precise type */
|
||||
ulint len, /* in: length */
|
||||
ulint prec); /* in: precision */
|
||||
/**************************************************************************
|
||||
Creates an index memory object. */
|
||||
|
||||
dict_index_t*
|
||||
dict_mem_index_create(
|
||||
/*==================*/
|
||||
/* out, own: index object */
|
||||
const char* table_name, /* in: table name */
|
||||
const char* index_name, /* in: index name */
|
||||
ulint space, /* in: space where the index tree is
|
||||
placed, ignored if the index is of
|
||||
the clustered type */
|
||||
ulint type, /* in: DICT_UNIQUE,
|
||||
DICT_CLUSTERED, ... ORed */
|
||||
ulint n_fields); /* in: number of fields */
|
||||
/**************************************************************************
|
||||
Adds a field definition to an index. NOTE: does not take a copy
|
||||
of the column name if the field is a column. The memory occupied
|
||||
by the column name may be released only after publishing the index. */
|
||||
|
||||
void
|
||||
dict_mem_index_add_field(
|
||||
/*=====================*/
|
||||
dict_index_t* index, /* in: index */
|
||||
const char* name, /* in: column name */
|
||||
ulint order, /* in: order criterion; 0 means an
|
||||
ascending order */
|
||||
ulint prefix_len); /* in: 0 or the column prefix length
|
||||
in a MySQL index like
|
||||
INDEX (textcol(25)) */
|
||||
/**************************************************************************
|
||||
Frees an index memory object. */
|
||||
|
||||
void
|
||||
dict_mem_index_free(
|
||||
/*================*/
|
||||
dict_index_t* index); /* in: index */
|
||||
/**************************************************************************
|
||||
Creates and initializes a foreign constraint memory object. */
|
||||
|
||||
dict_foreign_t*
|
||||
dict_mem_foreign_create(void);
|
||||
/*=========================*/
|
||||
/* out, own: foreign constraint struct */
|
||||
|
||||
/* Data structure for a column in a table */
|
||||
struct dict_col_struct{
|
||||
hash_node_t hash; /* hash chain node */
|
||||
ulint ind; /* table column position (they are numbered
|
||||
starting from 0) */
|
||||
ulint clust_pos;/* position of the column in the
|
||||
clustered index */
|
||||
ulint ord_part;/* count of how many times this column
|
||||
appears in ordering fields of an index */
|
||||
const char* name; /* name */
|
||||
dtype_t type; /* data type */
|
||||
dict_table_t* table; /* back pointer to table of this column */
|
||||
ulint aux; /* this is used as an auxiliary variable
|
||||
in some of the functions below */
|
||||
};
|
||||
|
||||
/* DICT_MAX_COL_PREFIX_LEN is measured in bytes. Starting from 4.1.6, we
|
||||
set max col prefix len to < 3 * 256, so that one can create a column prefix
|
||||
index on 255 characters of a TEXT field also in the UTF-8 charset. In that
|
||||
charset, a character may take at most 3 bytes. */
|
||||
|
||||
#define DICT_MAX_COL_PREFIX_LEN 768
|
||||
|
||||
/* Data structure for a field in an index */
|
||||
struct dict_field_struct{
|
||||
dict_col_t* col; /* pointer to the table column */
|
||||
const char* name; /* name of the column */
|
||||
ulint order; /* flags for ordering this field:
|
||||
DICT_DESCEND, ... */
|
||||
ulint prefix_len; /* 0 or the length of the column
|
||||
prefix in bytes in a MySQL index of
|
||||
type, e.g., INDEX (textcol(25));
|
||||
must be smaller than
|
||||
DICT_MAX_COL_PREFIX_LEN; NOTE that
|
||||
in the UTF-8 charset, MySQL sets this
|
||||
to 3 * the prefix len in UTF-8 chars */
|
||||
ulint fixed_len; /* 0 or the fixed length of the
|
||||
column if smaller than
|
||||
DICT_MAX_COL_PREFIX_LEN */
|
||||
ulint fixed_offs; /* offset to the field, or
|
||||
ULINT_UNDEFINED if it is not fixed
|
||||
within the record (due to preceding
|
||||
variable-length fields) */
|
||||
};
|
||||
|
||||
/* Data structure for an index tree */
|
||||
struct dict_tree_struct{
|
||||
ulint type; /* tree type */
|
||||
dulint id; /* id of the index stored in the tree, in the
|
||||
case of a mixed index, the id of the clustered
|
||||
index of the cluster table */
|
||||
ulint space; /* space of index tree */
|
||||
ulint page; /* index tree root page number */
|
||||
byte pad[64];/* Padding to prevent other memory hotspots on
|
||||
the same memory cache line */
|
||||
rw_lock_t lock; /* read-write lock protecting the upper levels
|
||||
of the index tree */
|
||||
ulint mem_fix;/* count of how many times this tree
|
||||
struct has been memoryfixed (by mini-
|
||||
transactions wanting to access the index
|
||||
tree) */
|
||||
UT_LIST_BASE_NODE_T(dict_index_t)
|
||||
tree_indexes; /* list of indexes stored in the
|
||||
index tree: if the tree is not of the
|
||||
mixed type there is only one index in
|
||||
the list; if the tree is of the mixed
|
||||
type, the first index in the list is the
|
||||
index of the cluster which owns the tree */
|
||||
ulint magic_n;/* magic number */
|
||||
};
|
||||
|
||||
#define DICT_TREE_MAGIC_N 7545676
|
||||
|
||||
/* Data structure for an index */
|
||||
struct dict_index_struct{
|
||||
dulint id; /* id of the index */
|
||||
mem_heap_t* heap; /* memory heap */
|
||||
ulint type; /* index type */
|
||||
const char* name; /* index name */
|
||||
const char* table_name; /* table name */
|
||||
dict_table_t* table; /* back pointer to table */
|
||||
ulint space; /* space where the index tree is placed */
|
||||
ulint trx_id_offset;/* position of the the trx id column
|
||||
in a clustered index record, if the fields
|
||||
before it are known to be of a fixed size,
|
||||
0 otherwise */
|
||||
ulint n_user_defined_cols;
|
||||
/* number of columns the user defined to
|
||||
be in the index: in the internal
|
||||
representation we add more columns */
|
||||
ulint n_uniq; /* number of fields from the beginning
|
||||
which are enough to determine an index
|
||||
entry uniquely */
|
||||
ulint n_def; /* number of fields defined so far */
|
||||
ulint n_fields;/* number of fields in the index */
|
||||
dict_field_t* fields; /* array of field descriptions */
|
||||
ulint n_nullable;/* number of nullable fields */
|
||||
UT_LIST_NODE_T(dict_index_t)
|
||||
indexes;/* list of indexes of the table */
|
||||
dict_tree_t* tree; /* index tree struct */
|
||||
UT_LIST_NODE_T(dict_index_t)
|
||||
tree_indexes; /* list of indexes of the same index
|
||||
tree */
|
||||
ibool cached; /* TRUE if the index object is in the
|
||||
dictionary cache */
|
||||
btr_search_t* search_info; /* info used in optimistic searches */
|
||||
/*----------------------*/
|
||||
ib_longlong* stat_n_diff_key_vals;
|
||||
/* approximate number of different key values
|
||||
for this index, for each n-column prefix
|
||||
where n <= dict_get_n_unique(index); we
|
||||
periodically calculate new estimates */
|
||||
ulint stat_index_size;
|
||||
/* approximate index size in database pages */
|
||||
ulint stat_n_leaf_pages;
|
||||
/* approximate number of leaf pages in the
|
||||
index tree */
|
||||
ulint magic_n;/* magic number */
|
||||
};
|
||||
|
||||
/* Data structure for a foreign key constraint; an example:
|
||||
FOREIGN KEY (A, B) REFERENCES TABLE2 (C, D) */
|
||||
|
||||
struct dict_foreign_struct{
|
||||
mem_heap_t* heap; /* this object is allocated from
|
||||
this memory heap */
|
||||
char* id; /* id of the constraint as a
|
||||
null-terminated string */
|
||||
ulint type; /* 0 or DICT_FOREIGN_ON_DELETE_CASCADE
|
||||
or DICT_FOREIGN_ON_DELETE_SET_NULL */
|
||||
char* foreign_table_name;/* foreign table name */
|
||||
dict_table_t* foreign_table; /* table where the foreign key is */
|
||||
const char** foreign_col_names;/* names of the columns in the
|
||||
foreign key */
|
||||
char* referenced_table_name;/* referenced table name */
|
||||
dict_table_t* referenced_table;/* table where the referenced key
|
||||
is */
|
||||
const char** referenced_col_names;/* names of the referenced
|
||||
columns in the referenced table */
|
||||
ulint n_fields; /* number of indexes' first fields
|
||||
for which the the foreign key
|
||||
constraint is defined: we allow the
|
||||
indexes to contain more fields than
|
||||
mentioned in the constraint, as long
|
||||
as the first fields are as mentioned */
|
||||
dict_index_t* foreign_index; /* foreign index; we require that
|
||||
both tables contain explicitly defined
|
||||
indexes for the constraint: InnoDB
|
||||
does not generate new indexes
|
||||
implicitly */
|
||||
dict_index_t* referenced_index;/* referenced index */
|
||||
UT_LIST_NODE_T(dict_foreign_t)
|
||||
foreign_list; /* list node for foreign keys of the
|
||||
table */
|
||||
UT_LIST_NODE_T(dict_foreign_t)
|
||||
referenced_list;/* list node for referenced keys of the
|
||||
table */
|
||||
};
|
||||
|
||||
/* The flags for ON_UPDATE and ON_DELETE can be ORed; the default is that
|
||||
a foreign key constraint is enforced, therefore RESTRICT just means no flag */
|
||||
#define DICT_FOREIGN_ON_DELETE_CASCADE 1
|
||||
#define DICT_FOREIGN_ON_DELETE_SET_NULL 2
|
||||
#define DICT_FOREIGN_ON_UPDATE_CASCADE 4
|
||||
#define DICT_FOREIGN_ON_UPDATE_SET_NULL 8
|
||||
#define DICT_FOREIGN_ON_DELETE_NO_ACTION 16
|
||||
#define DICT_FOREIGN_ON_UPDATE_NO_ACTION 32
|
||||
|
||||
|
||||
#define DICT_INDEX_MAGIC_N 76789786
|
||||
|
||||
/* Data structure for a database table */
|
||||
struct dict_table_struct{
|
||||
dulint id; /* id of the table or cluster */
|
||||
ulint type; /* DICT_TABLE_ORDINARY, ... */
|
||||
mem_heap_t* heap; /* memory heap */
|
||||
const char* name; /* table name */
|
||||
const char* dir_path_of_temp_table;/* NULL or the directory path
|
||||
where a TEMPORARY table that was explicitly
|
||||
created by a user should be placed if
|
||||
innodb_file_per_table is defined in my.cnf;
|
||||
in Unix this is usually /tmp/..., in Windows
|
||||
\temp\... */
|
||||
ulint space; /* space where the clustered index of the
|
||||
table is placed */
|
||||
ibool ibd_file_missing;/* TRUE if this is in a single-table
|
||||
tablespace and the .ibd file is missing; then
|
||||
we must return in ha_innodb.cc an error if the
|
||||
user tries to query such an orphaned table */
|
||||
ibool tablespace_discarded;/* this flag is set TRUE when the
|
||||
user calls DISCARD TABLESPACE on this table,
|
||||
and reset to FALSE in IMPORT TABLESPACE */
|
||||
ibool comp; /* flag: TRUE=compact page format */
|
||||
hash_node_t name_hash; /* hash chain node */
|
||||
hash_node_t id_hash; /* hash chain node */
|
||||
ulint n_def; /* number of columns defined so far */
|
||||
ulint n_cols; /* number of columns */
|
||||
dict_col_t* cols; /* array of column descriptions */
|
||||
UT_LIST_BASE_NODE_T(dict_index_t)
|
||||
indexes; /* list of indexes of the table */
|
||||
UT_LIST_BASE_NODE_T(dict_foreign_t)
|
||||
foreign_list;/* list of foreign key constraints
|
||||
in the table; these refer to columns
|
||||
in other tables */
|
||||
UT_LIST_BASE_NODE_T(dict_foreign_t)
|
||||
referenced_list;/* list of foreign key constraints
|
||||
which refer to this table */
|
||||
UT_LIST_NODE_T(dict_table_t)
|
||||
table_LRU; /* node of the LRU list of tables */
|
||||
ulint mem_fix;/* count of how many times the table
|
||||
and its indexes has been fixed in memory;
|
||||
currently NOT used */
|
||||
ulint n_mysql_handles_opened;
|
||||
/* count of how many handles MySQL has opened
|
||||
to this table; dropping of the table is
|
||||
NOT allowed until this count gets to zero;
|
||||
MySQL does NOT itself check the number of
|
||||
open handles at drop */
|
||||
ulint n_foreign_key_checks_running;
|
||||
/* count of how many foreign key check
|
||||
operations are currently being performed
|
||||
on the table: we cannot drop the table while
|
||||
there are foreign key checks running on
|
||||
it! */
|
||||
ibool cached; /* TRUE if the table object has been added
|
||||
to the dictionary cache */
|
||||
lock_t* auto_inc_lock;/* a buffer for an auto-inc lock
|
||||
for this table: we allocate the memory here
|
||||
so that individual transactions can get it
|
||||
and release it without a need to allocate
|
||||
space from the lock heap of the trx:
|
||||
otherwise the lock heap would grow rapidly
|
||||
if we do a large insert from a select */
|
||||
dulint query_cache_inv_trx_id;
|
||||
/* transactions whose trx id < than this
|
||||
number are not allowed to store to the MySQL
|
||||
query cache or retrieve from it; when a trx
|
||||
with undo logs commits, it sets this to the
|
||||
value of the trx id counter for the tables it
|
||||
had an IX lock on */
|
||||
UT_LIST_BASE_NODE_T(lock_t)
|
||||
locks; /* list of locks on the table */
|
||||
/*----------------------*/
|
||||
dulint mix_id; /* if the table is a member in a cluster,
|
||||
this is its mix id */
|
||||
ulint mix_len;/* if the table is a cluster or a member
|
||||
this is the common key prefix lenght */
|
||||
ulint mix_id_len;/* mix id length in a compressed form */
|
||||
byte mix_id_buf[12];
|
||||
/* mix id of a mixed table written in
|
||||
a compressed form */
|
||||
const char* cluster_name; /* if the table is a member in a
|
||||
cluster, this is the name of the cluster */
|
||||
/*----------------------*/
|
||||
ibool does_not_fit_in_memory;
|
||||
/* this field is used to specify in simulations
|
||||
tables which are so big that disk should be
|
||||
accessed: disk access is simulated by
|
||||
putting the thread to sleep for a while;
|
||||
NOTE that this flag is not stored to the data
|
||||
dictionary on disk, and the database will
|
||||
forget about value TRUE if it has to reload
|
||||
the table definition from disk */
|
||||
/*----------------------*/
|
||||
ib_longlong stat_n_rows;
|
||||
/* approximate number of rows in the table;
|
||||
we periodically calculate new estimates */
|
||||
ulint stat_clustered_index_size;
|
||||
/* approximate clustered index size in
|
||||
database pages */
|
||||
ulint stat_sum_of_other_index_sizes;
|
||||
/* other indexes in database pages */
|
||||
ibool stat_initialized; /* TRUE if statistics have
|
||||
been calculated the first time
|
||||
after database startup or table creation */
|
||||
ulint stat_modified_counter;
|
||||
/* when a row is inserted, updated, or deleted,
|
||||
we add 1 to this number; we calculate new
|
||||
estimates for the stat_... values for the
|
||||
table and the indexes at an interval of 2 GB
|
||||
or when about 1 / 16 of table has been
|
||||
modified; also when the estimate operation is
|
||||
called for MySQL SHOW TABLE STATUS; the
|
||||
counter is reset to zero at statistics
|
||||
calculation; this counter is not protected by
|
||||
any latch, because this is only used for
|
||||
heuristics */
|
||||
/*----------------------*/
|
||||
mutex_t autoinc_mutex;
|
||||
/* mutex protecting the autoincrement
|
||||
counter */
|
||||
ibool autoinc_inited;
|
||||
/* TRUE if the autoinc counter has been
|
||||
inited; MySQL gets the init value by executing
|
||||
SELECT MAX(auto inc column) */
|
||||
ib_longlong autoinc;/* autoinc counter value to give to the
|
||||
next inserted row */
|
||||
ulint magic_n;/* magic number */
|
||||
};
|
||||
#define DICT_TABLE_MAGIC_N 76333786
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
#include "dict0mem.ic"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
9
storage/innobase/include/dict0mem.ic
Normal file
9
storage/innobase/include/dict0mem.ic
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
/**********************************************************************
|
||||
Data dictionary memory object creation
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 1/8/1996 Heikki Tuuri
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
28
storage/innobase/include/dict0types.h
Normal file
28
storage/innobase/include/dict0types.h
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/******************************************************
|
||||
Data dictionary global types
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 1/8/1996 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#ifndef dict0types_h
|
||||
#define dict0types_h
|
||||
|
||||
typedef struct dict_sys_struct dict_sys_t;
|
||||
typedef struct dict_col_struct dict_col_t;
|
||||
typedef struct dict_field_struct dict_field_t;
|
||||
typedef struct dict_index_struct dict_index_t;
|
||||
typedef struct dict_tree_struct dict_tree_t;
|
||||
typedef struct dict_table_struct dict_table_t;
|
||||
typedef struct dict_foreign_struct dict_foreign_t;
|
||||
|
||||
/* A cluster object is a table object with the type field set to
|
||||
DICT_CLUSTERED */
|
||||
|
||||
typedef dict_table_t dict_cluster_t;
|
||||
|
||||
typedef struct ind_node_struct ind_node_t;
|
||||
typedef struct tab_node_struct tab_node_t;
|
||||
|
||||
#endif
|
||||
166
storage/innobase/include/dyn0dyn.h
Normal file
166
storage/innobase/include/dyn0dyn.h
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
/******************************************************
|
||||
The dynamically allocated array
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 2/5/1996 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#ifndef dyn0dyn_h
|
||||
#define dyn0dyn_h
|
||||
|
||||
#include "univ.i"
|
||||
#include "ut0lst.h"
|
||||
#include "mem0mem.h"
|
||||
|
||||
typedef struct dyn_block_struct dyn_block_t;
|
||||
typedef dyn_block_t dyn_array_t;
|
||||
|
||||
|
||||
/* This is the initial 'payload' size of a dynamic array;
|
||||
this must be > MLOG_BUF_MARGIN + 30! */
|
||||
#define DYN_ARRAY_DATA_SIZE 512
|
||||
|
||||
/*************************************************************************
|
||||
Initializes a dynamic array. */
|
||||
UNIV_INLINE
|
||||
dyn_array_t*
|
||||
dyn_array_create(
|
||||
/*=============*/
|
||||
/* out: initialized dyn array */
|
||||
dyn_array_t* arr); /* in: pointer to a memory buffer of
|
||||
size sizeof(dyn_array_t) */
|
||||
/****************************************************************
|
||||
Frees a dynamic array. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dyn_array_free(
|
||||
/*===========*/
|
||||
dyn_array_t* arr); /* in: dyn array */
|
||||
/*************************************************************************
|
||||
Makes room on top of a dyn array and returns a pointer to a buffer in it.
|
||||
After copying the elements, the caller must close the buffer using
|
||||
dyn_array_close. */
|
||||
UNIV_INLINE
|
||||
byte*
|
||||
dyn_array_open(
|
||||
/*===========*/
|
||||
/* out: pointer to the buffer */
|
||||
dyn_array_t* arr, /* in: dynamic array */
|
||||
ulint size); /* in: size in bytes of the buffer; MUST be
|
||||
smaller than DYN_ARRAY_DATA_SIZE! */
|
||||
/*************************************************************************
|
||||
Closes the buffer returned by dyn_array_open. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dyn_array_close(
|
||||
/*============*/
|
||||
dyn_array_t* arr, /* in: dynamic array */
|
||||
byte* ptr); /* in: buffer space from ptr up was not used */
|
||||
/*************************************************************************
|
||||
Makes room on top of a dyn array and returns a pointer to
|
||||
the added element. The caller must copy the element to
|
||||
the pointer returned. */
|
||||
UNIV_INLINE
|
||||
void*
|
||||
dyn_array_push(
|
||||
/*===========*/
|
||||
/* out: pointer to the element */
|
||||
dyn_array_t* arr, /* in: dynamic array */
|
||||
ulint size); /* in: size in bytes of the element */
|
||||
/****************************************************************
|
||||
Returns pointer to an element in dyn array. */
|
||||
UNIV_INLINE
|
||||
void*
|
||||
dyn_array_get_element(
|
||||
/*==================*/
|
||||
/* out: pointer to element */
|
||||
dyn_array_t* arr, /* in: dyn array */
|
||||
ulint pos); /* in: position of element as bytes
|
||||
from array start */
|
||||
/****************************************************************
|
||||
Returns the size of stored data in a dyn array. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dyn_array_get_data_size(
|
||||
/*====================*/
|
||||
/* out: data size in bytes */
|
||||
dyn_array_t* arr); /* in: dyn array */
|
||||
/****************************************************************
|
||||
Gets the first block in a dyn array. */
|
||||
UNIV_INLINE
|
||||
dyn_block_t*
|
||||
dyn_array_get_first_block(
|
||||
/*======================*/
|
||||
dyn_array_t* arr); /* in: dyn array */
|
||||
/****************************************************************
|
||||
Gets the last block in a dyn array. */
|
||||
UNIV_INLINE
|
||||
dyn_block_t*
|
||||
dyn_array_get_last_block(
|
||||
/*=====================*/
|
||||
dyn_array_t* arr); /* in: dyn array */
|
||||
/************************************************************************
|
||||
Gets the next block in a dyn array. */
|
||||
UNIV_INLINE
|
||||
dyn_block_t*
|
||||
dyn_array_get_next_block(
|
||||
/*=====================*/
|
||||
/* out: pointer to next, NULL if end of list */
|
||||
dyn_array_t* arr, /* in: dyn array */
|
||||
dyn_block_t* block); /* in: dyn array block */
|
||||
/************************************************************************
|
||||
Gets the number of used bytes in a dyn array block. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dyn_block_get_used(
|
||||
/*===============*/
|
||||
/* out: number of bytes used */
|
||||
dyn_block_t* block); /* in: dyn array block */
|
||||
/************************************************************************
|
||||
Gets pointer to the start of data in a dyn array block. */
|
||||
UNIV_INLINE
|
||||
byte*
|
||||
dyn_block_get_data(
|
||||
/*===============*/
|
||||
/* out: pointer to data */
|
||||
dyn_block_t* block); /* in: dyn array block */
|
||||
/************************************************************
|
||||
Pushes n bytes to a dyn array. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dyn_push_string(
|
||||
/*============*/
|
||||
dyn_array_t* arr, /* in: dyn array */
|
||||
byte* str, /* in: string to write */
|
||||
ulint len); /* in: string length */
|
||||
|
||||
/*#################################################################*/
|
||||
|
||||
/* NOTE! Do not use the fields of the struct directly: the definition
|
||||
appears here only for the compiler to know its size! */
|
||||
struct dyn_block_struct{
|
||||
mem_heap_t* heap; /* in the first block this is != NULL
|
||||
if dynamic allocation has been needed */
|
||||
ulint used; /* number of data bytes used in this block */
|
||||
byte data[DYN_ARRAY_DATA_SIZE];
|
||||
/* storage for array elements */
|
||||
UT_LIST_BASE_NODE_T(dyn_block_t) base;
|
||||
/* linear list of dyn blocks: this node is
|
||||
used only in the first block */
|
||||
UT_LIST_NODE_T(dyn_block_t) list;
|
||||
/* linear list node: used in all blocks */
|
||||
#ifdef UNIV_DEBUG
|
||||
ulint buf_end;/* only in the debug version: if dyn array is
|
||||
opened, this is the buffer end offset, else
|
||||
this is 0 */
|
||||
ulint magic_n;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
#include "dyn0dyn.ic"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
347
storage/innobase/include/dyn0dyn.ic
Normal file
347
storage/innobase/include/dyn0dyn.ic
Normal file
|
|
@ -0,0 +1,347 @@
|
|||
/******************************************************
|
||||
The dynamically allocated array
|
||||
|
||||
(c) 1996 Innobase Oy
|
||||
|
||||
Created 2/5/1996 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#define DYN_BLOCK_MAGIC_N 375767
|
||||
#define DYN_BLOCK_FULL_FLAG 0x1000000UL
|
||||
|
||||
/****************************************************************
|
||||
Adds a new block to a dyn array. */
|
||||
|
||||
dyn_block_t*
|
||||
dyn_array_add_block(
|
||||
/*================*/
|
||||
/* out: created block */
|
||||
dyn_array_t* arr); /* in: dyn array */
|
||||
|
||||
|
||||
/****************************************************************
|
||||
Gets the first block in a dyn array. */
|
||||
UNIV_INLINE
|
||||
dyn_block_t*
|
||||
dyn_array_get_first_block(
|
||||
/*======================*/
|
||||
dyn_array_t* arr) /* in: dyn array */
|
||||
{
|
||||
return(arr);
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
Gets the last block in a dyn array. */
|
||||
UNIV_INLINE
|
||||
dyn_block_t*
|
||||
dyn_array_get_last_block(
|
||||
/*=====================*/
|
||||
dyn_array_t* arr) /* in: dyn array */
|
||||
{
|
||||
if (arr->heap == NULL) {
|
||||
|
||||
return(arr);
|
||||
}
|
||||
|
||||
return(UT_LIST_GET_LAST(arr->base));
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets the next block in a dyn array. */
|
||||
UNIV_INLINE
|
||||
dyn_block_t*
|
||||
dyn_array_get_next_block(
|
||||
/*=====================*/
|
||||
/* out: pointer to next, NULL if end of list */
|
||||
dyn_array_t* arr, /* in: dyn array */
|
||||
dyn_block_t* block) /* in: dyn array block */
|
||||
{
|
||||
ut_ad(arr && block);
|
||||
|
||||
if (arr->heap == NULL) {
|
||||
ut_ad(arr == block);
|
||||
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
return(UT_LIST_GET_NEXT(list, block));
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets the number of used bytes in a dyn array block. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dyn_block_get_used(
|
||||
/*===============*/
|
||||
/* out: number of bytes used */
|
||||
dyn_block_t* block) /* in: dyn array block */
|
||||
{
|
||||
ut_ad(block);
|
||||
|
||||
return((block->used) & ~DYN_BLOCK_FULL_FLAG);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets pointer to the start of data in a dyn array block. */
|
||||
UNIV_INLINE
|
||||
byte*
|
||||
dyn_block_get_data(
|
||||
/*===============*/
|
||||
/* out: pointer to data */
|
||||
dyn_block_t* block) /* in: dyn array block */
|
||||
{
|
||||
ut_ad(block);
|
||||
|
||||
return(block->data);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Initializes a dynamic array. */
|
||||
UNIV_INLINE
|
||||
dyn_array_t*
|
||||
dyn_array_create(
|
||||
/*=============*/
|
||||
/* out: initialized dyn array */
|
||||
dyn_array_t* arr) /* in: pointer to a memory buffer of
|
||||
size sizeof(dyn_array_t) */
|
||||
{
|
||||
ut_ad(arr);
|
||||
ut_ad(DYN_ARRAY_DATA_SIZE < DYN_BLOCK_FULL_FLAG);
|
||||
|
||||
arr->heap = NULL;
|
||||
arr->used = 0;
|
||||
|
||||
#ifdef UNIV_DEBUG
|
||||
arr->buf_end = 0;
|
||||
arr->magic_n = DYN_BLOCK_MAGIC_N;
|
||||
#endif
|
||||
return(arr);
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
Frees a dynamic array. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dyn_array_free(
|
||||
/*===========*/
|
||||
dyn_array_t* arr) /* in: dyn array */
|
||||
{
|
||||
if (arr->heap != NULL) {
|
||||
mem_heap_free(arr->heap);
|
||||
}
|
||||
|
||||
#ifdef UNIV_DEBUG
|
||||
arr->magic_n = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Makes room on top of a dyn array and returns a pointer to the added element.
|
||||
The caller must copy the element to the pointer returned. */
|
||||
UNIV_INLINE
|
||||
void*
|
||||
dyn_array_push(
|
||||
/*===========*/
|
||||
/* out: pointer to the element */
|
||||
dyn_array_t* arr, /* in: dynamic array */
|
||||
ulint size) /* in: size in bytes of the element */
|
||||
{
|
||||
dyn_block_t* block;
|
||||
ulint used;
|
||||
|
||||
ut_ad(arr);
|
||||
ut_ad(arr->magic_n == DYN_BLOCK_MAGIC_N);
|
||||
ut_ad(size <= DYN_ARRAY_DATA_SIZE);
|
||||
ut_ad(size);
|
||||
|
||||
block = arr;
|
||||
used = block->used;
|
||||
|
||||
if (used + size > DYN_ARRAY_DATA_SIZE) {
|
||||
/* Get the last array block */
|
||||
|
||||
block = dyn_array_get_last_block(arr);
|
||||
used = block->used;
|
||||
|
||||
if (used + size > DYN_ARRAY_DATA_SIZE) {
|
||||
block = dyn_array_add_block(arr);
|
||||
used = block->used;
|
||||
}
|
||||
}
|
||||
|
||||
block->used = used + size;
|
||||
ut_ad(block->used <= DYN_ARRAY_DATA_SIZE);
|
||||
|
||||
return((block->data) + used);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Makes room on top of a dyn array and returns a pointer to a buffer in it.
|
||||
After copying the elements, the caller must close the buffer using
|
||||
dyn_array_close. */
|
||||
UNIV_INLINE
|
||||
byte*
|
||||
dyn_array_open(
|
||||
/*===========*/
|
||||
/* out: pointer to the buffer */
|
||||
dyn_array_t* arr, /* in: dynamic array */
|
||||
ulint size) /* in: size in bytes of the buffer; MUST be
|
||||
smaller than DYN_ARRAY_DATA_SIZE! */
|
||||
{
|
||||
dyn_block_t* block;
|
||||
ulint used;
|
||||
|
||||
ut_ad(arr);
|
||||
ut_ad(arr->magic_n == DYN_BLOCK_MAGIC_N);
|
||||
ut_ad(size <= DYN_ARRAY_DATA_SIZE);
|
||||
ut_ad(size);
|
||||
|
||||
block = arr;
|
||||
used = block->used;
|
||||
|
||||
if (used + size > DYN_ARRAY_DATA_SIZE) {
|
||||
/* Get the last array block */
|
||||
|
||||
block = dyn_array_get_last_block(arr);
|
||||
used = block->used;
|
||||
|
||||
if (used + size > DYN_ARRAY_DATA_SIZE) {
|
||||
block = dyn_array_add_block(arr);
|
||||
used = block->used;
|
||||
ut_a(size <= DYN_ARRAY_DATA_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
ut_ad(block->used <= DYN_ARRAY_DATA_SIZE);
|
||||
#ifdef UNIV_DEBUG
|
||||
ut_ad(arr->buf_end == 0);
|
||||
|
||||
arr->buf_end = used + size;
|
||||
#endif
|
||||
return((block->data) + used);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Closes the buffer returned by dyn_array_open. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dyn_array_close(
|
||||
/*============*/
|
||||
dyn_array_t* arr, /* in: dynamic array */
|
||||
byte* ptr) /* in: buffer space from ptr up was not used */
|
||||
{
|
||||
dyn_block_t* block;
|
||||
|
||||
ut_ad(arr);
|
||||
ut_ad(arr->magic_n == DYN_BLOCK_MAGIC_N);
|
||||
|
||||
block = dyn_array_get_last_block(arr);
|
||||
|
||||
ut_ad(arr->buf_end + block->data >= ptr);
|
||||
|
||||
block->used = ptr - block->data;
|
||||
|
||||
ut_ad(block->used <= DYN_ARRAY_DATA_SIZE);
|
||||
|
||||
#ifdef UNIV_DEBUG
|
||||
arr->buf_end = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
Returns pointer to an element in dyn array. */
|
||||
UNIV_INLINE
|
||||
void*
|
||||
dyn_array_get_element(
|
||||
/*==================*/
|
||||
/* out: pointer to element */
|
||||
dyn_array_t* arr, /* in: dyn array */
|
||||
ulint pos) /* in: position of element as bytes
|
||||
from array start */
|
||||
{
|
||||
dyn_block_t* block;
|
||||
ulint used;
|
||||
|
||||
ut_ad(arr);
|
||||
ut_ad(arr->magic_n == DYN_BLOCK_MAGIC_N);
|
||||
|
||||
/* Get the first array block */
|
||||
block = dyn_array_get_first_block(arr);
|
||||
|
||||
if (arr->heap != NULL) {
|
||||
used = dyn_block_get_used(block);
|
||||
|
||||
while (pos >= used) {
|
||||
pos -= used;
|
||||
block = UT_LIST_GET_NEXT(list, block);
|
||||
ut_ad(block);
|
||||
|
||||
used = dyn_block_get_used(block);
|
||||
}
|
||||
}
|
||||
|
||||
ut_ad(block);
|
||||
ut_ad(dyn_block_get_used(block) >= pos);
|
||||
|
||||
return(block->data + pos);
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
Returns the size of stored data in a dyn array. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
dyn_array_get_data_size(
|
||||
/*====================*/
|
||||
/* out: data size in bytes */
|
||||
dyn_array_t* arr) /* in: dyn array */
|
||||
{
|
||||
dyn_block_t* block;
|
||||
ulint sum = 0;
|
||||
|
||||
ut_ad(arr);
|
||||
ut_ad(arr->magic_n == DYN_BLOCK_MAGIC_N);
|
||||
|
||||
if (arr->heap == NULL) {
|
||||
|
||||
return(arr->used);
|
||||
}
|
||||
|
||||
/* Get the first array block */
|
||||
block = dyn_array_get_first_block(arr);
|
||||
|
||||
while (block != NULL) {
|
||||
sum += dyn_block_get_used(block);
|
||||
block = dyn_array_get_next_block(arr, block);
|
||||
}
|
||||
|
||||
return(sum);
|
||||
}
|
||||
|
||||
/************************************************************
|
||||
Pushes n bytes to a dyn array. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dyn_push_string(
|
||||
/*============*/
|
||||
dyn_array_t* arr, /* in: dyn array */
|
||||
byte* str, /* in: string to write */
|
||||
ulint len) /* in: string length */
|
||||
{
|
||||
byte* ptr;
|
||||
ulint n_copied;
|
||||
|
||||
while (len > 0) {
|
||||
if (len > DYN_ARRAY_DATA_SIZE) {
|
||||
n_copied = DYN_ARRAY_DATA_SIZE;
|
||||
} else {
|
||||
n_copied = len;
|
||||
}
|
||||
|
||||
ptr = (byte*) dyn_array_push(arr, n_copied);
|
||||
|
||||
ut_memcpy(ptr, str, n_copied);
|
||||
|
||||
str += n_copied;
|
||||
len -= n_copied;
|
||||
}
|
||||
}
|
||||
97
storage/innobase/include/eval0eval.h
Normal file
97
storage/innobase/include/eval0eval.h
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
/******************************************************
|
||||
SQL evaluator: evaluates simple data structures, like expressions, in
|
||||
a query graph
|
||||
|
||||
(c) 1997 Innobase Oy
|
||||
|
||||
Created 12/29/1997 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#ifndef eval0eval_h
|
||||
#define eval0eval_h
|
||||
|
||||
#include "univ.i"
|
||||
#include "que0types.h"
|
||||
#include "pars0sym.h"
|
||||
#include "pars0pars.h"
|
||||
|
||||
/*********************************************************************
|
||||
Free the buffer from global dynamic memory for a value of a que_node,
|
||||
if it has been allocated in the above function. The freeing for pushed
|
||||
column values is done in sel_col_prefetch_buf_free. */
|
||||
|
||||
void
|
||||
eval_node_free_val_buf(
|
||||
/*===================*/
|
||||
que_node_t* node); /* in: query graph node */
|
||||
/*********************************************************************
|
||||
Evaluates a symbol table symbol. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
eval_sym(
|
||||
/*=====*/
|
||||
sym_node_t* sym_node); /* in: symbol table node */
|
||||
/*********************************************************************
|
||||
Evaluates an expression. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
eval_exp(
|
||||
/*=====*/
|
||||
que_node_t* exp_node); /* in: expression */
|
||||
/*********************************************************************
|
||||
Sets an integer value as the value of an expression node. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
eval_node_set_int_val(
|
||||
/*==================*/
|
||||
que_node_t* node, /* in: expression node */
|
||||
lint val); /* in: value to set */
|
||||
/*********************************************************************
|
||||
Gets an integer value from an expression node. */
|
||||
UNIV_INLINE
|
||||
lint
|
||||
eval_node_get_int_val(
|
||||
/*==================*/
|
||||
/* out: integer value */
|
||||
que_node_t* node); /* in: expression node */
|
||||
/*********************************************************************
|
||||
Copies a binary string value as the value of a query graph node. Allocates a
|
||||
new buffer if necessary. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
eval_node_copy_and_alloc_val(
|
||||
/*=========================*/
|
||||
que_node_t* node, /* in: query graph node */
|
||||
byte* str, /* in: binary string */
|
||||
ulint len); /* in: string length or UNIV_SQL_NULL */
|
||||
/*********************************************************************
|
||||
Copies a query node value to another node. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
eval_node_copy_val(
|
||||
/*===============*/
|
||||
que_node_t* node1, /* in: node to copy to */
|
||||
que_node_t* node2); /* in: node to copy from */
|
||||
/*********************************************************************
|
||||
Gets a iboolean value from a query node. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
eval_node_get_ibool_val(
|
||||
/*===================*/
|
||||
/* out: iboolean value */
|
||||
que_node_t* node); /* in: query graph node */
|
||||
/*********************************************************************
|
||||
Evaluates a comparison node. */
|
||||
|
||||
ibool
|
||||
eval_cmp(
|
||||
/*=====*/
|
||||
/* out: the result of the comparison */
|
||||
func_node_t* cmp_node); /* in: comparison node */
|
||||
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
#include "eval0eval.ic"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
234
storage/innobase/include/eval0eval.ic
Normal file
234
storage/innobase/include/eval0eval.ic
Normal file
|
|
@ -0,0 +1,234 @@
|
|||
/******************************************************
|
||||
SQL evaluator: evaluates simple data structures, like expressions, in
|
||||
a query graph
|
||||
|
||||
(c) 1997 Innobase Oy
|
||||
|
||||
Created 12/29/1997 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#include "que0que.h"
|
||||
#include "rem0cmp.h"
|
||||
#include "pars0grm.h"
|
||||
|
||||
/*********************************************************************
|
||||
Evaluates a function node. */
|
||||
|
||||
void
|
||||
eval_func(
|
||||
/*======*/
|
||||
func_node_t* func_node); /* in: function node */
|
||||
/*********************************************************************
|
||||
Allocate a buffer from global dynamic memory for a value of a que_node.
|
||||
NOTE that this memory must be explicitly freed when the query graph is
|
||||
freed. If the node already has allocated buffer, that buffer is freed
|
||||
here. NOTE that this is the only function where dynamic memory should be
|
||||
allocated for a query node val field. */
|
||||
|
||||
byte*
|
||||
eval_node_alloc_val_buf(
|
||||
/*====================*/
|
||||
/* out: pointer to allocated buffer */
|
||||
que_node_t* node, /* in: query graph node; sets the val field
|
||||
data field to point to the new buffer, and
|
||||
len field equal to size */
|
||||
ulint size); /* in: buffer size */
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
Allocates a new buffer if needed. */
|
||||
UNIV_INLINE
|
||||
byte*
|
||||
eval_node_ensure_val_buf(
|
||||
/*=====================*/
|
||||
/* out: pointer to buffer */
|
||||
que_node_t* node, /* in: query graph node; sets the val field
|
||||
data field to point to the new buffer, and
|
||||
len field equal to size */
|
||||
ulint size) /* in: buffer size */
|
||||
{
|
||||
dfield_t* dfield;
|
||||
byte* data;
|
||||
|
||||
dfield = que_node_get_val(node);
|
||||
dfield_set_len(dfield, size);
|
||||
|
||||
data = dfield_get_data(dfield);
|
||||
|
||||
if (!data || que_node_get_val_buf_size(node) < size) {
|
||||
|
||||
data = eval_node_alloc_val_buf(node, size);
|
||||
}
|
||||
|
||||
return(data);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Evaluates a symbol table symbol. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
eval_sym(
|
||||
/*=====*/
|
||||
sym_node_t* sym_node) /* in: symbol table node */
|
||||
{
|
||||
|
||||
ut_ad(que_node_get_type(sym_node) == QUE_NODE_SYMBOL);
|
||||
|
||||
if (sym_node->indirection) {
|
||||
/* The symbol table node is an alias for a variable or a
|
||||
column */
|
||||
|
||||
dfield_copy_data(que_node_get_val(sym_node),
|
||||
que_node_get_val(sym_node->indirection));
|
||||
}
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Evaluates an expression. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
eval_exp(
|
||||
/*=====*/
|
||||
que_node_t* exp_node) /* in: expression */
|
||||
{
|
||||
if (que_node_get_type(exp_node) == QUE_NODE_SYMBOL) {
|
||||
|
||||
eval_sym((sym_node_t*)exp_node);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
eval_func(exp_node);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Sets an integer value as the value of an expression node. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
eval_node_set_int_val(
|
||||
/*==================*/
|
||||
que_node_t* node, /* in: expression node */
|
||||
lint val) /* in: value to set */
|
||||
{
|
||||
dfield_t* dfield;
|
||||
byte* data;
|
||||
|
||||
dfield = que_node_get_val(node);
|
||||
|
||||
data = dfield_get_data(dfield);
|
||||
|
||||
if (data == NULL) {
|
||||
data = eval_node_alloc_val_buf(node, 4);
|
||||
}
|
||||
|
||||
ut_ad(dfield_get_len(dfield) == 4);
|
||||
|
||||
mach_write_to_4(data, (ulint)val);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Gets an integer non-SQL null value from an expression node. */
|
||||
UNIV_INLINE
|
||||
lint
|
||||
eval_node_get_int_val(
|
||||
/*==================*/
|
||||
/* out: integer value */
|
||||
que_node_t* node) /* in: expression node */
|
||||
{
|
||||
dfield_t* dfield;
|
||||
|
||||
dfield = que_node_get_val(node);
|
||||
|
||||
ut_ad(dfield_get_len(dfield) == 4);
|
||||
|
||||
return((int)mach_read_from_4(dfield_get_data(dfield)));
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Gets a iboolean value from a query node. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
eval_node_get_ibool_val(
|
||||
/*===================*/
|
||||
/* out: iboolean value */
|
||||
que_node_t* node) /* in: query graph node */
|
||||
{
|
||||
dfield_t* dfield;
|
||||
byte* data;
|
||||
|
||||
dfield = que_node_get_val(node);
|
||||
|
||||
data = dfield_get_data(dfield);
|
||||
|
||||
ut_ad(data != NULL);
|
||||
|
||||
return(mach_read_from_1(data));
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Sets a iboolean value as the value of a function node. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
eval_node_set_ibool_val(
|
||||
/*===================*/
|
||||
func_node_t* func_node, /* in: function node */
|
||||
ibool val) /* in: value to set */
|
||||
{
|
||||
dfield_t* dfield;
|
||||
byte* data;
|
||||
|
||||
dfield = que_node_get_val(func_node);
|
||||
|
||||
data = dfield_get_data(dfield);
|
||||
|
||||
if (data == NULL) {
|
||||
/* Allocate 1 byte to hold the value */
|
||||
|
||||
data = eval_node_alloc_val_buf(func_node, 1);
|
||||
}
|
||||
|
||||
ut_ad(dfield_get_len(dfield) == 1);
|
||||
|
||||
mach_write_to_1(data, val);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Copies a binary string value as the value of a query graph node. Allocates a
|
||||
new buffer if necessary. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
eval_node_copy_and_alloc_val(
|
||||
/*=========================*/
|
||||
que_node_t* node, /* in: query graph node */
|
||||
byte* str, /* in: binary string */
|
||||
ulint len) /* in: string length or UNIV_SQL_NULL */
|
||||
{
|
||||
byte* data;
|
||||
|
||||
if (len == UNIV_SQL_NULL) {
|
||||
dfield_set_len(que_node_get_val(node), len);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
data = eval_node_ensure_val_buf(node, len);
|
||||
|
||||
ut_memcpy(data, str, len);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Copies a query node value to another node. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
eval_node_copy_val(
|
||||
/*===============*/
|
||||
que_node_t* node1, /* in: node to copy to */
|
||||
que_node_t* node2) /* in: node to copy from */
|
||||
{
|
||||
dfield_t* dfield2;
|
||||
|
||||
dfield2 = que_node_get_val(node2);
|
||||
|
||||
eval_node_copy_and_alloc_val(node1, dfield_get_data(dfield2),
|
||||
dfield_get_len(dfield2));
|
||||
}
|
||||
79
storage/innobase/include/eval0proc.h
Normal file
79
storage/innobase/include/eval0proc.h
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
/******************************************************
|
||||
Executes SQL stored procedures and their control structures
|
||||
|
||||
(c) 1998 Innobase Oy
|
||||
|
||||
Created 1/20/1998 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#ifndef eval0proc_h
|
||||
#define eval0proc_h
|
||||
|
||||
#include "univ.i"
|
||||
#include "que0types.h"
|
||||
#include "pars0sym.h"
|
||||
#include "pars0pars.h"
|
||||
|
||||
/**************************************************************************
|
||||
Performs an execution step of a procedure node. */
|
||||
UNIV_INLINE
|
||||
que_thr_t*
|
||||
proc_step(
|
||||
/*======*/
|
||||
/* out: query thread to run next or NULL */
|
||||
que_thr_t* thr); /* in: query thread */
|
||||
/**************************************************************************
|
||||
Performs an execution step of an if-statement node. */
|
||||
|
||||
que_thr_t*
|
||||
if_step(
|
||||
/*====*/
|
||||
/* out: query thread to run next or NULL */
|
||||
que_thr_t* thr); /* in: query thread */
|
||||
/**************************************************************************
|
||||
Performs an execution step of a while-statement node. */
|
||||
|
||||
que_thr_t*
|
||||
while_step(
|
||||
/*=======*/
|
||||
/* out: query thread to run next or NULL */
|
||||
que_thr_t* thr); /* in: query thread */
|
||||
/**************************************************************************
|
||||
Performs an execution step of a for-loop node. */
|
||||
|
||||
que_thr_t*
|
||||
for_step(
|
||||
/*=====*/
|
||||
/* out: query thread to run next or NULL */
|
||||
que_thr_t* thr); /* in: query thread */
|
||||
/**************************************************************************
|
||||
Performs an execution step of an assignment statement node. */
|
||||
|
||||
que_thr_t*
|
||||
assign_step(
|
||||
/*========*/
|
||||
/* out: query thread to run next or NULL */
|
||||
que_thr_t* thr); /* in: query thread */
|
||||
/**************************************************************************
|
||||
Performs an execution step of a procedure call node. */
|
||||
UNIV_INLINE
|
||||
que_thr_t*
|
||||
proc_eval_step(
|
||||
/*===========*/
|
||||
/* out: query thread to run next or NULL */
|
||||
que_thr_t* thr); /* in: query thread */
|
||||
/**************************************************************************
|
||||
Performs an execution step of a return-statement node. */
|
||||
|
||||
que_thr_t*
|
||||
return_step(
|
||||
/*========*/
|
||||
/* out: query thread to run next or NULL */
|
||||
que_thr_t* thr); /* in: query thread */
|
||||
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
#include "eval0proc.ic"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
71
storage/innobase/include/eval0proc.ic
Normal file
71
storage/innobase/include/eval0proc.ic
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
/******************************************************
|
||||
Executes SQL stored procedures and their control structures
|
||||
|
||||
(c) 1998 Innobase Oy
|
||||
|
||||
Created 1/20/1998 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#include "pars0pars.h"
|
||||
#include "que0que.h"
|
||||
#include "eval0eval.h"
|
||||
|
||||
/**************************************************************************
|
||||
Performs an execution step of a procedure node. */
|
||||
UNIV_INLINE
|
||||
que_thr_t*
|
||||
proc_step(
|
||||
/*======*/
|
||||
/* out: query thread to run next or NULL */
|
||||
que_thr_t* thr) /* in: query thread */
|
||||
{
|
||||
proc_node_t* node;
|
||||
|
||||
ut_ad(thr);
|
||||
|
||||
node = thr->run_node;
|
||||
ut_ad(que_node_get_type(node) == QUE_NODE_PROC);
|
||||
|
||||
if (thr->prev_node == que_node_get_parent(node)) {
|
||||
/* Start execution from the first statement in the statement
|
||||
list */
|
||||
|
||||
thr->run_node = node->stat_list;
|
||||
} else {
|
||||
/* Move to the next statement */
|
||||
ut_ad(que_node_get_next(thr->prev_node) == NULL);
|
||||
|
||||
thr->run_node = NULL;
|
||||
}
|
||||
|
||||
if (thr->run_node == NULL) {
|
||||
thr->run_node = que_node_get_parent(node);
|
||||
}
|
||||
|
||||
return(thr);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Performs an execution step of a procedure call node. */
|
||||
UNIV_INLINE
|
||||
que_thr_t*
|
||||
proc_eval_step(
|
||||
/*===========*/
|
||||
/* out: query thread to run next or NULL */
|
||||
que_thr_t* thr) /* in: query thread */
|
||||
{
|
||||
func_node_t* node;
|
||||
|
||||
ut_ad(thr);
|
||||
|
||||
node = thr->run_node;
|
||||
ut_ad(que_node_get_type(node) == QUE_NODE_FUNC);
|
||||
|
||||
/* Evaluate the procedure */
|
||||
|
||||
eval_exp(node);
|
||||
|
||||
thr->run_node = que_node_get_parent(node);
|
||||
|
||||
return(thr);
|
||||
}
|
||||
683
storage/innobase/include/fil0fil.h
Normal file
683
storage/innobase/include/fil0fil.h
Normal file
|
|
@ -0,0 +1,683 @@
|
|||
/******************************************************
|
||||
The low-level file system
|
||||
|
||||
(c) 1995 Innobase Oy
|
||||
|
||||
Created 10/25/1995 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#ifndef fil0fil_h
|
||||
#define fil0fil_h
|
||||
|
||||
#include "univ.i"
|
||||
#include "sync0rw.h"
|
||||
#include "dict0types.h"
|
||||
#include "ibuf0types.h"
|
||||
#include "ut0byte.h"
|
||||
#include "os0file.h"
|
||||
|
||||
/* When mysqld is run, the default directory "." is the mysqld datadir, but in
|
||||
ibbackup we must set it explicitly; the patgh must NOT contain the trailing
|
||||
'/' or '\' */
|
||||
extern const char* fil_path_to_mysql_datadir;
|
||||
|
||||
/* Initial size of a single-table tablespace in pages */
|
||||
#define FIL_IBD_FILE_INITIAL_SIZE 4
|
||||
|
||||
/* 'null' (undefined) page offset in the context of file spaces */
|
||||
#define FIL_NULL ULINT32_UNDEFINED
|
||||
|
||||
/* Space address data type; this is intended to be used when
|
||||
addresses accurate to a byte are stored in file pages. If the page part
|
||||
of the address is FIL_NULL, the address is considered undefined. */
|
||||
|
||||
typedef byte fil_faddr_t; /* 'type' definition in C: an address
|
||||
stored in a file page is a string of bytes */
|
||||
#define FIL_ADDR_PAGE 0 /* first in address is the page offset */
|
||||
#define FIL_ADDR_BYTE 4 /* then comes 2-byte byte offset within page*/
|
||||
|
||||
#define FIL_ADDR_SIZE 6 /* address size is 6 bytes */
|
||||
|
||||
/* A struct for storing a space address FIL_ADDR, when it is used
|
||||
in C program data structures. */
|
||||
|
||||
typedef struct fil_addr_struct fil_addr_t;
|
||||
struct fil_addr_struct{
|
||||
ulint page; /* page number within a space */
|
||||
ulint boffset; /* byte offset within the page */
|
||||
};
|
||||
|
||||
/* Null file address */
|
||||
extern fil_addr_t fil_addr_null;
|
||||
|
||||
/* The byte offsets on a file page for various variables */
|
||||
#define FIL_PAGE_SPACE_OR_CHKSUM 0 /* in < MySQL-4.0.14 space id the
|
||||
page belongs to (== 0) but in later
|
||||
versions the 'new' checksum of the
|
||||
page */
|
||||
#define FIL_PAGE_OFFSET 4 /* page offset inside space */
|
||||
#define FIL_PAGE_PREV 8 /* if there is a 'natural' predecessor
|
||||
of the page, its offset */
|
||||
#define FIL_PAGE_NEXT 12 /* if there is a 'natural' successor
|
||||
of the page, its offset */
|
||||
#define FIL_PAGE_LSN 16 /* lsn of the end of the newest
|
||||
modification log record to the page */
|
||||
#define FIL_PAGE_TYPE 24 /* file page type: FIL_PAGE_INDEX,...,
|
||||
2 bytes */
|
||||
#define FIL_PAGE_FILE_FLUSH_LSN 26 /* this is only defined for the
|
||||
first page in a data file: the file
|
||||
has been flushed to disk at least up
|
||||
to this lsn */
|
||||
#define FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID 34 /* starting from 4.1.x this
|
||||
contains the space id of the page */
|
||||
#define FIL_PAGE_DATA 38 /* start of the data on the page */
|
||||
|
||||
/* File page trailer */
|
||||
#define FIL_PAGE_END_LSN_OLD_CHKSUM 8 /* the low 4 bytes of this are used
|
||||
to store the page checksum, the
|
||||
last 4 bytes should be identical
|
||||
to the last 4 bytes of FIL_PAGE_LSN */
|
||||
#define FIL_PAGE_DATA_END 8
|
||||
|
||||
/* File page types */
|
||||
#define FIL_PAGE_INDEX 17855
|
||||
#define FIL_PAGE_UNDO_LOG 2
|
||||
#define FIL_PAGE_INODE 3
|
||||
#define FIL_PAGE_IBUF_FREE_LIST 4
|
||||
|
||||
/* Space types */
|
||||
#define FIL_TABLESPACE 501
|
||||
#define FIL_LOG 502
|
||||
|
||||
extern ulint fil_n_log_flushes;
|
||||
|
||||
extern ulint fil_n_pending_log_flushes;
|
||||
extern ulint fil_n_pending_tablespace_flushes;
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
Returns the version number of a tablespace, -1 if not found. */
|
||||
|
||||
ib_longlong
|
||||
fil_space_get_version(
|
||||
/*==================*/
|
||||
/* out: version number, -1 if the tablespace does not
|
||||
exist in the memory cache */
|
||||
ulint id); /* in: space id */
|
||||
/***********************************************************************
|
||||
Returns the latch of a file space. */
|
||||
|
||||
rw_lock_t*
|
||||
fil_space_get_latch(
|
||||
/*================*/
|
||||
/* out: latch protecting storage allocation */
|
||||
ulint id); /* in: space id */
|
||||
/***********************************************************************
|
||||
Returns the type of a file space. */
|
||||
|
||||
ulint
|
||||
fil_space_get_type(
|
||||
/*===============*/
|
||||
/* out: FIL_TABLESPACE or FIL_LOG */
|
||||
ulint id); /* in: space id */
|
||||
/***********************************************************************
|
||||
Returns the ibuf data of a file space. */
|
||||
|
||||
ibuf_data_t*
|
||||
fil_space_get_ibuf_data(
|
||||
/*====================*/
|
||||
/* out: ibuf data for this space */
|
||||
ulint id); /* in: space id */
|
||||
/***********************************************************************
|
||||
Appends a new file to the chain of files of a space. File must be closed. */
|
||||
|
||||
void
|
||||
fil_node_create(
|
||||
/*============*/
|
||||
const char* name, /* in: file name (file must be closed) */
|
||||
ulint size, /* in: file size in database blocks, rounded
|
||||
downwards to an integer */
|
||||
ulint id, /* in: space id where to append */
|
||||
ibool is_raw);/* in: TRUE if a raw device or
|
||||
a raw disk partition */
|
||||
/********************************************************************
|
||||
Drops files from the start of a file space, so that its size is cut by
|
||||
the amount given. */
|
||||
|
||||
void
|
||||
fil_space_truncate_start(
|
||||
/*=====================*/
|
||||
ulint id, /* in: space id */
|
||||
ulint trunc_len); /* in: truncate by this much; it is an error
|
||||
if this does not equal to the combined size of
|
||||
some initial files in the space */
|
||||
/***********************************************************************
|
||||
Creates a space memory object and puts it to the 'fil system' hash table. If
|
||||
there is an error, prints an error message to the .err log. */
|
||||
|
||||
ibool
|
||||
fil_space_create(
|
||||
/*=============*/
|
||||
/* out: TRUE if success */
|
||||
const char* name, /* in: space name */
|
||||
ulint id, /* in: space id */
|
||||
ulint purpose);/* in: FIL_TABLESPACE, or FIL_LOG if log */
|
||||
/***********************************************************************
|
||||
Frees a space object from a the tablespace memory cache. Closes the files in
|
||||
the chain but does not delete them. */
|
||||
|
||||
ibool
|
||||
fil_space_free(
|
||||
/*===========*/
|
||||
/* out: TRUE if success */
|
||||
ulint id); /* in: space id */
|
||||
/***********************************************************************
|
||||
Returns the size of the space in pages. The tablespace must be cached in the
|
||||
memory cache. */
|
||||
|
||||
ulint
|
||||
fil_space_get_size(
|
||||
/*===============*/
|
||||
/* out: space size, 0 if space not found */
|
||||
ulint id); /* in: space id */
|
||||
/***********************************************************************
|
||||
Checks if the pair space, page_no refers to an existing page in a tablespace
|
||||
file space. The tablespace must be cached in the memory cache. */
|
||||
|
||||
ibool
|
||||
fil_check_adress_in_tablespace(
|
||||
/*===========================*/
|
||||
/* out: TRUE if the address is meaningful */
|
||||
ulint id, /* in: space id */
|
||||
ulint page_no);/* in: page number */
|
||||
/********************************************************************
|
||||
Initializes the tablespace memory cache. */
|
||||
|
||||
void
|
||||
fil_init(
|
||||
/*=====*/
|
||||
ulint max_n_open); /* in: max number of open files */
|
||||
/***********************************************************************
|
||||
Opens all log files and system tablespace data files. They stay open until the
|
||||
database server shutdown. This should be called at a server startup after the
|
||||
space objects for the log and the system tablespace have been created. The
|
||||
purpose of this operation is to make sure we never run out of file descriptors
|
||||
if we need to read from the insert buffer or to write to the log. */
|
||||
|
||||
void
|
||||
fil_open_log_and_system_tablespace_files(void);
|
||||
/*==========================================*/
|
||||
/***********************************************************************
|
||||
Closes all open files. There must not be any pending i/o's or not flushed
|
||||
modifications in the files. */
|
||||
|
||||
void
|
||||
fil_close_all_files(void);
|
||||
/*=====================*/
|
||||
/***********************************************************************
|
||||
Sets the max tablespace id counter if the given number is bigger than the
|
||||
previous value. */
|
||||
|
||||
void
|
||||
fil_set_max_space_id_if_bigger(
|
||||
/*===========================*/
|
||||
ulint max_id);/* in: maximum known id */
|
||||
/********************************************************************
|
||||
Initializes the ibuf data structure for space 0 == the system tablespace.
|
||||
This can be called after the file space headers have been created and the
|
||||
dictionary system has been initialized. */
|
||||
|
||||
void
|
||||
fil_ibuf_init_at_db_start(void);
|
||||
/*===========================*/
|
||||
/********************************************************************
|
||||
Writes the flushed lsn and the latest archived log number to the page
|
||||
header of the first page of each data file in the system tablespace. */
|
||||
|
||||
ulint
|
||||
fil_write_flushed_lsn_to_data_files(
|
||||
/*================================*/
|
||||
/* out: DB_SUCCESS or error number */
|
||||
dulint lsn, /* in: lsn to write */
|
||||
ulint arch_log_no); /* in: latest archived log file number */
|
||||
/***********************************************************************
|
||||
Reads the flushed lsn and arch no fields from a data file at database
|
||||
startup. */
|
||||
|
||||
void
|
||||
fil_read_flushed_lsn_and_arch_log_no(
|
||||
/*=================================*/
|
||||
os_file_t data_file, /* in: open data file */
|
||||
ibool one_read_already, /* in: TRUE if min and max parameters
|
||||
below already contain sensible data */
|
||||
#ifdef UNIV_LOG_ARCHIVE
|
||||
ulint* min_arch_log_no, /* in/out: */
|
||||
ulint* max_arch_log_no, /* in/out: */
|
||||
#endif /* UNIV_LOG_ARCHIVE */
|
||||
dulint* min_flushed_lsn, /* in/out: */
|
||||
dulint* max_flushed_lsn); /* in/out: */
|
||||
/***********************************************************************
|
||||
Increments the count of pending insert buffer page merges, if space is not
|
||||
being deleted. */
|
||||
|
||||
ibool
|
||||
fil_inc_pending_ibuf_merges(
|
||||
/*========================*/
|
||||
/* out: TRUE if being deleted, and ibuf merges should
|
||||
be skipped */
|
||||
ulint id); /* in: space id */
|
||||
/***********************************************************************
|
||||
Decrements the count of pending insert buffer page merges. */
|
||||
|
||||
void
|
||||
fil_decr_pending_ibuf_merges(
|
||||
/*========================*/
|
||||
ulint id); /* in: space id */
|
||||
/***********************************************************************
|
||||
Parses the body of a log record written about an .ibd file operation. That is,
|
||||
the log record part after the standard (type, space id, page no) header of the
|
||||
log record.
|
||||
|
||||
If desired, also replays the delete or rename operation if the .ibd file
|
||||
exists and the space id in it matches. Replays the create operation if a file
|
||||
at that path does not exist yet. If the database directory for the file to be
|
||||
created does not exist, then we create the directory, too.
|
||||
|
||||
Note that ibbackup --apply-log sets fil_path_to_mysql_datadir to point to the
|
||||
datadir that we should use in replaying the file operations. */
|
||||
|
||||
byte*
|
||||
fil_op_log_parse_or_replay(
|
||||
/*=======================*/
|
||||
/* out: end of log record, or NULL if the
|
||||
record was not completely contained between
|
||||
ptr and end_ptr */
|
||||
byte* ptr, /* in: buffer containing the log record body,
|
||||
or an initial segment of it, if the record does
|
||||
not fir completely between ptr and end_ptr */
|
||||
byte* end_ptr, /* in: buffer end */
|
||||
ulint type, /* in: the type of this log record */
|
||||
ibool do_replay, /* in: TRUE if we want to replay the
|
||||
operation, and not just parse the log record */
|
||||
ulint space_id); /* in: if do_replay is TRUE, the space id of
|
||||
the tablespace in question; otherwise
|
||||
ignored */
|
||||
/***********************************************************************
|
||||
Deletes a single-table tablespace. The tablespace must be cached in the
|
||||
memory cache. */
|
||||
|
||||
ibool
|
||||
fil_delete_tablespace(
|
||||
/*==================*/
|
||||
/* out: TRUE if success */
|
||||
ulint id); /* in: space id */
|
||||
/***********************************************************************
|
||||
Discards a single-table tablespace. The tablespace must be cached in the
|
||||
memory cache. Discarding is like deleting a tablespace, but
|
||||
1) we do not drop the table from the data dictionary;
|
||||
2) we remove all insert buffer entries for the tablespace immediately; in DROP
|
||||
TABLE they are only removed gradually in the background;
|
||||
3) when the user does IMPORT TABLESPACE, the tablespace will have the same id
|
||||
as it originally had. */
|
||||
|
||||
ibool
|
||||
fil_discard_tablespace(
|
||||
/*===================*/
|
||||
/* out: TRUE if success */
|
||||
ulint id); /* in: space id */
|
||||
/***********************************************************************
|
||||
Renames a single-table tablespace. The tablespace must be cached in the
|
||||
tablespace memory cache. */
|
||||
|
||||
ibool
|
||||
fil_rename_tablespace(
|
||||
/*==================*/
|
||||
/* out: TRUE if success */
|
||||
const char* old_name, /* in: old table name in the standard
|
||||
databasename/tablename format of
|
||||
InnoDB, or NULL if we do the rename
|
||||
based on the space id only */
|
||||
ulint id, /* in: space id */
|
||||
const char* new_name); /* in: new table name in the standard
|
||||
databasename/tablename format
|
||||
of InnoDB */
|
||||
|
||||
/***********************************************************************
|
||||
Creates a new single-table tablespace to a database directory of MySQL.
|
||||
Database directories are under the 'datadir' of MySQL. The datadir is the
|
||||
directory of a running mysqld program. We can refer to it by simply the
|
||||
path '.'. Tables created with CREATE TEMPORARY TABLE we place in the temp
|
||||
dir of the mysqld server. */
|
||||
|
||||
ulint
|
||||
fil_create_new_single_table_tablespace(
|
||||
/*===================================*/
|
||||
/* out: DB_SUCCESS or error code */
|
||||
ulint* space_id, /* in/out: space id; if this is != 0,
|
||||
then this is an input parameter,
|
||||
otherwise output */
|
||||
const char* tablename, /* in: the table name in the usual
|
||||
databasename/tablename format
|
||||
of InnoDB, or a dir path to a temp
|
||||
table */
|
||||
ibool is_temp, /* in: TRUE if a table created with
|
||||
CREATE TEMPORARY TABLE */
|
||||
ulint size); /* in: the initial size of the
|
||||
tablespace file in pages,
|
||||
must be >= FIL_IBD_FILE_INITIAL_SIZE */
|
||||
/************************************************************************
|
||||
Tries to open a single-table tablespace and optionally checks the space id is
|
||||
right in it. If does not succeed, prints an error message to the .err log. This
|
||||
function is used to open a tablespace when we start up mysqld, and also in
|
||||
IMPORT TABLESPACE.
|
||||
NOTE that we assume this operation is used either at the database startup
|
||||
or under the protection of the dictionary mutex, so that two users cannot
|
||||
race here. This operation does not leave the file associated with the
|
||||
tablespace open, but closes it after we have looked at the space id in it. */
|
||||
|
||||
ibool
|
||||
fil_open_single_table_tablespace(
|
||||
/*=============================*/
|
||||
/* out: TRUE if success */
|
||||
ibool check_space_id, /* in: should we check that the space
|
||||
id in the file is right; we assume
|
||||
that this function runs much faster
|
||||
if no check is made, since accessing
|
||||
the file inode probably is much
|
||||
faster (the OS caches them) than
|
||||
accessing the first page of the file */
|
||||
ulint id, /* in: space id */
|
||||
const char* name); /* in: table name in the
|
||||
databasename/tablename format */
|
||||
/************************************************************************
|
||||
It is possible, though very improbable, that the lsn's in the tablespace to be
|
||||
imported have risen above the current system lsn, if a lengthy purge, ibuf
|
||||
merge, or rollback was performed on a backup taken with ibbackup. If that is
|
||||
the case, reset page lsn's in the file. We assume that mysqld was shut down
|
||||
after it performed these cleanup operations on the .ibd file, so that it at
|
||||
the shutdown stamped the latest lsn to the FIL_PAGE_FILE_FLUSH_LSN in the
|
||||
first page of the .ibd file, and we can determine whether we need to reset the
|
||||
lsn's just by looking at that flush lsn. */
|
||||
|
||||
ibool
|
||||
fil_reset_too_high_lsns(
|
||||
/*====================*/
|
||||
/* out: TRUE if success */
|
||||
const char* name, /* in: table name in the
|
||||
databasename/tablename format */
|
||||
dulint current_lsn); /* in: reset lsn's if the lsn stamped
|
||||
to FIL_PAGE_FILE_FLUSH_LSN in the
|
||||
first page is too high */
|
||||
/************************************************************************
|
||||
At the server startup, if we need crash recovery, scans the database
|
||||
directories under the MySQL datadir, looking for .ibd files. Those files are
|
||||
single-table tablespaces. We need to know the space id in each of them so that
|
||||
we know into which file we should look to check the contents of a page stored
|
||||
in the doublewrite buffer, also to know where to apply log records where the
|
||||
space id is != 0. */
|
||||
|
||||
ulint
|
||||
fil_load_single_table_tablespaces(void);
|
||||
/*===================================*/
|
||||
/* out: DB_SUCCESS or error number */
|
||||
/************************************************************************
|
||||
If we need crash recovery, and we have called
|
||||
fil_load_single_table_tablespaces() and dict_load_single_table_tablespaces(),
|
||||
we can call this function to print an error message of orphaned .ibd files
|
||||
for which there is not a data dictionary entry with a matching table name
|
||||
and space id. */
|
||||
|
||||
void
|
||||
fil_print_orphaned_tablespaces(void);
|
||||
/*================================*/
|
||||
/***********************************************************************
|
||||
Returns TRUE if a single-table tablespace does not exist in the memory cache,
|
||||
or is being deleted there. */
|
||||
|
||||
ibool
|
||||
fil_tablespace_deleted_or_being_deleted_in_mem(
|
||||
/*===========================================*/
|
||||
/* out: TRUE if does not exist or is being\
|
||||
deleted */
|
||||
ulint id, /* in: space id */
|
||||
ib_longlong version);/* in: tablespace_version should be this; if
|
||||
you pass -1 as the value of this, then this
|
||||
parameter is ignored */
|
||||
/***********************************************************************
|
||||
Returns TRUE if a single-table tablespace exists in the memory cache. */
|
||||
|
||||
ibool
|
||||
fil_tablespace_exists_in_mem(
|
||||
/*=========================*/
|
||||
/* out: TRUE if exists */
|
||||
ulint id); /* in: space id */
|
||||
/***********************************************************************
|
||||
Returns TRUE if a matching tablespace exists in the InnoDB tablespace memory
|
||||
cache. Note that if we have not done a crash recovery at the database startup,
|
||||
there may be many tablespaces which are not yet in the memory cache. */
|
||||
|
||||
ibool
|
||||
fil_space_for_table_exists_in_mem(
|
||||
/*==============================*/
|
||||
/* out: TRUE if a matching tablespace
|
||||
exists in the memory cache */
|
||||
ulint id, /* in: space id */
|
||||
const char* name, /* in: table name in the standard
|
||||
'databasename/tablename' format or
|
||||
the dir path to a temp table */
|
||||
ibool is_temp, /* in: TRUE if created with CREATE
|
||||
TEMPORARY TABLE */
|
||||
ibool mark_space, /* in: in crash recovery, at database
|
||||
startup we mark all spaces which have
|
||||
an associated table in the InnoDB
|
||||
data dictionary, so that
|
||||
we can print a warning about orphaned
|
||||
tablespaces */
|
||||
ibool print_error_if_does_not_exist);
|
||||
/* in: print detailed error
|
||||
information to the .err log if a
|
||||
matching tablespace is not found from
|
||||
memory */
|
||||
/**************************************************************************
|
||||
Tries to extend a data file so that it would accommodate the number of pages
|
||||
given. The tablespace must be cached in the memory cache. If the space is big
|
||||
enough already, does nothing. */
|
||||
|
||||
ibool
|
||||
fil_extend_space_to_desired_size(
|
||||
/*=============================*/
|
||||
/* out: TRUE if success */
|
||||
ulint* actual_size, /* out: size of the space after extension;
|
||||
if we ran out of disk space this may be lower
|
||||
than the desired size */
|
||||
ulint space_id, /* in: space id */
|
||||
ulint size_after_extend);/* in: desired size in pages after the
|
||||
extension; if the current space size is bigger
|
||||
than this already, the function does nothing */
|
||||
#ifdef UNIV_HOTBACKUP
|
||||
/************************************************************************
|
||||
Extends all tablespaces to the size stored in the space header. During the
|
||||
ibbackup --apply-log phase we extended the spaces on-demand so that log records
|
||||
could be appllied, but that may have left spaces still too small compared to
|
||||
the size stored in the space header. */
|
||||
|
||||
void
|
||||
fil_extend_tablespaces_to_stored_len(void);
|
||||
/*======================================*/
|
||||
#endif
|
||||
/***********************************************************************
|
||||
Tries to reserve free extents in a file space. */
|
||||
|
||||
ibool
|
||||
fil_space_reserve_free_extents(
|
||||
/*===========================*/
|
||||
/* out: TRUE if succeed */
|
||||
ulint id, /* in: space id */
|
||||
ulint n_free_now, /* in: number of free extents now */
|
||||
ulint n_to_reserve); /* in: how many one wants to reserve */
|
||||
/***********************************************************************
|
||||
Releases free extents in a file space. */
|
||||
|
||||
void
|
||||
fil_space_release_free_extents(
|
||||
/*===========================*/
|
||||
ulint id, /* in: space id */
|
||||
ulint n_reserved); /* in: how many one reserved */
|
||||
/***********************************************************************
|
||||
Gets the number of reserved extents. If the database is silent, this number
|
||||
should be zero. */
|
||||
|
||||
ulint
|
||||
fil_space_get_n_reserved_extents(
|
||||
/*=============================*/
|
||||
ulint id); /* in: space id */
|
||||
/************************************************************************
|
||||
Reads or writes data. This operation is asynchronous (aio). */
|
||||
|
||||
ulint
|
||||
fil_io(
|
||||
/*===*/
|
||||
/* out: DB_SUCCESS, or DB_TABLESPACE_DELETED
|
||||
if we are trying to do i/o on a tablespace
|
||||
which does not exist */
|
||||
ulint type, /* in: OS_FILE_READ or OS_FILE_WRITE,
|
||||
ORed to OS_FILE_LOG, if a log i/o
|
||||
and ORed to OS_AIO_SIMULATED_WAKE_LATER
|
||||
if simulated aio and we want to post a
|
||||
batch of i/os; NOTE that a simulated batch
|
||||
may introduce hidden chances of deadlocks,
|
||||
because i/os are not actually handled until
|
||||
all have been posted: use with great
|
||||
caution! */
|
||||
ibool sync, /* in: TRUE if synchronous aio is desired */
|
||||
ulint space_id, /* in: space id */
|
||||
ulint block_offset, /* in: offset in number of blocks */
|
||||
ulint byte_offset, /* in: remainder of offset in bytes; in
|
||||
aio this must be divisible by the OS block
|
||||
size */
|
||||
ulint len, /* in: how many bytes to read or write; this
|
||||
must not cross a file boundary; in aio this
|
||||
must be a block size multiple */
|
||||
void* buf, /* in/out: buffer where to store read data
|
||||
or from where to write; in aio this must be
|
||||
appropriately aligned */
|
||||
void* message); /* in: message for aio handler if non-sync
|
||||
aio used, else ignored */
|
||||
/************************************************************************
|
||||
Reads data from a space to a buffer. Remember that the possible incomplete
|
||||
blocks at the end of file are ignored: they are not taken into account when
|
||||
calculating the byte offset within a space. */
|
||||
|
||||
ulint
|
||||
fil_read(
|
||||
/*=====*/
|
||||
/* out: DB_SUCCESS, or DB_TABLESPACE_DELETED
|
||||
if we are trying to do i/o on a tablespace
|
||||
which does not exist */
|
||||
ibool sync, /* in: TRUE if synchronous aio is desired */
|
||||
ulint space_id, /* in: space id */
|
||||
ulint block_offset, /* in: offset in number of blocks */
|
||||
ulint byte_offset, /* in: remainder of offset in bytes; in aio
|
||||
this must be divisible by the OS block size */
|
||||
ulint len, /* in: how many bytes to read; this must not
|
||||
cross a file boundary; in aio this must be a
|
||||
block size multiple */
|
||||
void* buf, /* in/out: buffer where to store data read;
|
||||
in aio this must be appropriately aligned */
|
||||
void* message); /* in: message for aio handler if non-sync
|
||||
aio used, else ignored */
|
||||
/************************************************************************
|
||||
Writes data to a space from a buffer. Remember that the possible incomplete
|
||||
blocks at the end of file are ignored: they are not taken into account when
|
||||
calculating the byte offset within a space. */
|
||||
|
||||
ulint
|
||||
fil_write(
|
||||
/*======*/
|
||||
/* out: DB_SUCCESS, or DB_TABLESPACE_DELETED
|
||||
if we are trying to do i/o on a tablespace
|
||||
which does not exist */
|
||||
ibool sync, /* in: TRUE if synchronous aio is desired */
|
||||
ulint space_id, /* in: space id */
|
||||
ulint block_offset, /* in: offset in number of blocks */
|
||||
ulint byte_offset, /* in: remainder of offset in bytes; in aio
|
||||
this must be divisible by the OS block size */
|
||||
ulint len, /* in: how many bytes to write; this must
|
||||
not cross a file boundary; in aio this must
|
||||
be a block size multiple */
|
||||
void* buf, /* in: buffer from which to write; in aio
|
||||
this must be appropriately aligned */
|
||||
void* message); /* in: message for aio handler if non-sync
|
||||
aio used, else ignored */
|
||||
/**************************************************************************
|
||||
Waits for an aio operation to complete. This function is used to write the
|
||||
handler for completed requests. The aio array of pending requests is divided
|
||||
into segments (see os0file.c for more info). The thread specifies which
|
||||
segment it wants to wait for. */
|
||||
|
||||
void
|
||||
fil_aio_wait(
|
||||
/*=========*/
|
||||
ulint segment); /* in: the number of the segment in the aio
|
||||
array to wait for */
|
||||
/**************************************************************************
|
||||
Flushes to disk possible writes cached by the OS. If the space does not exist
|
||||
or is being dropped, does not do anything. */
|
||||
|
||||
void
|
||||
fil_flush(
|
||||
/*======*/
|
||||
ulint space_id); /* in: file space id (this can be a group of
|
||||
log files or a tablespace of the database) */
|
||||
/**************************************************************************
|
||||
Flushes to disk writes in file spaces of the given type possibly cached by
|
||||
the OS. */
|
||||
|
||||
void
|
||||
fil_flush_file_spaces(
|
||||
/*==================*/
|
||||
ulint purpose); /* in: FIL_TABLESPACE, FIL_LOG */
|
||||
/**********************************************************************
|
||||
Checks the consistency of the tablespace cache. */
|
||||
|
||||
ibool
|
||||
fil_validate(void);
|
||||
/*==============*/
|
||||
/* out: TRUE if ok */
|
||||
/************************************************************************
|
||||
Returns TRUE if file address is undefined. */
|
||||
|
||||
ibool
|
||||
fil_addr_is_null(
|
||||
/*=============*/
|
||||
/* out: TRUE if undefined */
|
||||
fil_addr_t addr); /* in: address */
|
||||
/************************************************************************
|
||||
Accessor functions for a file page */
|
||||
|
||||
ulint
|
||||
fil_page_get_prev(byte* page);
|
||||
ulint
|
||||
fil_page_get_next(byte* page);
|
||||
/*************************************************************************
|
||||
Sets the file page type. */
|
||||
|
||||
void
|
||||
fil_page_set_type(
|
||||
/*==============*/
|
||||
byte* page, /* in: file page */
|
||||
ulint type); /* in: type */
|
||||
/*************************************************************************
|
||||
Gets the file page type. */
|
||||
|
||||
ulint
|
||||
fil_page_get_type(
|
||||
/*==============*/
|
||||
/* out: type; NOTE that if the type has not been
|
||||
written to page, the return value not defined */
|
||||
byte* page); /* in: file page */
|
||||
|
||||
|
||||
typedef struct fil_space_struct fil_space_t;
|
||||
|
||||
#endif
|
||||
387
storage/innobase/include/fsp0fsp.h
Normal file
387
storage/innobase/include/fsp0fsp.h
Normal file
|
|
@ -0,0 +1,387 @@
|
|||
/******************************************************
|
||||
File space management
|
||||
|
||||
(c) 1995 Innobase Oy
|
||||
|
||||
Created 12/18/1995 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#ifndef fsp0fsp_h
|
||||
#define fsp0fsp_h
|
||||
|
||||
#include "univ.i"
|
||||
|
||||
#include "mtr0mtr.h"
|
||||
#include "fut0lst.h"
|
||||
#include "ut0byte.h"
|
||||
#include "page0types.h"
|
||||
|
||||
/* If records are inserted in order, there are the following
|
||||
flags to tell this (their type is made byte for the compiler
|
||||
to warn if direction and hint parameters are switched in
|
||||
fseg_alloc_free_page): */
|
||||
#define FSP_UP ((byte)111) /* alphabetically upwards */
|
||||
#define FSP_DOWN ((byte)112) /* alphabetically downwards */
|
||||
#define FSP_NO_DIR ((byte)113) /* no order */
|
||||
|
||||
/* File space extent size in pages */
|
||||
#define FSP_EXTENT_SIZE 64
|
||||
|
||||
/* On a page of any file segment, data may be put starting from this offset: */
|
||||
#define FSEG_PAGE_DATA FIL_PAGE_DATA
|
||||
|
||||
/* File segment header which points to the inode describing the file segment */
|
||||
typedef byte fseg_header_t;
|
||||
|
||||
#define FSEG_HDR_SPACE 0 /* space id of the inode */
|
||||
#define FSEG_HDR_PAGE_NO 4 /* page number of the inode */
|
||||
#define FSEG_HDR_OFFSET 8 /* byte offset of the inode */
|
||||
|
||||
#define FSEG_HEADER_SIZE 10
|
||||
|
||||
/**************************************************************************
|
||||
Initializes the file space system. */
|
||||
|
||||
void
|
||||
fsp_init(void);
|
||||
/*==========*/
|
||||
/**************************************************************************
|
||||
Gets the current free limit of a tablespace. The free limit means the
|
||||
place of the first page which has never been put to the the free list
|
||||
for allocation. The space above that address is initialized to zero.
|
||||
Sets also the global variable log_fsp_current_free_limit. */
|
||||
|
||||
ulint
|
||||
fsp_header_get_free_limit(
|
||||
/*======================*/
|
||||
/* out: free limit in megabytes */
|
||||
ulint space); /* in: space id, must be 0 */
|
||||
/**************************************************************************
|
||||
Gets the size of the tablespace from the tablespace header. If we do not
|
||||
have an auto-extending data file, this should be equal to the size of the
|
||||
data files. If there is an auto-extending data file, this can be smaller. */
|
||||
|
||||
ulint
|
||||
fsp_header_get_tablespace_size(
|
||||
/*===========================*/
|
||||
/* out: size in pages */
|
||||
ulint space); /* in: space id, must be 0 */
|
||||
/**************************************************************************
|
||||
Reads the file space size stored in the header page. */
|
||||
|
||||
ulint
|
||||
fsp_get_size_low(
|
||||
/*=============*/
|
||||
/* out: tablespace size stored in the space header */
|
||||
page_t* page); /* in: header page (page 0 in the tablespace) */
|
||||
/**************************************************************************
|
||||
Reads the space id from the first page of a tablespace. */
|
||||
|
||||
ulint
|
||||
fsp_header_get_space_id(
|
||||
/*====================*/
|
||||
/* out: space id, ULINT UNDEFINED if error */
|
||||
page_t* page); /* in: first page of a tablespace */
|
||||
/**************************************************************************
|
||||
Writes the space id to a tablespace header. This function is used past the
|
||||
buffer pool when we in fil0fil.c create a new single-table tablespace. */
|
||||
|
||||
void
|
||||
fsp_header_write_space_id(
|
||||
/*======================*/
|
||||
page_t* page, /* in: first page in the space */
|
||||
ulint space_id); /* in: space id */
|
||||
/**************************************************************************
|
||||
Initializes the space header of a new created space and creates also the
|
||||
insert buffer tree root if space == 0. */
|
||||
|
||||
void
|
||||
fsp_header_init(
|
||||
/*============*/
|
||||
ulint space, /* in: space id */
|
||||
ulint size, /* in: current size in blocks */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/**************************************************************************
|
||||
Increases the space size field of a space. */
|
||||
|
||||
void
|
||||
fsp_header_inc_size(
|
||||
/*================*/
|
||||
ulint space, /* in: space id */
|
||||
ulint size_inc,/* in: size increment in pages */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/**************************************************************************
|
||||
Creates a new segment. */
|
||||
|
||||
page_t*
|
||||
fseg_create(
|
||||
/*========*/
|
||||
/* out: the page where the segment header is placed,
|
||||
x-latched, NULL if could not create segment
|
||||
because of lack of space */
|
||||
ulint space, /* in: space id */
|
||||
ulint page, /* in: page where the segment header is placed: if
|
||||
this is != 0, the page must belong to another segment,
|
||||
if this is 0, a new page will be allocated and it
|
||||
will belong to the created segment */
|
||||
ulint byte_offset, /* in: byte offset of the created segment header
|
||||
on the page */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/**************************************************************************
|
||||
Creates a new segment. */
|
||||
|
||||
page_t*
|
||||
fseg_create_general(
|
||||
/*================*/
|
||||
/* out: the page where the segment header is placed,
|
||||
x-latched, NULL if could not create segment
|
||||
because of lack of space */
|
||||
ulint space, /* in: space id */
|
||||
ulint page, /* in: page where the segment header is placed: if
|
||||
this is != 0, the page must belong to another segment,
|
||||
if this is 0, a new page will be allocated and it
|
||||
will belong to the created segment */
|
||||
ulint byte_offset, /* in: byte offset of the created segment header
|
||||
on the page */
|
||||
ibool has_done_reservation, /* in: TRUE if the caller has already
|
||||
done the reservation for the pages with
|
||||
fsp_reserve_free_extents (at least 2 extents: one for
|
||||
the inode and the other for the segment) then there is
|
||||
no need to do the check for this individual
|
||||
operation */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/**************************************************************************
|
||||
Calculates the number of pages reserved by a segment, and how many pages are
|
||||
currently used. */
|
||||
|
||||
ulint
|
||||
fseg_n_reserved_pages(
|
||||
/*==================*/
|
||||
/* out: number of reserved pages */
|
||||
fseg_header_t* header, /* in: segment header */
|
||||
ulint* used, /* out: number of pages used (<= reserved) */
|
||||
mtr_t* mtr); /* in: mtr handle */
|
||||
/**************************************************************************
|
||||
Allocates a single free page from a segment. This function implements
|
||||
the intelligent allocation strategy which tries to minimize
|
||||
file space fragmentation. */
|
||||
|
||||
ulint
|
||||
fseg_alloc_free_page(
|
||||
/*=================*/
|
||||
/* out: the allocated page offset
|
||||
FIL_NULL if no page could be allocated */
|
||||
fseg_header_t* seg_header, /* in: segment header */
|
||||
ulint hint, /* in: hint of which page would be desirable */
|
||||
byte direction, /* in: if the new page is needed because
|
||||
of an index page split, and records are
|
||||
inserted there in order, into which
|
||||
direction they go alphabetically: FSP_DOWN,
|
||||
FSP_UP, FSP_NO_DIR */
|
||||
mtr_t* mtr); /* in: mtr handle */
|
||||
/**************************************************************************
|
||||
Allocates a single free page from a segment. This function implements
|
||||
the intelligent allocation strategy which tries to minimize file space
|
||||
fragmentation. */
|
||||
|
||||
ulint
|
||||
fseg_alloc_free_page_general(
|
||||
/*=========================*/
|
||||
/* out: allocated page offset, FIL_NULL if no
|
||||
page could be allocated */
|
||||
fseg_header_t* seg_header,/* in: segment header */
|
||||
ulint hint, /* in: hint of which page would be desirable */
|
||||
byte direction,/* in: if the new page is needed because
|
||||
of an index page split, and records are
|
||||
inserted there in order, into which
|
||||
direction they go alphabetically: FSP_DOWN,
|
||||
FSP_UP, FSP_NO_DIR */
|
||||
ibool has_done_reservation, /* in: TRUE if the caller has
|
||||
already done the reservation for the page
|
||||
with fsp_reserve_free_extents, then there
|
||||
is no need to do the check for this individual
|
||||
page */
|
||||
mtr_t* mtr); /* in: mtr handle */
|
||||
/**************************************************************************
|
||||
Reserves free pages from a tablespace. All mini-transactions which may
|
||||
use several pages from the tablespace should call this function beforehand
|
||||
and reserve enough free extents so that they certainly will be able
|
||||
to do their operation, like a B-tree page split, fully. Reservations
|
||||
must be released with function fil_space_release_free_extents!
|
||||
|
||||
The alloc_type below has the following meaning: FSP_NORMAL means an
|
||||
operation which will probably result in more space usage, like an
|
||||
insert in a B-tree; FSP_UNDO means allocation to undo logs: if we are
|
||||
deleting rows, then this allocation will in the long run result in
|
||||
less space usage (after a purge); FSP_CLEANING means allocation done
|
||||
in a physical record delete (like in a purge) or other cleaning operation
|
||||
which will result in less space usage in the long run. We prefer the latter
|
||||
two types of allocation: when space is scarce, FSP_NORMAL allocations
|
||||
will not succeed, but the latter two allocations will succeed, if possible.
|
||||
The purpose is to avoid dead end where the database is full but the
|
||||
user cannot free any space because these freeing operations temporarily
|
||||
reserve some space.
|
||||
|
||||
Single-table tablespaces whose size is < 32 pages are a special case. In this
|
||||
function we would liberally reserve several 64 page extents for every page
|
||||
split or merge in a B-tree. But we do not want to waste disk space if the table
|
||||
only occupies < 32 pages. That is why we apply different rules in that special
|
||||
case, just ensuring that there are 3 free pages available. */
|
||||
|
||||
ibool
|
||||
fsp_reserve_free_extents(
|
||||
/*=====================*/
|
||||
/* out: TRUE if we were able to make the reservation */
|
||||
ulint* n_reserved,/* out: number of extents actually reserved; if we
|
||||
return TRUE and the tablespace size is < 64 pages,
|
||||
then this can be 0, otherwise it is n_ext */
|
||||
ulint space, /* in: space id */
|
||||
ulint n_ext, /* in: number of extents to reserve */
|
||||
ulint alloc_type,/* in: FSP_NORMAL, FSP_UNDO, or FSP_CLEANING */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/**************************************************************************
|
||||
This function should be used to get information on how much we still
|
||||
will be able to insert new data to the database without running out the
|
||||
tablespace. Only free extents are taken into account and we also subtract
|
||||
the safety margin required by the above function fsp_reserve_free_extents. */
|
||||
|
||||
ulint
|
||||
fsp_get_available_space_in_free_extents(
|
||||
/*====================================*/
|
||||
/* out: available space in kB */
|
||||
ulint space); /* in: space id */
|
||||
/**************************************************************************
|
||||
Frees a single page of a segment. */
|
||||
|
||||
void
|
||||
fseg_free_page(
|
||||
/*===========*/
|
||||
fseg_header_t* seg_header, /* in: segment header */
|
||||
ulint space, /* in: space id */
|
||||
ulint page, /* in: page offset */
|
||||
mtr_t* mtr); /* in: mtr handle */
|
||||
/***********************************************************************
|
||||
Frees a segment. The freeing is performed in several mini-transactions,
|
||||
so that there is no danger of bufferfixing too many buffer pages. */
|
||||
|
||||
void
|
||||
fseg_free(
|
||||
/*======*/
|
||||
ulint space, /* in: space id */
|
||||
ulint page_no,/* in: page number where the segment header is
|
||||
placed */
|
||||
ulint offset);/* in: byte offset of the segment header on that
|
||||
page */
|
||||
/**************************************************************************
|
||||
Frees part of a segment. This function can be used to free a segment
|
||||
by repeatedly calling this function in different mini-transactions.
|
||||
Doing the freeing in a single mini-transaction might result in
|
||||
too big a mini-transaction. */
|
||||
|
||||
ibool
|
||||
fseg_free_step(
|
||||
/*===========*/
|
||||
/* out: TRUE if freeing completed */
|
||||
fseg_header_t* header, /* in, own: segment header; NOTE: if the header
|
||||
resides on the first page of the frag list
|
||||
of the segment, this pointer becomes obsolete
|
||||
after the last freeing step */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/**************************************************************************
|
||||
Frees part of a segment. Differs from fseg_free_step because this function
|
||||
leaves the header page unfreed. */
|
||||
|
||||
ibool
|
||||
fseg_free_step_not_header(
|
||||
/*======================*/
|
||||
/* out: TRUE if freeing completed, except the
|
||||
header page */
|
||||
fseg_header_t* header, /* in: segment header which must reside on
|
||||
the first fragment page of the segment */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/***************************************************************************
|
||||
Checks if a page address is an extent descriptor page address. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
fsp_descr_page(
|
||||
/*===========*/
|
||||
/* out: TRUE if a descriptor page */
|
||||
ulint page_no);/* in: page number */
|
||||
/***************************************************************
|
||||
Parses a redo log record of a file page init. */
|
||||
|
||||
byte*
|
||||
fsp_parse_init_file_page(
|
||||
/*=====================*/
|
||||
/* out: end of log record or NULL */
|
||||
byte* ptr, /* in: buffer */
|
||||
byte* end_ptr,/* in: buffer end */
|
||||
page_t* page); /* in: page or NULL */
|
||||
/***********************************************************************
|
||||
Validates the file space system and its segments. */
|
||||
|
||||
ibool
|
||||
fsp_validate(
|
||||
/*=========*/
|
||||
/* out: TRUE if ok */
|
||||
ulint space); /* in: space id */
|
||||
/***********************************************************************
|
||||
Prints info of a file space. */
|
||||
|
||||
void
|
||||
fsp_print(
|
||||
/*======*/
|
||||
ulint space); /* in: space id */
|
||||
/***********************************************************************
|
||||
Validates a segment. */
|
||||
|
||||
ibool
|
||||
fseg_validate(
|
||||
/*==========*/
|
||||
/* out: TRUE if ok */
|
||||
fseg_header_t* header, /* in: segment header */
|
||||
mtr_t* mtr2); /* in: mtr */
|
||||
/***********************************************************************
|
||||
Writes info of a segment. */
|
||||
|
||||
void
|
||||
fseg_print(
|
||||
/*=======*/
|
||||
fseg_header_t* header, /* in: segment header */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
|
||||
/* Flags for fsp_reserve_free_extents */
|
||||
#define FSP_NORMAL 1000000
|
||||
#define FSP_UNDO 2000000
|
||||
#define FSP_CLEANING 3000000
|
||||
|
||||
/* Number of pages described in a single descriptor page: currently each page
|
||||
description takes less than 1 byte; a descriptor page is repeated every
|
||||
this many file pages */
|
||||
#define XDES_DESCRIBED_PER_PAGE UNIV_PAGE_SIZE
|
||||
|
||||
/* The space low address page map, and also offsets for extent descriptor and
|
||||
bitmap pages which are repeated always after XDES_DESCRIBED_PER_PAGE more
|
||||
pages: */
|
||||
/*--------------------------------------*/
|
||||
#define FSP_XDES_OFFSET 0
|
||||
#define FSP_IBUF_BITMAP_OFFSET 1
|
||||
/* The ibuf bitmap pages are the ones whose
|
||||
page number is the number above plus a
|
||||
multiple of XDES_DESCRIBED_PER_PAGE */
|
||||
#define FSP_FIRST_INODE_PAGE_NO 2
|
||||
#define FSP_IBUF_HEADER_PAGE_NO 3
|
||||
#define FSP_IBUF_TREE_ROOT_PAGE_NO 4
|
||||
/* The ibuf tree root page number in
|
||||
tablespace 0; its fseg inode is on the page
|
||||
number FSP_FIRST_INODE_PAGE_NO */
|
||||
#define FSP_TRX_SYS_PAGE_NO 5
|
||||
#define FSP_FIRST_RSEG_PAGE_NO 6
|
||||
#define FSP_DICT_HDR_PAGE_NO 7
|
||||
/*--------------------------------------*/
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
#include "fsp0fsp.ic"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
24
storage/innobase/include/fsp0fsp.ic
Normal file
24
storage/innobase/include/fsp0fsp.ic
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/******************************************************
|
||||
File space management
|
||||
|
||||
(c) 1995 Innobase Oy
|
||||
|
||||
Created 12/18/1995 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
Checks if a page address is an extent descriptor page address. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
fsp_descr_page(
|
||||
/*===========*/
|
||||
/* out: TRUE if a descriptor page */
|
||||
ulint page_no)/* in: page number */
|
||||
{
|
||||
if (page_no % XDES_DESCRIBED_PER_PAGE == FSP_XDES_OFFSET) {
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
36
storage/innobase/include/fut0fut.h
Normal file
36
storage/innobase/include/fut0fut.h
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/**********************************************************************
|
||||
File-based utilities
|
||||
|
||||
(c) 1995 Innobase Oy
|
||||
|
||||
Created 12/13/1995 Heikki Tuuri
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
#ifndef fut0fut_h
|
||||
#define fut0fut_h
|
||||
|
||||
#include "univ.i"
|
||||
|
||||
#include "fil0fil.h"
|
||||
#include "mtr0mtr.h"
|
||||
|
||||
/************************************************************************
|
||||
Gets a pointer to a file address and latches the page. */
|
||||
UNIV_INLINE
|
||||
byte*
|
||||
fut_get_ptr(
|
||||
/*========*/
|
||||
/* out: pointer to a byte in a frame; the file
|
||||
page in the frame is bufferfixed and latched */
|
||||
ulint space, /* in: space id */
|
||||
fil_addr_t addr, /* in: file address */
|
||||
ulint rw_latch, /* in: RW_S_LATCH, RW_X_LATCH */
|
||||
mtr_t* mtr); /* in: mtr handle */
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
#include "fut0fut.ic"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
38
storage/innobase/include/fut0fut.ic
Normal file
38
storage/innobase/include/fut0fut.ic
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/**********************************************************************
|
||||
File-based utilities
|
||||
|
||||
(c) 1995 Innobase Oy
|
||||
|
||||
Created 12/13/1995 Heikki Tuuri
|
||||
***********************************************************************/
|
||||
|
||||
#include "sync0rw.h"
|
||||
#include "buf0buf.h"
|
||||
|
||||
/************************************************************************
|
||||
Gets a pointer to a file address and latches the page. */
|
||||
UNIV_INLINE
|
||||
byte*
|
||||
fut_get_ptr(
|
||||
/*========*/
|
||||
/* out: pointer to a byte in a frame; the file
|
||||
page in the frame is bufferfixed and latched */
|
||||
ulint space, /* in: space id */
|
||||
fil_addr_t addr, /* in: file address */
|
||||
ulint rw_latch, /* in: RW_S_LATCH, RW_X_LATCH */
|
||||
mtr_t* mtr) /* in: mtr handle */
|
||||
{
|
||||
byte* ptr;
|
||||
|
||||
ut_ad(mtr);
|
||||
ut_ad(addr.boffset < UNIV_PAGE_SIZE);
|
||||
ut_ad((rw_latch == RW_S_LATCH) || (rw_latch == RW_X_LATCH));
|
||||
|
||||
ptr = buf_page_get(space, addr.page, rw_latch, mtr) + addr.boffset;
|
||||
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_page_dbg_add_level(ptr, SYNC_NO_ORDER_CHECK);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
||||
return(ptr);
|
||||
}
|
||||
198
storage/innobase/include/fut0lst.h
Normal file
198
storage/innobase/include/fut0lst.h
Normal file
|
|
@ -0,0 +1,198 @@
|
|||
/**********************************************************************
|
||||
File-based list utilities
|
||||
|
||||
(c) 1995 Innobase Oy
|
||||
|
||||
Created 11/28/1995 Heikki Tuuri
|
||||
***********************************************************************/
|
||||
|
||||
#ifndef fut0lst_h
|
||||
#define fut0lst_h
|
||||
|
||||
#include "univ.i"
|
||||
|
||||
#include "fil0fil.h"
|
||||
#include "mtr0mtr.h"
|
||||
|
||||
|
||||
/* The C 'types' of base node and list node: these should be used to
|
||||
write self-documenting code. Of course, the sizeof macro cannot be
|
||||
applied to these types! */
|
||||
|
||||
typedef byte flst_base_node_t;
|
||||
typedef byte flst_node_t;
|
||||
|
||||
/* The physical size of a list base node in bytes */
|
||||
#define FLST_BASE_NODE_SIZE (4 + 2 * FIL_ADDR_SIZE)
|
||||
|
||||
/* The physical size of a list node in bytes */
|
||||
#define FLST_NODE_SIZE (2 * FIL_ADDR_SIZE)
|
||||
|
||||
|
||||
/************************************************************************
|
||||
Initializes a list base node. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
flst_init(
|
||||
/*======*/
|
||||
flst_base_node_t* base, /* in: pointer to base node */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/************************************************************************
|
||||
Adds a node as the last node in a list. */
|
||||
|
||||
void
|
||||
flst_add_last(
|
||||
/*==========*/
|
||||
flst_base_node_t* base, /* in: pointer to base node of list */
|
||||
flst_node_t* node, /* in: node to add */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/************************************************************************
|
||||
Adds a node as the first node in a list. */
|
||||
|
||||
void
|
||||
flst_add_first(
|
||||
/*===========*/
|
||||
flst_base_node_t* base, /* in: pointer to base node of list */
|
||||
flst_node_t* node, /* in: node to add */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/************************************************************************
|
||||
Inserts a node after another in a list. */
|
||||
|
||||
void
|
||||
flst_insert_after(
|
||||
/*==============*/
|
||||
flst_base_node_t* base, /* in: pointer to base node of list */
|
||||
flst_node_t* node1, /* in: node to insert after */
|
||||
flst_node_t* node2, /* in: node to add */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/************************************************************************
|
||||
Inserts a node before another in a list. */
|
||||
|
||||
void
|
||||
flst_insert_before(
|
||||
/*===============*/
|
||||
flst_base_node_t* base, /* in: pointer to base node of list */
|
||||
flst_node_t* node2, /* in: node to insert */
|
||||
flst_node_t* node3, /* in: node to insert before */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/************************************************************************
|
||||
Removes a node. */
|
||||
|
||||
void
|
||||
flst_remove(
|
||||
/*========*/
|
||||
flst_base_node_t* base, /* in: pointer to base node of list */
|
||||
flst_node_t* node2, /* in: node to remove */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/************************************************************************
|
||||
Cuts off the tail of the list, including the node given. The number of
|
||||
nodes which will be removed must be provided by the caller, as this function
|
||||
does not measure the length of the tail. */
|
||||
|
||||
void
|
||||
flst_cut_end(
|
||||
/*=========*/
|
||||
flst_base_node_t* base, /* in: pointer to base node of list */
|
||||
flst_node_t* node2, /* in: first node to remove */
|
||||
ulint n_nodes,/* in: number of nodes to remove,
|
||||
must be >= 1 */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/************************************************************************
|
||||
Cuts off the tail of the list, not including the given node. The number of
|
||||
nodes which will be removed must be provided by the caller, as this function
|
||||
does not measure the length of the tail. */
|
||||
|
||||
void
|
||||
flst_truncate_end(
|
||||
/*==============*/
|
||||
flst_base_node_t* base, /* in: pointer to base node of list */
|
||||
flst_node_t* node2, /* in: first node not to remove */
|
||||
ulint n_nodes,/* in: number of nodes to remove */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/************************************************************************
|
||||
Gets list length. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
flst_get_len(
|
||||
/*=========*/
|
||||
/* out: length */
|
||||
flst_base_node_t* base, /* in: pointer to base node */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/************************************************************************
|
||||
Gets list first node address. */
|
||||
UNIV_INLINE
|
||||
fil_addr_t
|
||||
flst_get_first(
|
||||
/*===========*/
|
||||
/* out: file address */
|
||||
flst_base_node_t* base, /* in: pointer to base node */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/************************************************************************
|
||||
Gets list last node address. */
|
||||
UNIV_INLINE
|
||||
fil_addr_t
|
||||
flst_get_last(
|
||||
/*==========*/
|
||||
/* out: file address */
|
||||
flst_base_node_t* base, /* in: pointer to base node */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/************************************************************************
|
||||
Gets list next node address. */
|
||||
UNIV_INLINE
|
||||
fil_addr_t
|
||||
flst_get_next_addr(
|
||||
/*===============*/
|
||||
/* out: file address */
|
||||
flst_node_t* node, /* in: pointer to node */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/************************************************************************
|
||||
Gets list prev node address. */
|
||||
UNIV_INLINE
|
||||
fil_addr_t
|
||||
flst_get_prev_addr(
|
||||
/*===============*/
|
||||
/* out: file address */
|
||||
flst_node_t* node, /* in: pointer to node */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/************************************************************************
|
||||
Writes a file address. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
flst_write_addr(
|
||||
/*============*/
|
||||
fil_faddr_t* faddr, /* in: pointer to file faddress */
|
||||
fil_addr_t addr, /* in: file address */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/************************************************************************
|
||||
Reads a file address. */
|
||||
UNIV_INLINE
|
||||
fil_addr_t
|
||||
flst_read_addr(
|
||||
/*===========*/
|
||||
/* out: file address */
|
||||
fil_faddr_t* faddr, /* in: pointer to file faddress */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/************************************************************************
|
||||
Validates a file-based list. */
|
||||
|
||||
ibool
|
||||
flst_validate(
|
||||
/*==========*/
|
||||
/* out: TRUE if ok */
|
||||
flst_base_node_t* base, /* in: pointer to base node of list */
|
||||
mtr_t* mtr1); /* in: mtr */
|
||||
/************************************************************************
|
||||
Prints info of a file-based list. */
|
||||
|
||||
void
|
||||
flst_print(
|
||||
/*=======*/
|
||||
flst_base_node_t* base, /* in: pointer to base node of list */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
#include "fut0lst.ic"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
147
storage/innobase/include/fut0lst.ic
Normal file
147
storage/innobase/include/fut0lst.ic
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
/**********************************************************************
|
||||
File-based list utilities
|
||||
|
||||
(c) 1995 Innobase Oy
|
||||
|
||||
Created 11/28/1995 Heikki Tuuri
|
||||
***********************************************************************/
|
||||
|
||||
#include "fut0fut.h"
|
||||
#include "mtr0log.h"
|
||||
#include "buf0buf.h"
|
||||
|
||||
/* We define the field offsets of a node for the list */
|
||||
#define FLST_PREV 0 /* 6-byte address of the previous list element;
|
||||
the page part of address is FIL_NULL, if no
|
||||
previous element */
|
||||
#define FLST_NEXT FIL_ADDR_SIZE /* 6-byte address of the next
|
||||
list element; the page part of address
|
||||
is FIL_NULL, if no next element */
|
||||
|
||||
/* We define the field offsets of a base node for the list */
|
||||
#define FLST_LEN 0 /* 32-bit list length field */
|
||||
#define FLST_FIRST 4 /* 6-byte address of the first element
|
||||
of the list; undefined if empty list */
|
||||
#define FLST_LAST (4 + FIL_ADDR_SIZE) /* 6-byte address of the
|
||||
last element of the list; undefined
|
||||
if empty list */
|
||||
|
||||
/************************************************************************
|
||||
Writes a file address. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
flst_write_addr(
|
||||
/*============*/
|
||||
fil_faddr_t* faddr, /* in: pointer to file faddress */
|
||||
fil_addr_t addr, /* in: file address */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
ut_ad(faddr && mtr);
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(faddr),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
|
||||
mlog_write_ulint(faddr + FIL_ADDR_PAGE, addr.page, MLOG_4BYTES, mtr);
|
||||
mlog_write_ulint(faddr + FIL_ADDR_BYTE, addr.boffset,
|
||||
MLOG_2BYTES, mtr);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Reads a file address. */
|
||||
UNIV_INLINE
|
||||
fil_addr_t
|
||||
flst_read_addr(
|
||||
/*===========*/
|
||||
/* out: file address */
|
||||
fil_faddr_t* faddr, /* in: pointer to file faddress */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
fil_addr_t addr;
|
||||
|
||||
ut_ad(faddr && mtr);
|
||||
|
||||
addr.page = mtr_read_ulint(faddr + FIL_ADDR_PAGE, MLOG_4BYTES, mtr);
|
||||
addr.boffset = mtr_read_ulint(faddr + FIL_ADDR_BYTE, MLOG_2BYTES,
|
||||
mtr);
|
||||
return(addr);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Initializes a list base node. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
flst_init(
|
||||
/*======*/
|
||||
flst_base_node_t* base, /* in: pointer to base node */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(base),
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
mlog_write_ulint(base + FLST_LEN, 0, MLOG_4BYTES, mtr);
|
||||
flst_write_addr(base + FLST_FIRST, fil_addr_null, mtr);
|
||||
flst_write_addr(base + FLST_LAST, fil_addr_null, mtr);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets list length. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
flst_get_len(
|
||||
/*=========*/
|
||||
/* out: length */
|
||||
flst_base_node_t* base, /* in: pointer to base node */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
return(mtr_read_ulint(base + FLST_LEN, MLOG_4BYTES, mtr));
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets list first node address. */
|
||||
UNIV_INLINE
|
||||
fil_addr_t
|
||||
flst_get_first(
|
||||
/*===========*/
|
||||
/* out: file address */
|
||||
flst_base_node_t* base, /* in: pointer to base node */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
return(flst_read_addr(base + FLST_FIRST, mtr));
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets list last node address. */
|
||||
UNIV_INLINE
|
||||
fil_addr_t
|
||||
flst_get_last(
|
||||
/*==========*/
|
||||
/* out: file address */
|
||||
flst_base_node_t* base, /* in: pointer to base node */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
return(flst_read_addr(base + FLST_LAST, mtr));
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets list next node address. */
|
||||
UNIV_INLINE
|
||||
fil_addr_t
|
||||
flst_get_next_addr(
|
||||
/*===============*/
|
||||
/* out: file address */
|
||||
flst_node_t* node, /* in: pointer to node */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
return(flst_read_addr(node + FLST_NEXT, mtr));
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Gets list prev node address. */
|
||||
UNIV_INLINE
|
||||
fil_addr_t
|
||||
flst_get_prev_addr(
|
||||
/*===============*/
|
||||
/* out: file address */
|
||||
flst_node_t* node, /* in: pointer to node */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
return(flst_read_addr(node + FLST_PREV, mtr));
|
||||
}
|
||||
146
storage/innobase/include/ha0ha.h
Normal file
146
storage/innobase/include/ha0ha.h
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
/******************************************************
|
||||
The hash table with external chains
|
||||
|
||||
(c) 1994-1997 Innobase Oy
|
||||
|
||||
Created 8/18/1994 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#ifndef ha0ha_h
|
||||
#define ha0ha_h
|
||||
|
||||
#include "univ.i"
|
||||
|
||||
#include "hash0hash.h"
|
||||
#include "page0types.h"
|
||||
|
||||
/*****************************************************************
|
||||
Looks for an element in a hash table. */
|
||||
UNIV_INLINE
|
||||
void*
|
||||
ha_search_and_get_data(
|
||||
/*===================*/
|
||||
/* out: pointer to the data of the first hash
|
||||
table node in chain having the fold number,
|
||||
NULL if not found */
|
||||
hash_table_t* table, /* in: hash table */
|
||||
ulint fold); /* in: folded value of the searched data */
|
||||
/*************************************************************
|
||||
Looks for an element when we know the pointer to the data and updates
|
||||
the pointer to data if found. */
|
||||
|
||||
void
|
||||
ha_search_and_update_if_found(
|
||||
/*==========================*/
|
||||
hash_table_t* table, /* in: hash table */
|
||||
ulint fold, /* in: folded value of the searched data */
|
||||
void* data, /* in: pointer to the data */
|
||||
void* new_data);/* in: new pointer to the data */
|
||||
/*****************************************************************
|
||||
Creates a hash table with >= n array cells. The actual number of cells is
|
||||
chosen to be a prime number slightly bigger than n. */
|
||||
|
||||
hash_table_t*
|
||||
ha_create(
|
||||
/*======*/
|
||||
/* out, own: created table */
|
||||
ibool in_btr_search, /* in: TRUE if the hash table is used in
|
||||
the btr_search module */
|
||||
ulint n, /* in: number of array cells */
|
||||
ulint n_mutexes, /* in: number of mutexes to protect the
|
||||
hash table: must be a power of 2 */
|
||||
ulint mutex_level); /* in: level of the mutexes in the latching
|
||||
order: this is used in the debug version */
|
||||
/*****************************************************************
|
||||
Inserts an entry into a hash table. If an entry with the same fold number
|
||||
is found, its node is updated to point to the new data, and no new node
|
||||
is inserted. */
|
||||
|
||||
ibool
|
||||
ha_insert_for_fold(
|
||||
/*===============*/
|
||||
/* out: TRUE if succeed, FALSE if no more
|
||||
memory could be allocated */
|
||||
hash_table_t* table, /* in: hash table */
|
||||
ulint fold, /* in: folded value of data; if a node with
|
||||
the same fold value already exists, it is
|
||||
updated to point to the same data, and no new
|
||||
node is created! */
|
||||
void* data); /* in: data, must not be NULL */
|
||||
/*****************************************************************
|
||||
Reserves the necessary hash table mutex and inserts an entry into the hash
|
||||
table. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
ha_insert_for_fold_mutex(
|
||||
/*=====================*/
|
||||
/* out: TRUE if succeed, FALSE if no more
|
||||
memory could be allocated */
|
||||
hash_table_t* table, /* in: hash table */
|
||||
ulint fold, /* in: folded value of data; if a node with
|
||||
the same fold value already exists, it is
|
||||
updated to point to the same data, and no new
|
||||
node is created! */
|
||||
void* data); /* in: data, must not be NULL */
|
||||
/*****************************************************************
|
||||
Deletes an entry from a hash table. */
|
||||
|
||||
void
|
||||
ha_delete(
|
||||
/*======*/
|
||||
hash_table_t* table, /* in: hash table */
|
||||
ulint fold, /* in: folded value of data */
|
||||
void* data); /* in: data, must not be NULL and must exist
|
||||
in the hash table */
|
||||
/*************************************************************
|
||||
Looks for an element when we know the pointer to the data and deletes
|
||||
it from the hash table if found. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
ha_search_and_delete_if_found(
|
||||
/*==========================*/
|
||||
/* out: TRUE if found */
|
||||
hash_table_t* table, /* in: hash table */
|
||||
ulint fold, /* in: folded value of the searched data */
|
||||
void* data); /* in: pointer to the data */
|
||||
/*********************************************************************
|
||||
Removes from the chain determined by fold all nodes whose data pointer
|
||||
points to the page given. */
|
||||
|
||||
void
|
||||
ha_remove_all_nodes_to_page(
|
||||
/*========================*/
|
||||
hash_table_t* table, /* in: hash table */
|
||||
ulint fold, /* in: fold value */
|
||||
page_t* page); /* in: buffer page */
|
||||
/*****************************************************************
|
||||
Validates a hash table. */
|
||||
|
||||
ibool
|
||||
ha_validate(
|
||||
/*========*/
|
||||
/* out: TRUE if ok */
|
||||
hash_table_t* table); /* in: hash table */
|
||||
/*****************************************************************
|
||||
Prints info of a hash table. */
|
||||
|
||||
void
|
||||
ha_print_info(
|
||||
/*==========*/
|
||||
FILE* file, /* in: file where to print */
|
||||
hash_table_t* table); /* in: hash table */
|
||||
|
||||
/* The hash table external chain node */
|
||||
|
||||
typedef struct ha_node_struct ha_node_t;
|
||||
struct ha_node_struct {
|
||||
ha_node_t* next; /* next chain node or NULL if none */
|
||||
void* data; /* pointer to the data */
|
||||
ulint fold; /* fold value for the data */
|
||||
};
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
#include "ha0ha.ic"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue