1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-26 01:44:06 +03:00
Files
mariadb/storage/bdb/db/db_iface.c
unknown 47d10d0eca Import BDB 4.3.28
storage/bdb/LICENSE:
  Import db-4.3.28
storage/bdb/btree/bt_compare.c:
  Import db-4.3.28
storage/bdb/btree/bt_conv.c:
  Import db-4.3.28
storage/bdb/btree/bt_curadj.c:
  Import db-4.3.28
storage/bdb/btree/bt_cursor.c:
  Import db-4.3.28
storage/bdb/btree/bt_delete.c:
  Import db-4.3.28
storage/bdb/btree/bt_method.c:
  Import db-4.3.28
storage/bdb/btree/bt_open.c:
  Import db-4.3.28
storage/bdb/btree/bt_put.c:
  Import db-4.3.28
storage/bdb/btree/bt_rec.c:
  Import db-4.3.28
storage/bdb/btree/bt_reclaim.c:
  Import db-4.3.28
storage/bdb/btree/bt_recno.c:
  Import db-4.3.28
storage/bdb/btree/bt_rsearch.c:
  Import db-4.3.28
storage/bdb/btree/bt_search.c:
  Import db-4.3.28
storage/bdb/btree/bt_split.c:
  Import db-4.3.28
storage/bdb/btree/bt_stat.c:
  Import db-4.3.28
storage/bdb/btree/bt_upgrade.c:
  Import db-4.3.28
storage/bdb/btree/bt_verify.c:
  Import db-4.3.28
storage/bdb/btree/btree.src:
  Import db-4.3.28
storage/bdb/build_win32/Berkeley_DB.dsw:
  Import db-4.3.28
storage/bdb/build_win32/app_dsp.src:
  Import db-4.3.28
storage/bdb/build_win32/db_test.src:
  Import db-4.3.28
storage/bdb/build_win32/dbkill.cpp:
  Import db-4.3.28
storage/bdb/build_win32/dynamic_dsp.src:
  Import db-4.3.28
storage/bdb/build_win32/java_dsp.src:
  Import db-4.3.28
storage/bdb/build_win32/libdb_tcl.def:
  Import db-4.3.28
storage/bdb/build_win32/libdbrc.src:
  Import db-4.3.28
storage/bdb/build_win32/static_dsp.src:
  Import db-4.3.28
storage/bdb/build_win32/tcl_dsp.src:
  Import db-4.3.28
storage/bdb/clib/getcwd.c:
  Import db-4.3.28
storage/bdb/clib/getopt.c:
  Import db-4.3.28
storage/bdb/clib/memcmp.c:
  Import db-4.3.28
storage/bdb/clib/memmove.c:
  Import db-4.3.28
storage/bdb/clib/raise.c:
  Import db-4.3.28
storage/bdb/clib/snprintf.c:
  Import db-4.3.28
storage/bdb/clib/strcasecmp.c:
  Import db-4.3.28
storage/bdb/clib/strdup.c:
  Import db-4.3.28
storage/bdb/clib/strerror.c:
  Import db-4.3.28
storage/bdb/common/db_byteorder.c:
  Import db-4.3.28
storage/bdb/common/db_err.c:
  Import db-4.3.28
storage/bdb/common/db_getlong.c:
  Import db-4.3.28
storage/bdb/common/db_idspace.c:
  Import db-4.3.28
storage/bdb/common/db_log2.c:
  Import db-4.3.28
storage/bdb/common/util_arg.c:
  Import db-4.3.28
storage/bdb/common/util_cache.c:
  Import db-4.3.28
storage/bdb/common/util_log.c:
  Import db-4.3.28
storage/bdb/common/util_sig.c:
  Import db-4.3.28
storage/bdb/cxx/cxx_db.cpp:
  Import db-4.3.28
storage/bdb/cxx/cxx_dbc.cpp:
  Import db-4.3.28
storage/bdb/cxx/cxx_dbt.cpp:
  Import db-4.3.28
storage/bdb/cxx/cxx_env.cpp:
  Import db-4.3.28
storage/bdb/cxx/cxx_except.cpp:
  Import db-4.3.28
storage/bdb/cxx/cxx_lock.cpp:
  Import db-4.3.28
storage/bdb/cxx/cxx_logc.cpp:
  Import db-4.3.28
storage/bdb/cxx/cxx_mpool.cpp:
  Import db-4.3.28
storage/bdb/cxx/cxx_txn.cpp:
  Import db-4.3.28
storage/bdb/db/crdel.src:
  Import db-4.3.28
storage/bdb/db/crdel_rec.c:
  Import db-4.3.28
storage/bdb/db/db.c:
  Import db-4.3.28
storage/bdb/db/db.src:
  Import db-4.3.28
storage/bdb/db/db_am.c:
  Import db-4.3.28
storage/bdb/db/db_cam.c:
  Import db-4.3.28
storage/bdb/db/db_conv.c:
  Import db-4.3.28
storage/bdb/db/db_dispatch.c:
  Import db-4.3.28
storage/bdb/db/db_dup.c:
  Import db-4.3.28
storage/bdb/db/db_iface.c:
  Import db-4.3.28
storage/bdb/db/db_join.c:
  Import db-4.3.28
storage/bdb/db/db_meta.c:
  Import db-4.3.28
storage/bdb/db/db_method.c:
  Import db-4.3.28
storage/bdb/db/db_open.c:
  Import db-4.3.28
storage/bdb/db/db_overflow.c:
  Import db-4.3.28
storage/bdb/db/db_pr.c:
  Import db-4.3.28
storage/bdb/db/db_rec.c:
  Import db-4.3.28
storage/bdb/db/db_reclaim.c:
  Import db-4.3.28
storage/bdb/db/db_remove.c:
  Import db-4.3.28
storage/bdb/db/db_rename.c:
  Import db-4.3.28
storage/bdb/db/db_ret.c:
  Import db-4.3.28
storage/bdb/db/db_truncate.c:
  Import db-4.3.28
storage/bdb/db/db_upg.c:
  Import db-4.3.28
storage/bdb/db/db_upg_opd.c:
  Import db-4.3.28
storage/bdb/db/db_vrfy.c:
  Import db-4.3.28
storage/bdb/db/db_vrfyutil.c:
  Import db-4.3.28
storage/bdb/db185/db185.c:
  Import db-4.3.28
storage/bdb/db185/db185_int.in:
  Import db-4.3.28
storage/bdb/db_archive/db_archive.c:
  Import db-4.3.28
storage/bdb/db_checkpoint/db_checkpoint.c:
  Import db-4.3.28
storage/bdb/db_deadlock/db_deadlock.c:
  Import db-4.3.28
storage/bdb/db_dump/db_dump.c:
  Import db-4.3.28
storage/bdb/db_dump185/db_dump185.c:
  Import db-4.3.28
storage/bdb/db_load/db_load.c:
  Import db-4.3.28
storage/bdb/db_printlog/README:
  Import db-4.3.28
storage/bdb/db_printlog/db_printlog.c:
  Import db-4.3.28
storage/bdb/db_printlog/dbname.awk:
  Import db-4.3.28
storage/bdb/db_printlog/rectype.awk:
  Import db-4.3.28
storage/bdb/db_printlog/status.awk:
  Import db-4.3.28
storage/bdb/db_recover/db_recover.c:
  Import db-4.3.28
storage/bdb/db_stat/db_stat.c:
  Import db-4.3.28
storage/bdb/db_upgrade/db_upgrade.c:
  Import db-4.3.28
storage/bdb/db_verify/db_verify.c:
  Import db-4.3.28
storage/bdb/dbinc/btree.h:
  Import db-4.3.28
storage/bdb/dbinc/crypto.h:
  Import db-4.3.28
storage/bdb/dbinc/cxx_int.h:
  Import db-4.3.28
storage/bdb/dbinc/db.in:
  Import db-4.3.28
storage/bdb/dbinc/db_185.in:
  Import db-4.3.28
storage/bdb/dbinc/db_am.h:
  Import db-4.3.28
storage/bdb/dbinc/db_cxx.in:
  Import db-4.3.28
storage/bdb/dbinc/db_dispatch.h:
  Import db-4.3.28
storage/bdb/dbinc/db_int.in:
  Import db-4.3.28
storage/bdb/dbinc/db_join.h:
  Import db-4.3.28
storage/bdb/dbinc/db_page.h:
  Import db-4.3.28
storage/bdb/dbinc/db_server_int.h:
  Import db-4.3.28
storage/bdb/dbinc/db_shash.h:
  Import db-4.3.28
storage/bdb/dbinc/db_swap.h:
  Import db-4.3.28
storage/bdb/dbinc/db_upgrade.h:
  Import db-4.3.28
storage/bdb/dbinc/db_verify.h:
  Import db-4.3.28
storage/bdb/dbinc/debug.h:
  Import db-4.3.28
storage/bdb/dbinc/fop.h:
  Import db-4.3.28
storage/bdb/dbinc/globals.h:
  Import db-4.3.28
storage/bdb/dbinc/hash.h:
  Import db-4.3.28
storage/bdb/dbinc/hmac.h:
  Import db-4.3.28
storage/bdb/dbinc/lock.h:
  Import db-4.3.28
storage/bdb/dbinc/log.h:
  Import db-4.3.28
storage/bdb/dbinc/mp.h:
  Import db-4.3.28
storage/bdb/dbinc/mutex.h:
  Import db-4.3.28
storage/bdb/dbinc/os.h:
  Import db-4.3.28
storage/bdb/dbinc/qam.h:
  Import db-4.3.28
storage/bdb/dbinc/queue.h:
  Import db-4.3.28
storage/bdb/dbinc/region.h:
  Import db-4.3.28
storage/bdb/dbinc/rep.h:
  Import db-4.3.28
storage/bdb/dbinc/shqueue.h:
  Import db-4.3.28
storage/bdb/dbinc/tcl_db.h:
  Import db-4.3.28
storage/bdb/dbinc/txn.h:
  Import db-4.3.28
storage/bdb/dbinc/xa.h:
  Import db-4.3.28
storage/bdb/dbm/dbm.c:
  Import db-4.3.28
storage/bdb/dbreg/dbreg.c:
  Import db-4.3.28
storage/bdb/dbreg/dbreg.src:
  Import db-4.3.28
storage/bdb/dbreg/dbreg_rec.c:
  Import db-4.3.28
storage/bdb/dbreg/dbreg_util.c:
  Import db-4.3.28
storage/bdb/dist/Makefile.in:
  Import db-4.3.28
storage/bdb/dist/RELEASE:
  Import db-4.3.28
storage/bdb/dist/aclocal/config.ac:
  Import db-4.3.28
storage/bdb/dist/aclocal/libtool.ac:
  Import db-4.3.28
storage/bdb/dist/aclocal/mutex.ac:
  Import db-4.3.28
storage/bdb/dist/aclocal/options.ac:
  Import db-4.3.28
storage/bdb/dist/aclocal/programs.ac:
  Import db-4.3.28
storage/bdb/dist/aclocal/sosuffix.ac:
  Import db-4.3.28
storage/bdb/dist/aclocal/tcl.ac:
  Import db-4.3.28
storage/bdb/dist/aclocal/types.ac:
  Import db-4.3.28
storage/bdb/dist/aclocal_java/ac_jni_include_dirs.ac:
  Import db-4.3.28
storage/bdb/dist/aclocal_java/ac_prog_java.ac:
  Import db-4.3.28
storage/bdb/dist/buildrel:
  Import db-4.3.28
storage/bdb/dist/configure.ac:
  Import db-4.3.28
storage/bdb/dist/gen_inc.awk:
  Import db-4.3.28
storage/bdb/dist/gen_rec.awk:
  Import db-4.3.28
storage/bdb/dist/gen_rpc.awk:
  Import db-4.3.28
storage/bdb/dist/ltmain.sh:
  Import db-4.3.28
storage/bdb/dist/pubdef.in:
  Import db-4.3.28
storage/bdb/dist/srcfiles.in:
  Import db-4.3.28
storage/bdb/dist/vx_2.0/BerkeleyDB.wpj:
  Import db-4.3.28
storage/bdb/dist/vx_2.0/wpj.in:
  Import db-4.3.28
storage/bdb/dist/vx_config.in:
  Import db-4.3.28
storage/bdb/dist/vx_setup/CONFIG.in:
  Import db-4.3.28
storage/bdb/dist/vx_setup/LICENSE.TXT:
  Import db-4.3.28
storage/bdb/dist/vx_setup/vx_allfile.in:
  Import db-4.3.28
storage/bdb/dist/vx_setup/vx_demofile.in:
  Import db-4.3.28
storage/bdb/dist/win_config.in:
  Import db-4.3.28
storage/bdb/dist/win_exports.in:
  Import db-4.3.28
storage/bdb/env/db_salloc.c:
  Import db-4.3.28
storage/bdb/env/db_shash.c:
  Import db-4.3.28
storage/bdb/env/env_file.c:
  Import db-4.3.28
storage/bdb/env/env_method.c:
  Import db-4.3.28
storage/bdb/env/env_open.c:
  Import db-4.3.28
storage/bdb/env/env_recover.c:
  Import db-4.3.28
storage/bdb/env/env_region.c:
  Import db-4.3.28
storage/bdb/fileops/fileops.src:
  Import db-4.3.28
storage/bdb/fileops/fop_basic.c:
  Import db-4.3.28
storage/bdb/fileops/fop_rec.c:
  Import db-4.3.28
storage/bdb/fileops/fop_util.c:
  Import db-4.3.28
storage/bdb/hash/hash.c:
  Import db-4.3.28
storage/bdb/hash/hash.src:
  Import db-4.3.28
storage/bdb/hash/hash_conv.c:
  Import db-4.3.28
storage/bdb/hash/hash_dup.c:
  Import db-4.3.28
storage/bdb/hash/hash_func.c:
  Import db-4.3.28
storage/bdb/hash/hash_meta.c:
  Import db-4.3.28
storage/bdb/hash/hash_method.c:
  Import db-4.3.28
storage/bdb/hash/hash_open.c:
  Import db-4.3.28
storage/bdb/hash/hash_page.c:
  Import db-4.3.28
storage/bdb/hash/hash_rec.c:
  Import db-4.3.28
storage/bdb/hash/hash_reclaim.c:
  Import db-4.3.28
storage/bdb/hash/hash_stat.c:
  Import db-4.3.28
storage/bdb/hash/hash_upgrade.c:
  Import db-4.3.28
storage/bdb/hash/hash_verify.c:
  Import db-4.3.28
storage/bdb/hmac/hmac.c:
  Import db-4.3.28
storage/bdb/hmac/sha1.c:
  Import db-4.3.28
storage/bdb/hsearch/hsearch.c:
  Import db-4.3.28
storage/bdb/lock/lock.c:
  Import db-4.3.28
storage/bdb/lock/lock_deadlock.c:
  Import db-4.3.28
storage/bdb/lock/lock_method.c:
  Import db-4.3.28
storage/bdb/lock/lock_region.c:
  Import db-4.3.28
storage/bdb/lock/lock_stat.c:
  Import db-4.3.28
storage/bdb/lock/lock_util.c:
  Import db-4.3.28
storage/bdb/log/log.c:
  Import db-4.3.28
storage/bdb/log/log_archive.c:
  Import db-4.3.28
storage/bdb/log/log_compare.c:
  Import db-4.3.28
storage/bdb/log/log_get.c:
  Import db-4.3.28
storage/bdb/log/log_method.c:
  Import db-4.3.28
storage/bdb/log/log_put.c:
  Import db-4.3.28
storage/bdb/mp/mp_alloc.c:
  Import db-4.3.28
storage/bdb/mp/mp_bh.c:
  Import db-4.3.28
storage/bdb/mp/mp_fget.c:
  Import db-4.3.28
storage/bdb/mp/mp_fopen.c:
  Import db-4.3.28
storage/bdb/mp/mp_fput.c:
  Import db-4.3.28
storage/bdb/mp/mp_fset.c:
  Import db-4.3.28
storage/bdb/mp/mp_method.c:
  Import db-4.3.28
storage/bdb/mp/mp_region.c:
  Import db-4.3.28
storage/bdb/mp/mp_register.c:
  Import db-4.3.28
storage/bdb/mp/mp_stat.c:
  Import db-4.3.28
storage/bdb/mp/mp_sync.c:
  Import db-4.3.28
storage/bdb/mp/mp_trickle.c:
  Import db-4.3.28
storage/bdb/mutex/mut_fcntl.c:
  Import db-4.3.28
storage/bdb/mutex/mut_pthread.c:
  Import db-4.3.28
storage/bdb/mutex/mut_tas.c:
  Import db-4.3.28
storage/bdb/mutex/mut_win32.c:
  Import db-4.3.28
storage/bdb/mutex/mutex.c:
  Import db-4.3.28
storage/bdb/mutex/tm.c:
  Import db-4.3.28
storage/bdb/mutex/uts4_cc.s:
  Import db-4.3.28
storage/bdb/os/os_abs.c:
  Import db-4.3.28
storage/bdb/os/os_alloc.c:
  Import db-4.3.28
storage/bdb/os/os_clock.c:
  Import db-4.3.28
storage/bdb/os/os_config.c:
  Import db-4.3.28
storage/bdb/os/os_dir.c:
  Import db-4.3.28
storage/bdb/os/os_errno.c:
  Import db-4.3.28
storage/bdb/os/os_fid.c:
  Import db-4.3.28
storage/bdb/os/os_fsync.c:
  Import db-4.3.28
storage/bdb/os/os_handle.c:
  Import db-4.3.28
storage/bdb/os/os_id.c:
  Import db-4.3.28
storage/bdb/os/os_map.c:
  Import db-4.3.28
storage/bdb/os/os_method.c:
  Import db-4.3.28
storage/bdb/os/os_oflags.c:
  Import db-4.3.28
storage/bdb/os/os_open.c:
  Import db-4.3.28
storage/bdb/os/os_region.c:
  Import db-4.3.28
storage/bdb/os/os_rename.c:
  Import db-4.3.28
storage/bdb/os/os_root.c:
  Import db-4.3.28
storage/bdb/os/os_rpath.c:
  Import db-4.3.28
storage/bdb/os/os_rw.c:
  Import db-4.3.28
storage/bdb/os/os_seek.c:
  Import db-4.3.28
storage/bdb/os/os_sleep.c:
  Import db-4.3.28
storage/bdb/os/os_spin.c:
  Import db-4.3.28
storage/bdb/os/os_stat.c:
  Import db-4.3.28
storage/bdb/os/os_tmpdir.c:
  Import db-4.3.28
storage/bdb/os/os_unlink.c:
  Import db-4.3.28
storage/bdb/os_vxworks/os_vx_abs.c:
  Import db-4.3.28
storage/bdb/os_vxworks/os_vx_config.c:
  Import db-4.3.28
storage/bdb/os_vxworks/os_vx_map.c:
  Import db-4.3.28
storage/bdb/os_win32/os_abs.c:
  Import db-4.3.28
storage/bdb/os_win32/os_clock.c:
  Import db-4.3.28
storage/bdb/os_win32/os_config.c:
  Import db-4.3.28
storage/bdb/os_win32/os_dir.c:
  Import db-4.3.28
storage/bdb/os_win32/os_errno.c:
  Import db-4.3.28
storage/bdb/os_win32/os_fid.c:
  Import db-4.3.28
storage/bdb/os_win32/os_fsync.c:
  Import db-4.3.28
storage/bdb/os_win32/os_handle.c:
  Import db-4.3.28
storage/bdb/os_win32/os_map.c:
  Import db-4.3.28
storage/bdb/os_win32/os_open.c:
  Import db-4.3.28
storage/bdb/os_win32/os_rename.c:
  Import db-4.3.28
storage/bdb/os_win32/os_rw.c:
  Import db-4.3.28
storage/bdb/os_win32/os_seek.c:
  Import db-4.3.28
storage/bdb/os_win32/os_sleep.c:
  Import db-4.3.28
storage/bdb/os_win32/os_spin.c:
  Import db-4.3.28
storage/bdb/os_win32/os_stat.c:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/BerkeleyDB.pm:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/BerkeleyDB.pod.P:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/BerkeleyDB.pod:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/BerkeleyDB.xs:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/Changes:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/MANIFEST:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/Makefile.PL:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/README:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/config.in:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/constants.h:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/mkconsts:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/patches/5.004:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/ppport.h:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/scan:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/t/btree.t:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/t/destroy.t:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/t/env.t:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/t/filter.t:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/t/hash.t:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/t/join.t:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/t/mldbm.t:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/t/queue.t:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/t/recno.t:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/t/strict.t:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/t/subdb.t:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/t/txn.t:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/t/util.pm:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/typemap:
  Import db-4.3.28
storage/bdb/perl/DB_File/Changes:
  Import db-4.3.28
storage/bdb/perl/DB_File/DB_File.pm:
  Import db-4.3.28
storage/bdb/perl/DB_File/DB_File.xs:
  Import db-4.3.28
storage/bdb/perl/DB_File/MANIFEST:
  Import db-4.3.28
storage/bdb/perl/DB_File/Makefile.PL:
  Import db-4.3.28
storage/bdb/perl/DB_File/README:
  Import db-4.3.28
storage/bdb/perl/DB_File/dbinfo:
  Import db-4.3.28
storage/bdb/perl/DB_File/patches/5.004:
  Import db-4.3.28
storage/bdb/perl/DB_File/ppport.h:
  Import db-4.3.28
storage/bdb/perl/DB_File/t/db-btree.t:
  Import db-4.3.28
storage/bdb/perl/DB_File/t/db-hash.t:
  Import db-4.3.28
storage/bdb/perl/DB_File/t/db-recno.t:
  Import db-4.3.28
storage/bdb/perl/DB_File/typemap:
  Import db-4.3.28
storage/bdb/qam/qam.c:
  Import db-4.3.28
storage/bdb/qam/qam.src:
  Import db-4.3.28
storage/bdb/qam/qam_conv.c:
  Import db-4.3.28
storage/bdb/qam/qam_files.c:
  Import db-4.3.28
storage/bdb/qam/qam_method.c:
  Import db-4.3.28
storage/bdb/qam/qam_open.c:
  Import db-4.3.28
storage/bdb/qam/qam_rec.c:
  Import db-4.3.28
storage/bdb/qam/qam_stat.c:
  Import db-4.3.28
storage/bdb/qam/qam_upgrade.c:
  Import db-4.3.28
storage/bdb/qam/qam_verify.c:
  Import db-4.3.28
storage/bdb/rep/rep_method.c:
  Import db-4.3.28
storage/bdb/rep/rep_record.c:
  Import db-4.3.28
storage/bdb/rep/rep_region.c:
  Import db-4.3.28
storage/bdb/rep/rep_util.c:
  Import db-4.3.28
storage/bdb/rpc_client/client.c:
  Import db-4.3.28
storage/bdb/rpc_client/gen_client_ret.c:
  Import db-4.3.28
storage/bdb/rpc_server/c/db_server_util.c:
  Import db-4.3.28
storage/bdb/rpc_server/cxx/db_server_cxxproc.cpp:
  Import db-4.3.28
storage/bdb/rpc_server/cxx/db_server_cxxutil.cpp:
  Import db-4.3.28
storage/bdb/rpc_server/java/FreeList.java:
  Import db-4.3.28
storage/bdb/rpc_server/java/LocalIterator.java:
  Import db-4.3.28
storage/bdb/rpc_server/java/README:
  Import db-4.3.28
storage/bdb/rpc_server/java/RpcDb.java:
  Import db-4.3.28
storage/bdb/rpc_server/java/RpcDbEnv.java:
  Import db-4.3.28
storage/bdb/rpc_server/java/RpcDbTxn.java:
  Import db-4.3.28
storage/bdb/rpc_server/java/RpcDbc.java:
  Import db-4.3.28
storage/bdb/rpc_server/java/Timer.java:
  Import db-4.3.28
storage/bdb/rpc_server/java/gen/__db_open_reply.java:
  Import db-4.3.28
storage/bdb/rpc_server/java/gen/__db_stat_msg.java:
  Import db-4.3.28
storage/bdb/rpc_server/java/gen/db_server.java:
  Import db-4.3.28
storage/bdb/rpc_server/java/s_jrpcgen:
  Import db-4.3.28
storage/bdb/rpc_server/rpc.src:
  Import db-4.3.28
storage/bdb/tcl/docs/db.html:
  Import db-4.3.28
storage/bdb/tcl/docs/env.html:
  Import db-4.3.28
storage/bdb/tcl/docs/historic.html:
  Import db-4.3.28
storage/bdb/tcl/docs/index.html:
  Import db-4.3.28
storage/bdb/tcl/docs/library.html:
  Import db-4.3.28
storage/bdb/tcl/docs/lock.html:
  Import db-4.3.28
storage/bdb/tcl/docs/log.html:
  Import db-4.3.28
storage/bdb/tcl/docs/mpool.html:
  Import db-4.3.28
storage/bdb/tcl/docs/rep.html:
  Import db-4.3.28
storage/bdb/tcl/docs/test.html:
  Import db-4.3.28
storage/bdb/tcl/docs/txn.html:
  Import db-4.3.28
storage/bdb/tcl/tcl_compat.c:
  Import db-4.3.28
storage/bdb/tcl/tcl_db.c:
  Import db-4.3.28
storage/bdb/tcl/tcl_db_pkg.c:
  Import db-4.3.28
storage/bdb/tcl/tcl_dbcursor.c:
  Import db-4.3.28
storage/bdb/tcl/tcl_env.c:
  Import db-4.3.28
storage/bdb/tcl/tcl_internal.c:
  Import db-4.3.28
storage/bdb/tcl/tcl_lock.c:
  Import db-4.3.28
storage/bdb/tcl/tcl_log.c:
  Import db-4.3.28
storage/bdb/tcl/tcl_mp.c:
  Import db-4.3.28
storage/bdb/tcl/tcl_rep.c:
  Import db-4.3.28
storage/bdb/tcl/tcl_txn.c:
  Import db-4.3.28
storage/bdb/tcl/tcl_util.c:
  Import db-4.3.28
storage/bdb/test/archive.tcl:
  Import db-4.3.28
storage/bdb/test/bigfile001.tcl:
  Import db-4.3.28
storage/bdb/test/bigfile002.tcl:
  Import db-4.3.28
storage/bdb/test/byteorder.tcl:
  Import db-4.3.28
storage/bdb/test/conscript.tcl:
  Import db-4.3.28
storage/bdb/test/dbm.tcl:
  Import db-4.3.28
storage/bdb/test/dbscript.tcl:
  Import db-4.3.28
storage/bdb/test/ddoyscript.tcl:
  Import db-4.3.28
storage/bdb/test/ddscript.tcl:
  Import db-4.3.28
storage/bdb/test/dead001.tcl:
  Import db-4.3.28
storage/bdb/test/dead002.tcl:
  Import db-4.3.28
storage/bdb/test/dead003.tcl:
  Import db-4.3.28
storage/bdb/test/dead004.tcl:
  Import db-4.3.28
storage/bdb/test/dead005.tcl:
  Import db-4.3.28
storage/bdb/test/dead006.tcl:
  Import db-4.3.28
storage/bdb/test/dead007.tcl:
  Import db-4.3.28
storage/bdb/test/env001.tcl:
  Import db-4.3.28
storage/bdb/test/env002.tcl:
  Import db-4.3.28
storage/bdb/test/env003.tcl:
  Import db-4.3.28
storage/bdb/test/env004.tcl:
  Import db-4.3.28
storage/bdb/test/env005.tcl:
  Import db-4.3.28
storage/bdb/test/env006.tcl:
  Import db-4.3.28
storage/bdb/test/env007.tcl:
  Import db-4.3.28
storage/bdb/test/env008.tcl:
  Import db-4.3.28
storage/bdb/test/env009.tcl:
  Import db-4.3.28
storage/bdb/test/env010.tcl:
  Import db-4.3.28
storage/bdb/test/env011.tcl:
  Import db-4.3.28
storage/bdb/test/hsearch.tcl:
  Import db-4.3.28
storage/bdb/test/join.tcl:
  Import db-4.3.28
storage/bdb/test/lock001.tcl:
  Import db-4.3.28
storage/bdb/test/lock002.tcl:
  Import db-4.3.28
storage/bdb/test/lock003.tcl:
  Import db-4.3.28
storage/bdb/test/lock004.tcl:
  Import db-4.3.28
storage/bdb/test/lock005.tcl:
  Import db-4.3.28
storage/bdb/test/lockscript.tcl:
  Import db-4.3.28
storage/bdb/test/log001.tcl:
  Import db-4.3.28
storage/bdb/test/log002.tcl:
  Import db-4.3.28
storage/bdb/test/log003.tcl:
  Import db-4.3.28
storage/bdb/test/log004.tcl:
  Import db-4.3.28
storage/bdb/test/log005.tcl:
  Import db-4.3.28
storage/bdb/test/logtrack.tcl:
  Import db-4.3.28
storage/bdb/test/mdbscript.tcl:
  Import db-4.3.28
storage/bdb/test/memp001.tcl:
  Import db-4.3.28
storage/bdb/test/memp002.tcl:
  Import db-4.3.28
storage/bdb/test/memp003.tcl:
  Import db-4.3.28
storage/bdb/test/mpoolscript.tcl:
  Import db-4.3.28
storage/bdb/test/mutex001.tcl:
  Import db-4.3.28
storage/bdb/test/mutex002.tcl:
  Import db-4.3.28
storage/bdb/test/mutex003.tcl:
  Import db-4.3.28
storage/bdb/test/mutexscript.tcl:
  Import db-4.3.28
storage/bdb/test/ndbm.tcl:
  Import db-4.3.28
storage/bdb/test/parallel.tcl:
  Import db-4.3.28
storage/bdb/test/recd001.tcl:
  Import db-4.3.28
storage/bdb/test/recd002.tcl:
  Import db-4.3.28
storage/bdb/test/recd003.tcl:
  Import db-4.3.28
storage/bdb/test/recd004.tcl:
  Import db-4.3.28
storage/bdb/test/recd005.tcl:
  Import db-4.3.28
storage/bdb/test/recd006.tcl:
  Import db-4.3.28
storage/bdb/test/recd007.tcl:
  Import db-4.3.28
storage/bdb/test/recd008.tcl:
  Import db-4.3.28
storage/bdb/test/recd009.tcl:
  Import db-4.3.28
storage/bdb/test/recd010.tcl:
  Import db-4.3.28
storage/bdb/test/recd011.tcl:
  Import db-4.3.28
storage/bdb/test/recd012.tcl:
  Import db-4.3.28
storage/bdb/test/recd013.tcl:
  Import db-4.3.28
storage/bdb/test/recd014.tcl:
  Import db-4.3.28
storage/bdb/test/recd015.tcl:
  Import db-4.3.28
storage/bdb/test/recd016.tcl:
  Import db-4.3.28
storage/bdb/test/recd017.tcl:
  Import db-4.3.28
storage/bdb/test/recd018.tcl:
  Import db-4.3.28
storage/bdb/test/recd019.tcl:
  Import db-4.3.28
storage/bdb/test/recd020.tcl:
  Import db-4.3.28
storage/bdb/test/recd15scr.tcl:
  Import db-4.3.28
storage/bdb/test/recdscript.tcl:
  Import db-4.3.28
storage/bdb/test/rep001.tcl:
  Import db-4.3.28
storage/bdb/test/rep002.tcl:
  Import db-4.3.28
storage/bdb/test/rep003.tcl:
  Import db-4.3.28
storage/bdb/test/rep005.tcl:
  Import db-4.3.28
storage/bdb/test/reputils.tcl:
  Import db-4.3.28
storage/bdb/test/rpc001.tcl:
  Import db-4.3.28
storage/bdb/test/rpc002.tcl:
  Import db-4.3.28
storage/bdb/test/rpc003.tcl:
  Import db-4.3.28
storage/bdb/test/rpc004.tcl:
  Import db-4.3.28
storage/bdb/test/rpc005.tcl:
  Import db-4.3.28
storage/bdb/test/rsrc001.tcl:
  Import db-4.3.28
storage/bdb/test/rsrc002.tcl:
  Import db-4.3.28
storage/bdb/test/rsrc003.tcl:
  Import db-4.3.28
storage/bdb/test/rsrc004.tcl:
  Import db-4.3.28
storage/bdb/test/scr001/chk.code:
  Import db-4.3.28
storage/bdb/test/scr003/chk.define:
  Import db-4.3.28
storage/bdb/test/scr004/chk.javafiles:
  Import db-4.3.28
storage/bdb/test/scr005/chk.nl:
  Import db-4.3.28
storage/bdb/test/scr006/chk.offt:
  Import db-4.3.28
storage/bdb/test/scr007/chk.proto:
  Import db-4.3.28
storage/bdb/test/scr008/chk.pubdef:
  Import db-4.3.28
storage/bdb/test/scr009/chk.srcfiles:
  Import db-4.3.28
storage/bdb/test/scr010/chk.str:
  Import db-4.3.28
storage/bdb/test/scr010/spell.ok:
  Import db-4.3.28
storage/bdb/test/scr011/chk.tags:
  Import db-4.3.28
storage/bdb/test/scr012/chk.vx_code:
  Import db-4.3.28
storage/bdb/test/scr013/chk.stats:
  Import db-4.3.28
storage/bdb/test/scr015/TestConstruct01.cpp:
  Import db-4.3.28
storage/bdb/test/scr015/TestConstruct01.testerr:
  Import db-4.3.28
storage/bdb/test/scr015/TestGetSetMethods.cpp:
  Import db-4.3.28
storage/bdb/test/scr015/TestKeyRange.cpp:
  Import db-4.3.28
storage/bdb/test/scr015/TestLogc.cpp:
  Import db-4.3.28
storage/bdb/test/scr015/TestSimpleAccess.cpp:
  Import db-4.3.28
storage/bdb/test/scr015/TestTruncate.cpp:
  Import db-4.3.28
storage/bdb/test/scr015/chk.cxxtests:
  Import db-4.3.28
storage/bdb/test/scr016/CallbackTest.java:
  Import db-4.3.28
storage/bdb/test/scr016/CallbackTest.testout:
  Import db-4.3.28
storage/bdb/test/scr016/TestAppendRecno.java:
  Import db-4.3.28
storage/bdb/test/scr016/TestAssociate.java:
  Import db-4.3.28
storage/bdb/test/scr016/TestClosedDb.java:
  Import db-4.3.28
storage/bdb/test/scr016/TestClosedDb.testout:
  Import db-4.3.28
storage/bdb/test/scr016/TestConstruct01.java:
  Import db-4.3.28
storage/bdb/test/scr016/TestConstruct01.testout:
  Import db-4.3.28
storage/bdb/test/scr016/TestConstruct02.java:
  Import db-4.3.28
storage/bdb/test/scr016/TestDbtFlags.java:
  Import db-4.3.28
storage/bdb/test/scr016/TestGetSetMethods.java:
  Import db-4.3.28
storage/bdb/test/scr016/TestKeyRange.java:
  Import db-4.3.28
storage/bdb/test/scr016/TestLockVec.java:
  Import db-4.3.28
storage/bdb/test/scr016/TestLogc.java:
  Import db-4.3.28
storage/bdb/test/scr016/TestOpenEmpty.java:
  Import db-4.3.28
storage/bdb/test/scr016/TestOpenEmpty.testerr:
  Import db-4.3.28
storage/bdb/test/scr016/TestReplication.java:
  Import db-4.3.28
storage/bdb/test/scr016/TestRpcServer.java:
  Import db-4.3.28
storage/bdb/test/scr016/TestSameDbt.java:
  Import db-4.3.28
storage/bdb/test/scr016/TestSimpleAccess.java:
  Import db-4.3.28
storage/bdb/test/scr016/TestStat.java:
  Import db-4.3.28
storage/bdb/test/scr016/TestStat.testout:
  Import db-4.3.28
storage/bdb/test/scr016/TestTruncate.java:
  Import db-4.3.28
storage/bdb/test/scr016/TestTruncate.testout:
  Import db-4.3.28
storage/bdb/test/scr016/TestUtil.java:
  Import db-4.3.28
storage/bdb/test/scr016/TestXAServlet.java:
  Import db-4.3.28
storage/bdb/test/scr016/chk.javatests:
  Import db-4.3.28
storage/bdb/test/scr016/ignore:
  Import db-4.3.28
storage/bdb/test/scr016/testone:
  Import db-4.3.28
storage/bdb/test/scr017/chk.db185:
  Import db-4.3.28
storage/bdb/test/scr019/chk.include:
  Import db-4.3.28
storage/bdb/test/scr020/chk.inc:
  Import db-4.3.28
storage/bdb/test/scr021/chk.flags:
  Import db-4.3.28
storage/bdb/test/scr022/chk.rr:
  Import db-4.3.28
storage/bdb/test/sdb001.tcl:
  Import db-4.3.28
storage/bdb/test/sdb002.tcl:
  Import db-4.3.28
storage/bdb/test/sdb003.tcl:
  Import db-4.3.28
storage/bdb/test/sdb004.tcl:
  Import db-4.3.28
storage/bdb/test/sdb005.tcl:
  Import db-4.3.28
storage/bdb/test/sdb006.tcl:
  Import db-4.3.28
storage/bdb/test/sdb007.tcl:
  Import db-4.3.28
storage/bdb/test/sdb008.tcl:
  Import db-4.3.28
storage/bdb/test/sdb009.tcl:
  Import db-4.3.28
storage/bdb/test/sdb010.tcl:
  Import db-4.3.28
storage/bdb/test/sdb011.tcl:
  Import db-4.3.28
storage/bdb/test/sdb012.tcl:
  Import db-4.3.28
storage/bdb/test/sdbscript.tcl:
  Import db-4.3.28
storage/bdb/test/sdbtest001.tcl:
  Import db-4.3.28
storage/bdb/test/sdbtest002.tcl:
  Import db-4.3.28
storage/bdb/test/sdbutils.tcl:
  Import db-4.3.28
storage/bdb/test/sec001.tcl:
  Import db-4.3.28
storage/bdb/test/sec002.tcl:
  Import db-4.3.28
storage/bdb/test/shelltest.tcl:
  Import db-4.3.28
storage/bdb/test/si001.tcl:
  Import db-4.3.28
storage/bdb/test/si002.tcl:
  Import db-4.3.28
storage/bdb/test/si003.tcl:
  Import db-4.3.28
storage/bdb/test/si004.tcl:
  Import db-4.3.28
storage/bdb/test/si005.tcl:
  Import db-4.3.28
storage/bdb/test/sysscript.tcl:
  Import db-4.3.28
storage/bdb/test/test.tcl:
  Import db-4.3.28
storage/bdb/test/test001.tcl:
  Import db-4.3.28
storage/bdb/test/test002.tcl:
  Import db-4.3.28
storage/bdb/test/test003.tcl:
  Import db-4.3.28
storage/bdb/test/test004.tcl:
  Import db-4.3.28
storage/bdb/test/test005.tcl:
  Import db-4.3.28
storage/bdb/test/test006.tcl:
  Import db-4.3.28
storage/bdb/test/test007.tcl:
  Import db-4.3.28
storage/bdb/test/test008.tcl:
  Import db-4.3.28
storage/bdb/test/test009.tcl:
  Import db-4.3.28
storage/bdb/test/test010.tcl:
  Import db-4.3.28
storage/bdb/test/test011.tcl:
  Import db-4.3.28
storage/bdb/test/test012.tcl:
  Import db-4.3.28
storage/bdb/test/test013.tcl:
  Import db-4.3.28
storage/bdb/test/test014.tcl:
  Import db-4.3.28
storage/bdb/test/test015.tcl:
  Import db-4.3.28
storage/bdb/test/test016.tcl:
  Import db-4.3.28
storage/bdb/test/test017.tcl:
  Import db-4.3.28
storage/bdb/test/test018.tcl:
  Import db-4.3.28
storage/bdb/test/test019.tcl:
  Import db-4.3.28
storage/bdb/test/test020.tcl:
  Import db-4.3.28
storage/bdb/test/test021.tcl:
  Import db-4.3.28
storage/bdb/test/test022.tcl:
  Import db-4.3.28
storage/bdb/test/test023.tcl:
  Import db-4.3.28
storage/bdb/test/test024.tcl:
  Import db-4.3.28
storage/bdb/test/test025.tcl:
  Import db-4.3.28
storage/bdb/test/test026.tcl:
  Import db-4.3.28
storage/bdb/test/test027.tcl:
  Import db-4.3.28
storage/bdb/test/test028.tcl:
  Import db-4.3.28
storage/bdb/test/test029.tcl:
  Import db-4.3.28
storage/bdb/test/test030.tcl:
  Import db-4.3.28
storage/bdb/test/test031.tcl:
  Import db-4.3.28
storage/bdb/test/test032.tcl:
  Import db-4.3.28
storage/bdb/test/test033.tcl:
  Import db-4.3.28
storage/bdb/test/test034.tcl:
  Import db-4.3.28
storage/bdb/test/test035.tcl:
  Import db-4.3.28
storage/bdb/test/test036.tcl:
  Import db-4.3.28
storage/bdb/test/test037.tcl:
  Import db-4.3.28
storage/bdb/test/test038.tcl:
  Import db-4.3.28
storage/bdb/test/test039.tcl:
  Import db-4.3.28
storage/bdb/test/test040.tcl:
  Import db-4.3.28
storage/bdb/test/test041.tcl:
  Import db-4.3.28
storage/bdb/test/test042.tcl:
  Import db-4.3.28
storage/bdb/test/test043.tcl:
  Import db-4.3.28
storage/bdb/test/test044.tcl:
  Import db-4.3.28
storage/bdb/test/test045.tcl:
  Import db-4.3.28
storage/bdb/test/test046.tcl:
  Import db-4.3.28
storage/bdb/test/test047.tcl:
  Import db-4.3.28
storage/bdb/test/test048.tcl:
  Import db-4.3.28
storage/bdb/test/test049.tcl:
  Import db-4.3.28
storage/bdb/test/test050.tcl:
  Import db-4.3.28
storage/bdb/test/test051.tcl:
  Import db-4.3.28
storage/bdb/test/test052.tcl:
  Import db-4.3.28
storage/bdb/test/test053.tcl:
  Import db-4.3.28
storage/bdb/test/test054.tcl:
  Import db-4.3.28
storage/bdb/test/test055.tcl:
  Import db-4.3.28
storage/bdb/test/test056.tcl:
  Import db-4.3.28
storage/bdb/test/test057.tcl:
  Import db-4.3.28
storage/bdb/test/test058.tcl:
  Import db-4.3.28
storage/bdb/test/test059.tcl:
  Import db-4.3.28
storage/bdb/test/test060.tcl:
  Import db-4.3.28
storage/bdb/test/test061.tcl:
  Import db-4.3.28
storage/bdb/test/test062.tcl:
  Import db-4.3.28
storage/bdb/test/test063.tcl:
  Import db-4.3.28
storage/bdb/test/test064.tcl:
  Import db-4.3.28
storage/bdb/test/test065.tcl:
  Import db-4.3.28
storage/bdb/test/test066.tcl:
  Import db-4.3.28
storage/bdb/test/test067.tcl:
  Import db-4.3.28
storage/bdb/test/test068.tcl:
  Import db-4.3.28
storage/bdb/test/test069.tcl:
  Import db-4.3.28
storage/bdb/test/test070.tcl:
  Import db-4.3.28
storage/bdb/test/test071.tcl:
  Import db-4.3.28
storage/bdb/test/test072.tcl:
  Import db-4.3.28
storage/bdb/test/test073.tcl:
  Import db-4.3.28
storage/bdb/test/test074.tcl:
  Import db-4.3.28
storage/bdb/test/test076.tcl:
  Import db-4.3.28
storage/bdb/test/test077.tcl:
  Import db-4.3.28
storage/bdb/test/test078.tcl:
  Import db-4.3.28
storage/bdb/test/test079.tcl:
  Import db-4.3.28
storage/bdb/test/test081.tcl:
  Import db-4.3.28
storage/bdb/test/test082.tcl:
  Import db-4.3.28
storage/bdb/test/test083.tcl:
  Import db-4.3.28
storage/bdb/test/test084.tcl:
  Import db-4.3.28
storage/bdb/test/test085.tcl:
  Import db-4.3.28
storage/bdb/test/test086.tcl:
  Import db-4.3.28
storage/bdb/test/test087.tcl:
  Import db-4.3.28
storage/bdb/test/test088.tcl:
  Import db-4.3.28
storage/bdb/test/test089.tcl:
  Import db-4.3.28
storage/bdb/test/test090.tcl:
  Import db-4.3.28
storage/bdb/test/test091.tcl:
  Import db-4.3.28
storage/bdb/test/test092.tcl:
  Import db-4.3.28
storage/bdb/test/test093.tcl:
  Import db-4.3.28
storage/bdb/test/test094.tcl:
  Import db-4.3.28
storage/bdb/test/test095.tcl:
  Import db-4.3.28
storage/bdb/test/test096.tcl:
  Import db-4.3.28
storage/bdb/test/test097.tcl:
  Import db-4.3.28
storage/bdb/test/test098.tcl:
  Import db-4.3.28
storage/bdb/test/test099.tcl:
  Import db-4.3.28
storage/bdb/test/test100.tcl:
  Import db-4.3.28
storage/bdb/test/test101.tcl:
  Import db-4.3.28
storage/bdb/test/testparams.tcl:
  Import db-4.3.28
storage/bdb/test/testutils.tcl:
  Import db-4.3.28
storage/bdb/test/txn001.tcl:
  Import db-4.3.28
storage/bdb/test/txn002.tcl:
  Import db-4.3.28
storage/bdb/test/txn003.tcl:
  Import db-4.3.28
storage/bdb/test/txn004.tcl:
  Import db-4.3.28
storage/bdb/test/txn005.tcl:
  Import db-4.3.28
storage/bdb/test/txn006.tcl:
  Import db-4.3.28
storage/bdb/test/txn007.tcl:
  Import db-4.3.28
storage/bdb/test/txn008.tcl:
  Import db-4.3.28
storage/bdb/test/txn009.tcl:
  Import db-4.3.28
storage/bdb/test/txnscript.tcl:
  Import db-4.3.28
storage/bdb/test/update.tcl:
  Import db-4.3.28
storage/bdb/test/upgrade.tcl:
  Import db-4.3.28
storage/bdb/test/wrap.tcl:
  Import db-4.3.28
storage/bdb/txn/txn.c:
  Import db-4.3.28
storage/bdb/txn/txn.src:
  Import db-4.3.28
storage/bdb/txn/txn_method.c:
  Import db-4.3.28
storage/bdb/txn/txn_rec.c:
  Import db-4.3.28
storage/bdb/txn/txn_recover.c:
  Import db-4.3.28
storage/bdb/txn/txn_region.c:
  Import db-4.3.28
storage/bdb/txn/txn_stat.c:
  Import db-4.3.28
storage/bdb/txn/txn_util.c:
  Import db-4.3.28
storage/bdb/xa/xa.c:
  Import db-4.3.28
storage/bdb/xa/xa_db.c:
  Import db-4.3.28
storage/bdb/xa/xa_map.c:
  Import db-4.3.28
storage/bdb/clib/strtol.c:
  Import db-4.3.28
storage/bdb/clib/strtoul.c:
  Import db-4.3.28
storage/bdb/common/crypto_stub.c:
  Import db-4.3.28
storage/bdb/crypto/aes_method.c:
  Import db-4.3.28
storage/bdb/crypto/crypto.c:
  Import db-4.3.28
storage/bdb/crypto/crypto.html:
  Import db-4.3.28
storage/bdb/crypto/mersenne/mt19937db.c:
  Import db-4.3.28
storage/bdb/crypto/rijndael/rijndael-alg-fst.c:
  Import db-4.3.28
storage/bdb/crypto/rijndael/rijndael-alg-fst.h:
  Import db-4.3.28
storage/bdb/crypto/rijndael/rijndael-api-fst.c:
  Import db-4.3.28
storage/bdb/crypto/rijndael/rijndael-api-fst.h:
  Import db-4.3.28
storage/bdb/cxx/cxx_multi.cpp:
  Import db-4.3.28
storage/bdb/cxx/cxx_seq.cpp:
  Import db-4.3.28
storage/bdb/db/db_ovfl_vrfy.c:
  Import db-4.3.28
storage/bdb/db/db_setid.c:
  Import db-4.3.28
storage/bdb/db/db_setlsn.c:
  Import db-4.3.28
storage/bdb/db/db_stati.c:
  Import db-4.3.28
storage/bdb/db/db_vrfy_stub.c:
  Import db-4.3.28
storage/bdb/db_stat/dd.sh:
  Import db-4.3.28
storage/bdb/dbreg/dbreg_stat.c:
  Import db-4.3.28
storage/bdb/dist/aclocal/rpc.ac:
  Import db-4.3.28
storage/bdb/dist/aclocal/sequence.ac:
  Import db-4.3.28
storage/bdb/dist/config.hin:
  Import db-4.3.28
storage/bdb/dist/s_java_const:
  Import db-4.3.28
storage/bdb/dist/s_java_stat:
  Import db-4.3.28
storage/bdb/dist/s_java_swig:
  Import db-4.3.28
storage/bdb/dist/s_je2db:
  Import db-4.3.28
storage/bdb/dist/s_winmsi:
  Import db-4.3.28
storage/bdb/dist/template/db_server_proc:
  Import db-4.3.28
storage/bdb/dist/template/gen_client_ret:
  Import db-4.3.28
storage/bdb/dist/template/rec_btree:
  Import db-4.3.28
storage/bdb/dist/template/rec_crdel:
  Import db-4.3.28
storage/bdb/dist/template/rec_dbreg:
  Import db-4.3.28
storage/bdb/dist/template/rec_db:
  Import db-4.3.28
storage/bdb/dist/template/rec_fileops:
  Import db-4.3.28
storage/bdb/dist/template/rec_hash:
  Import db-4.3.28
storage/bdb/dist/template/rec_qam:
  Import db-4.3.28
storage/bdb/dist/template/rec_rep:
  Import db-4.3.28
storage/bdb/dist/template/rec_txn:
  Import db-4.3.28
storage/bdb/dist/vx_2.0/BerkeleyDBsmall.wpj:
  Import db-4.3.28
storage/bdb/dist/vx_2.2/BerkeleyDB.wpj:
  Import db-4.3.28
storage/bdb/dist/vx_2.2/BerkeleyDBsmall.wpj:
  Import db-4.3.28
storage/bdb/dist/vx_2.2/wpj.in:
  Import db-4.3.28
storage/bdb/dist/win_db.in:
  Import db-4.3.28
storage/bdb/dist/winmsi/dbcorewix.in:
  Import db-4.3.28
storage/bdb/dist/winmsi/dbvarsbat.in:
  Import db-4.3.28
storage/bdb/dist/winmsi/dbwix.m4:
  Import db-4.3.28
storage/bdb/dist/winmsi/environment.in:
  Import db-4.3.28
storage/bdb/dist/winmsi/features.in:
  Import db-4.3.28
storage/bdb/dist/winmsi/files.in:
  Import db-4.3.28
storage/bdb/dist/winmsi/images/caticon.ibd:
  Import db-4.3.28
storage/bdb/dist/winmsi/images/foldernew.ibd:
  Import db-4.3.28
storage/bdb/dist/winmsi/images/folderup.ibd:
  Import db-4.3.28
storage/bdb/dist/winmsi/images/sleepycat.jpg:
  Import db-4.3.28
storage/bdb/dist/winmsi/images/topstripe.ibd:
  Import db-4.3.28
storage/bdb/dist/winmsi/images/webicon.ico:
  Import db-4.3.28
storage/bdb/dist/winmsi/links.in:
  Import db-4.3.28
storage/bdb/dist/winmsi/s_winmsi.fcn:
  Import db-4.3.28
storage/bdb/dist/winmsi/winbuild.bat:
  Import db-4.3.28
storage/bdb/env/env_stat.c:
  Import db-4.3.28
storage/bdb/hash/hash_stub.c:
  Import db-4.3.28
storage/bdb/lock/lock_id.c:
  Import db-4.3.28
storage/bdb/lock/lock_list.c:
  Import db-4.3.28
storage/bdb/lock/lock_timer.c:
  Import db-4.3.28
storage/bdb/log/log_stat.c:
  Import db-4.3.28
storage/bdb/mp/mp_fmethod.c:
  Import db-4.3.28
storage/bdb/os/os_truncate.c:
  Import db-4.3.28
storage/bdb/os_win32/os_truncate.c:
  Import db-4.3.28
storage/bdb/os_win32/os_unlink.c:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/META.yml:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/t/cds.t:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/t/encrypt.t:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/t/pod.t:
  Import db-4.3.28
storage/bdb/perl/DB_File/META.yml:
  Import db-4.3.28
storage/bdb/qam/qam_stub.c:
  Import db-4.3.28
storage/bdb/rep/rep.src:
  Import db-4.3.28
storage/bdb/rep/rep_backup.c:
  Import db-4.3.28
storage/bdb/rep/rep_stat.c:
  Import db-4.3.28
storage/bdb/rep/rep_stub.c:
  Import db-4.3.28
storage/bdb/rpc_client/gen_client.c:
  Import db-4.3.28
storage/bdb/rpc_server/c/db_server_proc.c:
  Import db-4.3.28
storage/bdb/rpc_server/c/gen_db_server.c:
  Import db-4.3.28
storage/bdb/rpc_server/db_server.x:
  Import db-4.3.28
storage/bdb/sequence/seq_stat.c:
  Import db-4.3.28
storage/bdb/sequence/sequence.c:
  Import db-4.3.28
storage/bdb/tcl/tcl_seq.c:
  Import db-4.3.28
storage/bdb/dist/config.guess:
  Import db-4.3.28
storage/bdb/dist/config.sub:
  Import db-4.3.28
storage/bdb/dist/s_all:
  Import db-4.3.28
storage/bdb/dist/s_config:
  Import db-4.3.28
storage/bdb/dist/s_crypto:
  Import db-4.3.28
storage/bdb/dist/s_include:
  Import db-4.3.28
storage/bdb/dist/s_java:
  Import db-4.3.28
storage/bdb/dist/s_perm:
  Import db-4.3.28
storage/bdb/dist/s_readme:
  Import db-4.3.28
storage/bdb/dist/s_recover:
  Import db-4.3.28
storage/bdb/dist/s_rpc:
  Import db-4.3.28
storage/bdb/dist/s_symlink:
  Import db-4.3.28
storage/bdb/dist/s_tags:
  Import db-4.3.28
storage/bdb/dist/s_test:
  Import db-4.3.28
storage/bdb/dist/s_vxworks:
  Import db-4.3.28
storage/bdb/dist/s_win32_dsp:
  Import db-4.3.28
storage/bdb/dist/s_win32:
  Import db-4.3.28
storage/bdb/perl/BerkeleyDB/dbinfo:
  Import db-4.3.28
2005-07-20 15:48:22 -07:00

2322 lines
52 KiB
C

/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1996-2004
* Sleepycat Software. All rights reserved.
*
* $Id: db_iface.c,v 11.121 2004/10/07 17:33:32 sue Exp $
*/
#include "db_config.h"
#ifndef NO_SYSTEM_INCLUDES
#include <sys/types.h>
#include <string.h>
#endif
#include "db_int.h"
#include "dbinc/db_page.h"
#include "dbinc/db_shash.h"
#include "dbinc/btree.h"
#include "dbinc/hash.h" /* For __db_no_hash_am(). */
#include "dbinc/qam.h" /* For __db_no_queue_am(). */
#include "dbinc/lock.h"
#include "dbinc/log.h"
#include "dbinc/mp.h"
static int __db_associate_arg __P((DB *, DB *,
int (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t));
static int __db_c_get_arg __P((DBC *, DBT *, DBT *, u_int32_t));
static int __db_c_pget_arg __P((DBC *, DBT *, u_int32_t));
static int __db_c_put_arg __P((DBC *, DBT *, DBT *, u_int32_t));
static int __db_curinval __P((const DB_ENV *));
static int __db_cursor_arg __P((DB *, u_int32_t));
static int __db_del_arg __P((DB *, u_int32_t));
static int __db_get_arg __P((const DB *, const DBT *, DBT *, u_int32_t));
static int __db_join_arg __P((DB *, DBC **, u_int32_t));
static int __db_open_arg __P((DB *,
DB_TXN *, const char *, const char *, DBTYPE, u_int32_t));
static int __db_pget_arg __P((DB *, DBT *, u_int32_t));
static int __db_put_arg __P((DB *, DBT *, DBT *, u_int32_t));
static int __db_rdonly __P((const DB_ENV *, const char *));
static int __dbt_ferr __P((const DB *, const char *, const DBT *, int));
/*
* A database should be required to be readonly if it's been explicitly
* specified as such or if we're a client in a replicated environment and
* we don't have the special "client-writer" designation.
*/
#define IS_READONLY(dbp) \
(F_ISSET(dbp, DB_AM_RDONLY) || \
(IS_REP_CLIENT((dbp)->dbenv) && \
!F_ISSET((dbp), DB_AM_CL_WRITER)))
/*
* These functions implement the Berkeley DB API. They are organized in a
* layered fashion. The interface functions (XXX_pp) perform all generic
* error checks (for example, PANIC'd region, replication state change
* in progress, inconsistent transaction usage), call function-specific
* check routines (_arg) to check for proper flag usage, etc., do pre-amble
* processing (incrementing handle counts, handling auto-commit), call the
* function and then do post-amble processing (DB_AUTO_COMMIT, dec handle
* counts).
*
* So, the basic structure is:
* Check for generic errors
* Call function-specific check routine
* Increment handle count
* Create internal transaction if necessary
* Call underlying worker function
* Commit/abort internal transaction if necessary
* Decrement handle count
*/
/*
* __db_associate_pp --
* DB->associate pre/post processing.
*
* PUBLIC: int __db_associate_pp __P((DB *, DB_TXN *, DB *,
* PUBLIC: int (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t));
*/
int
__db_associate_pp(dbp, txn, sdbp, callback, flags)
DB *dbp, *sdbp;
DB_TXN *txn;
int (*callback) __P((DB *, const DBT *, const DBT *, DBT *));
u_int32_t flags;
{
DBC *sdbc;
DB_ENV *dbenv;
int handle_check, ret, txn_local;
dbenv = dbp->dbenv;
PANIC_CHECK(dbenv);
if ((ret = __db_associate_arg(dbp, sdbp, callback, flags)) != 0)
return (ret);
/*
* Secondary cursors may have the primary's lock file ID, so we need
* to make sure that no older cursors are lying around when we make
* the transition.
*/
if (TAILQ_FIRST(&sdbp->active_queue) != NULL ||
TAILQ_FIRST(&sdbp->join_queue) != NULL) {
__db_err(dbenv,
"Databases may not become secondary indices while cursors are open");
return (EINVAL);
}
/*
* Create a local transaction as necessary, check for consistent
* transaction usage, and, if we have no transaction but do have
* locking on, acquire a locker id for the handle lock acquisition.
*/
txn_local = 0;
if (IS_AUTO_COMMIT(dbenv, txn, flags)) {
if ((ret = __db_txn_auto_init(dbenv, &txn)) != 0)
return (ret);
txn_local = 1;
LF_CLR(DB_AUTO_COMMIT);
} else if (txn != NULL && !TXN_ON(dbenv))
return (__db_not_txn_env(dbenv));
/* Check for consistent transaction usage. */
if ((ret = __db_check_txn(dbp, txn, DB_LOCK_INVALIDID, 0)) != 0)
goto err;
/* Check for replication block. */
handle_check = IS_REPLICATED(dbenv, dbp);
if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0)
goto err;
while ((sdbc = TAILQ_FIRST(&sdbp->free_queue)) != NULL)
if ((ret = __db_c_destroy(sdbc)) != 0)
break;
if (ret == 0)
ret = __db_associate(dbp, txn, sdbp, callback, flags);
/* Release replication block. */
if (handle_check)
__env_db_rep_exit(dbenv);
err: return (txn_local ? __db_txn_auto_resolve(dbenv, txn, 0, ret) : ret);
}
/*
* __db_associate_arg --
* Check DB->associate arguments.
*/
static int
__db_associate_arg(dbp, sdbp, callback, flags)
DB *dbp, *sdbp;
int (*callback) __P((DB *, const DBT *, const DBT *, DBT *));
u_int32_t flags;
{
DB_ENV *dbenv;
int ret;
dbenv = dbp->dbenv;
if (F_ISSET(sdbp, DB_AM_SECONDARY)) {
__db_err(dbenv,
"Secondary index handles may not be re-associated");
return (EINVAL);
}
if (F_ISSET(dbp, DB_AM_SECONDARY)) {
__db_err(dbenv,
"Secondary indices may not be used as primary databases");
return (EINVAL);
}
if (F_ISSET(dbp, DB_AM_DUP)) {
__db_err(dbenv,
"Primary databases may not be configured with duplicates");
return (EINVAL);
}
if (F_ISSET(dbp, DB_AM_RENUMBER)) {
__db_err(dbenv,
"Renumbering recno databases may not be used as primary databases");
return (EINVAL);
}
if (dbp->dbenv != sdbp->dbenv &&
(!F_ISSET(dbp->dbenv, DB_ENV_DBLOCAL) ||
!F_ISSET(sdbp->dbenv, DB_ENV_DBLOCAL))) {
__db_err(dbenv,
"The primary and secondary must be opened in the same environment");
return (EINVAL);
}
if ((DB_IS_THREADED(dbp) && !DB_IS_THREADED(sdbp)) ||
(!DB_IS_THREADED(dbp) && DB_IS_THREADED(sdbp))) {
__db_err(dbenv,
"The DB_THREAD setting must be the same for primary and secondary");
return (EINVAL);
}
if (callback == NULL &&
(!F_ISSET(dbp, DB_AM_RDONLY) || !F_ISSET(sdbp, DB_AM_RDONLY))) {
__db_err(dbenv,
"Callback function may be NULL only when database handles are read-only");
return (EINVAL);
}
if ((ret = __db_fchk(dbenv,
"DB->associate", flags, DB_CREATE | DB_AUTO_COMMIT)) != 0)
return (ret);
return (0);
}
/*
* __db_close_pp --
* DB->close pre/post processing.
*
* PUBLIC: int __db_close_pp __P((DB *, u_int32_t));
*/
int
__db_close_pp(dbp, flags)
DB *dbp;
u_int32_t flags;
{
DB_ENV *dbenv;
int handle_check, ret, t_ret;
dbenv = dbp->dbenv;
ret = 0;
PANIC_CHECK(dbenv);
/*
* !!!
* The actual argument checking is simple, do it inline.
*
* Validate arguments and complain if they're wrong, but as a DB
* handle destructor, we can't fail.
*/
if (flags != 0 && flags != DB_NOSYNC &&
(t_ret = __db_ferr(dbenv, "DB->close", 0)) != 0 && ret == 0)
ret = t_ret;
/* Check for replication block. */
handle_check = IS_REPLICATED(dbenv, dbp);
if (handle_check &&
(t_ret = __db_rep_enter(dbp, 0, 0, 0)) != 0) {
handle_check = 0;
if (ret == 0)
ret = t_ret;
}
if ((t_ret = __db_close(dbp, NULL, flags)) != 0 && ret == 0)
ret = t_ret;
/* Release replication block. */
if (handle_check)
__env_db_rep_exit(dbenv);
return (ret);
}
/*
* __db_cursor_pp --
* DB->cursor pre/post processing.
*
* PUBLIC: int __db_cursor_pp __P((DB *, DB_TXN *, DBC **, u_int32_t));
*/
int
__db_cursor_pp(dbp, txn, dbcp, flags)
DB *dbp;
DB_TXN *txn;
DBC **dbcp;
u_int32_t flags;
{
DB_ENV *dbenv;
int handle_check, ret;
dbenv = dbp->dbenv;
PANIC_CHECK(dbenv);
DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->cursor");
if ((ret = __db_cursor_arg(dbp, flags)) != 0)
return (ret);
/*
* Check for consistent transaction usage. For now, assume that
* this cursor might be used for read operations only (in which
* case it may not require a txn). We'll check more stringently
* in c_del and c_put. (Note that this all means that the
* read-op txn tests have to be a subset of the write-op ones.)
*/
if ((ret = __db_check_txn(dbp, txn, DB_LOCK_INVALIDID, 1)) != 0)
return (ret);
/* Check for replication block. */
handle_check = IS_REPLICATED(dbenv, dbp);
if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0)
return (ret);
ret = __db_cursor(dbp, txn, dbcp, flags);
/* Release replication block. */
if (handle_check)
__env_db_rep_exit(dbenv);
return (ret);
}
/*
* __db_cursor --
* DB->cursor.
*
* PUBLIC: int __db_cursor __P((DB *, DB_TXN *, DBC **, u_int32_t));
*/
int
__db_cursor(dbp, txn, dbcp, flags)
DB *dbp;
DB_TXN *txn;
DBC **dbcp;
u_int32_t flags;
{
DB_ENV *dbenv;
DBC *dbc;
db_lockmode_t mode;
u_int32_t op;
int ret;
dbenv = dbp->dbenv;
if ((ret = __db_cursor_int(dbp,
txn, dbp->type, PGNO_INVALID, 0, DB_LOCK_INVALIDID, &dbc)) != 0)
return (ret);
/*
* If this is CDB, do all the locking in the interface, which is
* right here.
*/
if (CDB_LOCKING(dbenv)) {
op = LF_ISSET(DB_OPFLAGS_MASK);
mode = (op == DB_WRITELOCK) ? DB_LOCK_WRITE :
((op == DB_WRITECURSOR) ? DB_LOCK_IWRITE : DB_LOCK_READ);
if ((ret = __lock_get(dbenv, dbc->locker, 0,
&dbc->lock_dbt, mode, &dbc->mylock)) != 0)
goto err;
if (op == DB_WRITECURSOR)
F_SET(dbc, DBC_WRITECURSOR);
if (op == DB_WRITELOCK)
F_SET(dbc, DBC_WRITER);
}
if (LF_ISSET(DB_DIRTY_READ) ||
(txn != NULL && F_ISSET(txn, TXN_DIRTY_READ)))
F_SET(dbc, DBC_DIRTY_READ);
if (LF_ISSET(DB_DEGREE_2) ||
(txn != NULL && F_ISSET(txn, TXN_DEGREE_2)))
F_SET(dbc, DBC_DEGREE_2);
*dbcp = dbc;
return (0);
err: (void)__db_c_close(dbc);
return (ret);
}
/*
* __db_cursor_arg --
* Check DB->cursor arguments.
*/
static int
__db_cursor_arg(dbp, flags)
DB *dbp;
u_int32_t flags;
{
DB_ENV *dbenv;
dbenv = dbp->dbenv;
/*
* DB_DIRTY_READ and DB_DGREE_2 are the only valid bit-flags
* and requires locking.
*/
if (LF_ISSET(DB_DIRTY_READ | DB_DEGREE_2)) {
if (!LOCKING_ON(dbenv))
return (__db_fnl(dbenv, "DB->cursor"));
LF_CLR(DB_DIRTY_READ | DB_DEGREE_2);
}
/* Check for invalid function flags. */
switch (flags) {
case 0:
break;
case DB_WRITECURSOR:
if (IS_READONLY(dbp))
return (__db_rdonly(dbenv, "DB->cursor"));
if (!CDB_LOCKING(dbenv))
return (__db_ferr(dbenv, "DB->cursor", 0));
break;
case DB_WRITELOCK:
if (IS_READONLY(dbp))
return (__db_rdonly(dbenv, "DB->cursor"));
break;
default:
return (__db_ferr(dbenv, "DB->cursor", 0));
}
return (0);
}
/*
* __db_del_pp --
* DB->del pre/post processing.
*
* PUBLIC: int __db_del_pp __P((DB *, DB_TXN *, DBT *, u_int32_t));
*/
int
__db_del_pp(dbp, txn, key, flags)
DB *dbp;
DB_TXN *txn;
DBT *key;
u_int32_t flags;
{
DB_ENV *dbenv;
int handle_check, ret, txn_local;
dbenv = dbp->dbenv;
PANIC_CHECK(dbenv);
DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->del");
if ((ret = __db_del_arg(dbp, flags)) != 0)
return (ret);
/* Create local transaction as necessary. */
if (IS_AUTO_COMMIT(dbenv, txn, flags)) {
if ((ret = __db_txn_auto_init(dbenv, &txn)) != 0)
return (ret);
txn_local = 1;
LF_CLR(DB_AUTO_COMMIT);
} else
txn_local = 0;
/* Check for consistent transaction usage. */
if ((ret = __db_check_txn(dbp, txn, DB_LOCK_INVALIDID, 0)) != 0)
goto err;
/* Check for replication block. */
handle_check = IS_REPLICATED(dbenv, dbp);
if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0)
goto err;
ret = __db_del(dbp, txn, key, flags);
/* Release replication block. */
if (handle_check)
__env_db_rep_exit(dbenv);
err: return (txn_local ? __db_txn_auto_resolve(dbenv, txn, 0, ret) : ret);
}
/*
* __db_del_arg --
* Check DB->delete arguments.
*/
static int
__db_del_arg(dbp, flags)
DB *dbp;
u_int32_t flags;
{
DB_ENV *dbenv;
dbenv = dbp->dbenv;
/* Check for changes to a read-only tree. */
if (IS_READONLY(dbp))
return (__db_rdonly(dbenv, "DB->del"));
/* Check for invalid function flags. */
LF_CLR(DB_AUTO_COMMIT);
switch (flags) {
case 0:
break;
default:
return (__db_ferr(dbenv, "DB->del", 0));
}
return (0);
}
/*
* db_fd_pp --
* DB->fd pre/post processing.
*
* PUBLIC: int __db_fd_pp __P((DB *, int *));
*/
int
__db_fd_pp(dbp, fdp)
DB *dbp;
int *fdp;
{
DB_ENV *dbenv;
DB_FH *fhp;
int handle_check, ret;
dbenv = dbp->dbenv;
PANIC_CHECK(dbenv);
DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->fd");
/* Check for replication block. */
handle_check = IS_REPLICATED(dbenv, dbp);
if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, 0)) != 0)
return (ret);
/*
* !!!
* There's no argument checking to be done.
*
* !!!
* The actual method call is simple, do it inline.
*
* XXX
* Truly spectacular layering violation.
*/
if ((ret = __mp_xxx_fh(dbp->mpf, &fhp)) != 0)
goto err;
if (fhp == NULL) {
*fdp = -1;
__db_err(dbenv,
"Database does not have a valid file handle");
ret = ENOENT;
} else
*fdp = fhp->fd;
err: /* Release replication block. */
if (handle_check)
__env_db_rep_exit(dbenv);
return (ret);
}
/*
* __db_get_pp --
* DB->get pre/post processing.
*
* PUBLIC: int __db_get_pp __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
*/
int
__db_get_pp(dbp, txn, key, data, flags)
DB *dbp;
DB_TXN *txn;
DBT *key, *data;
u_int32_t flags;
{
DB_ENV *dbenv;
u_int32_t mode;
int handle_check, ret, txn_local;
dbenv = dbp->dbenv;
PANIC_CHECK(dbenv);
DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->get");
if ((ret = __db_get_arg(dbp, key, data, flags)) != 0)
return (ret);
mode = 0;
txn_local = 0;
if (LF_ISSET(DB_DIRTY_READ))
mode = DB_DIRTY_READ;
else if ((flags & DB_OPFLAGS_MASK) == DB_CONSUME ||
(flags & DB_OPFLAGS_MASK) == DB_CONSUME_WAIT) {
mode = DB_WRITELOCK;
if (IS_AUTO_COMMIT(dbenv, txn, flags)) {
if ((ret = __db_txn_auto_init(dbenv, &txn)) != 0)
return (ret);
txn_local = 1;
LF_CLR(DB_AUTO_COMMIT);
}
}
/* Check for consistent transaction usage. */
if ((ret = __db_check_txn(dbp, txn, DB_LOCK_INVALIDID,
mode == DB_WRITELOCK || LF_ISSET(DB_RMW) ? 0 : 1)) != 0)
goto err;
/* Check for replication block. */
handle_check = IS_REPLICATED(dbenv, dbp);
if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0)
goto err;
ret = __db_get(dbp, txn, key, data, flags);
/* Release replication block. */
if (handle_check)
__env_db_rep_exit(dbenv);
err: return (txn_local ? __db_txn_auto_resolve(dbenv, txn, 0, ret) : ret);
}
/*
* __db_get --
* DB->get.
*
* PUBLIC: int __db_get __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
*/
int
__db_get(dbp, txn, key, data, flags)
DB *dbp;
DB_TXN *txn;
DBT *key, *data;
u_int32_t flags;
{
DBC *dbc;
u_int32_t mode;
int ret, t_ret;
mode = 0;
if (LF_ISSET(DB_DIRTY_READ)) {
mode = DB_DIRTY_READ;
LF_CLR(DB_DIRTY_READ);
} else if (LF_ISSET(DB_DEGREE_2)) {
mode = DB_DEGREE_2;
LF_CLR(DB_DEGREE_2);
} else if ((flags & DB_OPFLAGS_MASK) == DB_CONSUME ||
(flags & DB_OPFLAGS_MASK) == DB_CONSUME_WAIT)
mode = DB_WRITELOCK;
if ((ret = __db_cursor(dbp, txn, &dbc, mode)) != 0)
return (ret);
DEBUG_LREAD(dbc, txn, "DB->get", key, NULL, flags);
/*
* The DBC_TRANSIENT flag indicates that we're just doing a
* single operation with this cursor, and that in case of
* error we don't need to restore it to its old position--we're
* going to close it right away. Thus, we can perform the get
* without duplicating the cursor, saving some cycles in this
* common case.
*/
F_SET(dbc, DBC_TRANSIENT);
/*
* SET_RET_MEM indicates that if key and/or data have no DBT
* flags set and DB manages the returned-data memory, that memory
* will belong to this handle, not to the underlying cursor.
*/
SET_RET_MEM(dbc, dbp);
if (LF_ISSET(~(DB_RMW | DB_MULTIPLE)) == 0)
LF_SET(DB_SET);
ret = __db_c_get(dbc, key, data, flags);
if (dbc != NULL && (t_ret = __db_c_close(dbc)) != 0 && ret == 0)
ret = t_ret;
return (ret);
}
/*
* __db_get_arg --
* DB->get argument checking, used by both DB->get and DB->pget.
*/
static int
__db_get_arg(dbp, key, data, flags)
const DB *dbp;
const DBT *key;
DBT *data;
u_int32_t flags;
{
DB_ENV *dbenv;
int check_thread, dirty, multi, ret;
dbenv = dbp->dbenv;
/*
* Check for read-modify-write validity. DB_RMW doesn't make sense
* with CDB cursors since if you're going to write the cursor, you
* had to create it with DB_WRITECURSOR. Regardless, we check for
* LOCKING_ON and not STD_LOCKING, as we don't want to disallow it.
* If this changes, confirm that DB does not itself set the DB_RMW
* flag in a path where CDB may have been configured.
*/
check_thread = dirty = 0;
if (LF_ISSET(DB_DIRTY_READ | DB_RMW | DB_DEGREE_2)) {
if (!LOCKING_ON(dbenv))
return (__db_fnl(dbenv, "DB->get"));
dirty = LF_ISSET(DB_DIRTY_READ | DB_DEGREE_2);
if ((ret = __db_fcchk(dbenv,
"DB->get", flags, DB_DIRTY_READ, DB_DEGREE_2)) != 0)
return (ret);
LF_CLR(DB_DIRTY_READ | DB_RMW | DB_DEGREE_2);
}
multi = 0;
if (LF_ISSET(DB_MULTIPLE | DB_MULTIPLE_KEY)) {
if (LF_ISSET(DB_MULTIPLE_KEY))
goto multi_err;
multi = LF_ISSET(DB_MULTIPLE) ? 1 : 0;
LF_CLR(DB_MULTIPLE);
}
if (LF_ISSET(DB_AUTO_COMMIT)) {
LF_CLR(DB_AUTO_COMMIT);
if (flags != DB_CONSUME && flags != DB_CONSUME_WAIT)
goto err;
}
/* Check for invalid function flags. */
switch (flags) {
case 0:
case DB_GET_BOTH:
break;
case DB_SET_RECNO:
check_thread = 1;
if (!F_ISSET(dbp, DB_AM_RECNUM))
goto err;
break;
case DB_CONSUME:
case DB_CONSUME_WAIT:
check_thread = 1;
if (dirty) {
__db_err(dbenv,
"%s is not supported with DB_CONSUME or DB_CONSUME_WAIT",
LF_ISSET(DB_DIRTY_READ) ?
"DB_DIRTY_READ" : "DB_DEGREE_2");
return (EINVAL);
}
if (multi)
multi_err: return (__db_ferr(dbenv, "DB->get", 1));
if (dbp->type == DB_QUEUE)
break;
/* FALLTHROUGH */
default:
err: return (__db_ferr(dbenv, "DB->get", 0));
}
/*
* Check for invalid key/data flags.
*
* XXX: Dave Krinsky
* Remember to modify this when we fix the flag-returning problem.
*/
if ((ret = __dbt_ferr(dbp, "key", key, check_thread)) != 0)
return (ret);
if ((ret = __dbt_ferr(dbp, "data", data, 1)) != 0)
return (ret);
if (multi) {
if (!F_ISSET(data, DB_DBT_USERMEM)) {
__db_err(dbenv,
"DB_MULTIPLE requires DB_DBT_USERMEM be set");
return (EINVAL);
}
if (F_ISSET(key, DB_DBT_PARTIAL) ||
F_ISSET(data, DB_DBT_PARTIAL)) {
__db_err(dbenv,
"DB_MULTIPLE does not support DB_DBT_PARTIAL");
return (EINVAL);
}
if (data->ulen < 1024 ||
data->ulen < dbp->pgsize || data->ulen % 1024 != 0) {
__db_err(dbenv, "%s%s",
"DB_MULTIPLE buffers must be ",
"aligned, at least page size and multiples of 1KB");
return (EINVAL);
}
}
return (0);
}
/*
* __db_join_pp --
* DB->join pre/post processing.
*
* PUBLIC: int __db_join_pp __P((DB *, DBC **, DBC **, u_int32_t));
*/
int
__db_join_pp(primary, curslist, dbcp, flags)
DB *primary;
DBC **curslist, **dbcp;
u_int32_t flags;
{
DB_ENV *dbenv;
int handle_check, ret;
dbenv = primary->dbenv;
PANIC_CHECK(dbenv);
if ((ret = __db_join_arg(primary, curslist, flags)) != 0)
return (ret);
/* Check for replication block. */
handle_check = IS_REPLICATED(dbenv, primary);
if (handle_check && (ret =
__db_rep_enter(primary, 1, 0, curslist[0]->txn != NULL)) != 0)
return (ret);
ret = __db_join(primary, curslist, dbcp, flags);
/* Release replication block. */
if (handle_check)
__env_db_rep_exit(dbenv);
return (ret);
}
/*
* __db_join_arg --
* Check DB->join arguments.
*/
static int
__db_join_arg(primary, curslist, flags)
DB *primary;
DBC **curslist;
u_int32_t flags;
{
DB_ENV *dbenv;
DB_TXN *txn;
int i;
dbenv = primary->dbenv;
switch (flags) {
case 0:
case DB_JOIN_NOSORT:
break;
default:
return (__db_ferr(dbenv, "DB->join", 0));
}
if (curslist == NULL || curslist[0] == NULL) {
__db_err(dbenv,
"At least one secondary cursor must be specified to DB->join");
return (EINVAL);
}
txn = curslist[0]->txn;
for (i = 1; curslist[i] != NULL; i++)
if (curslist[i]->txn != txn) {
__db_err(dbenv,
"All secondary cursors must share the same transaction");
return (EINVAL);
}
return (0);
}
/*
* __db_key_range_pp --
* DB->key_range pre/post processing.
*
* PUBLIC: int __db_key_range_pp
* PUBLIC: __P((DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t));
*/
int
__db_key_range_pp(dbp, txn, key, kr, flags)
DB *dbp;
DB_TXN *txn;
DBT *key;
DB_KEY_RANGE *kr;
u_int32_t flags;
{
DBC *dbc;
DB_ENV *dbenv;
int handle_check, ret, t_ret;
dbenv = dbp->dbenv;
PANIC_CHECK(dbp->dbenv);
DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->key_range");
/*
* !!!
* The actual argument checking is simple, do it inline.
*/
if (flags != 0)
return (__db_ferr(dbenv, "DB->key_range", 0));
/* Check for consistent transaction usage. */
if ((ret = __db_check_txn(dbp, txn, DB_LOCK_INVALIDID, 1)) != 0)
return (ret);
/* Check for replication block. */
handle_check = IS_REPLICATED(dbenv, dbp);
if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0)
return (ret);
/*
* !!!
* The actual method call is simple, do it inline.
*/
switch (dbp->type) {
case DB_BTREE:
/* Acquire a cursor. */
if ((ret = __db_cursor(dbp, txn, &dbc, 0)) != 0)
break;
DEBUG_LWRITE(dbc, NULL, "bam_key_range", NULL, NULL, 0);
ret = __bam_key_range(dbc, key, kr, flags);
if ((t_ret = __db_c_close(dbc)) != 0 && ret == 0)
ret = t_ret;
break;
case DB_HASH:
case DB_QUEUE:
case DB_RECNO:
ret = __dbh_am_chk(dbp, DB_OK_BTREE);
break;
case DB_UNKNOWN:
default:
ret = __db_unknown_type(dbenv, "DB->key_range", dbp->type);
break;
}
/* Release replication block. */
if (handle_check)
__env_db_rep_exit(dbenv);
return (ret);
}
/*
* __db_open_pp --
* DB->open pre/post processing.
*
* PUBLIC: int __db_open_pp __P((DB *, DB_TXN *,
* PUBLIC: const char *, const char *, DBTYPE, u_int32_t, int));
*/
int
__db_open_pp(dbp, txn, fname, dname, type, flags, mode)
DB *dbp;
DB_TXN *txn;
const char *fname, *dname;
DBTYPE type;
u_int32_t flags;
int mode;
{
DB_ENV *dbenv;
int handle_check, nosync, remove_me, ret, txn_local;
dbenv = dbp->dbenv;
nosync = 1;
remove_me = 0;
PANIC_CHECK(dbenv);
if ((ret = __db_open_arg(dbp, txn, fname, dname, type, flags)) != 0)
return (ret);
/*
* Save the file and database names and flags. We do this here
* because we don't pass all of the flags down into the actual
* DB->open method call, we strip DB_AUTO_COMMIT at this layer.
*/
if ((fname != NULL &&
(ret = __os_strdup(dbenv, fname, &dbp->fname)) != 0) ||
(dname != NULL &&
(ret = __os_strdup(dbenv, dname, &dbp->dname)) != 0))
return (ret);
dbp->open_flags = flags;
/* Save the current DB handle flags for refresh. */
dbp->orig_flags = dbp->flags;
/*
* Create local transaction as necessary, check for consistent
* transaction usage.
*/
txn_local = 0;
if (IS_AUTO_COMMIT(dbenv, txn, flags)) {
if ((ret = __db_txn_auto_init(dbenv, &txn)) != 0)
return (ret);
txn_local = 1;
LF_CLR(DB_AUTO_COMMIT);
} else
if (txn != NULL && !TXN_ON(dbenv))
return (__db_not_txn_env(dbenv));
/* Check for replication block. */
handle_check = IS_REPLICATED(dbenv, dbp);
if (handle_check &&
(ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0) {
handle_check = 0;
goto err;
}
if ((ret = __db_open(dbp,
txn, fname, dname, type, flags, mode, PGNO_BASE_MD)) != 0)
goto err;
/*
* You can open the database that describes the subdatabases in the
* rest of the file read-only. The content of each key's data is
* unspecified and applications should never be adding new records
* or updating existing records. However, during recovery, we need
* to open these databases R/W so we can redo/undo changes in them.
* Likewise, we need to open master databases read/write during
* rename and remove so we can be sure they're fully sync'ed, so
* we provide an override flag for the purpose.
*/
if (dname == NULL && !IS_RECOVERING(dbenv) && !LF_ISSET(DB_RDONLY) &&
!LF_ISSET(DB_RDWRMASTER) && F_ISSET(dbp, DB_AM_SUBDB)) {
__db_err(dbenv,
"files containing multiple databases may only be opened read-only");
ret = EINVAL;
goto err;
}
/*
* Success: file creations have to be synchronous, otherwise we don't
* care.
*/
if (F_ISSET(dbp, DB_AM_CREATED | DB_AM_CREATED_MSTR))
nosync = 0;
/* Success: don't discard the file on close. */
F_CLR(dbp, DB_AM_DISCARD | DB_AM_CREATED | DB_AM_CREATED_MSTR);
/*
* If not transactional, remove the databases/subdatabases. If we're
* transactional, the child transaction abort cleans up.
*/
err: if (ret != 0 && txn == NULL) {
remove_me = F_ISSET(dbp, DB_AM_CREATED);
if (F_ISSET(dbp, DB_AM_CREATED_MSTR) ||
(dname == NULL && remove_me))
/* Remove file. */
(void)__db_remove_int(dbp, txn, fname, NULL, DB_FORCE);
else if (remove_me)
/* Remove subdatabase. */
(void)__db_remove_int(dbp, txn, fname, dname, DB_FORCE);
}
/* Release replication block. */
if (handle_check)
__env_db_rep_exit(dbenv);
return (txn_local ?
__db_txn_auto_resolve(dbenv, txn, nosync, ret) : ret);
}
/*
* __db_open_arg --
* Check DB->open arguments.
*/
static int
__db_open_arg(dbp, txn, fname, dname, type, flags)
DB *dbp;
DB_TXN *txn;
const char *fname, *dname;
DBTYPE type;
u_int32_t flags;
{
DB_ENV *dbenv;
u_int32_t ok_flags;
int ret;
dbenv = dbp->dbenv;
/* Validate arguments. */
#undef OKFLAGS
#define OKFLAGS \
(DB_AUTO_COMMIT | DB_CREATE | DB_DIRTY_READ | DB_EXCL | \
DB_FCNTL_LOCKING | DB_NO_AUTO_COMMIT | DB_NOMMAP | DB_RDONLY | \
DB_RDWRMASTER | DB_THREAD | DB_TRUNCATE | DB_WRITEOPEN)
if ((ret = __db_fchk(dbenv, "DB->open", flags, OKFLAGS)) != 0)
return (ret);
if (LF_ISSET(DB_EXCL) && !LF_ISSET(DB_CREATE))
return (__db_ferr(dbenv, "DB->open", 1));
if (LF_ISSET(DB_RDONLY) && LF_ISSET(DB_CREATE))
return (__db_ferr(dbenv, "DB->open", 1));
#ifdef HAVE_VXWORKS
if (LF_ISSET(DB_TRUNCATE)) {
__db_err(dbenv, "DB_TRUNCATE not supported on VxWorks");
return (DB_OPNOTSUP);
}
#endif
switch (type) {
case DB_UNKNOWN:
if (LF_ISSET(DB_CREATE|DB_TRUNCATE)) {
__db_err(dbenv,
"%s: DB_UNKNOWN type specified with DB_CREATE or DB_TRUNCATE",
fname);
return (EINVAL);
}
ok_flags = 0;
break;
case DB_BTREE:
ok_flags = DB_OK_BTREE;
break;
case DB_HASH:
#ifndef HAVE_HASH
return (__db_no_hash_am(dbenv));
#endif
ok_flags = DB_OK_HASH;
break;
case DB_QUEUE:
#ifndef HAVE_QUEUE
return (__db_no_queue_am(dbenv));
#endif
ok_flags = DB_OK_QUEUE;
break;
case DB_RECNO:
ok_flags = DB_OK_RECNO;
break;
default:
__db_err(dbenv, "unknown type: %lu", (u_long)type);
return (EINVAL);
}
if (ok_flags)
DB_ILLEGAL_METHOD(dbp, ok_flags);
/* The environment may have been created, but never opened. */
if (!F_ISSET(dbenv, DB_ENV_DBLOCAL | DB_ENV_OPEN_CALLED)) {
__db_err(dbenv, "environment not yet opened");
return (EINVAL);
}
/*
* Historically, you could pass in an environment that didn't have a
* mpool, and DB would create a private one behind the scenes. This
* no longer works.
*/
if (!F_ISSET(dbenv, DB_ENV_DBLOCAL) && !MPOOL_ON(dbenv)) {
__db_err(dbenv, "environment did not include a memory pool");
return (EINVAL);
}
/*
* You can't specify threads during DB->open if subsystems in the
* environment weren't configured with them.
*/
if (LF_ISSET(DB_THREAD) &&
!F_ISSET(dbenv, DB_ENV_DBLOCAL | DB_ENV_THREAD)) {
__db_err(dbenv, "environment not created using DB_THREAD");
return (EINVAL);
}
/* DB_TRUNCATE is neither transaction recoverable nor lockable. */
if (LF_ISSET(DB_TRUNCATE) && (LOCKING_ON(dbenv) || txn != NULL)) {
__db_err(dbenv,
"DB_TRUNCATE illegal with %s specified",
LOCKING_ON(dbenv) ? "locking" : "transactions");
return (EINVAL);
}
/* Subdatabase checks. */
if (dname != NULL) {
/* Subdatabases must be created in named files. */
if (fname == NULL) {
__db_err(dbenv,
"multiple databases cannot be created in temporary files");
return (EINVAL);
}
/* QAM can't be done as a subdatabase. */
if (type == DB_QUEUE) {
__db_err(dbenv, "Queue databases must be one-per-file");
return (EINVAL);
}
}
return (0);
}
/*
* __db_pget_pp --
* DB->pget pre/post processing.
*
* PUBLIC: int __db_pget_pp
* PUBLIC: __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t));
*/
int
__db_pget_pp(dbp, txn, skey, pkey, data, flags)
DB *dbp;
DB_TXN *txn;
DBT *skey, *pkey, *data;
u_int32_t flags;
{
DB_ENV *dbenv;
int handle_check, ret;
dbenv = dbp->dbenv;
PANIC_CHECK(dbenv);
DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->pget");
if ((ret = __db_pget_arg(dbp, pkey, flags)) != 0)
return (ret);
if ((ret = __db_get_arg(dbp, skey, data, flags)) != 0)
return (ret);
/* Check for replication block. */
handle_check = IS_REPLICATED(dbenv, dbp);
if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0)
return (ret);
ret = __db_pget(dbp, txn, skey, pkey, data, flags);
/* Release replication block. */
if (handle_check)
__env_db_rep_exit(dbenv);
return (ret);
}
/*
* __db_pget --
* DB->pget.
*
* PUBLIC: int __db_pget
* PUBLIC: __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t));
*/
int
__db_pget(dbp, txn, skey, pkey, data, flags)
DB *dbp;
DB_TXN *txn;
DBT *skey, *pkey, *data;
u_int32_t flags;
{
DBC *dbc;
int ret, t_ret;
if ((ret = __db_cursor(dbp, txn, &dbc, 0)) != 0)
return (ret);
SET_RET_MEM(dbc, dbp);
DEBUG_LREAD(dbc, txn, "__db_pget", skey, NULL, flags);
/*
* !!!
* The actual method call is simple, do it inline.
*
* The underlying cursor pget will fill in a default DBT for null
* pkeys, and use the cursor's returned-key memory internally to
* store any intermediate primary keys. However, we've just set
* the returned-key memory to the DB handle's key memory, which
* is unsafe to use if the DB handle is threaded. If the pkey
* argument is NULL, use the DBC-owned returned-key memory
* instead; it'll go away when we close the cursor before we
* return, but in this case that's just fine, as we're not
* returning the primary key.
*/
if (pkey == NULL)
dbc->rkey = &dbc->my_rkey;
/*
* The cursor is just a perfectly ordinary secondary database cursor.
* Call its c_pget() method to do the dirty work.
*/
if (flags == 0 || flags == DB_RMW)
flags |= DB_SET;
ret = __db_c_pget(dbc, skey, pkey, data, flags);
if ((t_ret = __db_c_close(dbc)) != 0 && ret == 0)
ret = t_ret;
return (ret);
}
/*
* __db_pget_arg --
* Check DB->pget arguments.
*/
static int
__db_pget_arg(dbp, pkey, flags)
DB *dbp;
DBT *pkey;
u_int32_t flags;
{
DB_ENV *dbenv;
int ret;
dbenv = dbp->dbenv;
if (!F_ISSET(dbp, DB_AM_SECONDARY)) {
__db_err(dbenv,
"DB->pget may only be used on secondary indices");
return (EINVAL);
}
if (LF_ISSET(DB_MULTIPLE | DB_MULTIPLE_KEY)) {
__db_err(dbenv,
"DB_MULTIPLE and DB_MULTIPLE_KEY may not be used on secondary indices");
return (EINVAL);
}
/* DB_CONSUME makes no sense on a secondary index. */
LF_CLR(DB_RMW);
switch (flags) {
case DB_CONSUME:
case DB_CONSUME_WAIT:
return (__db_ferr(dbenv, "DB->pget", 0));
default:
/* __db_get_arg will catch the rest. */
break;
}
/*
* We allow the pkey field to be NULL, so that we can make the
* two-DBT get calls into wrappers for the three-DBT ones.
*/
if (pkey != NULL &&
(ret = __dbt_ferr(dbp, "primary key", pkey, 1)) != 0)
return (ret);
/* But the pkey field can't be NULL if we're doing a DB_GET_BOTH. */
if (pkey == NULL && flags == DB_GET_BOTH) {
__db_err(dbenv,
"DB_GET_BOTH on a secondary index requires a primary key");
return (EINVAL);
}
return (0);
}
/*
* __db_put_pp --
* DB->put pre/post processing.
*
* PUBLIC: int __db_put_pp __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
*/
int
__db_put_pp(dbp, txn, key, data, flags)
DB *dbp;
DB_TXN *txn;
DBT *key, *data;
u_int32_t flags;
{
DB_ENV *dbenv;
int handle_check, ret, txn_local;
dbenv = dbp->dbenv;
PANIC_CHECK(dbenv);
DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->put");
if ((ret = __db_put_arg(dbp, key, data, flags)) != 0)
return (ret);
/* Create local transaction as necessary. */
if (IS_AUTO_COMMIT(dbenv, txn, flags)) {
if ((ret = __db_txn_auto_init(dbenv, &txn)) != 0)
return (ret);
txn_local = 1;
LF_CLR(DB_AUTO_COMMIT);
} else
txn_local = 0;
/* Check for consistent transaction usage. */
if ((ret = __db_check_txn(dbp, txn, DB_LOCK_INVALIDID, 0)) != 0)
goto err;
/* Check for replication block. */
handle_check = IS_REPLICATED(dbenv, dbp);
if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, txn != NULL)) != 0)
goto err;
ret = __db_put(dbp, txn, key, data, flags);
/* Release replication block. */
if (handle_check)
__env_db_rep_exit(dbenv);
err: return (txn_local ? __db_txn_auto_resolve(dbenv, txn, 0, ret) : ret);
}
/*
* __db_put_arg --
* Check DB->put arguments.
*/
static int
__db_put_arg(dbp, key, data, flags)
DB *dbp;
DBT *key, *data;
u_int32_t flags;
{
DB_ENV *dbenv;
int ret, returnkey;
dbenv = dbp->dbenv;
returnkey = 0;
/* Check for changes to a read-only tree. */
if (IS_READONLY(dbp))
return (__db_rdonly(dbenv, "put"));
/* Check for puts on a secondary. */
if (F_ISSET(dbp, DB_AM_SECONDARY)) {
__db_err(dbenv, "DB->put forbidden on secondary indices");
return (EINVAL);
}
/* Check for invalid function flags. */
LF_CLR(DB_AUTO_COMMIT);
switch (flags) {
case 0:
case DB_NOOVERWRITE:
break;
case DB_APPEND:
if (dbp->type != DB_RECNO && dbp->type != DB_QUEUE)
goto err;
returnkey = 1;
break;
case DB_NODUPDATA:
if (F_ISSET(dbp, DB_AM_DUPSORT))
break;
/* FALLTHROUGH */
default:
err: return (__db_ferr(dbenv, "DB->put", 0));
}
/* Check for invalid key/data flags. */
if ((ret = __dbt_ferr(dbp, "key", key, returnkey)) != 0)
return (ret);
if ((ret = __dbt_ferr(dbp, "data", data, 0)) != 0)
return (ret);
/* Keys shouldn't have partial flags during a put. */
if (F_ISSET(key, DB_DBT_PARTIAL))
return (__db_ferr(dbenv, "key DBT", 0));
/* Check for partial puts in the presence of duplicates. */
if (F_ISSET(data, DB_DBT_PARTIAL) &&
(F_ISSET(dbp, DB_AM_DUP) || F_ISSET(key, DB_DBT_DUPOK))) {
__db_err(dbenv,
"a partial put in the presence of duplicates requires a cursor operation");
return (EINVAL);
}
return (0);
}
/*
* __db_sync_pp --
* DB->sync pre/post processing.
*
* PUBLIC: int __db_sync_pp __P((DB *, u_int32_t));
*/
int
__db_sync_pp(dbp, flags)
DB *dbp;
u_int32_t flags;
{
DB_ENV *dbenv;
int handle_check, ret;
dbenv = dbp->dbenv;
PANIC_CHECK(dbp->dbenv);
DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->sync");
/*
* !!!
* The actual argument checking is simple, do it inline.
*/
if (flags != 0)
return (__db_ferr(dbenv, "DB->sync", 0));
/* Check for replication block. */
handle_check = IS_REPLICATED(dbenv, dbp);
if (handle_check && (ret = __db_rep_enter(dbp, 1, 0, 0)) != 0)
return (ret);
ret = __db_sync(dbp);
/* Release replication block. */
if (handle_check)
__env_db_rep_exit(dbenv);
return (ret);
}
/*
* __db_c_close_pp --
* DBC->c_close pre/post processing.
*
* PUBLIC: int __db_c_close_pp __P((DBC *));
*/
int
__db_c_close_pp(dbc)
DBC *dbc;
{
DB_ENV *dbenv;
DB *dbp;
int handle_check, ret;
dbp = dbc->dbp;
dbenv = dbp->dbenv;
PANIC_CHECK(dbenv);
/*
* If the cursor is already closed we have a serious problem, and we
* assume that the cursor isn't on the active queue. Don't do any of
* the remaining cursor close processing.
*/
if (!F_ISSET(dbc, DBC_ACTIVE)) {
if (dbp != NULL)
__db_err(dbenv, "Closing already-closed cursor");
DB_ASSERT(0);
return (EINVAL);
}
/* Check for replication block. */
handle_check = IS_REPLICATED(dbenv, dbp);
if (handle_check &&
(ret = __db_rep_enter(dbp, 0, 0, dbc->txn != NULL)) != 0)
return (ret);
ret = __db_c_close(dbc);
/* Release replication block. */
if (handle_check)
__env_db_rep_exit(dbenv);
return (ret);
}
/*
* __db_c_count_pp --
* DBC->c_count pre/post processing.
*
* PUBLIC: int __db_c_count_pp __P((DBC *, db_recno_t *, u_int32_t));
*/
int
__db_c_count_pp(dbc, recnop, flags)
DBC *dbc;
db_recno_t *recnop;
u_int32_t flags;
{
DB_ENV *dbenv;
DB *dbp;
int handle_check, ret;
dbp = dbc->dbp;
dbenv = dbp->dbenv;
PANIC_CHECK(dbenv);
/*
* !!!
* The actual argument checking is simple, do it inline.
*/
if (flags != 0)
return (__db_ferr(dbenv, "DBcursor->count", 0));
/*
* The cursor must be initialized, return EINVAL for an invalid cursor,
* otherwise 0.
*/
if (!IS_INITIALIZED(dbc))
return (__db_curinval(dbenv));
/* Check for replication block. */
handle_check = IS_REPLICATED(dbenv, dbp);
if (handle_check &&
(ret = __db_rep_enter(dbp, 1, 0, dbc->txn != NULL)) != 0)
return (ret);
ret = __db_c_count(dbc, recnop);
/* Release replication block. */
if (handle_check)
__env_db_rep_exit(dbenv);
return (ret);
}
/*
* __db_c_del_pp --
* DBC->c_del pre/post processing.
*
* PUBLIC: int __db_c_del_pp __P((DBC *, u_int32_t));
*/
int
__db_c_del_pp(dbc, flags)
DBC *dbc;
u_int32_t flags;
{
DB *dbp;
DB_ENV *dbenv;
int handle_check, ret;
dbp = dbc->dbp;
dbenv = dbp->dbenv;
PANIC_CHECK(dbenv);
if ((ret = __db_c_del_arg(dbc, flags)) != 0)
return (ret);
/* Check for consistent transaction usage. */
if ((ret = __db_check_txn(dbp, dbc->txn, dbc->locker, 0)) != 0)
return (ret);
/* Check for replication block. */
handle_check = IS_REPLICATED(dbenv, dbp);
if (handle_check &&
(ret = __db_rep_enter(dbp, 1, 0, dbc->txn != NULL)) != 0)
return (ret);
DEBUG_LWRITE(dbc, dbc->txn, "DBcursor->del", NULL, NULL, flags);
ret = __db_c_del(dbc, flags);
/* Release replication block. */
if (handle_check)
__env_db_rep_exit(dbenv);
return (ret);
}
/*
* __db_c_del_arg --
* Check DBC->c_del arguments.
*
* PUBLIC: int __db_c_del_arg __P((DBC *, u_int32_t));
*/
int
__db_c_del_arg(dbc, flags)
DBC *dbc;
u_int32_t flags;
{
DB *dbp;
DB_ENV *dbenv;
dbp = dbc->dbp;
dbenv = dbp->dbenv;
/* Check for changes to a read-only tree. */
if (IS_READONLY(dbp))
return (__db_rdonly(dbenv, "DBcursor->del"));
/* Check for invalid function flags. */
switch (flags) {
case 0:
break;
case DB_UPDATE_SECONDARY:
DB_ASSERT(F_ISSET(dbp, DB_AM_SECONDARY));
break;
default:
return (__db_ferr(dbenv, "DBcursor->del", 0));
}
/*
* The cursor must be initialized, return EINVAL for an invalid cursor,
* otherwise 0.
*/
if (!IS_INITIALIZED(dbc))
return (__db_curinval(dbenv));
return (0);
}
/*
* __db_c_dup_pp --
* DBC->c_dup pre/post processing.
*
* PUBLIC: int __db_c_dup_pp __P((DBC *, DBC **, u_int32_t));
*/
int
__db_c_dup_pp(dbc, dbcp, flags)
DBC *dbc, **dbcp;
u_int32_t flags;
{
DB *dbp;
DB_ENV *dbenv;
int handle_check, ret;
dbp = dbc->dbp;
dbenv = dbp->dbenv;
PANIC_CHECK(dbenv);
/*
* !!!
* The actual argument checking is simple, do it inline.
*/
if (flags != 0 && flags != DB_POSITION)
return (__db_ferr(dbenv, "DBcursor->dup", 0));
/* Check for replication block. */
handle_check = IS_REPLICATED(dbenv, dbp);
if (handle_check &&
(ret = __db_rep_enter(dbp, 1, 0, dbc->txn != NULL)) != 0)
return (ret);
ret = __db_c_dup(dbc, dbcp, flags);
/* Release replication block. */
if (handle_check)
__env_db_rep_exit(dbenv);
return (ret);
}
/*
* __db_c_get_pp --
* DBC->c_get pre/post processing.
*
* PUBLIC: int __db_c_get_pp __P((DBC *, DBT *, DBT *, u_int32_t));
*/
int
__db_c_get_pp(dbc, key, data, flags)
DBC *dbc;
DBT *key, *data;
u_int32_t flags;
{
DB *dbp;
DB_ENV *dbenv;
int handle_check, ret;
dbp = dbc->dbp;
dbenv = dbp->dbenv;
PANIC_CHECK(dbenv);
if ((ret = __db_c_get_arg(dbc, key, data, flags)) != 0)
return (ret);
/* Check for replication block. */
handle_check = IS_REPLICATED(dbenv, dbp);
if (handle_check &&
(ret = __db_rep_enter(dbp, 1, 0, dbc->txn != NULL)) != 0)
return (ret);
DEBUG_LREAD(dbc, dbc->txn, "DBcursor->get",
flags == DB_SET || flags == DB_SET_RANGE ? key : NULL, NULL, flags);
ret = __db_c_get(dbc, key, data, flags);
/* Release replication block. */
if (handle_check)
__env_db_rep_exit(dbenv);
return (ret);
}
/*
* __db_c_get_arg --
* Common DBC->get argument checking, used by both DBC->get and DBC->pget.
*/
static int
__db_c_get_arg(dbc, key, data, flags)
DBC *dbc;
DBT *key, *data;
u_int32_t flags;
{
DB *dbp;
DB_ENV *dbenv;
int dirty, multi, ret;
dbp = dbc->dbp;
dbenv = dbp->dbenv;
/*
* Typically in checking routines that modify the flags, we have
* to save them and restore them, because the checking routine
* calls the work routine. However, this is a pure-checking
* routine which returns to a function that calls the work routine,
* so it's OK that we do not save and restore the flags, even though
* we modify them.
*
* Check for read-modify-write validity. DB_RMW doesn't make sense
* with CDB cursors since if you're going to write the cursor, you
* had to create it with DB_WRITECURSOR. Regardless, we check for
* LOCKING_ON and not STD_LOCKING, as we don't want to disallow it.
* If this changes, confirm that DB does not itself set the DB_RMW
* flag in a path where CDB may have been configured.
*/
dirty = 0;
if (LF_ISSET(DB_DIRTY_READ | DB_RMW)) {
if (!LOCKING_ON(dbenv))
return (__db_fnl(dbenv, "DBcursor->get"));
if (LF_ISSET(DB_DIRTY_READ))
dirty = 1;
LF_CLR(DB_DIRTY_READ | DB_RMW);
}
multi = 0;
if (LF_ISSET(DB_MULTIPLE | DB_MULTIPLE_KEY)) {
multi = 1;
if (LF_ISSET(DB_MULTIPLE) && LF_ISSET(DB_MULTIPLE_KEY))
goto multi_err;
LF_CLR(DB_MULTIPLE | DB_MULTIPLE_KEY);
}
/* Check for invalid function flags. */
switch (flags) {
case DB_CONSUME:
case DB_CONSUME_WAIT:
if (dirty) {
__db_err(dbenv,
"DB_DIRTY_READ is not supported with DB_CONSUME or DB_CONSUME_WAIT");
return (EINVAL);
}
if (dbp->type != DB_QUEUE)
goto err;
break;
case DB_CURRENT:
case DB_FIRST:
case DB_GET_BOTH:
case DB_GET_BOTH_RANGE:
case DB_NEXT:
case DB_NEXT_DUP:
case DB_NEXT_NODUP:
case DB_SET:
case DB_SET_RANGE:
break;
case DB_LAST:
case DB_PREV:
case DB_PREV_NODUP:
if (multi)
multi_err: return (__db_ferr(dbenv, "DBcursor->get", 1));
break;
case DB_GET_BOTHC:
if (dbp->type == DB_QUEUE)
goto err;
break;
case DB_GET_RECNO:
/*
* The one situation in which this might be legal with a
* non-RECNUM dbp is if dbp is a secondary and its primary is
* DB_AM_RECNUM.
*/
if (!F_ISSET(dbp, DB_AM_RECNUM) &&
(!F_ISSET(dbp, DB_AM_SECONDARY) ||
!F_ISSET(dbp->s_primary, DB_AM_RECNUM)))
goto err;
break;
case DB_SET_RECNO:
if (!F_ISSET(dbp, DB_AM_RECNUM))
goto err;
break;
default:
err: return (__db_ferr(dbenv, "DBcursor->get", 0));
}
/* Check for invalid key/data flags. */
if ((ret = __dbt_ferr(dbp, "key", key, 0)) != 0)
return (ret);
if ((ret = __dbt_ferr(dbp, "data", data, 0)) != 0)
return (ret);
if (multi) {
if (!F_ISSET(data, DB_DBT_USERMEM)) {
__db_err(dbenv,
"DB_MULTIPLE/DB_MULTIPLE_KEY require DB_DBT_USERMEM be set");
return (EINVAL);
}
if (F_ISSET(key, DB_DBT_PARTIAL) ||
F_ISSET(data, DB_DBT_PARTIAL)) {
__db_err(dbenv,
"DB_MULTIPLE/DB_MULTIPLE_KEY do not support DB_DBT_PARTIAL");
return (EINVAL);
}
if (data->ulen < 1024 ||
data->ulen < dbp->pgsize || data->ulen % 1024 != 0) {
__db_err(dbenv, "%s%s",
"DB_MULTIPLE/DB_MULTIPLE_KEY buffers must be ",
"aligned, at least page size and multiples of 1KB");
return (EINVAL);
}
}
/*
* The cursor must be initialized for DB_CURRENT, DB_GET_RECNO and
* DB_NEXT_DUP. Return EINVAL for an invalid cursor, otherwise 0.
*/
if (!IS_INITIALIZED(dbc) && (flags == DB_CURRENT ||
flags == DB_GET_RECNO || flags == DB_NEXT_DUP))
return (__db_curinval(dbenv));
/* Check for consistent transaction usage. */
if (LF_ISSET(DB_RMW) &&
(ret = __db_check_txn(dbp, dbc->txn, dbc->locker, 0)) != 0)
return (ret);
return (0);
}
/*
* __db_secondary_close_pp --
* DB->close for secondaries
*
* PUBLIC: int __db_secondary_close_pp __P((DB *, u_int32_t));
*/
int
__db_secondary_close_pp(dbp, flags)
DB *dbp;
u_int32_t flags;
{
DB_ENV *dbenv;
int handle_check, ret, t_ret;
dbenv = dbp->dbenv;
ret = 0;
PANIC_CHECK(dbenv);
/*
* !!!
* The actual argument checking is simple, do it inline.
*
* Validate arguments and complain if they're wrong, but as a DB
* handle destructor, we can't fail.
*/
if (flags != 0 && flags != DB_NOSYNC &&
(t_ret = __db_ferr(dbenv, "DB->close", 0)) != 0 && ret == 0)
ret = t_ret;
/* Check for replication block. */
handle_check = IS_REPLICATED(dbenv, dbp);
if (handle_check &&
(t_ret = __db_rep_enter(dbp, 0, 0, 0)) != 0) {
handle_check = 0;
if (ret == 0)
ret = t_ret;
}
if ((t_ret = __db_secondary_close(dbp, flags)) != 0 && ret == 0)
ret = t_ret;
/* Release replication block. */
if (handle_check)
__env_db_rep_exit(dbenv);
return (ret);
}
/*
* __db_c_pget_pp --
* DBC->c_pget pre/post processing.
*
* PUBLIC: int __db_c_pget_pp __P((DBC *, DBT *, DBT *, DBT *, u_int32_t));
*/
int
__db_c_pget_pp(dbc, skey, pkey, data, flags)
DBC *dbc;
DBT *skey, *pkey, *data;
u_int32_t flags;
{
DB *dbp;
DB_ENV *dbenv;
int handle_check, ret;
dbp = dbc->dbp;
dbenv = dbp->dbenv;
PANIC_CHECK(dbenv);
if ((ret = __db_c_pget_arg(dbc, pkey, flags)) != 0)
return (ret);
if ((ret = __db_c_get_arg(dbc, skey, data, flags)) != 0)
return (ret);
/* Check for replication block. */
handle_check = IS_REPLICATED(dbenv, dbp);
if (handle_check &&
(ret = __db_rep_enter(dbp, 1, 0, dbc->txn != NULL)) != 0)
return (ret);
ret = __db_c_pget(dbc, skey, pkey, data, flags);
/* Release replication block. */
if (handle_check)
__env_db_rep_exit(dbenv);
return (ret);
}
/*
* __db_c_pget_arg --
* Check DBC->pget arguments.
*/
static int
__db_c_pget_arg(dbc, pkey, flags)
DBC *dbc;
DBT *pkey;
u_int32_t flags;
{
DB *dbp;
DB_ENV *dbenv;
int ret;
dbp = dbc->dbp;
dbenv = dbp->dbenv;
if (!F_ISSET(dbp, DB_AM_SECONDARY)) {
__db_err(dbenv,
"DBcursor->pget may only be used on secondary indices");
return (EINVAL);
}
if (LF_ISSET(DB_MULTIPLE | DB_MULTIPLE_KEY)) {
__db_err(dbenv,
"DB_MULTIPLE and DB_MULTIPLE_KEY may not be used on secondary indices");
return (EINVAL);
}
switch (LF_ISSET(~DB_RMW)) {
case DB_CONSUME:
case DB_CONSUME_WAIT:
/* These flags make no sense on a secondary index. */
return (__db_ferr(dbenv, "DBcursor->pget", 0));
case DB_GET_BOTH:
/* DB_GET_BOTH is "get both the primary and the secondary". */
if (pkey == NULL) {
__db_err(dbenv,
"DB_GET_BOTH requires both a secondary and a primary key");
return (EINVAL);
}
break;
default:
/* __db_c_get_arg will catch the rest. */
break;
}
/*
* We allow the pkey field to be NULL, so that we can make the
* two-DBT get calls into wrappers for the three-DBT ones.
*/
if (pkey != NULL &&
(ret = __dbt_ferr(dbp, "primary key", pkey, 0)) != 0)
return (ret);
/* But the pkey field can't be NULL if we're doing a DB_GET_BOTH. */
if (pkey == NULL && (flags & DB_OPFLAGS_MASK) == DB_GET_BOTH) {
__db_err(dbenv,
"DB_GET_BOTH on a secondary index requires a primary key");
return (EINVAL);
}
return (0);
}
/*
* __db_c_put_pp --
* DBC->put pre/post processing.
*
* PUBLIC: int __db_c_put_pp __P((DBC *, DBT *, DBT *, u_int32_t));
*/
int
__db_c_put_pp(dbc, key, data, flags)
DBC *dbc;
DBT *key, *data;
u_int32_t flags;
{
DB *dbp;
DB_ENV *dbenv;
int handle_check, ret;
dbp = dbc->dbp;
dbenv = dbp->dbenv;
PANIC_CHECK(dbenv);
if ((ret = __db_c_put_arg(dbc, key, data, flags)) != 0)
return (ret);
/* Check for consistent transaction usage. */
if ((ret = __db_check_txn(dbp, dbc->txn, dbc->locker, 0)) != 0)
return (ret);
/* Check for replication block. */
handle_check = IS_REPLICATED(dbenv, dbp);
if (handle_check &&
(ret = __db_rep_enter(dbp, 1, 0, dbc->txn != NULL)) != 0)
return (ret);
DEBUG_LWRITE(dbc, dbc->txn, "DBcursor->put",
flags == DB_KEYFIRST || flags == DB_KEYLAST ||
flags == DB_NODUPDATA || flags == DB_UPDATE_SECONDARY ?
key : NULL, data, flags);
ret =__db_c_put(dbc, key, data, flags);
/* Release replication block. */
if (handle_check)
__env_db_rep_exit(dbenv);
return (ret);
}
/*
* __db_c_put_arg --
* Check DBC->put arguments.
*/
static int
__db_c_put_arg(dbc, key, data, flags)
DBC *dbc;
DBT *key, *data;
u_int32_t flags;
{
DB *dbp;
DB_ENV *dbenv;
int key_flags, ret;
dbp = dbc->dbp;
dbenv = dbp->dbenv;
key_flags = 0;
/* Check for changes to a read-only tree. */
if (IS_READONLY(dbp))
return (__db_rdonly(dbenv, "c_put"));
/* Check for puts on a secondary. */
if (F_ISSET(dbp, DB_AM_SECONDARY)) {
if (flags == DB_UPDATE_SECONDARY)
flags = DB_KEYLAST;
else {
__db_err(dbenv,
"DBcursor->put forbidden on secondary indices");
return (EINVAL);
}
}
/* Check for invalid function flags. */
switch (flags) {
case DB_AFTER:
case DB_BEFORE:
switch (dbp->type) {
case DB_BTREE:
case DB_HASH: /* Only with unsorted duplicates. */
if (!F_ISSET(dbp, DB_AM_DUP))
goto err;
if (dbp->dup_compare != NULL)
goto err;
break;
case DB_QUEUE: /* Not permitted. */
goto err;
case DB_RECNO: /* Only with mutable record numbers. */
if (!F_ISSET(dbp, DB_AM_RENUMBER))
goto err;
key_flags = 1;
break;
case DB_UNKNOWN:
default:
goto err;
}
break;
case DB_CURRENT:
/*
* If there is a comparison function, doing a DB_CURRENT
* must not change the part of the data item that is used
* for the comparison.
*/
break;
case DB_NODUPDATA:
if (!F_ISSET(dbp, DB_AM_DUPSORT))
goto err;
/* FALLTHROUGH */
case DB_KEYFIRST:
case DB_KEYLAST:
key_flags = 1;
break;
default:
err: return (__db_ferr(dbenv, "DBcursor->put", 0));
}
/* Check for invalid key/data flags. */
if (key_flags && (ret = __dbt_ferr(dbp, "key", key, 0)) != 0)
return (ret);
if ((ret = __dbt_ferr(dbp, "data", data, 0)) != 0)
return (ret);
/* Keys shouldn't have partial flags during a put. */
if (F_ISSET(key, DB_DBT_PARTIAL))
return (__db_ferr(dbenv, "key DBT", 0));
/*
* The cursor must be initialized for anything other than DB_KEYFIRST
* and DB_KEYLAST, return EINVAL for an invalid cursor, otherwise 0.
*/
if (!IS_INITIALIZED(dbc) && flags != DB_KEYFIRST &&
flags != DB_KEYLAST && flags != DB_NODUPDATA)
return (__db_curinval(dbenv));
return (0);
}
/*
* __dbt_ferr --
* Check a DBT for flag errors.
*/
static int
__dbt_ferr(dbp, name, dbt, check_thread)
const DB *dbp;
const char *name;
const DBT *dbt;
int check_thread;
{
DB_ENV *dbenv;
int ret;
dbenv = dbp->dbenv;
/*
* Check for invalid DBT flags. We allow any of the flags to be
* specified to any DB or DBcursor call so that applications can
* set DB_DBT_MALLOC when retrieving a data item from a secondary
* database and then specify that same DBT as a key to a primary
* database, without having to clear flags.
*/
if ((ret = __db_fchk(dbenv, name, dbt->flags, DB_DBT_APPMALLOC |
DB_DBT_MALLOC | DB_DBT_DUPOK | DB_DBT_REALLOC | DB_DBT_USERMEM |
DB_DBT_PARTIAL)) != 0)
return (ret);
switch (F_ISSET(dbt, DB_DBT_MALLOC | DB_DBT_REALLOC | DB_DBT_USERMEM)) {
case 0:
case DB_DBT_MALLOC:
case DB_DBT_REALLOC:
case DB_DBT_USERMEM:
break;
default:
return (__db_ferr(dbenv, name, 1));
}
if (check_thread && DB_IS_THREADED(dbp) &&
!F_ISSET(dbt, DB_DBT_MALLOC | DB_DBT_REALLOC | DB_DBT_USERMEM)) {
__db_err(dbenv,
"DB_THREAD mandates memory allocation flag on DBT %s",
name);
return (EINVAL);
}
return (0);
}
/*
* __db_rdonly --
* Common readonly message.
*/
static int
__db_rdonly(dbenv, name)
const DB_ENV *dbenv;
const char *name;
{
__db_err(dbenv, "%s: attempt to modify a read-only tree", name);
return (EACCES);
}
/*
* __db_curinval
* Report that a cursor is in an invalid state.
*/
static int
__db_curinval(dbenv)
const DB_ENV *dbenv;
{
__db_err(dbenv,
"Cursor position must be set before performing this operation");
return (EINVAL);
}
/*
* __db_txn_auto_init --
* Handle DB_AUTO_COMMIT initialization.
*
* PUBLIC: int __db_txn_auto_init __P((DB_ENV *, DB_TXN **));
*/
int
__db_txn_auto_init(dbenv, txnidp)
DB_ENV *dbenv;
DB_TXN **txnidp;
{
if (*txnidp != NULL) {
__db_err(dbenv,
"DB_AUTO_COMMIT may not be specified along with a transaction handle");
return (EINVAL);
}
if (!TXN_ON(dbenv)) {
__db_err(dbenv,
"DB_AUTO_COMMIT may not be specified in non-transactional environment");
return (EINVAL);
}
/*
* We're creating a transaction for the user, and we want it to block
* if replication recovery is running. Call the user-level API.
*/
return (dbenv->txn_begin(dbenv, NULL, txnidp, 0));
}
/*
* __db_txn_auto_resolve --
* Handle DB_AUTO_COMMIT resolution.
*
* PUBLIC: int __db_txn_auto_resolve __P((DB_ENV *, DB_TXN *, int, int));
*/
int
__db_txn_auto_resolve(dbenv, txn, nosync, ret)
DB_ENV *dbenv;
DB_TXN *txn;
int nosync, ret;
{
int t_ret;
/*
* We're resolving a transaction for the user, and must decrement the
* replication handle count. Call the user-level API.
*/
if (ret == 0)
return (txn->commit(txn, nosync ? DB_TXN_NOSYNC : 0));
if ((t_ret = txn->abort(txn)) != 0)
return (__db_panic(dbenv, t_ret));
return (ret);
}