summaryrefslogtreecommitdiff
path: root/storage/tokudb/ft-index/src/tests
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2014-08-07 19:12:45 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2014-08-07 19:12:45 +0200
commitf835588cc2e32da97269cc58e97ee77b5927498a (patch)
tree8e5c53593e7e3a9db0892afefb118fd0d581e23a /storage/tokudb/ft-index/src/tests
parent0219ac1e98cc53250a8e165c4b37e83529932256 (diff)
parentb81b6d3f836feb682b963c9489f00ca1ee6a6a95 (diff)
downloadmariadb-git-f835588cc2e32da97269cc58e97ee77b5927498a.tar.gz
- Commiting merge files
Diffstat (limited to 'storage/tokudb/ft-index/src/tests')
-rw-r--r--storage/tokudb/ft-index/src/tests/CMakeLists.txt378
-rw-r--r--storage/tokudb/ft-index/src/tests/bdb-simple-deadlock-detect.cc300
-rw-r--r--storage/tokudb/ft-index/src/tests/bdb-simple-deadlock-nowait.cc177
-rw-r--r--storage/tokudb/ft-index/src/tests/bdb-simple-deadlock-on-the-fly.cc292
-rw-r--r--storage/tokudb/ft-index/src/tests/bdb.suppressions87
-rw-r--r--storage/tokudb/ft-index/src/tests/big-nested-abort-abort.cc4
-rw-r--r--storage/tokudb/ft-index/src/tests/big-nested-abort-commit.cc3
-rw-r--r--storage/tokudb/ft-index/src/tests/big-nested-commit-abort.cc3
-rw-r--r--storage/tokudb/ft-index/src/tests/big-nested-commit-commit.cc5
-rw-r--r--storage/tokudb/ft-index/src/tests/blocking-first-empty.cc8
-rw-r--r--storage/tokudb/ft-index/src/tests/blocking-first.cc8
-rw-r--r--storage/tokudb/ft-index/src/tests/blocking-last.cc8
-rw-r--r--storage/tokudb/ft-index/src/tests/blocking-next-prev-deadlock.cc14
-rw-r--r--storage/tokudb/ft-index/src/tests/blocking-next-prev.cc10
-rw-r--r--storage/tokudb/ft-index/src/tests/blocking-prelock-range.cc2
-rw-r--r--storage/tokudb/ft-index/src/tests/blocking-put-timeout.cc23
-rw-r--r--storage/tokudb/ft-index/src/tests/blocking-put-wakeup.cc2
-rw-r--r--storage/tokudb/ft-index/src/tests/blocking-put.cc2
-rw-r--r--storage/tokudb/ft-index/src/tests/blocking-set-range-0.cc8
-rw-r--r--storage/tokudb/ft-index/src/tests/blocking-set-range-n.cc8
-rw-r--r--storage/tokudb/ft-index/src/tests/blocking-set-range-reverse-0.cc6
-rw-r--r--storage/tokudb/ft-index/src/tests/blocking-set.cc8
-rw-r--r--storage/tokudb/ft-index/src/tests/blocking-table-lock.cc2
-rw-r--r--storage/tokudb/ft-index/src/tests/checkpoint1.cc2
-rw-r--r--storage/tokudb/ft-index/src/tests/checkpoint_fairness.cc2
-rw-r--r--storage/tokudb/ft-index/src/tests/checkpoint_stress.cc7
-rw-r--r--storage/tokudb/ft-index/src/tests/cilktests/Makefile40
-rw-r--r--storage/tokudb/ft-index/src/tests/cilktests/bar2.cilk22
-rw-r--r--storage/tokudb/ft-index/src/tests/cilktests/foo.cilk41
-rw-r--r--storage/tokudb/ft-index/src/tests/cilktests/foo2.cpp131
-rw-r--r--storage/tokudb/ft-index/src/tests/cilktests/get.cilk27
-rw-r--r--storage/tokudb/ft-index/src/tests/cilktests/measurecilkrun.cilk106
-rw-r--r--storage/tokudb/ft-index/src/tests/create-datadir.cc11
-rw-r--r--storage/tokudb/ft-index/src/tests/cursor-more-than-a-leaf-provdel.cc8
-rw-r--r--storage/tokudb/ft-index/src/tests/db-put-simple-deadlock-threads.cc12
-rw-r--r--storage/tokudb/ft-index/src/tests/db-put-simple-deadlock.cc15
-rw-r--r--storage/tokudb/ft-index/src/tests/db-put-simple-lockwait.cc4
-rw-r--r--storage/tokudb/ft-index/src/tests/db-put-update-deadlock.cc20
-rw-r--r--storage/tokudb/ft-index/src/tests/dump-env.cc8
-rw-r--r--storage/tokudb/ft-index/src/tests/filesize.cc4
-rw-r--r--storage/tokudb/ft-index/src/tests/hotindexer-undo-do-test.cc4
-rw-r--r--storage/tokudb/ft-index/src/tests/inflate.cc4
-rw-r--r--storage/tokudb/ft-index/src/tests/inflate2.cc4
-rw-r--r--storage/tokudb/ft-index/src/tests/loader-blobs-create-leaf.c.notyet149
-rw-r--r--storage/tokudb/ft-index/src/tests/medium-nested-commit-commit.cc3
-rw-r--r--storage/tokudb/ft-index/src/tests/recover-compare-db-descriptor.cc10
-rw-r--r--storage/tokudb/ft-index/src/tests/recover-compare-db.cc8
-rw-r--r--storage/tokudb/ft-index/src/tests/recover-fcreate-basementnodesize.cc7
-rw-r--r--storage/tokudb/ft-index/src/tests/recover-fcreate-nodesize.cc7
-rw-r--r--storage/tokudb/ft-index/src/tests/recover-missing-dbfile-2.cc6
-rw-r--r--storage/tokudb/ft-index/src/tests/recover-missing-dbfile.cc6
-rw-r--r--storage/tokudb/ft-index/src/tests/recover-upgrade-db-descriptor-multihandle.cc10
-rw-r--r--storage/tokudb/ft-index/src/tests/recover-upgrade-db-descriptor.cc10
-rw-r--r--storage/tokudb/ft-index/src/tests/recovery_stress.cc4
-rw-r--r--storage/tokudb/ft-index/src/tests/root_fifo_2.cc4
-rw-r--r--storage/tokudb/ft-index/src/tests/rowsize.cc7
-rw-r--r--storage/tokudb/ft-index/src/tests/simple.cc2
-rw-r--r--storage/tokudb/ft-index/src/tests/test-prepare.cc2
-rw-r--r--storage/tokudb/ft-index/src/tests/test-prepare2.cc2
-rw-r--r--storage/tokudb/ft-index/src/tests/test-prepare3.cc2
-rw-r--r--storage/tokudb/ft-index/src/tests/test-xa-prepare.cc2
-rw-r--r--storage/tokudb/ft-index/src/tests/test.h44
-rw-r--r--storage/tokudb/ft-index/src/tests/test1426.cc196
-rw-r--r--storage/tokudb/ft-index/src/tests/test1753.cc4
-rw-r--r--storage/tokudb/ft-index/src/tests/test1842.cc5
-rw-r--r--storage/tokudb/ft-index/src/tests/test3039.cc6
-rw-r--r--storage/tokudb/ft-index/src/tests/test3219.cc2
-rw-r--r--storage/tokudb/ft-index/src/tests/test4573-logtrim.cc2
-rw-r--r--storage/tokudb/ft-index/src/tests/test5092.cc2
-rw-r--r--storage/tokudb/ft-index/src/tests/test938.cc2
-rw-r--r--storage/tokudb/ft-index/src/tests/test938c.cc2
-rw-r--r--storage/tokudb/ft-index/src/tests/test_abort1.cc20
-rw-r--r--storage/tokudb/ft-index/src/tests/test_abort2.cc7
-rw-r--r--storage/tokudb/ft-index/src/tests/test_abort3.cc4
-rw-r--r--storage/tokudb/ft-index/src/tests/test_abort4.cc4
-rw-r--r--storage/tokudb/ft-index/src/tests/test_abort5.cc4
-rw-r--r--storage/tokudb/ft-index/src/tests/test_abort_delete_first.cc8
-rw-r--r--storage/tokudb/ft-index/src/tests/test_archive1.cc7
-rw-r--r--storage/tokudb/ft-index/src/tests/test_blobs_leaf_split.cc4
-rw-r--r--storage/tokudb/ft-index/src/tests/test_cachesize.cc9
-rw-r--r--storage/tokudb/ft-index/src/tests/test_cursor_delete2.cc4
-rw-r--r--storage/tokudb/ft-index/src/tests/test_db_dbt_mem_behavior.cc2
-rw-r--r--storage/tokudb/ft-index/src/tests/test_db_delete.cc13
-rw-r--r--storage/tokudb/ft-index/src/tests/test_db_env_open_nocreate.cc29
-rw-r--r--storage/tokudb/ft-index/src/tests/test_db_env_open_open_close.cc11
-rw-r--r--storage/tokudb/ft-index/src/tests/test_db_env_set_lg_dir.cc5
-rw-r--r--storage/tokudb/ft-index/src/tests/test_db_env_set_tmp_dir.cc5
-rw-r--r--storage/tokudb/ft-index/src/tests/test_db_env_strdup_null.cc3
-rw-r--r--storage/tokudb/ft-index/src/tests/test_db_get_put_flags.cc9
-rw-r--r--storage/tokudb/ft-index/src/tests/test_db_remove.cc4
-rw-r--r--storage/tokudb/ft-index/src/tests/test_db_txn_locks_nonheaviside.cc18
-rw-r--r--storage/tokudb/ft-index/src/tests/test_db_txn_locks_read_uncommitted.cc25
-rw-r--r--storage/tokudb/ft-index/src/tests/test_env_close_flags.cc10
-rw-r--r--storage/tokudb/ft-index/src/tests/test_env_create_db_create.cc6
-rw-r--r--storage/tokudb/ft-index/src/tests/test_env_open_flags.cc6
-rw-r--r--storage/tokudb/ft-index/src/tests/test_equal_keys_with_different_bytes.cc (renamed from storage/tokudb/ft-index/src/tests/test_txn_abort8.cc)109
-rw-r--r--storage/tokudb/ft-index/src/tests/test_groupcommit_count.cc12
-rw-r--r--storage/tokudb/ft-index/src/tests/test_locktree_close.cc2
-rw-r--r--storage/tokudb/ft-index/src/tests/test_log1.cc5
-rw-r--r--storage/tokudb/ft-index/src/tests/test_log10.cc11
-rw-r--r--storage/tokudb/ft-index/src/tests/test_log1_abort.cc8
-rw-r--r--storage/tokudb/ft-index/src/tests/test_log7.cc5
-rw-r--r--storage/tokudb/ft-index/src/tests/test_log8.cc4
-rw-r--r--storage/tokudb/ft-index/src/tests/test_log9.cc4
-rw-r--r--storage/tokudb/ft-index/src/tests/test_logflush.cc4
-rw-r--r--storage/tokudb/ft-index/src/tests/test_logmax.cc4
-rw-r--r--storage/tokudb/ft-index/src/tests/test_reverse_compare_fun.cc10
-rw-r--r--storage/tokudb/ft-index/src/tests/test_set_func_malloc.cc3
-rw-r--r--storage/tokudb/ft-index/src/tests/test_txn_abort7.cc6
-rw-r--r--storage/tokudb/ft-index/src/tests/test_txn_abort9.cc162
-rw-r--r--storage/tokudb/ft-index/src/tests/test_txn_commit8.cc156
-rw-r--r--storage/tokudb/ft-index/src/tests/test_txn_cursor_last.cc10
-rw-r--r--storage/tokudb/ft-index/src/tests/test_txn_nested1.cc73
-rw-r--r--storage/tokudb/ft-index/src/tests/test_txn_nested_abort4.cc4
-rw-r--r--storage/tokudb/ft-index/src/tests/test_weakxaction.cc6
-rw-r--r--storage/tokudb/ft-index/src/tests/time_create_db.cc (renamed from storage/tokudb/ft-index/src/tests/test_txn_close_open_commit.cc)139
-rw-r--r--storage/tokudb/ft-index/src/tests/upgrade-test-1.cc2
117 files changed, 150 insertions, 3142 deletions
diff --git a/storage/tokudb/ft-index/src/tests/CMakeLists.txt b/storage/tokudb/ft-index/src/tests/CMakeLists.txt
index d85d24be001..366d392143a 100644
--- a/storage/tokudb/ft-index/src/tests/CMakeLists.txt
+++ b/storage/tokudb/ft-index/src/tests/CMakeLists.txt
@@ -20,9 +20,6 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS)
file(GLOB transparent_upgrade_srcs RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" upgrade*.cc)
- file(GLOB tdb_dontrun_srcs RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" bdb-simple-deadlock*.cc)
- string(REGEX REPLACE "\\.cc(;|$)" "\\1" tdb_dontrun_tests "${tdb_dontrun_srcs}")
-
file(GLOB srcs RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" *.cc)
list(REMOVE_ITEM srcs ${transparent_upgrade_srcs})
@@ -36,329 +33,10 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS)
string(REGEX REPLACE "\\.cc(;|$)" ".tdb\\1" stress_tests "${stress_test_srcs}")
set(tdb_srcs ${srcs})
- list(REMOVE_ITEM tdb_srcs ${tdb_dontrun_srcs})
string(REGEX REPLACE "\\.cc(;|$)" ".tdb\\1" tdb_bins "${tdb_srcs}")
list(REMOVE_ITEM tdb_srcs ${abortrecover_srcs} ${loader_srcs})
string(REGEX REPLACE "\\.cc(;|$)" ".tdb\\1" tdb_tests "${tdb_srcs}")
- if(BDB_FOUND)
- set(bdb_dontrun_srcs
- backwards_10_each_le_and_msg
- bigtxn27
- blackhole
- blocking-prelock-range
- blocking-set-range-reverse-0
- blocking-table-lock
- bug1381
- bug627
- cachetable-race
- checkpoint_callback
- checkpoint_stress
- cursor-isolation
- cursor-set-del-rmw
- cursor-set-range-rmw
- db-put-simple-deadlock
- del-simple
- del-multiple
- del-multiple-huge-primary-row
- del-multiple-srcdb
- directory_lock
- diskfull
- dump-env
- env_loader_memory
- env-put-multiple
- env_nproc
- env_startup
- execute-updates
- filesize
- get_key_after_bytes_unit
- get_last_key
- helgrind1
- helgrind2
- helgrind3
- hotindexer-bw
- hotindexer-error-callback
- hotindexer-insert-committed-optimized
- hotindexer-insert-committed
- hotindexer-insert-provisional
- hotindexer-lock-test
- hotindexer-multiclient
- hotindexer-nested-insert-committed
- hotindexer-put-abort
- hotindexer-put-commit
- hotindexer-put-multiple
- hotindexer-simple-abort
- hotindexer-simple-abort-put
- hotindexer-undo-do-test
- hotindexer-with-queries
- hot-optimize-table-tests
- insert-dup-prelock
- isolation
- isolation-read-committed
- keyrange
- keyrange-merge
- last-verify-time
- loader-cleanup-test
- loader-create-abort
- loader-create-close
- loader-dup-test
- loader-no-puts
- loader-reference-test
- loader-stress-del
- loader-stress-test
- loader-tpch-load
- locktree_escalation_stalls
- lock-pressure
- manyfiles
- maxsize-for-loader
- multiprocess
- mvcc-create-table
- mvcc-many-committed
- mvcc-read-committed
- openlimit17
- openlimit17-locktree
- openlimit17-metafiles
- perf_checkpoint_var
- perf_child_txn
- perf_cursor_nop
- perf_iibench
- perf_insert
- perf_insert_multiple
- perf_malloc_free
- perf_nop
- perf_ptquery
- perf_ptquery2
- perf_rangequery
- perf_read_txn
- perf_read_txn_single_thread
- perf_read_write
- perf_txn_single_thread
- perf_xmalloc_free
- prelock-read-read
- prelock-read-write
- prelock-write-read
- prelock-write-write
- print_engine_status
- powerfail
- preload-db
- preload-db-nested
- progress
- put-del-multiple-array-indexing
- put-multiple
- queries_with_deletes
- recover-2483
- recover-3113
- recover-5146
- recover-child-rollback
- recover-compare-db
- recover-compare-db-descriptor
- recover-del-multiple
- recover-del-multiple-abort
- recover-del-multiple-srcdb-fdelete-all
- recover-delboth-after-checkpoint
- recover-delboth-checkpoint
- recover-descriptor
- recover-descriptor2
- recover-descriptor3
- recover-descriptor4
- recover-descriptor5
- recover-descriptor6
- recover-descriptor7
- recover-descriptor8
- recover-descriptor9
- recover-descriptor10
- recover-descriptor11
- recover-descriptor12
- recover-fclose-in-checkpoint
- recover-fcreate-basementnodesize
- recover-flt1
- recover-flt2
- recover-flt3
- recover-flt4
- recover-flt5
- recover-flt6
- recover-flt7
- recover-flt8
- recover-flt9
- recover-flt10
- recover-hotindexer-simple-abort-put
- recover-loader-test
- recover-lsn-filter-multiple
- recover-put-multiple
- recover-put-multiple-abort
- recover-put-multiple-fdelete-all
- recover-put-multiple-fdelete-some
- recover-put-multiple-srcdb-fdelete-all
- recover-split-checkpoint
- recover-tablelock
- recover-test-logsuppress
- recover-test-logsuppress-put
- recover-test_stress1
- recover-test_stress2
- recover-test_stress3
- recover-test_stress_openclose
- recover-upgrade-db-descriptor-multihandle
- recover-upgrade-db-descriptor
- recover-update-multiple
- recover-update-multiple-abort
- recover-update_aborts
- recover-update_aborts_before_checkpoint
- recover-update_aborts_before_close
- recover-update_changes_values
- recover-update_changes_values_before_checkpoint
- recover-update_changes_values_before_close
- recover-update_broadcast_aborts
- recover-update_broadcast_aborts2
- recover-update_broadcast_aborts3
- recover-update_broadcast_aborts_before_checkpoint
- recover-update_broadcast_aborts_before_close
- recover-update_broadcast_changes_values
- recover-update_broadcast_changes_values2
- recover-update_broadcast_changes_values3
- recover-update_broadcast_changes_values_before_checkpoint
- recover-update_broadcast_changes_values_before_close
- recover-update_changes_values_before_close
- recovery_fileops_stress
- recovery_fileops_unit
- recovery_stress
- redirect
- replace-into-write-lock
- root_fifo_2
- root_fifo_32
- root_fifo_41
- seqinsert
- shutdown-3344
- stat64
- stat64-create-modify-times
- stat64_flatten
- stat64-null-txn
- stat64-root-changes
- stress-gc
- stress-gc2
- test-xa-prepare
- test1324
- test1572
- test3219
- test3522
- test3522b
- test3529
- test_3645
- test_3529_insert_2
- test_3529_table_lock
- test_3755
- test_4015
- test_4368
- test_4657
- test_5015
- test_5469
- test-5138
- test938c
- test_abort1
- test_abort4
- test_abort5
- test_bad_implicit_promotion
- test_blobs_leaf_split
- test_bulk_fetch
- test_compression_methods
- test_cmp_descriptor
- test_cursor_interrupt
- test_cursor_with_read_txn
- test_db_change_pagesize
- test_db_change_xxx
- test_cursor_delete_2119
- test_db_descriptor
- test_db_descriptor_named_db
- test_db_txn_locks_read_uncommitted
- test_get_max_row_size
- test_insert_many_gc
- test_iterate_live_transactions
- test_iterate_pending_lock_requests
- test_large_update_broadcast_small_cachetable
- test_lock_timeout_callback
- test_locking_with_read_txn
- test_locktree_close
- test_logflush
- test_multiple_checkpoints_block_commit
- test_query
- test_read_txn_invalid_ops
- test_redirect_func
- test_restrict
- test_row_size_supported
- test_simple_read_txn
- test_stress0
- test_stress1
- test_stress2
- test_stress3
- test_stress4
- test_stress5
- test_stress6
- test_stress7
- test_stress_openclose
- test_stress_with_verify
- test_stress_hot_indexing
- test_transactional_descriptor
- test_trans_desc_during_chkpt
- test_trans_desc_during_chkpt2
- test_trans_desc_during_chkpt3
- test_trans_desc_during_chkpt4
- test_txn_abort6
- test_txn_abort8
- test_txn_abort9
- test_txn_close_open_commit
- test_txn_commit8
- test_txn_nested1
- test_txn_nested2
- test_txn_nested3
- test_txn_nested4
- test_txn_nested5
- test_update_abort_works
- test_update_calls_back
- test_update_can_delete_elements
- test_update_changes_values
- test_update_nonexistent_keys
- test_update_previously_deleted
- test_update_stress
- test_update_txn_snapshot_works_concurrently
- test_update_txn_snapshot_works_correctly_with_deletes
- test_update_broadcast_abort_works
- test_update_broadcast_calls_back
- test_update_broadcast_can_delete_elements
- test_update_broadcast_changes_values
- test_update_broadcast_previously_deleted
- test_update_broadcast_stress
- test_update_broadcast_update_fun_has_choices
- test_update_broadcast_with_empty_table
- test_update_broadcast_indexer
- test_update_broadcast_loader
- test_update_broadcast_nested_updates
- test_update_nested_updates
- test_update_with_empty_table
- test_updates_single_key
- txn-ignore
- transactional_fileops
- update-multiple-data-diagonal
- update-multiple-key0
- update-multiple-nochange
- update-multiple-with-indexer
- update-multiple-with-indexer-array
- update
- upgrade_simple
- upgrade-test-1
- upgrade-test-2
- upgrade-test-3
- upgrade-test-4
- upgrade-test-5
- upgrade-test-6
- upgrade-test-7
- zombie_db
- )
- set(bdb_srcs ${srcs})
- string(REGEX REPLACE "\\.cc(;|$)" "\\1" bdb_testbases "${bdb_srcs}")
- list(REMOVE_ITEM bdb_testbases ${bdb_dontrun_srcs})
- string(REGEX REPLACE "(.)(;|$)" "\\1.bdb\\2" bdb_tests "${bdb_testbases}")
- set(bdb_bins ${bdb_tests})
- endif()
-
set(tdb_tests_that_should_fail
test_db_no_env.tdb
test_log8.recover
@@ -373,8 +51,6 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS)
list(REMOVE_ITEM tdb_bins test-5138.tdb)
add_executable(test-5138.tdb test-5138.cc)
target_link_libraries(test-5138.tdb ${LIBTOKUDB}_static ${ZLIB_LIBRARY} ${LIBTOKUPORTABILITY}_static ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS})
- set_property(TARGET test-5138.tdb APPEND PROPERTY
- COMPILE_DEFINITIONS "USE_TDB;IS_TDB=1;TOKUDB=1")
add_space_separated_property(TARGET test-5138.tdb COMPILE_FLAGS -fvisibility=hidden)
add_ydb_test(test-5138.tdb)
@@ -387,25 +63,9 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS)
# We link the test with util directly so that the test code itself can use
# some of those things (i.e. kibbutz in the threaded tests).
target_link_libraries(${base}.tdb util ${LIBTOKUDB} ${LIBTOKUPORTABILITY})
- set_property(TARGET ${base}.tdb APPEND PROPERTY
- COMPILE_DEFINITIONS "USE_TDB;IS_TDB=1;TOKUDB=1")
add_space_separated_property(TARGET ${base}.tdb COMPILE_FLAGS -fvisibility=hidden)
endforeach(bin)
- if(BDB_FOUND)
- foreach(bin ${bdb_bins})
- get_filename_component(base ${bin} NAME_WE)
-
- add_executable(${base}.bdb ${base}.cc)
- set_property(TARGET ${base}.bdb APPEND PROPERTY
- COMPILE_DEFINITIONS "USE_BDB;IS_TDB=0;TOKU_ALLOW_DEPRECATED")
- set_target_properties(${base}.bdb PROPERTIES
- INCLUDE_DIRECTORIES "${BDB_INCLUDE_DIR};${CMAKE_CURRENT_BINARY_DIR}/../../toku_include;${CMAKE_CURRENT_SOURCE_DIR}/../../toku_include;${CMAKE_CURRENT_SOURCE_DIR}/../../portability;${CMAKE_CURRENT_SOURCE_DIR}/../..")
- target_link_libraries(${base}.bdb ${LIBTOKUPORTABILITY} ${BDB_LIBRARIES})
- add_space_separated_property(TARGET ${base}.bdb COMPILE_FLAGS -fvisibility=hidden)
- endforeach(bin)
- endif()
-
foreach(bin loader-cleanup-test.tdb diskfull.tdb)
set_property(TARGET ${bin} APPEND PROPERTY
COMPILE_DEFINITIONS DONT_DEPRECATE_WRITES)
@@ -418,22 +78,6 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS)
endmacro(declare_custom_tests)
declare_custom_tests(test1426.tdb)
- if(BDB_FOUND)
- macro(declare_custom_bdb_tests)
- foreach(test ${ARGN})
- list(REMOVE_ITEM bdb_tests ${test})
- endforeach(test)
- endmacro(declare_custom_bdb_tests)
-
- declare_custom_bdb_tests(test1426.bdb)
- configure_file(run_test1426.sh . COPYONLY)
- add_test(NAME ydb/test1426.tdb
- COMMAND run_test1426.sh
- $<TARGET_FILE:test1426.tdb> $<TARGET_FILE:test1426.bdb>
- "test1426.tdb.ctest-data" "test1426.bdb.ctest-data"
- $<TARGET_FILE:tokudb_dump> "${BDB_INCLUDE_DIR}/../bin/db_dump")
- add_dependencies(test1426.tdb tokudb_dump)
- endif()
string(REGEX REPLACE "\\.cc(;|$)" ".tdb\\1" recover_would_be_tdb_tests "${recover_srcs}")
declare_custom_tests(${recover_would_be_tdb_tests})
@@ -740,7 +384,7 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS)
setup_toku_test_properties(ydb/${test} ${test})
endforeach()
- foreach(test ${tdb_tests} ${bdb_tests})
+ foreach(test ${tdb_tests})
add_ydb_test(${test})
endforeach(test)
@@ -822,16 +466,6 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS)
ydb/test_txn_nested5.tdb
ydb/test_update_broadcast_stress.tdb
)
- if (BDB_FOUND)
- list(APPEND long_tests
- ydb/root_fifo_1.bdb
- ydb/root_fifo_31.bdb
- ydb/rowsize.bdb
- ydb/test_log10.bdb
- ydb/test_log7.bdb
- ydb/test_logmax.bdb
- )
- endif (BDB_FOUND)
set_tests_properties(${long_tests} PROPERTIES TIMEOUT 3600)
## some take even longer, with valgrind
set(extra_long_tests
@@ -847,11 +481,6 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS)
ydb/test3039.tdb
ydb/test_update_stress.tdb
)
- if (BDB_FOUND)
- list(APPEND extra_long_tests
- ydb/test_groupcommit_count.bdb
- )
- endif (BDB_FOUND)
set_tests_properties(${extra_long_tests} PROPERTIES TIMEOUT 7200)
## these really take a long time with valgrind
set(phenomenally_long_tests
@@ -861,10 +490,5 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS)
ydb/recover_stress.tdb
ydb/test3529.tdb
)
- if (BDB_FOUND)
- list(APPEND phenomenally_long_tests
- ydb/test1426.tdb
- )
- endif (BDB_FOUND)
set_tests_properties(${phenomenally_long_tests} PROPERTIES TIMEOUT 14400)
endif(BUILD_TESTING OR BUILD_SRC_TESTS)
diff --git a/storage/tokudb/ft-index/src/tests/bdb-simple-deadlock-detect.cc b/storage/tokudb/ft-index/src/tests/bdb-simple-deadlock-detect.cc
deleted file mode 100644
index ce0dcab38a3..00000000000
--- a/storage/tokudb/ft-index/src/tests/bdb-simple-deadlock-detect.cc
+++ /dev/null
@@ -1,300 +0,0 @@
-/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
-// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
-#ident "$Id$"
-/*
-COPYING CONDITIONS NOTICE:
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of version 2 of the GNU General Public License as
- published by the Free Software Foundation, and provided that the
- following conditions are met:
-
- * Redistributions of source code must retain this COPYING
- CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
- DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
- PATENT MARKING NOTICE (below), and the PATENT RIGHTS
- GRANT (below).
-
- * Redistributions in binary form must reproduce this COPYING
- CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
- DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
- PATENT MARKING NOTICE (below), and the PATENT RIGHTS
- GRANT (below) in the documentation and/or other materials
- provided with the distribution.
-
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-
-COPYRIGHT NOTICE:
-
- TokuDB, Tokutek Fractal Tree Indexing Library.
- Copyright (C) 2007-2013 Tokutek, Inc.
-
-DISCLAIMER:
-
- 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.
-
-UNIVERSITY PATENT NOTICE:
-
- The technology is licensed by the Massachusetts Institute of
- Technology, Rutgers State University of New Jersey, and the Research
- Foundation of State University of New York at Stony Brook under
- United States of America Serial No. 11/760379 and to the patents
- and/or patent applications resulting from it.
-
-PATENT MARKING NOTICE:
-
- This software is covered by US Patent No. 8,185,551.
- This software is covered by US Patent No. 8,489,638.
-
-PATENT RIGHTS GRANT:
-
- "THIS IMPLEMENTATION" means the copyrightable works distributed by
- Tokutek as part of the Fractal Tree project.
-
- "PATENT CLAIMS" means the claims of patents that are owned or
- licensable by Tokutek, both currently or in the future; and that in
- the absence of this license would be infringed by THIS
- IMPLEMENTATION or by using or running THIS IMPLEMENTATION.
-
- "PATENT CHALLENGE" shall mean a challenge to the validity,
- patentability, enforceability and/or non-infringement of any of the
- PATENT CLAIMS or otherwise opposing any of the PATENT CLAIMS.
-
- Tokutek hereby grants to you, for the term and geographical scope of
- the PATENT CLAIMS, a non-exclusive, no-charge, royalty-free,
- irrevocable (except as stated in this section) patent license to
- make, have made, use, offer to sell, sell, import, transfer, and
- otherwise run, modify, and propagate the contents of THIS
- IMPLEMENTATION, where such license applies only to the PATENT
- CLAIMS. This grant does not include claims that would be infringed
- only as a consequence of further modifications of THIS
- IMPLEMENTATION. If you or your agent or licensee institute or order
- or agree to the institution of patent litigation against any entity
- (including a cross-claim or counterclaim in a lawsuit) alleging that
- THIS IMPLEMENTATION constitutes direct or contributory patent
- infringement, or inducement of patent infringement, then any rights
- granted to you under this License shall terminate as of the date
- such litigation is filed. If you or your agent or exclusive
- licensee institute or order or agree to the institution of a PATENT
- CHALLENGE, then Tokutek may terminate any rights granted to you
- under this License.
-*/
-
-#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
-#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
-// verify that the BDB locker can detect deadlocks on the fly and allow
-// the deadlock to be unwound by the deadlocked threads. the main thread
-// polls for deadlocks with the lock_detect function.
-//
-// A write locks L
-// B write locks M
-// A tries to write lock M && B tries to write lock L
-// One of A or B gets the DEADLOCK error, the other waits
-// A and B release their locks
-
-#include "test.h"
-#include "toku_pthread.h"
-#include <portability/toku_atomic.h>
-
-struct test_seq {
- int state;
- toku_mutex_t lock;
- toku_cond_t cv;
-};
-
-static void test_seq_init(struct test_seq *seq) {
- seq->state = 0;
- toku_mutex_init(&seq->lock, NULL);
- toku_cond_init(&seq->cv, NULL);
-}
-
-static void test_seq_destroy(struct test_seq *seq) {
- toku_mutex_destroy(&seq->lock);
- toku_cond_destroy(&seq->cv);
-}
-
-static void test_seq_sleep(struct test_seq *seq, int new_state) {
- toku_mutex_lock(&seq->lock);
- while (seq->state != new_state) {
- toku_cond_wait(&seq->cv, &seq->lock);
- }
- toku_mutex_unlock(&seq->lock);
-}
-
-static void test_seq_next_state(struct test_seq *seq) {
- toku_mutex_lock(&seq->lock);
- seq->state++;
- toku_cond_broadcast(&seq->cv);
- toku_mutex_unlock(&seq->lock);
-}
-
-struct locker_args {
- DB_ENV *db_env;
- struct test_seq *test_seq;
- int *deadlock_count;
-};
-
-static void *run_locker_a(void *arg) {
- struct locker_args *locker_args = (struct locker_args *) arg;
- DB_ENV *db_env = locker_args->db_env;
- struct test_seq *test_seq = locker_args->test_seq;
- int r;
-
- uint32_t locker_a;
- r = db_env->lock_id(db_env, &locker_a); assert(r == 0);
-
- DBT object_l = { .data = (char *) "L", .size = 1 };
- DBT object_m = { .data = (char *) "M", .size = 1 };
-
- test_seq_sleep(test_seq, 0);
- DB_LOCK lock_a_l;
- r = db_env->lock_get(db_env, locker_a, DB_LOCK_NOWAIT, &object_l, DB_LOCK_WRITE, &lock_a_l); assert(r == 0);
- test_seq_next_state(test_seq);
-
- test_seq_sleep(test_seq, 2);
- DB_LOCK lock_a_m;
- bool m_locked = false;
- r = db_env->lock_get(db_env, locker_a, 0, &object_m, DB_LOCK_WRITE, &lock_a_m);
- assert(r == 0 || r == DB_LOCK_DEADLOCK);
- if (r == 0)
- m_locked = true;
-
- r = db_env->lock_put(db_env, &lock_a_l); assert(r == 0);
-
- if (m_locked) {
- r = db_env->lock_put(db_env, &lock_a_m); assert(r == 0);
- } else {
- (void) toku_sync_fetch_and_add(locker_args->deadlock_count, 1);
- if (verbose) printf("%s:%u m deadlock\n", __FUNCTION__, __LINE__);
- }
-
- r = db_env->lock_id_free(db_env, locker_a); assert(r == 0);
-
- return arg;
-}
-
-static void *run_locker_b(void *arg) {
- struct locker_args *locker_args = (struct locker_args *) arg;
- DB_ENV *db_env = locker_args->db_env;
- struct test_seq *test_seq = locker_args->test_seq;
- int r;
-
- uint32_t locker_b;
- r = db_env->lock_id(db_env, &locker_b); assert(r == 0);
-
- DBT object_l = { .data = (char *) "L", .size = 1 };
- DBT object_m = { .data = (char *) "M", .size = 1 };
-
- test_seq_sleep(test_seq, 1);
- DB_LOCK lock_b_m;
- r = db_env->lock_get(db_env, locker_b, DB_LOCK_NOWAIT, &object_m, DB_LOCK_WRITE, &lock_b_m); assert(r == 0);
- test_seq_next_state(test_seq);
-
- test_seq_sleep(test_seq, 2);
- DB_LOCK lock_b_l;
- bool l_locked = false;
- r = db_env->lock_get(db_env, locker_b, 0, &object_l, DB_LOCK_WRITE, &lock_b_l);
- assert(r == 0 || r == DB_LOCK_DEADLOCK);
- if (r == 0)
- l_locked = true;
-
- r = db_env->lock_put(db_env, &lock_b_m); assert(r == 0);
-
- if (l_locked) {
- r = db_env->lock_put(db_env, &lock_b_l); assert(r == 0);
- } else {
- (void) toku_sync_fetch_and_add(locker_args->deadlock_count, 1);
- if (verbose) printf("%s:%u l deadlock\n", __FUNCTION__, __LINE__);
- }
-
- r = db_env->lock_id_free(db_env, locker_b); assert(r == 0);
-
- return arg;
-}
-
-static void simple_deadlock(DB_ENV *db_env) {
- int r;
-
- struct test_seq test_seq; ZERO_STRUCT(test_seq); test_seq_init(&test_seq);
-
- int deadlock_count = 0 ;
-
- toku_pthread_t tid_a;
- struct locker_args args_a = { db_env, &test_seq, &deadlock_count };
- r = toku_pthread_create(&tid_a, NULL, run_locker_a, &args_a); assert(r == 0);
-
- toku_pthread_t tid_b;
- struct locker_args args_b = { db_env, &test_seq, &deadlock_count };
- r = toku_pthread_create(&tid_b, NULL, run_locker_b, &args_b); assert(r == 0);
-
- while (1) {
- sleep(10);
- int rejected = 0;
- r = db_env->lock_detect(db_env, 0, DB_LOCK_YOUNGEST, &rejected); assert(r == 0);
- if (verbose)
- printf("%s %d\n", __FUNCTION__, rejected);
- if (rejected == 0)
- break;
- }
-
- void *ret = NULL;
- r = toku_pthread_join(tid_a, &ret); assert(r == 0);
- r = toku_pthread_join(tid_b, &ret); assert(r == 0);
-
- assert(deadlock_count == 1);
-
- test_seq_destroy(&test_seq);
-}
-
-int test_main(int argc, char * const argv[]) {
- uint64_t cachesize = 0;
- int do_txn = 1;
- const char *db_env_dir = TOKU_TEST_FILENAME;
- int db_env_open_flags = DB_CREATE | DB_PRIVATE | DB_INIT_MPOOL | DB_INIT_TXN | DB_INIT_LOCK | DB_INIT_LOG | DB_THREAD;
-
- // parse_args(argc, argv);
- for (int i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "--verbose") == 0) {
- verbose++;
- continue;
- }
- if (strcmp(argv[i], "-q") == 0 || strcmp(argv[i], "--quiet") == 0) {
- if (verbose > 0)
- verbose--;
- continue;
- }
- assert(0);
- }
-
- // setup env
- int r;
- char rm_cmd[strlen(db_env_dir) + strlen("rm -rf ") + 1];
- snprintf(rm_cmd, sizeof(rm_cmd), "rm -rf %s", db_env_dir);
- r = system(rm_cmd); assert(r == 0);
-
- r = toku_os_mkdir(db_env_dir, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); assert(r == 0);
-
- DB_ENV *db_env = NULL;
- r = db_env_create(&db_env, 0); assert(r == 0);
- if (cachesize) {
- const uint64_t gig = 1 << 30;
- r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
- }
- if (!do_txn)
- db_env_open_flags &= ~(DB_INIT_TXN | DB_INIT_LOG);
- r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
-
- // run test
- simple_deadlock(db_env);
-
- // close env
- r = db_env->close(db_env, 0); assert(r == 0); db_env = NULL;
-
- return 0;
-}
diff --git a/storage/tokudb/ft-index/src/tests/bdb-simple-deadlock-nowait.cc b/storage/tokudb/ft-index/src/tests/bdb-simple-deadlock-nowait.cc
deleted file mode 100644
index 036fb8d0115..00000000000
--- a/storage/tokudb/ft-index/src/tests/bdb-simple-deadlock-nowait.cc
+++ /dev/null
@@ -1,177 +0,0 @@
-/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
-// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
-#ident "$Id$"
-/*
-COPYING CONDITIONS NOTICE:
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of version 2 of the GNU General Public License as
- published by the Free Software Foundation, and provided that the
- following conditions are met:
-
- * Redistributions of source code must retain this COPYING
- CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
- DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
- PATENT MARKING NOTICE (below), and the PATENT RIGHTS
- GRANT (below).
-
- * Redistributions in binary form must reproduce this COPYING
- CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
- DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
- PATENT MARKING NOTICE (below), and the PATENT RIGHTS
- GRANT (below) in the documentation and/or other materials
- provided with the distribution.
-
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-
-COPYRIGHT NOTICE:
-
- TokuDB, Tokutek Fractal Tree Indexing Library.
- Copyright (C) 2007-2013 Tokutek, Inc.
-
-DISCLAIMER:
-
- 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.
-
-UNIVERSITY PATENT NOTICE:
-
- The technology is licensed by the Massachusetts Institute of
- Technology, Rutgers State University of New Jersey, and the Research
- Foundation of State University of New York at Stony Brook under
- United States of America Serial No. 11/760379 and to the patents
- and/or patent applications resulting from it.
-
-PATENT MARKING NOTICE:
-
- This software is covered by US Patent No. 8,185,551.
- This software is covered by US Patent No. 8,489,638.
-
-PATENT RIGHTS GRANT:
-
- "THIS IMPLEMENTATION" means the copyrightable works distributed by
- Tokutek as part of the Fractal Tree project.
-
- "PATENT CLAIMS" means the claims of patents that are owned or
- licensable by Tokutek, both currently or in the future; and that in
- the absence of this license would be infringed by THIS
- IMPLEMENTATION or by using or running THIS IMPLEMENTATION.
-
- "PATENT CHALLENGE" shall mean a challenge to the validity,
- patentability, enforceability and/or non-infringement of any of the
- PATENT CLAIMS or otherwise opposing any of the PATENT CLAIMS.
-
- Tokutek hereby grants to you, for the term and geographical scope of
- the PATENT CLAIMS, a non-exclusive, no-charge, royalty-free,
- irrevocable (except as stated in this section) patent license to
- make, have made, use, offer to sell, sell, import, transfer, and
- otherwise run, modify, and propagate the contents of THIS
- IMPLEMENTATION, where such license applies only to the PATENT
- CLAIMS. This grant does not include claims that would be infringed
- only as a consequence of further modifications of THIS
- IMPLEMENTATION. If you or your agent or licensee institute or order
- or agree to the institution of patent litigation against any entity
- (including a cross-claim or counterclaim in a lawsuit) alleging that
- THIS IMPLEMENTATION constitutes direct or contributory patent
- infringement, or inducement of patent infringement, then any rights
- granted to you under this License shall terminate as of the date
- such litigation is filed. If you or your agent or exclusive
- licensee institute or order or agree to the institution of a PATENT
- CHALLENGE, then Tokutek may terminate any rights granted to you
- under this License.
-*/
-
-#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
-#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
-// verify that a simle write lock deadlock is detected by the BDB locker
-// A write locks L
-// B write locks M
-// A tries to write lock M, gets DB_LOCK_NOTGRANTED
-// B tries to write lock L, gets DB_LOCK_NOTGRANTED
-
-#include "test.h"
-
-static void simple_deadlock(DB_ENV *db_env) {
- int r;
-
- uint32_t locker_a;
- r = db_env->lock_id(db_env, &locker_a); assert(r == 0);
- uint32_t locker_b;
- r = db_env->lock_id(db_env, &locker_b); assert(r == 0);
-
- DBT object_l = { .data = (char *) "L", .size = 1 };
- DBT object_m = { .data = (char *) "M", .size = 1 };
-
- DB_LOCK lock_a_l;
- r = db_env->lock_get(db_env, locker_a, DB_LOCK_NOWAIT, &object_l, DB_LOCK_WRITE, &lock_a_l); assert(r == 0);
-
- DB_LOCK lock_b_m;
- r = db_env->lock_get(db_env, locker_b, DB_LOCK_NOWAIT, &object_m, DB_LOCK_WRITE, &lock_b_m); assert(r == 0);
-
- DB_LOCK lock_a_m;
- r = db_env->lock_get(db_env, locker_a, DB_LOCK_NOWAIT, &object_m, DB_LOCK_WRITE, &lock_a_m); assert(r == DB_LOCK_NOTGRANTED);
-
- DB_LOCK lock_b_l;
- r = db_env->lock_get(db_env, locker_b, DB_LOCK_NOWAIT, &object_l, DB_LOCK_WRITE, &lock_b_l); assert(r == DB_LOCK_NOTGRANTED);
-
- r = db_env->lock_put(db_env, &lock_a_l); assert(r == 0);
- r = db_env->lock_put(db_env, &lock_b_m); assert(r == 0);
-
- r = db_env->lock_id_free(db_env, locker_a); assert(r == 0);
- r = db_env->lock_id_free(db_env, locker_b); assert(r == 0);
-}
-
-int test_main(int argc, char * const argv[]) {
- uint64_t cachesize = 0;
- int do_txn = 1;
- const char *db_env_dir = TOKU_TEST_FILENAME;
- int db_env_open_flags = DB_CREATE | DB_PRIVATE | DB_INIT_MPOOL | DB_INIT_TXN | DB_INIT_LOCK | DB_INIT_LOG | DB_THREAD;
-
- // parse_args(argc, argv);
- for (int i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "--verbose") == 0) {
- verbose++;
- continue;
- }
- if (strcmp(argv[i], "-q") == 0 || strcmp(argv[i], "--quiet") == 0) {
- if (verbose > 0)
- verbose--;
- continue;
- }
- assert(0);
- }
-
- // setup env
- int r;
- char rm_cmd[strlen(db_env_dir) + strlen("rm -rf ") + 1];
- snprintf(rm_cmd, sizeof(rm_cmd), "rm -rf %s", db_env_dir);
- r = system(rm_cmd); assert(r == 0);
-
- r = toku_os_mkdir(db_env_dir, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); assert(r == 0);
-
- DB_ENV *db_env = NULL;
- r = db_env_create(&db_env, 0); assert(r == 0);
- if (cachesize) {
- const uint64_t gig = 1 << 30;
- r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
- }
- if (!do_txn)
- db_env_open_flags &= ~(DB_INIT_TXN | DB_INIT_LOG);
- r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
-#if 0 && defined(USE_BDB)
- r = db_env->set_lk_detect(db_env, DB_LOCK_YOUNGEST); assert(r == 0);
-#endif
-
- // run test
- simple_deadlock(db_env);
-
- // close env
- r = db_env->close(db_env, 0); assert(r == 0); db_env = NULL;
-
- return 0;
-}
diff --git a/storage/tokudb/ft-index/src/tests/bdb-simple-deadlock-on-the-fly.cc b/storage/tokudb/ft-index/src/tests/bdb-simple-deadlock-on-the-fly.cc
deleted file mode 100644
index 12386e173c3..00000000000
--- a/storage/tokudb/ft-index/src/tests/bdb-simple-deadlock-on-the-fly.cc
+++ /dev/null
@@ -1,292 +0,0 @@
-/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
-// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
-#ident "$Id$"
-/*
-COPYING CONDITIONS NOTICE:
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of version 2 of the GNU General Public License as
- published by the Free Software Foundation, and provided that the
- following conditions are met:
-
- * Redistributions of source code must retain this COPYING
- CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
- DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
- PATENT MARKING NOTICE (below), and the PATENT RIGHTS
- GRANT (below).
-
- * Redistributions in binary form must reproduce this COPYING
- CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
- DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
- PATENT MARKING NOTICE (below), and the PATENT RIGHTS
- GRANT (below) in the documentation and/or other materials
- provided with the distribution.
-
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-
-COPYRIGHT NOTICE:
-
- TokuDB, Tokutek Fractal Tree Indexing Library.
- Copyright (C) 2007-2013 Tokutek, Inc.
-
-DISCLAIMER:
-
- 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.
-
-UNIVERSITY PATENT NOTICE:
-
- The technology is licensed by the Massachusetts Institute of
- Technology, Rutgers State University of New Jersey, and the Research
- Foundation of State University of New York at Stony Brook under
- United States of America Serial No. 11/760379 and to the patents
- and/or patent applications resulting from it.
-
-PATENT MARKING NOTICE:
-
- This software is covered by US Patent No. 8,185,551.
- This software is covered by US Patent No. 8,489,638.
-
-PATENT RIGHTS GRANT:
-
- "THIS IMPLEMENTATION" means the copyrightable works distributed by
- Tokutek as part of the Fractal Tree project.
-
- "PATENT CLAIMS" means the claims of patents that are owned or
- licensable by Tokutek, both currently or in the future; and that in
- the absence of this license would be infringed by THIS
- IMPLEMENTATION or by using or running THIS IMPLEMENTATION.
-
- "PATENT CHALLENGE" shall mean a challenge to the validity,
- patentability, enforceability and/or non-infringement of any of the
- PATENT CLAIMS or otherwise opposing any of the PATENT CLAIMS.
-
- Tokutek hereby grants to you, for the term and geographical scope of
- the PATENT CLAIMS, a non-exclusive, no-charge, royalty-free,
- irrevocable (except as stated in this section) patent license to
- make, have made, use, offer to sell, sell, import, transfer, and
- otherwise run, modify, and propagate the contents of THIS
- IMPLEMENTATION, where such license applies only to the PATENT
- CLAIMS. This grant does not include claims that would be infringed
- only as a consequence of further modifications of THIS
- IMPLEMENTATION. If you or your agent or licensee institute or order
- or agree to the institution of patent litigation against any entity
- (including a cross-claim or counterclaim in a lawsuit) alleging that
- THIS IMPLEMENTATION constitutes direct or contributory patent
- infringement, or inducement of patent infringement, then any rights
- granted to you under this License shall terminate as of the date
- such litigation is filed. If you or your agent or exclusive
- licensee institute or order or agree to the institution of a PATENT
- CHALLENGE, then Tokutek may terminate any rights granted to you
- under this License.
-*/
-
-#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
-#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
-// verify that the BDB locker can detect deadlocks on the fly and allow
-// the deadlock to be unwound by the deadlocked threads. we use the
-// set_lk_detect function to force the locker to check for deadlocks.
-//
-// A write locks L
-// B write locks M
-// A tries to write lock M && B tries to write lock L
-// One of A or B should get the DEADLOCK error, the other waits
-// A and B release their locks
-
-#include "test.h"
-#include "toku_pthread.h"
-#include <portability/toku_atomic.h>
-
-struct test_seq {
- int state;
- toku_mutex_t lock;
- toku_cond_t cv;
-};
-
-static void test_seq_init(struct test_seq *seq) {
- seq->state = 0;
- toku_mutex_init(&seq->lock, NULL);
- toku_cond_init(&seq->cv, NULL);
-}
-
-static void test_seq_destroy(struct test_seq *seq) {
- toku_mutex_destroy(&seq->lock);
- toku_cond_destroy(&seq->cv);
-}
-
-static void test_seq_sleep(struct test_seq *seq, int new_state) {
- toku_mutex_lock(&seq->lock);
- while (seq->state != new_state) {
- toku_cond_wait(&seq->cv, &seq->lock);
- }
- toku_mutex_unlock(&seq->lock);
-}
-
-static void test_seq_next_state(struct test_seq *seq) {
- toku_mutex_lock(&seq->lock);
- seq->state++;
- toku_cond_broadcast(&seq->cv);
- toku_mutex_unlock(&seq->lock);
-}
-
-struct locker_args {
- DB_ENV *db_env;
- struct test_seq *test_seq;
- int *deadlock_count;
-};
-
-static void *run_locker_a(void *arg) {
- struct locker_args *locker_args = (struct locker_args *) arg;
- DB_ENV *db_env = locker_args->db_env;
- struct test_seq *test_seq = locker_args->test_seq;
- int r;
-
- uint32_t locker_a;
- r = db_env->lock_id(db_env, &locker_a); assert(r == 0);
-
- DBT object_l = { .data = (char *) "L", .size = 1 };
- DBT object_m = { .data = (char *) "M", .size = 1 };
-
- test_seq_sleep(test_seq, 0);
- DB_LOCK lock_a_l;
- r = db_env->lock_get(db_env, locker_a, DB_LOCK_NOWAIT, &object_l, DB_LOCK_WRITE, &lock_a_l); assert(r == 0);
- test_seq_next_state(test_seq);
-
- test_seq_sleep(test_seq, 2);
- DB_LOCK lock_a_m;
- bool m_locked = false;
- r = db_env->lock_get(db_env, locker_a, 0, &object_m, DB_LOCK_WRITE, &lock_a_m);
- assert(r == 0 || r == DB_LOCK_DEADLOCK);
- if (r == 0)
- m_locked = true;
-
- r = db_env->lock_put(db_env, &lock_a_l); assert(r == 0);
-
- if (m_locked) {
- r = db_env->lock_put(db_env, &lock_a_m); assert(r == 0);
- } else {
- (void) toku_sync_fetch_and_add(locker_args->deadlock_count, 1);
- if (verbose) printf("%s:%u m deadlock\n", __FUNCTION__, __LINE__);
- }
-
- r = db_env->lock_id_free(db_env, locker_a); assert(r == 0);
-
- return arg;
-}
-
-static void *run_locker_b(void *arg) {
- struct locker_args *locker_args = (struct locker_args *) arg;
- DB_ENV *db_env = locker_args->db_env;
- struct test_seq *test_seq = locker_args->test_seq;
- int r;
-
- uint32_t locker_b;
- r = db_env->lock_id(db_env, &locker_b); assert(r == 0);
-
- DBT object_l = { .data = (char *) "L", .size = 1 };
- DBT object_m = { .data = (char *) "M", .size = 1 };
-
- test_seq_sleep(test_seq, 1);
- DB_LOCK lock_b_m;
- r = db_env->lock_get(db_env, locker_b, DB_LOCK_NOWAIT, &object_m, DB_LOCK_WRITE, &lock_b_m); assert(r == 0);
- test_seq_next_state(test_seq);
-
- test_seq_sleep(test_seq, 2);
- DB_LOCK lock_b_l;
- bool l_locked = false;
- r = db_env->lock_get(db_env, locker_b, 0, &object_l, DB_LOCK_WRITE, &lock_b_l);
- assert(r == 0 || r == DB_LOCK_DEADLOCK);
- if (r == 0)
- l_locked = true;
-
- r = db_env->lock_put(db_env, &lock_b_m); assert(r == 0);
-
- if (l_locked) {
- r = db_env->lock_put(db_env, &lock_b_l); assert(r == 0);
- } else {
- (void) toku_sync_fetch_and_add(locker_args->deadlock_count, 1);
- if (verbose) printf("%s:%u l deadlock\n", __FUNCTION__, __LINE__);
- }
-
- r = db_env->lock_id_free(db_env, locker_b); assert(r == 0);
-
- return arg;
-}
-
-static void simple_deadlock(DB_ENV *db_env) {
- int r;
- int deadlock_count = 0;
-
- struct test_seq test_seq; ZERO_STRUCT(test_seq); test_seq_init(&test_seq);
-
- toku_pthread_t tid_a;
- struct locker_args args_a = { db_env, &test_seq, &deadlock_count };
- r = toku_pthread_create(&tid_a, NULL, run_locker_a, &args_a); assert(r == 0);
-
- toku_pthread_t tid_b;
- struct locker_args args_b = { db_env, &test_seq, &deadlock_count };
- r = toku_pthread_create(&tid_b, NULL, run_locker_b, &args_b); assert(r == 0);
-
- void *ret = NULL;
- r = toku_pthread_join(tid_a, &ret); assert(r == 0);
- r = toku_pthread_join(tid_b, &ret); assert(r == 0);
-
- assert(deadlock_count == 1);
-
- test_seq_destroy(&test_seq);
-}
-
-int test_main(int argc, char * const argv[]) {
- uint64_t cachesize = 0;
- int do_txn = 1;
- const char *db_env_dir = TOKU_TEST_FILENAME;
- int db_env_open_flags = DB_CREATE | DB_PRIVATE | DB_INIT_MPOOL | DB_INIT_TXN | DB_INIT_LOCK | DB_INIT_LOG | DB_THREAD;
-
- // parse_args(argc, argv);
- for (int i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "--verbose") == 0) {
- verbose++;
- continue;
- }
- if (strcmp(argv[i], "-q") == 0 || strcmp(argv[i], "--quiet") == 0) {
- if (verbose > 0)
- verbose--;
- continue;
- }
- assert(0);
- }
-
- // setup env
- int r;
- char rm_cmd[strlen(db_env_dir) + strlen("rm -rf ") + 1];
- snprintf(rm_cmd, sizeof(rm_cmd), "rm -rf %s", db_env_dir);
- r = system(rm_cmd); assert(r == 0);
-
- r = toku_os_mkdir(db_env_dir, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); assert(r == 0);
-
- DB_ENV *db_env = NULL;
- r = db_env_create(&db_env, 0); assert(r == 0);
- if (cachesize) {
- const uint64_t gig = 1 << 30;
- r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
- }
- if (!do_txn)
- db_env_open_flags &= ~(DB_INIT_TXN | DB_INIT_LOG);
- r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
-#if defined(USE_BDB)
- r = db_env->set_lk_detect(db_env, DB_LOCK_YOUNGEST); assert(r == 0);
-#endif
-
- // run test
- simple_deadlock(db_env);
-
- // close env
- r = db_env->close(db_env, 0); assert(r == 0); db_env = NULL;
-
- return 0;
-}
diff --git a/storage/tokudb/ft-index/src/tests/bdb.suppressions b/storage/tokudb/ft-index/src/tests/bdb.suppressions
deleted file mode 100644
index 5e06d9a84e7..00000000000
--- a/storage/tokudb/ft-index/src/tests/bdb.suppressions
+++ /dev/null
@@ -1,87 +0,0 @@
-{
- bdb_writes_undefined_data_to_disk
- Memcheck:Param
- pwrite64(buf)
- fun:pwrite64
- fun:__os_io
- obj:/lib/libdb-4.3.so
- fun:__memp_bhwrite
- fun:__memp_sync_int
- fun:__memp_fsync
- fun:__db_sync
- fun:__db_refresh
- fun:__db_close
- fun:__fop_subdb_setup
- fun:__db_open
- fun:__db_open_pp
-}
-
-{
- bdb_leaks_db_home_strdup
- Memcheck:Leak
- fun:_vgrZU_libcZdsoZa_malloc
- fun:__os_malloc
- fun:__os_strdup
- fun:__db_open_pp
- fun:main
-}
-
-{
- bdb_leaks_in_db_create
- Memcheck:Leak
- fun:_vgrZU_libcZdsoZa_malloc
- fun:__os_malloc
- fun:__os_calloc
- fun:__bam_db_create
- fun:db_create
- fun:main
-}
-
-{
- bdb_leaks_if_you_open_twice
- Memcheck:Leak
- fun:_vgrZU_libcZdsoZa_malloc
- fun:__os_malloc
- fun:__os_strdup
- fun:__db_open_pp
-}
-
-{
- bdb_leaks_again
- Memcheck:Leak
- fun:_vgrZU_libcZdsoZa_malloc
- fun:__os_malloc
- fun:__os_strdup
- fun:__db_home
- obj:/lib/libdb-4.3.so
- fun:__dbenv_open
-}
-
-{
- <bdb_leaks>
- Memcheck:Leak
- fun:_vgrZU_libcZdsoZa_malloc
- fun:__os_malloc
- fun:__os_calloc
- fun:__bam_db_create
- fun:db_create
-}
-
-{
- <bdb_leaks>
- Memcheck:Leak
- fun:_vgrZU_libcZdsoZa_malloc
- fun:__os_malloc
- fun:__os_calloc
- fun:__bam_db_create
- fun:db_create
-}
-
-{
- <bdb_leaks>
- Memcheck:Leak
- fun:_vgrZU_libcZdsoZa_malloc
- fun:__os_malloc
- fun:__os_calloc
- fun:db_create
-}
diff --git a/storage/tokudb/ft-index/src/tests/big-nested-abort-abort.cc b/storage/tokudb/ft-index/src/tests/big-nested-abort-abort.cc
index 0707773d6b5..882c3441a8f 100644
--- a/storage/tokudb/ft-index/src/tests/big-nested-abort-abort.cc
+++ b/storage/tokudb/ft-index/src/tests/big-nested-abort-abort.cc
@@ -175,11 +175,7 @@ setup (void) {
r=db_env_create(&env, 0); CKERR(r);
-#ifndef TOKUDB
- r=env->set_lk_max_objects(env, N); CKERR(r);
-#else
r=env->set_redzone(env, 0); CKERR(r);
-#endif
env->set_errfile(env, stderr);
r=env->open(env, TOKU_TEST_FILENAME, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r);
diff --git a/storage/tokudb/ft-index/src/tests/big-nested-abort-commit.cc b/storage/tokudb/ft-index/src/tests/big-nested-abort-commit.cc
index 711f235275e..98dde05cfde 100644
--- a/storage/tokudb/ft-index/src/tests/big-nested-abort-commit.cc
+++ b/storage/tokudb/ft-index/src/tests/big-nested-abort-commit.cc
@@ -174,9 +174,6 @@ setup (void) {
r=db_env_create(&env, 0); CKERR(r);
-#ifndef TOKUDB
- r=env->set_lk_max_objects(env, N); CKERR(r);
-#endif
env->set_errfile(env, stderr);
r=env->open(env, TOKU_TEST_FILENAME, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r);
diff --git a/storage/tokudb/ft-index/src/tests/big-nested-commit-abort.cc b/storage/tokudb/ft-index/src/tests/big-nested-commit-abort.cc
index 0469867396d..ec8707530fa 100644
--- a/storage/tokudb/ft-index/src/tests/big-nested-commit-abort.cc
+++ b/storage/tokudb/ft-index/src/tests/big-nested-commit-abort.cc
@@ -169,9 +169,6 @@ setup (void) {
r=db_env_create(&env, 0); CKERR(r);
-#ifndef TOKUDB
- r=env->set_lk_max_objects(env, N); CKERR(r);
-#endif
env->set_errfile(env, stderr);
r=env->open(env, TOKU_TEST_FILENAME, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r);
diff --git a/storage/tokudb/ft-index/src/tests/big-nested-commit-commit.cc b/storage/tokudb/ft-index/src/tests/big-nested-commit-commit.cc
index ad25b5e90e8..189bc97769f 100644
--- a/storage/tokudb/ft-index/src/tests/big-nested-commit-commit.cc
+++ b/storage/tokudb/ft-index/src/tests/big-nested-commit-commit.cc
@@ -168,13 +168,8 @@ setup (void) {
r=toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_env_create(&env, 0); CKERR(r);
-#ifdef TOKUDB
r=env->set_redzone(env, 0); CKERR(r);
-#endif
-#ifndef TOKUDB
- r=env->set_lk_max_objects(env, N); CKERR(r);
-#endif
env->set_errfile(env, stderr);
r=env->open(env, TOKU_TEST_FILENAME, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r);
diff --git a/storage/tokudb/ft-index/src/tests/blocking-first-empty.cc b/storage/tokudb/ft-index/src/tests/blocking-first-empty.cc
index 72267437a4a..6ccf879005d 100644
--- a/storage/tokudb/ft-index/src/tests/blocking-first-empty.cc
+++ b/storage/tokudb/ft-index/src/tests/blocking-first-empty.cc
@@ -98,7 +98,6 @@ struct my_callback_context {
DBT val;
};
-#if TOKUDB
static int blocking_first_callback(DBT const *a UU(), DBT const *b UU(), void *e UU()) {
DBT const *found_key = a;
DBT const *found_val = b;
@@ -107,7 +106,6 @@ static int blocking_first_callback(DBT const *a UU(), DBT const *b UU(), void *e
copy_dbt(&context->val, found_val);
return 0;
}
-#endif
static void blocking_first(DB_ENV *db_env, DB *db, uint64_t nrows, long sleeptime) {
int r;
@@ -122,11 +120,7 @@ static void blocking_first(DB_ENV *db_env, DB *db, uint64_t nrows, long sleeptim
DBC *cursor = NULL;
r = db->cursor(db, txn, &cursor, 0); assert(r == 0); // get a write lock on -inf +inf
-#if TOKUDB
r = cursor->c_getf_first(cursor, DB_RMW, blocking_first_callback, &context); assert(r == DB_NOTFOUND);
-#else
- r = cursor->c_get(cursor, &context.key, &context.val, DB_FIRST + DB_RMW); assert(r == DB_NOTFOUND);
-#endif
usleep(sleeptime);
@@ -219,9 +213,7 @@ int test_main(int argc, char * const argv[]) {
r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
}
r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
-#if TOKUDB
r = db_env->set_lock_timeout(db_env, 30 * 1000, nullptr); assert(r == 0);
-#endif
// create the db
DB *db = NULL;
diff --git a/storage/tokudb/ft-index/src/tests/blocking-first.cc b/storage/tokudb/ft-index/src/tests/blocking-first.cc
index 1bd414a90aa..6d255023274 100644
--- a/storage/tokudb/ft-index/src/tests/blocking-first.cc
+++ b/storage/tokudb/ft-index/src/tests/blocking-first.cc
@@ -116,7 +116,6 @@ struct my_callback_context {
DBT val;
};
-#if TOKUDB
static int blocking_first_callback(DBT const *a UU(), DBT const *b UU(), void *e UU()) {
DBT const *found_key = a;
DBT const *found_val = b;
@@ -125,7 +124,6 @@ static int blocking_first_callback(DBT const *a UU(), DBT const *b UU(), void *e
copy_dbt(&context->val, found_val);
return 0;
}
-#endif
static void blocking_first(DB_ENV *db_env, DB *db, uint64_t nrows, long sleeptime) {
int r;
@@ -140,11 +138,7 @@ static void blocking_first(DB_ENV *db_env, DB *db, uint64_t nrows, long sleeptim
DBC *cursor = NULL;
r = db->cursor(db, txn, &cursor, 0); assert(r == 0); // get a write lock on -inf ... 0
-#if TOKUDB
r = cursor->c_getf_first(cursor, DB_RMW, blocking_first_callback, &context); assert(r == 0);
-#else
- r = cursor->c_get(cursor, &context.key, &context.val, DB_FIRST + DB_RMW); assert(r == 0);
-#endif
usleep(sleeptime);
r = cursor->c_close(cursor); assert(r == 0);
@@ -236,9 +230,7 @@ int test_main(int argc, char * const argv[]) {
r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
}
r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
-#if TOKUDB
r = db_env->set_lock_timeout(db_env, 30 * 1000, nullptr); assert(r == 0);
-#endif
// create the db
DB *db = NULL;
diff --git a/storage/tokudb/ft-index/src/tests/blocking-last.cc b/storage/tokudb/ft-index/src/tests/blocking-last.cc
index 5ca6ce5ec6a..403f31bca61 100644
--- a/storage/tokudb/ft-index/src/tests/blocking-last.cc
+++ b/storage/tokudb/ft-index/src/tests/blocking-last.cc
@@ -116,7 +116,6 @@ struct my_callback_context {
DBT val;
};
-#if TOKUDB
static int blocking_last_callback(DBT const *a UU(), DBT const *b UU(), void *e UU()) {
DBT const *found_key = a;
DBT const *found_val = b;
@@ -125,7 +124,6 @@ static int blocking_last_callback(DBT const *a UU(), DBT const *b UU(), void *e
copy_dbt(&context->val, found_val);
return 0;
}
-#endif
static void blocking_last(DB_ENV *db_env, DB *db, uint64_t nrows, long sleeptime) {
int r;
@@ -140,11 +138,7 @@ static void blocking_last(DB_ENV *db_env, DB *db, uint64_t nrows, long sleeptime
DBC *cursor = NULL;
r = db->cursor(db, txn, &cursor, 0); assert(r == 0); // get a write lock on -inf ... 0
-#if TOKUDB
r = cursor->c_getf_last(cursor, DB_RMW, blocking_last_callback, &context); assert(r == 0);
-#else
- r = cursor->c_get(cursor, &context.key, &context.val, DB_LAST + DB_RMW); assert(r == 0);
-#endif
usleep(sleeptime);
r = cursor->c_close(cursor); assert(r == 0);
@@ -236,9 +230,7 @@ int test_main(int argc, char * const argv[]) {
r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
}
r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
-#if TOKUDB
r = db_env->set_lock_timeout(db_env, 30 * 1000, nullptr); assert(r == 0);
-#endif
// create the db
DB *db = NULL;
diff --git a/storage/tokudb/ft-index/src/tests/blocking-next-prev-deadlock.cc b/storage/tokudb/ft-index/src/tests/blocking-next-prev-deadlock.cc
index fb591feff28..f71c89aa3e7 100644
--- a/storage/tokudb/ft-index/src/tests/blocking-next-prev-deadlock.cc
+++ b/storage/tokudb/ft-index/src/tests/blocking-next-prev-deadlock.cc
@@ -124,7 +124,6 @@ struct my_callback_context {
DBT val;
};
-#if TOKUDB
static int blocking_next_callback(DBT const *a UU(), DBT const *b UU(), void *e UU()) {
DBT const *found_key = a;
DBT const *found_val = b;
@@ -133,7 +132,6 @@ static int blocking_next_callback(DBT const *a UU(), DBT const *b UU(), void *e
copy_dbt(&context->val, found_val);
return 0;
}
-#endif
static void blocking_next(DB_ENV *db_env, DB *db, uint64_t nrows UU(), long sleeptime) {
int r;
@@ -150,11 +148,7 @@ static void blocking_next(DB_ENV *db_env, DB *db, uint64_t nrows UU(), long slee
uint64_t i;
for (i = 0; ; i++) {
-#if TOKUDB
r = cursor->c_getf_next(cursor, DB_RMW, blocking_next_callback, &context);
-#else
- r = cursor->c_get(cursor, &context.key, &context.val, DB_NEXT + DB_RMW);
-#endif
if (r != 0)
break;
if (verbose)
@@ -196,11 +190,7 @@ static void blocking_prev(DB_ENV *db_env, DB *db, uint64_t nrows UU(), long slee
uint64_t i;
for (i = 0; ; i++) {
-#if TOKUDB
r = cursor->c_getf_prev(cursor, DB_RMW, blocking_next_callback, &context);
-#else
- r = cursor->c_get(cursor, &context.key, &context.val, DB_PREV + DB_RMW);
-#endif
if (r != 0)
break;
if (verbose)
@@ -305,11 +295,7 @@ int test_main(int argc, char * const argv[]) {
r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
}
r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
-#if TOKUDB
r = db_env->set_lock_timeout(db_env, 30 * 1000, nullptr); assert(r == 0);
-#else
- r = db_env->set_lk_detect(db_env, DB_LOCK_YOUNGEST); assert(r == 0);
-#endif
// create the db
DB *db = NULL;
diff --git a/storage/tokudb/ft-index/src/tests/blocking-next-prev.cc b/storage/tokudb/ft-index/src/tests/blocking-next-prev.cc
index 86644a13cf5..ec1ae8ff340 100644
--- a/storage/tokudb/ft-index/src/tests/blocking-next-prev.cc
+++ b/storage/tokudb/ft-index/src/tests/blocking-next-prev.cc
@@ -123,7 +123,6 @@ struct my_callback_context {
DBT val;
};
-#if TOKUDB
static int blocking_next_callback(DBT const *a UU(), DBT const *b UU(), void *e UU()) {
DBT const *found_key = a;
DBT const *found_val = b;
@@ -132,7 +131,6 @@ static int blocking_next_callback(DBT const *a UU(), DBT const *b UU(), void *e
copy_dbt(&context->val, found_val);
return 0;
}
-#endif
static void blocking_next(DB_ENV *db_env, DB *db, uint64_t nrows UU(), long sleeptime) {
int r;
@@ -149,11 +147,7 @@ static void blocking_next(DB_ENV *db_env, DB *db, uint64_t nrows UU(), long slee
uint64_t i;
for (i = 0; ; i++) {
-#if TOKUDB
r = cursor->c_getf_next(cursor, 0, blocking_next_callback, &context);
-#else
- r = cursor->c_get(cursor, &context.key, &context.val, DB_NEXT);
-#endif
if (r != 0)
break;
if (verbose)
@@ -199,11 +193,7 @@ static void blocking_prev(DB_ENV *db_env, DB *db, uint64_t nrows UU(), long slee
uint64_t i;
for (i = 0; ; i++) {
-#if TOKUDB
r = cursor->c_getf_prev(cursor, 0, blocking_next_callback, &context);
-#else
- r = cursor->c_get(cursor, &context.key, &context.val, DB_PREV);
-#endif
if (r != 0)
break;
if (verbose)
diff --git a/storage/tokudb/ft-index/src/tests/blocking-prelock-range.cc b/storage/tokudb/ft-index/src/tests/blocking-prelock-range.cc
index cece47cbeec..15065dcf244 100644
--- a/storage/tokudb/ft-index/src/tests/blocking-prelock-range.cc
+++ b/storage/tokudb/ft-index/src/tests/blocking-prelock-range.cc
@@ -181,9 +181,7 @@ int test_main(int argc, char * const argv[]) {
r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
}
r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
-#if TOKUDB
r = db_env->set_lock_timeout(db_env, 30 * 1000, nullptr); assert(r == 0);
-#endif
// create the db
DB *db = NULL;
diff --git a/storage/tokudb/ft-index/src/tests/blocking-put-timeout.cc b/storage/tokudb/ft-index/src/tests/blocking-put-timeout.cc
index c43bcfad5f0..b91198a4438 100644
--- a/storage/tokudb/ft-index/src/tests/blocking-put-timeout.cc
+++ b/storage/tokudb/ft-index/src/tests/blocking-put-timeout.cc
@@ -156,11 +156,7 @@ static void t_b(DB_ENV *db_env, DB *db, struct test_seq *seq) {
DBT key = { .data = &k, .size = sizeof k };
DBT val = { .data = &k, .size = sizeof k };
r = db->put(db, txn_b, &key, &val, 0);
-#if USE_BDB
- assert(r == DB_LOCK_DEADLOCK);
-#else
assert(r == DB_LOCK_NOTGRANTED);
-#endif
r = txn_b->abort(txn_b); assert(r == 0);
}
@@ -212,31 +208,12 @@ int test_main(int argc, char * const argv[]) {
r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
}
r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
-#if USE_BDB
- db_timeout_t t;
- r = db_env->get_timeout(db_env, &t, DB_SET_LOCK_TIMEOUT); assert(r == 0);
- if (verbose) printf("lock %d\n", t);
- r = db_env->get_timeout(db_env, &t, DB_SET_TXN_TIMEOUT); assert(r == 0);
- if (verbose) printf("txn %d\n", t);
-
- r = db_env->set_timeout(db_env, 5000000, DB_SET_LOCK_TIMEOUT); assert(r == 0);
- r = db_env->set_timeout(db_env, 5000000, DB_SET_TXN_TIMEOUT); assert(r == 0);
-
- r = db_env->get_timeout(db_env, &t, DB_SET_LOCK_TIMEOUT); assert(r == 0);
- if (verbose) printf("lock %d\n", t);
- r = db_env->get_timeout(db_env, &t, DB_SET_TXN_TIMEOUT); assert(r == 0);
- if (verbose) printf("txn %d\n", t);
-
- r = db_env->set_lk_detect(db_env, DB_LOCK_EXPIRE); assert(r == 0);
-#endif
-#if USE_TDB
uint64_t lock_timeout_msec;
r = db_env->get_lock_timeout(db_env, &lock_timeout_msec); assert(r == 0);
if (verbose) printf("lock timeout: %" PRIu64 "\n", lock_timeout_msec);
r = db_env->set_lock_timeout(db_env, 5000, nullptr); assert(r == 0);
r = db_env->get_lock_timeout(db_env, &lock_timeout_msec); assert(r == 0);
if (verbose) printf("lock timeout: %" PRIu64 "\n", lock_timeout_msec);
-#endif
// create the db
DB *db = NULL;
diff --git a/storage/tokudb/ft-index/src/tests/blocking-put-wakeup.cc b/storage/tokudb/ft-index/src/tests/blocking-put-wakeup.cc
index 9c8ad60787b..06c51b6fede 100644
--- a/storage/tokudb/ft-index/src/tests/blocking-put-wakeup.cc
+++ b/storage/tokudb/ft-index/src/tests/blocking-put-wakeup.cc
@@ -208,9 +208,7 @@ int test_main(int argc, char * const argv[]) {
r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
}
r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
-#if TOKUDB
r = db_env->set_lock_timeout(db_env, 30 * 1000, nullptr); assert(r == 0);
-#endif
// create the db
DB *db = NULL;
diff --git a/storage/tokudb/ft-index/src/tests/blocking-put.cc b/storage/tokudb/ft-index/src/tests/blocking-put.cc
index afd083986d8..8100862881a 100644
--- a/storage/tokudb/ft-index/src/tests/blocking-put.cc
+++ b/storage/tokudb/ft-index/src/tests/blocking-put.cc
@@ -180,9 +180,7 @@ int test_main(int argc, char * const argv[]) {
r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
}
r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
-#if TOKUDB
r = db_env->set_lock_timeout(db_env, 30 * 1000, nullptr); assert(r == 0);
-#endif
// create the db
DB *db = NULL;
diff --git a/storage/tokudb/ft-index/src/tests/blocking-set-range-0.cc b/storage/tokudb/ft-index/src/tests/blocking-set-range-0.cc
index 8d2dad831a2..896d4a82e12 100644
--- a/storage/tokudb/ft-index/src/tests/blocking-set-range-0.cc
+++ b/storage/tokudb/ft-index/src/tests/blocking-set-range-0.cc
@@ -117,7 +117,6 @@ struct my_callback_context {
DBT val;
};
-#if TOKUDB
static int blocking_set_range_callback(DBT const *a UU(), DBT const *b UU(), void *e UU()) {
DBT const *found_key = a;
DBT const *found_val = b;
@@ -126,7 +125,6 @@ static int blocking_set_range_callback(DBT const *a UU(), DBT const *b UU(), voi
copy_dbt(&context->val, found_val);
return 0;
}
-#endif
static void blocking_set_range(DB_ENV *db_env, DB *db, uint64_t nrows, long sleeptime, uint64_t the_key) {
int r;
@@ -144,11 +142,7 @@ static void blocking_set_range(DB_ENV *db_env, DB *db, uint64_t nrows, long slee
uint64_t k = htonl(the_key);
DBT key = { .data = &k, .size = sizeof k };
-#if TOKUDB
r = cursor->c_getf_set_range(cursor, DB_RMW, &key, blocking_set_range_callback, &context); assert(r == 0);
-#else
- r = cursor->c_get(cursor, &key, &context.val, DB_SET_RANGE + DB_RMW); assert(r == 0);
-#endif
uint64_t v;
assert(context.val.size == sizeof v);
memcpy(&v, context.val.data, context.val.size);
@@ -246,9 +240,7 @@ int test_main(int argc, char * const argv[]) {
r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
}
r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
-#if TOKUDB
r = db_env->set_lock_timeout(db_env, 30 * 1000, nullptr); assert(r == 0);
-#endif
// create the db
DB *db = NULL;
diff --git a/storage/tokudb/ft-index/src/tests/blocking-set-range-n.cc b/storage/tokudb/ft-index/src/tests/blocking-set-range-n.cc
index 838d18ed6d5..841809fadbe 100644
--- a/storage/tokudb/ft-index/src/tests/blocking-set-range-n.cc
+++ b/storage/tokudb/ft-index/src/tests/blocking-set-range-n.cc
@@ -117,7 +117,6 @@ struct my_callback_context {
DBT val;
};
-#if TOKUDB
static int blocking_set_range_callback(DBT const *a UU(), DBT const *b UU(), void *e UU()) {
DBT const *found_key = a;
DBT const *found_val = b;
@@ -126,7 +125,6 @@ static int blocking_set_range_callback(DBT const *a UU(), DBT const *b UU(), voi
copy_dbt(&context->val, found_val);
return 0;
}
-#endif
static void blocking_set_range(DB_ENV *db_env, DB *db, uint64_t nrows, long sleeptime, uint64_t the_key) {
int r;
@@ -144,11 +142,7 @@ static void blocking_set_range(DB_ENV *db_env, DB *db, uint64_t nrows, long slee
uint64_t k = htonl(the_key);
DBT key = { .data = &k, .size = sizeof k };
-#if TOKUDB
r = cursor->c_getf_set_range(cursor, DB_RMW, &key, blocking_set_range_callback, &context); assert(r == DB_NOTFOUND);
-#else
- r = cursor->c_get(cursor, &key, &context.val, DB_SET_RANGE + DB_RMW); assert(r == DB_NOTFOUND);
-#endif
usleep(sleeptime);
r = cursor->c_close(cursor); assert(r == 0);
@@ -241,9 +235,7 @@ int test_main(int argc, char * const argv[]) {
r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
}
r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
-#if TOKUDB
r = db_env->set_lock_timeout(db_env, 30 * 1000, nullptr); assert(r == 0);
-#endif
// create the db
DB *db = NULL;
diff --git a/storage/tokudb/ft-index/src/tests/blocking-set-range-reverse-0.cc b/storage/tokudb/ft-index/src/tests/blocking-set-range-reverse-0.cc
index 7d06dc4c9e0..f63bb3c0e5b 100644
--- a/storage/tokudb/ft-index/src/tests/blocking-set-range-reverse-0.cc
+++ b/storage/tokudb/ft-index/src/tests/blocking-set-range-reverse-0.cc
@@ -142,11 +142,7 @@ static void blocking_set_range(DB_ENV *db_env, DB *db, uint64_t nrows, long slee
uint64_t k = htonl(the_key);
DBT key = { .data = &k, .size = sizeof k };
-#if TOKUDB
r = cursor->c_getf_set_range_reverse(cursor, 0, &key, blocking_set_range_callback, &context); assert(r == 0);
-#else
- r = cursor->c_get(cursor, &key, &context.val, DB_SET_RANGE_REVERSE); assert(r == 0);
-#endif
uint64_t v;
assert(context.val.size == sizeof v);
memcpy(&v, context.val.data, context.val.size);
@@ -244,9 +240,7 @@ int test_main(int argc, char * const argv[]) {
r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
}
r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
-#if TOKUDB
r = db_env->set_lock_timeout(db_env, 30 * 1000, nullptr); assert(r == 0);
-#endif
// create the db
DB *db = NULL;
diff --git a/storage/tokudb/ft-index/src/tests/blocking-set.cc b/storage/tokudb/ft-index/src/tests/blocking-set.cc
index d229321aa43..dd0196ff276 100644
--- a/storage/tokudb/ft-index/src/tests/blocking-set.cc
+++ b/storage/tokudb/ft-index/src/tests/blocking-set.cc
@@ -112,7 +112,6 @@ static void populate(DB_ENV *db_env, DB *db, uint64_t nrows) {
r = txn->commit(txn, 0); assert(r == 0);
}
-#if TOKUDB
static int blocking_set_callback(DBT const *a UU(), DBT const *b UU(), void *e UU()) {
// DBT const *found_key = a;
DBT const *found_val = b;
@@ -123,7 +122,6 @@ static int blocking_set_callback(DBT const *a UU(), DBT const *b UU(), void *e U
memcpy(my_val->data, found_val->data, found_val->size);
return 0;
}
-#endif
static void blocking_set(DB_ENV *db_env, DB *db, uint64_t nrows, long sleeptime) {
int r;
@@ -140,11 +138,7 @@ static void blocking_set(DB_ENV *db_env, DB *db, uint64_t nrows, long sleeptime)
uint64_t k = htonl(0); // set to key 0
DBT key = { .data = &k, .size = sizeof k };
-#if TOKUDB
r = cursor->c_getf_set(cursor, DB_RMW, &key, blocking_set_callback, &val); assert(r == 0);
-#else
- r = cursor->c_get(cursor, &key, &val, DB_SET + DB_RMW); assert(r == 0);
-#endif
uint64_t v;
assert(val.size == sizeof v);
memcpy(&v, val.data, val.size);
@@ -226,9 +220,7 @@ int test_main(int argc, char * const argv[]) {
r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
}
r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
-#if TOKUDB
r = db_env->set_lock_timeout(db_env, 30 * 1000, nullptr); assert(r == 0);
-#endif
// create the db
DB *db = NULL;
diff --git a/storage/tokudb/ft-index/src/tests/blocking-table-lock.cc b/storage/tokudb/ft-index/src/tests/blocking-table-lock.cc
index 2ae82319a7e..42e824debbf 100644
--- a/storage/tokudb/ft-index/src/tests/blocking-table-lock.cc
+++ b/storage/tokudb/ft-index/src/tests/blocking-table-lock.cc
@@ -174,9 +174,7 @@ int test_main(int argc, char * const argv[]) {
r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
}
r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
-#if TOKUDB
r = db_env->set_lock_timeout(db_env, 30 * 1000, nullptr); assert(r == 0);
-#endif
// create the db
DB *db = NULL;
diff --git a/storage/tokudb/ft-index/src/tests/checkpoint1.cc b/storage/tokudb/ft-index/src/tests/checkpoint1.cc
index 3620b9006a8..9fe56cdbc36 100644
--- a/storage/tokudb/ft-index/src/tests/checkpoint1.cc
+++ b/storage/tokudb/ft-index/src/tests/checkpoint1.cc
@@ -118,9 +118,7 @@ checkpoint1 (void)
toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO);
r = db_env_create(&env, 0); CKERR(r);
-#ifdef TOKUDB
r = env->set_redzone(env, 0); CKERR(r);
-#endif
r = env->open(env, TOKU_TEST_FILENAME, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = db_create(&db, env, 0); CKERR(r);
diff --git a/storage/tokudb/ft-index/src/tests/checkpoint_fairness.cc b/storage/tokudb/ft-index/src/tests/checkpoint_fairness.cc
index c94e1f4b1ab..03d5c47f4e5 100644
--- a/storage/tokudb/ft-index/src/tests/checkpoint_fairness.cc
+++ b/storage/tokudb/ft-index/src/tests/checkpoint_fairness.cc
@@ -147,9 +147,7 @@ int test_main(int argc, char * const argv[]) {
// try to starve the checkpoint
{ int chk_r = db_env_create(&env, 0); CKERR(chk_r); }
-#ifdef USE_TDB
{ int chk_r = env->set_redzone(env, 0); CKERR(chk_r); }
-#endif
{
const int size = 10+strlen(env_dir);
char cmd[size];
diff --git a/storage/tokudb/ft-index/src/tests/checkpoint_stress.cc b/storage/tokudb/ft-index/src/tests/checkpoint_stress.cc
index ebbaf4085fc..976ba8e8555 100644
--- a/storage/tokudb/ft-index/src/tests/checkpoint_stress.cc
+++ b/storage/tokudb/ft-index/src/tests/checkpoint_stress.cc
@@ -272,13 +272,10 @@ random_acts(void * d) {
}
}
-
-#if IS_TDB && !TOKU_WINDOWS
return intothevoid;
-#endif
}
-uint64_t max_windows_cachesize = 256 << 20;
+uint64_t max_cachesize = 256 << 20;
static void
run_test (int iter, int die) {
@@ -296,7 +293,7 @@ run_test (int iter, int die) {
const int32_t K256 = 256 * 1024;
uint64_t cachebytes = 0;
cachebytes = K256 * (iter + 1) - (128 * 1024);
- if (cachebytes > max_windows_cachesize)
+ if (cachebytes > max_cachesize)
cachebytes = 0;
if (iter & 2) cachebytes = 0; // use default cachesize half the time
diff --git a/storage/tokudb/ft-index/src/tests/cilktests/Makefile b/storage/tokudb/ft-index/src/tests/cilktests/Makefile
deleted file mode 100644
index d5a4b45fffa..00000000000
--- a/storage/tokudb/ft-index/src/tests/cilktests/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-default: build
-TARGETS = get.parallel get.serial
-CPPFLAGS = -I../../../include -I../../../toku_include -I../../../linux
-CFLAGS = -Wall -W -Werror -g $(OPTFLAGS)
-LOADLIBES = -L../../../lib -ltokuportability -ltokudb
-LDFLAGS = -Wl,-rpath,../../../lib
-build: $(TARGETS)
-CILKPP=/home/bradley/cilkarts/8503/cilk/bin/cilk++
-CXX=/home/bradley/cilkarts/8503/cilk/bin/c++
-CILKSCREEN=/home/bradley/cilkarts/8503/cilk/bin/cilkscreen
-
-%.parallel: %.cilk
- $(CILKPP) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $< -o $@ $(LOADLIBES)
-%.serial: %.cilk
- $(CILKPP) -fcilk-stub $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $< -o $@ $(LOADLIBES)
-check: check_get.parallel check_get.serial
-check_%.parallel: %.parallel
- $(CILKSCREEN) ./$<
-check_%.serial: %.serial
- valgrind ./$<
-
-foo.serial foo.parallel: CPPFLAGS=
-foo.serial foo.parallel: LOADLIBES=
-foo.serial foo.parallel: LDFLAGS=
-foo.serial: CFLAGS=-lpthread
-
-%.o: %.cilk
- $(CILKPP) $(CPPFLAGS) $(CFLAGS) $< -c -o $@
-
-foo2: foo2.o bar2.o
- $(CILKPP) foo2.o bar2.o -o $@ -lpthread -L/home/bradley/cilkarts/8503/cilk/lib64 -lcilkrts -Wl,-rpath=/home/bradley/cilkarts/8503/cilk/lib64
-
-broken:
- $(CXX) foo2.o bar2.o -o $@ -lpthread -L/home/bradley/cilkarts/8503/cilk/lib64 -lcilkrts -Wl,-rpath=/home/bradley/cilkarts/8503/cilk/lib64
-
-measurecilkrun.parallel: OPTFLAGS=-O2
-measurecilkrun.parallel: LDFLAGS=
-measurecilkrun.parallel: LOADLIBES=
-measurecilkrun.parallel: CPPFLAGS=
-check_measurecilkrun.parallel: CILKSCREEN=
diff --git a/storage/tokudb/ft-index/src/tests/cilktests/bar2.cilk b/storage/tokudb/ft-index/src/tests/cilktests/bar2.cilk
deleted file mode 100644
index 3939cee64bc..00000000000
--- a/storage/tokudb/ft-index/src/tests/cilktests/bar2.cilk
+++ /dev/null
@@ -1,22 +0,0 @@
-#include <cilk.h>
-#include <stdio.h>
-#include "foo2.h"
-
-extern "Cilk++"
-int foo2 (int i) {
- return i+1;
-}
-
-int foo (int i) {
- int r;
- r = cilk_spawn foo2 (i+1);
- cilk_sync;
- return r+1;
-}
-
-extern "C++"
-void do_foo (void) {
- printf("Running cilk\n");
- int r = cilk::run(&foo, 3);
- printf("Done r =%d\n", r);
-}
diff --git a/storage/tokudb/ft-index/src/tests/cilktests/foo.cilk b/storage/tokudb/ft-index/src/tests/cilktests/foo.cilk
deleted file mode 100644
index dfc5540db4b..00000000000
--- a/storage/tokudb/ft-index/src/tests/cilktests/foo.cilk
+++ /dev/null
@@ -1,41 +0,0 @@
-#include <pthread.h>
-#include <unistd.h>
-#include <assert.h>
-#include <stdio.h>
-
-pthread_t pt[2];
-pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
-
-extern "C" void* start (void *extra __attribute__((__unused__))) {
- { int r = pthread_mutex_lock(&mutex); assert(r==0); }
- printf("T%lx got lock\n", pthread_self());
- sleep(1);
- printf("T%lx releasing lock\n", pthread_self());
- { int r = pthread_mutex_unlock(&mutex); assert(r==0); }
- return 0;
-}
-
-void create_pthread(void) {
- for (int i=0; i<2; i++) {
- int r = pthread_create(&pt[i], 0, start, NULL);
- assert(r==0);
- }
-}
-
-void join_pthread (void) {
- for (int i=0; i<2; i++) {
- int r = pthread_join(pt[i], NULL);
- assert(r==0);
- }
-}
-
-void foo (void) {
-}
-
-int cilk_main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__unused__))) {
- create_pthread();
- cilk_spawn foo();
- cilk_sync;
- join_pthread();
- return 0;
-}
diff --git a/storage/tokudb/ft-index/src/tests/cilktests/foo2.cpp b/storage/tokudb/ft-index/src/tests/cilktests/foo2.cpp
deleted file mode 100644
index edc8e7f8cf0..00000000000
--- a/storage/tokudb/ft-index/src/tests/cilktests/foo2.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
-// vim: expandtab:ts=8:sw=4:softtabstop=4:
-/*
-COPYING CONDITIONS NOTICE:
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of version 2 of the GNU General Public License as
- published by the Free Software Foundation, and provided that the
- following conditions are met:
-
- * Redistributions of source code must retain this COPYING
- CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
- DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
- PATENT MARKING NOTICE (below), and the PATENT RIGHTS
- GRANT (below).
-
- * Redistributions in binary form must reproduce this COPYING
- CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
- DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
- PATENT MARKING NOTICE (below), and the PATENT RIGHTS
- GRANT (below) in the documentation and/or other materials
- provided with the distribution.
-
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-
-COPYRIGHT NOTICE:
-
- TokuDB, Tokutek Fractal Tree Indexing Library.
- Copyright (C) 2007-2013 Tokutek, Inc.
-
-DISCLAIMER:
-
- 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.
-
-UNIVERSITY PATENT NOTICE:
-
- The technology is licensed by the Massachusetts Institute of
- Technology, Rutgers State University of New Jersey, and the Research
- Foundation of State University of New York at Stony Brook under
- United States of America Serial No. 11/760379 and to the patents
- and/or patent applications resulting from it.
-
-PATENT MARKING NOTICE:
-
- This software is covered by US Patent No. 8,185,551.
- This software is covered by US Patent No. 8,489,638.
-
-PATENT RIGHTS GRANT:
-
- "THIS IMPLEMENTATION" means the copyrightable works distributed by
- Tokutek as part of the Fractal Tree project.
-
- "PATENT CLAIMS" means the claims of patents that are owned or
- licensable by Tokutek, both currently or in the future; and that in
- the absence of this license would be infringed by THIS
- IMPLEMENTATION or by using or running THIS IMPLEMENTATION.
-
- "PATENT CHALLENGE" shall mean a challenge to the validity,
- patentability, enforceability and/or non-infringement of any of the
- PATENT CLAIMS or otherwise opposing any of the PATENT CLAIMS.
-
- Tokutek hereby grants to you, for the term and geographical scope of
- the PATENT CLAIMS, a non-exclusive, no-charge, royalty-free,
- irrevocable (except as stated in this section) patent license to
- make, have made, use, offer to sell, sell, import, transfer, and
- otherwise run, modify, and propagate the contents of THIS
- IMPLEMENTATION, where such license applies only to the PATENT
- CLAIMS. This grant does not include claims that would be infringed
- only as a consequence of further modifications of THIS
- IMPLEMENTATION. If you or your agent or licensee institute or order
- or agree to the institution of patent litigation against any entity
- (including a cross-claim or counterclaim in a lawsuit) alleging that
- THIS IMPLEMENTATION constitutes direct or contributory patent
- infringement, or inducement of patent infringement, then any rights
- granted to you under this License shall terminate as of the date
- such litigation is filed. If you or your agent or exclusive
- licensee institute or order or agree to the institution of a PATENT
- CHALLENGE, then Tokutek may terminate any rights granted to you
- under this License.
-*/
-
-#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
-#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
-
-#include <pthread.h>
-#include <unistd.h>
-#include <assert.h>
-#include <stdio.h>
-#include "foo2.h"
-#include "cilk.h"
-
-pthread_t pt[2];
-pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
-
-extern "C" void* start (void *extra __attribute__((__unused__))) {
- { int r = pthread_mutex_lock(&mutex); assert(r==0); }
- printf("T%lx got lock\n", pthread_self());
- sleep(1);
- printf("T%lx releasing lock\n", pthread_self());
- { int r = pthread_mutex_unlock(&mutex); assert(r==0); }
- return 0;
-}
-
-void create_pthread(void) {
- for (int i=0; i<2; i++) {
- int r = pthread_create(&pt[i], 0, start, NULL);
- assert(r==0);
- }
-}
-
-void join_pthread (void) {
- for (int i=0; i<2; i++) {
- int r = pthread_join(pt[i], NULL);
- assert(r==0);
- }
-}
-
-int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__unused__))) {
- __cilkscreen_disable_instrumentation();
- create_pthread();
- __cilkscreen_enable_instrumentation();
- do_foo();
- join_pthread();
- return 0;
-}
diff --git a/storage/tokudb/ft-index/src/tests/cilktests/get.cilk b/storage/tokudb/ft-index/src/tests/cilktests/get.cilk
deleted file mode 100644
index 810ab332581..00000000000
--- a/storage/tokudb/ft-index/src/tests/cilktests/get.cilk
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Perform a DB->get in a cilk thread */
-
-#include <assert.h>
-#include <db.h>
-#include <stdlib.h>
-#include <toku_os.h>
-
-#define DIR __FILE__ ".dir"
-
-DB_ENV *env;
-
-void foo (void) {
- printf("foo\n");
-}
-
-const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
-
-int cilk_main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__unused__))) {
- system("rm -rf " DIR);
- toku_os_mkdir(DIR, 0777);
- { int r = db_env_create(&env, 0); assert(r==0); }
- { int r = env->open(env, DIR, envflags,S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0); }
- cilk_spawn foo();
- cilk_sync;
- { int r = env->close(env, 0); assert(r==0); }
- return 0;
-}
diff --git a/storage/tokudb/ft-index/src/tests/cilktests/measurecilkrun.cilk b/storage/tokudb/ft-index/src/tests/cilktests/measurecilkrun.cilk
deleted file mode 100644
index b6949b7e989..00000000000
--- a/storage/tokudb/ft-index/src/tests/cilktests/measurecilkrun.cilk
+++ /dev/null
@@ -1,106 +0,0 @@
-#include <pthread.h>
-#include <unistd.h>
-#include <assert.h>
-#include <stdio.h>
-#include "cilk.h"
-#include <sys/time.h>
-
-int foo (int i) {
- return i+1;
-}
-
-int fooi (void* iv) {
- int *ip=(int*)iv;
- return foo(*ip);
-}
-
-extern "C++" {
-
-int N = 1000;
-
-double tdiff (struct timeval *after, struct timeval *before)
-{
- return after->tv_sec - before->tv_sec + (1e-6)*(after->tv_usec - before->tv_usec);
-}
-
-
-void do_cilkrun (void) {
- cilk::run(&foo, 0);
-}
-
-static cilk::context *ctx;
-void do_cilkcxt (void) {
- int i = 0;
- int j __attribute__((__unused__)) = ctx->run(&fooi, (void*)&i);
-}
-
-void do_N_cilkcxt (void) {
- struct timeval start,end;
- gettimeofday(&start, 0);
- cilk::context ctx;
- int r=0;
- for (int i=0; i<N; i++) {
- int j=ctx.run(&fooi, (void*)&i);
- r+=j;
- }
- gettimeofday(&end, 0);
- printf("%.3fus per ctx.run (tot=%d)\n", 1e6*tdiff(&end, &start)/N, 0);
-}
-
-
-extern "Cilk++" int cilk_in_pt (int i) {
- assert(i==0);
- return 0;
-}
-
-pthread_t pt_for_cilk;
-extern void* do_pt_for_cilk(void *extra __attribute__((__unused__))) {
- cilk::run(&cilk_in_pt, 0);
- return 0;
-}
-
-void setup_cilk_in_pthread (void) {
- int r = pthread_create(&pt_for_cilk, 0, do_pt_for_cilk, NULL);
- assert(r==0);
-}
-
-void do_cilk_in_pthread (void) {
-}
-
-void* do_something (void *extra __attribute__((__unused__))) {
- return 0;
-}
-
-void do_pthread(void) {
- pthread_t pt;
- {int r = pthread_create(&pt, 0, do_something, NULL); assert(r==0);}
- {int r = pthread_join(pt, NULL); assert(r==0);}
-}
-
-void measure(void (*f)(void), const char *string) {
- const int maxiter=4;
- for (int j=0; j<maxiter; j++) {
- int M = (j+1==maxiter) ? N : 1<<j;
- struct timeval start,end;
- gettimeofday(&start, 0);
- for (int i=0; i<M; i++) {
- f();
- }
- gettimeofday(&end, 0);
- printf("%9.3fus per call (%d calls) for %s\n", 1e6*tdiff(&end, &start)/M, M, string);
- }
- printf("\n");
-}
-
-int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__unused__))) {
- measure(do_pthread, "pthread");
- measure(do_cilkrun, "cilkrun");
-
- ctx = new cilk::context;
- measure(do_cilkcxt, "cilkcxt");
- delete ctx;
-
- return 0;
-}
-
-} /* end extern "C" */
diff --git a/storage/tokudb/ft-index/src/tests/create-datadir.cc b/storage/tokudb/ft-index/src/tests/create-datadir.cc
index bcf37621780..ecd0b032897 100644
--- a/storage/tokudb/ft-index/src/tests/create-datadir.cc
+++ b/storage/tokudb/ft-index/src/tests/create-datadir.cc
@@ -114,13 +114,9 @@ static void run_test (void) {
r = db_create(&db, env, 0); CKERR(r);
r = db->open(db, NULL, "bdir/b.db", NULL, DB_BTREE, DB_AUTO_COMMIT|DB_CREATE, 0666);
-#if USE_TDB
CKERR(r); //Success, so need a new handle
r = db->close(db, 0); CKERR(r);
r = db_create(&db, env, 0); CKERR(r);
-#else
- assert(r != 0);
-#endif
char path[TOKU_PATH_MAX+1];
r = toku_os_mkdir(toku_path_join(path, 2, TOKU_TEST_FILENAME, "bdir"), 0777); assert(r == 0);
r = db->open(db, NULL, "bdir/b.db", NULL, DB_BTREE, DB_AUTO_COMMIT|DB_CREATE, 0666); CKERR(r);
@@ -137,13 +133,6 @@ static void run_test (void) {
r = db->open(db, NULL, "c.db", NULL, DB_BTREE, DB_AUTO_COMMIT|DB_CREATE, 0666); CKERR(r);
r = db->close(db, 0); CKERR(r);
-#if 0
- // test fname with absolute path
- r = db_create(&db, env, 0); CKERR(r);
- r = db->open(db, NULL, "/tmp/d.db", NULL, DB_BTREE, DB_AUTO_COMMIT|DB_CREATE, 0666); CKERR(r);
- r = db->close(db, 0); CKERR(r);
-#endif
-
r = env->close(env, 0); CKERR(r);
}
diff --git a/storage/tokudb/ft-index/src/tests/cursor-more-than-a-leaf-provdel.cc b/storage/tokudb/ft-index/src/tests/cursor-more-than-a-leaf-provdel.cc
index 5b3ba8a37cb..2927bb7c5ff 100644
--- a/storage/tokudb/ft-index/src/tests/cursor-more-than-a-leaf-provdel.cc
+++ b/storage/tokudb/ft-index/src/tests/cursor-more-than-a-leaf-provdel.cc
@@ -104,22 +104,14 @@ setup (void) {
r=toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_env_create(&env, 0); CKERR(r);
-#ifdef TOKUDB
r=env->set_redzone(env, 0); CKERR(r);
r=env->set_default_bt_compare(env, int_dbt_cmp); CKERR(r);
-#endif
env->set_errfile(env, stderr);
-#ifdef USE_BDB
- r=env->set_lk_max_objects(env, 2*num_insert); CKERR(r);
-#endif
r=env->open(env, TOKU_TEST_FILENAME, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
-#ifdef USE_BDB
- r=db->set_bt_compare(db, int_dbt_cmp); CKERR(r);
-#endif
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); assert(r==0);
}
diff --git a/storage/tokudb/ft-index/src/tests/db-put-simple-deadlock-threads.cc b/storage/tokudb/ft-index/src/tests/db-put-simple-deadlock-threads.cc
index 004a7aad12d..d60725c4966 100644
--- a/storage/tokudb/ft-index/src/tests/db-put-simple-deadlock-threads.cc
+++ b/storage/tokudb/ft-index/src/tests/db-put-simple-deadlock-threads.cc
@@ -184,9 +184,6 @@ static void simple_deadlock(DB_ENV *db_env, DB *db, int do_txn, int n) {
}
uint32_t txn_flags = 0;
-#if USE_BDB
- txn_flags = DB_TXN_NOWAIT; // force no wait for BDB to avoid a bug described below
-#endif
DB_TXN *txn_a = NULL;
if (do_txn) {
@@ -209,7 +206,6 @@ static void simple_deadlock(DB_ENV *db_env, DB *db, int do_txn, int n) {
test_seq_next_state(&test_seq);
test_seq_sleep(&test_seq, 2);
- // BDB does not time out this lock request, so the test hangs. it looks like a bug in bdb's __lock_get_internal.
insert_row(db, txn_a, htonl(n-1), n-1, DB_LOCK_NOTGRANTED);
test_seq_next_state(&test_seq);
@@ -268,16 +264,8 @@ int test_main(int argc, char * const argv[]) {
}
if (!do_txn)
db_env_open_flags &= ~(DB_INIT_TXN | DB_INIT_LOG);
-#if USE_BDB
- r = db_env->set_flags(db_env, DB_TIME_NOTGRANTED, 1); assert(r == 0); // force DB_LOCK_DEADLOCK to DB_LOCK_NOTGRANTED
-#endif
r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
-#if defined(USE_TDB)
r = db_env->set_lock_timeout(db_env, 0, nullptr); assert(r == 0); // no wait
-#elif defined(USE_BDB)
- r = db_env->set_lk_detect(db_env, DB_LOCK_YOUNGEST); assert(r == 0);
- r = db_env->set_timeout(db_env, 10000, DB_SET_LOCK_TIMEOUT); assert(r == 0);
-#endif
// create the db
DB *db = NULL;
diff --git a/storage/tokudb/ft-index/src/tests/db-put-simple-deadlock.cc b/storage/tokudb/ft-index/src/tests/db-put-simple-deadlock.cc
index d373752994a..acc841b8d78 100644
--- a/storage/tokudb/ft-index/src/tests/db-put-simple-deadlock.cc
+++ b/storage/tokudb/ft-index/src/tests/db-put-simple-deadlock.cc
@@ -88,7 +88,7 @@ PATENT RIGHTS GRANT:
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
-// this test demonstrates that a simple deadlock with 2 transactions on a single thread works with tokudb, hangs with bdb
+// this test demonstrates that a simple deadlock with 2 transactions on a single thread works with tokudb
#include "test.h"
@@ -115,9 +115,6 @@ static void simple_deadlock(DB_ENV *db_env, DB *db, int do_txn, int n) {
}
uint32_t txn_flags = 0;
-#if USE_BDB
- txn_flags = DB_TXN_NOWAIT; // force no wait for BDB to avoid a bug described below
-#endif
DB_TXN *txn_a = NULL;
if (do_txn) {
@@ -133,7 +130,6 @@ static void simple_deadlock(DB_ENV *db_env, DB *db, int do_txn, int n) {
insert_row(db, txn_b, htonl(n-1), n-1, 0);
- // if the txn_flags is 0, then BDB does not time out this lock request, so the test hangs. it looks like a bug in bdb's __lock_get_internal.
insert_row(db, txn_a, htonl(n-1), n-1, DB_LOCK_NOTGRANTED);
insert_row(db, txn_b, htonl(0), 0, DB_LOCK_NOTGRANTED);
@@ -148,7 +144,7 @@ int test_main(int argc, char * const argv[]) {
uint64_t cachesize = 0;
uint32_t pagesize = 0;
int do_txn = 1;
- int nrows = 1000; // for BDB, insert enough rows to create a tree with more than one page in it. this avoids a page locking conflict.
+ int nrows = 1000;
const char *db_env_dir = TOKU_TEST_FILENAME;
const char *db_filename = "simple_deadlock";
int db_env_open_flags = DB_CREATE | DB_PRIVATE | DB_INIT_MPOOL | DB_INIT_TXN | DB_INIT_LOCK | DB_INIT_LOG | DB_THREAD;
@@ -187,14 +183,7 @@ int test_main(int argc, char * const argv[]) {
}
if (!do_txn)
db_env_open_flags &= ~(DB_INIT_TXN | DB_INIT_LOG);
-#if USE_BDB
- r = db_env->set_flags(db_env, DB_TIME_NOTGRANTED, 1); assert(r == 0); // force DB_LOCK_DEADLOCK to DB_LOCK_NOTGRANTED
-#endif
r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
-#if defined(USE_BDB)
- r = db_env->set_lk_detect(db_env, DB_LOCK_YOUNGEST); assert(r == 0);
- r = db_env->set_timeout(db_env, 1000, DB_SET_LOCK_TIMEOUT); assert(r == 0);
-#endif
// create the db
DB *db = NULL;
r = db_create(&db, db_env, 0); assert(r == 0);
diff --git a/storage/tokudb/ft-index/src/tests/db-put-simple-lockwait.cc b/storage/tokudb/ft-index/src/tests/db-put-simple-lockwait.cc
index 54682db81af..e459652101d 100644
--- a/storage/tokudb/ft-index/src/tests/db-put-simple-lockwait.cc
+++ b/storage/tokudb/ft-index/src/tests/db-put-simple-lockwait.cc
@@ -213,11 +213,7 @@ int test_main(int argc, char * const argv[]) {
if (!do_txn)
db_env_open_flags &= ~(DB_INIT_TXN | DB_INIT_LOG);
r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
-#if TOKUDB
r = db_env->set_lock_timeout(db_env, 30 * 1000, nullptr); assert(r == 0);
-#else
- r = db_env->set_lk_detect(db_env, DB_LOCK_YOUNGEST); assert(r == 0);
-#endif
// create the db
DB *db = NULL;
diff --git a/storage/tokudb/ft-index/src/tests/db-put-update-deadlock.cc b/storage/tokudb/ft-index/src/tests/db-put-update-deadlock.cc
index 1a546825fc4..ddd2893cae0 100644
--- a/storage/tokudb/ft-index/src/tests/db-put-update-deadlock.cc
+++ b/storage/tokudb/ft-index/src/tests/db-put-update-deadlock.cc
@@ -91,7 +91,6 @@ PATENT RIGHTS GRANT:
// for all i: T(i) reads 0, gets a read lock on 0
// for all i: T(i) writes 0, enters a deadlock
// tokudb detects deadlock on the fly
-// bdb detects deadlock on the fly or uses a deadlock detector
// --poll runs the deadlock detector until all the txns are resolved
#include "test.h"
@@ -201,18 +200,6 @@ static void update_deadlock(DB_ENV *db_env, DB *db, int do_txn, int nrows, int n
}
#endif
-#if defined(USE_BDB)
- // check for deadlocks
- if (poll_deadlock) {
- while (n_txns > 0) {
- sleep(10);
- int rejected = 0;
- r = db_env->lock_detect(db_env, 0, DB_LOCK_YOUNGEST, &rejected); assert(r == 0);
- printf("%s rejected %d\n", __FUNCTION__, rejected);
- }
- }
-#endif
-
// cleanup
for (int i = 0; i < ntxns; i++) {
void *ret = NULL;
@@ -274,14 +261,7 @@ int test_main(int argc, char * const argv[]) {
if (!do_txn)
db_env_open_flags &= ~(DB_INIT_TXN | DB_INIT_LOG);
r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
-#if defined(TOKUDB)
r = db_env->set_lock_timeout(db_env, 30 * 1000, nullptr); assert(r == 0);
-#endif
-#if defined(USE_BDB)
- if (!poll_deadlock) {
- r = db_env->set_lk_detect(db_env, DB_LOCK_YOUNGEST); assert(r == 0);
- }
-#endif
// create the db
DB *db = NULL;
diff --git a/storage/tokudb/ft-index/src/tests/dump-env.cc b/storage/tokudb/ft-index/src/tests/dump-env.cc
index 9e1459b80ec..8348c25f2bd 100644
--- a/storage/tokudb/ft-index/src/tests/dump-env.cc
+++ b/storage/tokudb/ft-index/src/tests/dump-env.cc
@@ -106,22 +106,14 @@ setup (void) {
}
r=db_env_create(&env, 0); CKERR(r);
-#ifdef TOKUDB
r=env->set_redzone(env, 0); CKERR(r);
r=env->set_default_bt_compare(env, int_dbt_cmp); CKERR(r);
-#endif
env->set_errfile(env, stderr);
-#ifdef USE_BDB
- r=env->set_lk_max_objects(env, 2*num_insert); CKERR(r);
-#endif
r=env->open(env, TOKU_TEST_FILENAME, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
-#ifdef USE_BDB
- r=db->set_bt_compare(db, int_dbt_cmp); CKERR(r);
-#endif
r=db->open(db, txn, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=txn->commit(txn, 0); assert(r==0);
}
diff --git a/storage/tokudb/ft-index/src/tests/filesize.cc b/storage/tokudb/ft-index/src/tests/filesize.cc
index c1b7ad2df30..b47be955efd 100644
--- a/storage/tokudb/ft-index/src/tests/filesize.cc
+++ b/storage/tokudb/ft-index/src/tests/filesize.cc
@@ -196,11 +196,7 @@ delete_n (uint32_t ah)
ndelete_notfound++;
else
ndelete_failed++;
-#ifdef USE_BDB
- assert(r==0 || r==DB_NOTFOUND);
-#else
CKERR(r);
-#endif
}
static void
diff --git a/storage/tokudb/ft-index/src/tests/hotindexer-undo-do-test.cc b/storage/tokudb/ft-index/src/tests/hotindexer-undo-do-test.cc
index e1a2070a036..51f60652d14 100644
--- a/storage/tokudb/ft-index/src/tests/hotindexer-undo-do-test.cc
+++ b/storage/tokudb/ft-index/src/tests/hotindexer-undo-do-test.cc
@@ -97,14 +97,14 @@ PATENT RIGHTS GRANT:
#include <ft/tokuconst.h>
#include <ft/fttypes.h>
-#include <ft/omt.h>
#include <ft/leafentry.h>
#include <ft/ule.h>
#include <ft/ule-internal.h>
#include <ft/le-cursor.h>
-#include "indexer-internal.h"
#include <ft/xids-internal.h>
+#include "indexer-internal.h"
+
struct txn {
TXNID xid;
TOKUTXN_STATE state;
diff --git a/storage/tokudb/ft-index/src/tests/inflate.cc b/storage/tokudb/ft-index/src/tests/inflate.cc
index 5a727544be5..8311b591c86 100644
--- a/storage/tokudb/ft-index/src/tests/inflate.cc
+++ b/storage/tokudb/ft-index/src/tests/inflate.cc
@@ -165,11 +165,7 @@ delete_n (uint32_t ah)
DBT key;
dbt_init(&key, &an, 4);
int r = db->del(db, NULL, &key, DB_DELETE_ANY);
-#ifdef USE_BDB
- assert(r==0 || r==DB_NOTFOUND);
-#else
CKERR(r);
-#endif
}
static void
diff --git a/storage/tokudb/ft-index/src/tests/inflate2.cc b/storage/tokudb/ft-index/src/tests/inflate2.cc
index 2bb930446a2..e5b8b6f270f 100644
--- a/storage/tokudb/ft-index/src/tests/inflate2.cc
+++ b/storage/tokudb/ft-index/src/tests/inflate2.cc
@@ -179,11 +179,7 @@ delete_n_now (uint32_t ah)
DBT key;
dbt_init(&key, &an, 4);
int r = db->del(db, NULL, &key, DB_DELETE_ANY);
-#ifdef USE_BDB
- assert(r==0 || r==DB_NOTFOUND);
-#else
CKERR(r);
-#endif
get_n(ah, DB_NOTFOUND);
}
diff --git a/storage/tokudb/ft-index/src/tests/loader-blobs-create-leaf.c.notyet b/storage/tokudb/ft-index/src/tests/loader-blobs-create-leaf.c.notyet
deleted file mode 100644
index 04a26a5cc25..00000000000
--- a/storage/tokudb/ft-index/src/tests/loader-blobs-create-leaf.c.notyet
+++ /dev/null
@@ -1,149 +0,0 @@
-// verify that the loader can deal with blobs larger than the node size
-
-#include "test.h"
-
-static int my_bt_compare(DB *db, const DBT *a, const DBT *b) {
- db = db;
- assert(a->size == 8 && b->size == 8);
- return memcmp(a->data, b->data, 8);
-}
-
-static int my_row_generate(DB *dest_db, DB *src_db, DBT *dest_key, DBT *dest_val, const DBT *src_key, const DBT *src_val) {
- dest_db = dest_db; src_db = src_db; dest_key = dest_key; dest_val = dest_val; src_key = src_key; src_val = src_val;
- assert(dest_key->flags == DB_DBT_REALLOC);
- dest_key->data = toku_realloc(dest_key->data, src_key->size);
- memcpy(dest_key->data, src_key->data, src_key->size);
- dest_key->size = src_key->size;
- assert(dest_val->flags == DB_DBT_REALLOC);
- dest_val->data = toku_realloc(dest_val->data, src_val->size);
- memcpy(dest_val->data, src_val->data, src_val->size);
- dest_val->size = src_val->size;
- return 0;
-}
-
-static void insert(DB_LOADER *loader, int k, int val_size) {
- int r;
-
- // generate the key
- char key_buffer[8];
- memset(key_buffer, 0, sizeof key_buffer);
- int newa = htonl(k);
- memcpy(key_buffer, &newa, sizeof newa);
-
- // generate the value
- char *val_buffer = toku_malloc(val_size); assert(val_buffer);
- memset(val_buffer, 0, val_size);
-
- DBT key = { .data = key_buffer, .size = sizeof key_buffer };
- DBT value = { .data = val_buffer, .size = val_size };
- r = loader->put(loader, &key, &value);
- if (DISALLOW_PUTS) {
- assert(r == EINVAL);
- }
- else {
- assert_zero(r);
- }
-
- toku_free(val_buffer);
-}
-
-int test_main(int argc, char * const argv[]) {
- uint32_t loader_flags = 0;
-#if defined(TOKUDB)
- char *db_env_dir = "blobs.leafsplit.env.tokudb";
-#else
- char *db_env_dir = "blobs.leafsplit.env.bdb";
-#endif
- int db_env_open_flags = DB_CREATE | DB_PRIVATE | DB_INIT_MPOOL | DB_INIT_TXN | DB_INIT_LOCK | DB_INIT_LOG;
- char *db_filename = "blobs.db";
- int do_txn = 1;
- u_int64_t cachesize = 0;
- u_int32_t pagesize = 0;
-
- int i;
- for (i = 1; i < argc; i++) {
- char *arg = argv[i];
- if (strcmp(arg, "-v") == 0 || strcmp(arg, "--verbose") == 0) {
- verbose++;
- continue;
- }
- if (strcmp(arg, "-q") == 0) {
- if (verbose > 0) verbose--;
- continue;
- }
- if (strcmp(arg, "-z") == 0) {
- loader_flags |= LOADER_COMPRESS_INTERMEDIATES;
- continue;
- }
- if (strcmp(arg, "-p") == 0) {
- loader_flags |= LOADER_DISALLOW_PUTS;
- continue;
- }
- if (strcmp(arg, "--txn") == 0 && i+1 < argc) {
- do_txn = atoi(argv[++i]);
- continue;
- }
- if (strcmp(arg, "--pagesize") == 0 && i+1 < argc) {
- pagesize = atoi(argv[++i]);
- continue;
- }
- if (strcmp(arg, "--cachesize") == 0 && i+1 < argc) {
- cachesize = atol(argv[++i]);
- continue;
- }
-
- assert(0);
- }
-
- int r;
- char rm_cmd[strlen(db_env_dir) + strlen("rm -rf ") + 1];
- snprintf(rm_cmd, sizeof(rm_cmd), "rm -rf %s", db_env_dir);
- r = system(rm_cmd); assert_zero(r);
-
- r = toku_os_mkdir(db_env_dir, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); assert_zero(r);
-
- // create and open the env
- DB_ENV *db_env = NULL;
- r = db_env_create(&db_env, 0); assert_zero(r);
- if (cachesize) {
- const u_int64_t gig = 1 << 30;
- r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert_zero(r);
- }
- r = db_env->set_generate_row_callback_for_put(db_env, my_row_generate); assert_zero(r);
- r = db_env->set_default_bt_compare(db_env, my_bt_compare); assert_zero(r);
- if (!do_txn)
- db_env_open_flags &= ~(DB_INIT_TXN | DB_INIT_LOG);
- r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert_zero(r);
-
- // create the db
- DB *db = NULL;
- r = db_create(&db, db_env, 0); assert_zero(r);
- DB_TXN *create_txn = NULL;
- if (do_txn) {
- r = db_env->txn_begin(db_env, NULL, &create_txn, 0); assert_zero(r);
- }
- if (pagesize) {
- r = db->set_pagesize(db, pagesize); assert_zero(r);
- }
- r = db->open(db, create_txn, db_filename, NULL, DB_BTREE, DB_CREATE, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert_zero(r);
-
- DB_LOADER *loader = NULL;
- uint32_t db_flags = 0;
- uint32_t dbt_flags = 0;
- r = db_env->create_loader(db_env, create_txn, &loader, db, 1, &db, &db_flags, &dbt_flags, loader_flags); assert_zero(r);
-
- insert(loader, 1, 8000000);
- insert(loader, 2, 1);
-
- r = loader->close(loader); assert_zero(r);
-
- if (do_txn) {
- r = create_txn->commit(create_txn, 0); assert_zero(r);
- }
-
- // shutdown
- r = db->close(db, 0); assert_zero(r); db = NULL;
- r = db_env->close(db_env, 0); assert_zero(r); db_env = NULL;
-
- return 0;
-}
diff --git a/storage/tokudb/ft-index/src/tests/medium-nested-commit-commit.cc b/storage/tokudb/ft-index/src/tests/medium-nested-commit-commit.cc
index e1c815695cc..48d9102d523 100644
--- a/storage/tokudb/ft-index/src/tests/medium-nested-commit-commit.cc
+++ b/storage/tokudb/ft-index/src/tests/medium-nested-commit-commit.cc
@@ -177,9 +177,6 @@ test_setup (void) {
r=toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_env_create(&env, 0); CKERR(r);
-#ifndef TOKUDB
- r=env->set_lk_max_objects(env, N); CKERR(r);
-#endif
env->set_errfile(env, stderr);
r=env->open(env, TOKU_TEST_FILENAME, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r);
diff --git a/storage/tokudb/ft-index/src/tests/recover-compare-db-descriptor.cc b/storage/tokudb/ft-index/src/tests/recover-compare-db-descriptor.cc
index 8da0e58af8d..58ae0b007e3 100644
--- a/storage/tokudb/ft-index/src/tests/recover-compare-db-descriptor.cc
+++ b/storage/tokudb/ft-index/src/tests/recover-compare-db-descriptor.cc
@@ -100,8 +100,6 @@ const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG
const char *namea="a.db";
const char *nameb="b.db";
-#if USE_TDB
-
static int my_compare(DB *UU(db), const DBT *a, const DBT *b) {
assert(db);
assert(db->cmp_descriptor);
@@ -112,17 +110,13 @@ static int my_compare(DB *UU(db), const DBT *a, const DBT *b) {
return memcmp(a->data, b->data, a->size);
}
-#endif
-
static void
change_descriptor(DB_ENV* env, DB* db) {
-#if USE_TDB
DBT descriptor;
dbt_init(&descriptor, descriptor_contents, sizeof(descriptor_contents));
IN_TXN_COMMIT(env, NULL, txn_desc, 0, {
{ int chk_r = db->change_descriptor(db, txn_desc, &descriptor, DB_UPDATE_CMP_DESCRIPTOR); CKERR(chk_r); }
});
-#endif
}
static void
@@ -136,9 +130,7 @@ do_x1_shutdown (bool do_commit, bool do_abort) {
DB *dba, *dbb;
r = db_env_create(&env, 0); CKERR(r);
r = env->set_data_dir(env, "data"); CKERR(r);
-#if USE_TDB
r = env->set_default_bt_compare(env, my_compare); CKERR(r);
-#endif
r = env->open(env, TOKU_TEST_FILENAME, envflags, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = db_create(&dba, env, 0); CKERR(r);
r = dba->open(dba, NULL, namea, NULL, DB_BTREE, DB_AUTO_COMMIT|DB_CREATE, 0666); CKERR(r);
@@ -181,9 +173,7 @@ do_x1_recover (bool did_commit) {
r = toku_os_mkdir(datadir, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = db_env_create(&env, 0); CKERR(r);
r = env->set_data_dir(env, "data"); CKERR(r);
-#if USE_TDB
r = env->set_default_bt_compare(env, my_compare); CKERR(r);
-#endif
r = env->open(env, TOKU_TEST_FILENAME, envflags|DB_RECOVER, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = db_create(&dba, env, 0); CKERR(r);
r = dba->open(dba, NULL, namea, NULL, DB_BTREE, DB_AUTO_COMMIT|DB_CREATE, 0666); CKERR(r);
diff --git a/storage/tokudb/ft-index/src/tests/recover-compare-db.cc b/storage/tokudb/ft-index/src/tests/recover-compare-db.cc
index 0102a36db6a..7e1de1ef3fe 100644
--- a/storage/tokudb/ft-index/src/tests/recover-compare-db.cc
+++ b/storage/tokudb/ft-index/src/tests/recover-compare-db.cc
@@ -98,16 +98,12 @@ const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG
const char *namea="a.db";
const char *nameb="b.db";
-#if USE_TDB
-
static int my_compare(DB *UU(db), const DBT *a, const DBT *b) {
assert(db);
assert(a->size == b->size);
return memcmp(a->data, b->data, a->size);
}
-#endif
-
static void
do_x1_shutdown (bool do_commit, bool do_abort) {
int r;
@@ -116,9 +112,7 @@ do_x1_shutdown (bool do_commit, bool do_abort) {
DB_ENV *env;
DB *dba, *dbb;
r = db_env_create(&env, 0); CKERR(r);
-#if USE_TDB
r = env->set_default_bt_compare(env, my_compare); CKERR(r);
-#endif
r = env->open(env, TOKU_TEST_FILENAME, envflags, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = db_create(&dba, env, 0); CKERR(r);
r = dba->open(dba, NULL, namea, NULL, DB_BTREE, DB_AUTO_COMMIT|DB_CREATE, 0666); CKERR(r);
@@ -155,9 +149,7 @@ do_x1_recover (bool did_commit) {
DB *dba, *dbb;
int r;
r = db_env_create(&env, 0); CKERR(r);
-#if USE_TDB
r = env->set_default_bt_compare(env, my_compare); CKERR(r);
-#endif
r = env->open(env, TOKU_TEST_FILENAME, envflags|DB_RECOVER, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = db_create(&dba, env, 0); CKERR(r);
r = dba->open(dba, NULL, namea, NULL, DB_BTREE, DB_AUTO_COMMIT|DB_CREATE, 0666); CKERR(r);
diff --git a/storage/tokudb/ft-index/src/tests/recover-fcreate-basementnodesize.cc b/storage/tokudb/ft-index/src/tests/recover-fcreate-basementnodesize.cc
index 2297a095e69..228528a5327 100644
--- a/storage/tokudb/ft-index/src/tests/recover-fcreate-basementnodesize.cc
+++ b/storage/tokudb/ft-index/src/tests/recover-fcreate-basementnodesize.cc
@@ -99,7 +99,6 @@ static const char *namea="a.db"; uint32_t nodesizea = 0;
static const char *nameb="b.db"; uint32_t nodesizeb = 32*1024;
static void do_remove(DB_ENV *env, const char *filename) {
-#if TOKUDB
int r;
DBT dname;
DBT iname;
@@ -112,12 +111,6 @@ static void do_remove(DB_ENV *env, const char *filename) {
toku_path_join(rmpath, 2, TOKU_TEST_FILENAME, iname.data);
toku_os_recursive_delete(rmpath);
toku_free(iname.data);
-#else
- (void) env;
- char rmpath[TOKU_PATH_MAX+1];
- toku_path_join(rmpath, 2, TOKU_TEST_FILENAME, filename);
- toku_os_recursive_delete(rmpath);
-#endif
}
static void run_test (void) {
diff --git a/storage/tokudb/ft-index/src/tests/recover-fcreate-nodesize.cc b/storage/tokudb/ft-index/src/tests/recover-fcreate-nodesize.cc
index d0a695b16ad..619704efcf2 100644
--- a/storage/tokudb/ft-index/src/tests/recover-fcreate-nodesize.cc
+++ b/storage/tokudb/ft-index/src/tests/recover-fcreate-nodesize.cc
@@ -100,7 +100,6 @@ static const char *namea="a.db"; uint32_t nodesizea = 0;
static const char *nameb="b.db"; uint32_t nodesizeb = 64*1024;
static void do_remove(DB_ENV *env, const char *filename) {
-#if TOKUDB
int r;
DBT dname;
DBT iname;
@@ -113,12 +112,6 @@ static void do_remove(DB_ENV *env, const char *filename) {
toku_path_join(rmpath, 2, TOKU_TEST_FILENAME, iname.data);
toku_os_recursive_delete(rmpath);
toku_free(iname.data);
-#else
- (void) env;
- char rmpath[TOKU_PATH_MAX+1];
- toku_path_join(rmpath, 2, TOKU_TEST_FILENAME, filename);
- toku_os_recursive_delete(rmpath);
-#endif
}
static void run_test (void) {
diff --git a/storage/tokudb/ft-index/src/tests/recover-missing-dbfile-2.cc b/storage/tokudb/ft-index/src/tests/recover-missing-dbfile-2.cc
index 777fb3499e6..59f963ef503 100644
--- a/storage/tokudb/ft-index/src/tests/recover-missing-dbfile-2.cc
+++ b/storage/tokudb/ft-index/src/tests/recover-missing-dbfile-2.cc
@@ -109,9 +109,7 @@ static void run_test (void) {
DB_ENV *env;
r = db_env_create(&env, 0); CKERR(r);
-#if IS_TDB
db_env_enable_engine_status(0); // disable engine status on crash because test is expected to fail
-#endif
r = env->open(env, TOKU_TEST_FILENAME, envflags, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
DB *dba;
@@ -160,9 +158,7 @@ static void run_recover (void) {
CKERR(r);
r = db_env_create(&env, 0); CKERR(r);
-#if IS_TDB
db_env_enable_engine_status(0); // disable engine status on crash because test is expected to fail
-#endif
r = env->open(env, TOKU_TEST_FILENAME, envflags + DB_RECOVER, S_IRWXU+S_IRWXG+S_IRWXO);
assert(r == DB_RUNRECOVERY);
@@ -184,9 +180,7 @@ static void run_no_recover (void) {
int r;
r = db_env_create(&env, 0); CKERR(r);
-#if IS_TDB
db_env_enable_engine_status(0); // disable engine status on crash because test is expected to fail
-#endif
r = env->open(env, TOKU_TEST_FILENAME, envflags & ~DB_RECOVER, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = env->close(env, 0); CKERR(r);
exit(0);
diff --git a/storage/tokudb/ft-index/src/tests/recover-missing-dbfile.cc b/storage/tokudb/ft-index/src/tests/recover-missing-dbfile.cc
index 1287ac71c18..a71f91d7417 100644
--- a/storage/tokudb/ft-index/src/tests/recover-missing-dbfile.cc
+++ b/storage/tokudb/ft-index/src/tests/recover-missing-dbfile.cc
@@ -109,9 +109,7 @@ static void run_test (void) {
DB *dba;
r = db_env_create(&env, 0); CKERR(r);
-#if IS_TDB
db_env_enable_engine_status(0); // disable engine status on crash because test is expected to fail
-#endif
r = env->open(env, TOKU_TEST_FILENAME, envflags, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = db_create(&dba, env, 0); CKERR(r);
@@ -151,9 +149,7 @@ static void run_recover (void) {
CKERR(r);
r = db_env_create(&env, 0); CKERR(r);
-#if IS_TDB
db_env_enable_engine_status(0); // disable engine status on crash because test is expected to fail
-#endif
r = env->open(env, TOKU_TEST_FILENAME, envflags + DB_RECOVER, S_IRWXU+S_IRWXG+S_IRWXO);
CKERR2(r, DB_RUNRECOVERY);
@@ -175,9 +171,7 @@ static void run_no_recover (void) {
int r;
r = db_env_create(&env, 0); CKERR(r);
-#if IS_TDB
db_env_enable_engine_status(0); // disable engine status on crash because test is expected to fail
-#endif
r = env->open(env, TOKU_TEST_FILENAME, envflags & ~DB_RECOVER, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = env->close(env, 0); CKERR(r);
exit(0);
diff --git a/storage/tokudb/ft-index/src/tests/recover-upgrade-db-descriptor-multihandle.cc b/storage/tokudb/ft-index/src/tests/recover-upgrade-db-descriptor-multihandle.cc
index 67ffd36560f..3914badda0b 100644
--- a/storage/tokudb/ft-index/src/tests/recover-upgrade-db-descriptor-multihandle.cc
+++ b/storage/tokudb/ft-index/src/tests/recover-upgrade-db-descriptor-multihandle.cc
@@ -105,8 +105,6 @@ const char *namea="a.db";
int verified = 0;
uint32_t forced_version = 2;
-#if USE_TDB
-
static int my_compare(DB *UU(db), const DBT *a, const DBT *b) {
assert(db);
assert(db->cmp_descriptor);
@@ -121,18 +119,14 @@ static int my_compare(DB *UU(db), const DBT *a, const DBT *b) {
return memcmp(a->data, b->data, a->size);
}
-#endif
-
static void
change_descriptor(DB* db, int which, DB_ENV* env) {
-#if USE_TDB
DBT descriptor;
size_t len = strlen(descriptor_contents[which])+1;
dbt_init(&descriptor, descriptor_contents[which], len);
IN_TXN_COMMIT(env, NULL, txn_desc, 0, {
{ int chk_r = db->change_descriptor(db, txn_desc, &descriptor, DB_UPDATE_CMP_DESCRIPTOR); CKERR(chk_r); }
});
-#endif
}
static void
@@ -146,9 +140,7 @@ do_x1_shutdown (bool do_commit, bool do_abort) {
DB *dba, *dbb;
r = db_env_create(&env, 0); CKERR(r);
r = env->set_data_dir(env, "data"); CKERR(r);
-#if USE_TDB
r = env->set_default_bt_compare(env, my_compare); CKERR(r);
-#endif
r = env->open(env, TOKU_TEST_FILENAME, envflags, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = db_create(&dba, env, 0); CKERR(r);
@@ -194,9 +186,7 @@ do_x1_recover (bool did_commit) {
r = toku_os_mkdir(datadir, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = db_env_create(&env, 0); CKERR(r);
r = env->set_data_dir(env, "data"); CKERR(r);
-#if USE_TDB
r = env->set_default_bt_compare(env, my_compare); CKERR(r);
-#endif
r = env->open(env, TOKU_TEST_FILENAME, envflags|DB_RECOVER, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = db_create(&dba, env, 0); CKERR(r);
r = dba->open(dba, NULL, namea, NULL, DB_BTREE, DB_AUTO_COMMIT|DB_CREATE, 0666); CKERR(r);
diff --git a/storage/tokudb/ft-index/src/tests/recover-upgrade-db-descriptor.cc b/storage/tokudb/ft-index/src/tests/recover-upgrade-db-descriptor.cc
index 31cacc9d354..5bf6e1be049 100644
--- a/storage/tokudb/ft-index/src/tests/recover-upgrade-db-descriptor.cc
+++ b/storage/tokudb/ft-index/src/tests/recover-upgrade-db-descriptor.cc
@@ -105,8 +105,6 @@ const char *namea="a.db";
int verified = 0;
uint32_t forced_version = 2;
-#if USE_TDB
-
static int my_compare(DB *UU(db), const DBT *a, const DBT *b) {
assert(db);
assert(db->cmp_descriptor);
@@ -121,18 +119,14 @@ static int my_compare(DB *UU(db), const DBT *a, const DBT *b) {
return memcmp(a->data, b->data, a->size);
}
-#endif
-
static void
change_descriptor(DB* db, int which, DB_ENV* env) {
-#if USE_TDB
DBT descriptor;
size_t len = strlen(descriptor_contents[which])+1;
dbt_init(&descriptor, descriptor_contents[which], len);
IN_TXN_COMMIT(env, NULL, txn_desc, 0, {
{ int chk_r = db->change_descriptor(db, txn_desc, &descriptor, DB_UPDATE_CMP_DESCRIPTOR); CKERR(chk_r); }
});
-#endif
}
static void
@@ -146,9 +140,7 @@ do_x1_shutdown (bool do_commit, bool do_abort) {
DB *dba;
r = db_env_create(&env, 0); CKERR(r);
r = env->set_data_dir(env, "data"); CKERR(r);
-#if USE_TDB
r = env->set_default_bt_compare(env, my_compare); CKERR(r);
-#endif
r = env->open(env, TOKU_TEST_FILENAME, envflags, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = db_create(&dba, env, 0); CKERR(r);
@@ -197,9 +189,7 @@ do_x1_recover (bool did_commit) {
r = toku_os_mkdir(datadir, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = db_env_create(&env, 0); CKERR(r);
r = env->set_data_dir(env, "data"); CKERR(r);
-#if USE_TDB
r = env->set_default_bt_compare(env, my_compare); CKERR(r);
-#endif
r = env->open(env, TOKU_TEST_FILENAME, envflags|DB_RECOVER, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = db_create(&dba, env, 0); CKERR(r);
r = dba->open(dba, NULL, namea, NULL, DB_BTREE, DB_AUTO_COMMIT|DB_CREATE, 0666); CKERR(r);
diff --git a/storage/tokudb/ft-index/src/tests/recovery_stress.cc b/storage/tokudb/ft-index/src/tests/recovery_stress.cc
index 26190bae824..9e6b3117031 100644
--- a/storage/tokudb/ft-index/src/tests/recovery_stress.cc
+++ b/storage/tokudb/ft-index/src/tests/recovery_stress.cc
@@ -95,7 +95,7 @@ PATENT RIGHTS GRANT:
#include "checkpoint_test.h"
-static const uint64_t max_windows_cachesize = 256 << 20;
+static const uint64_t max_cachesize = 256 << 20;
static const int NUM_DICTIONARIES = 1;
static const int OPER_STEPS = 6;
@@ -495,7 +495,7 @@ static void run_test (int iter) {
uint64_t cachebytes = 0; // 0 => use default size
const int32_t K256 = 256 * 1024;
cachebytes = K256 * (iter + 1) - (128 * 1024);
- if (cachebytes > max_windows_cachesize)
+ if (cachebytes > max_cachesize)
cachebytes = 0;
if (iter & 2) cachebytes = 0; // use default cachesize half the time
diff --git a/storage/tokudb/ft-index/src/tests/root_fifo_2.cc b/storage/tokudb/ft-index/src/tests/root_fifo_2.cc
index 98f209bf769..b8d3ac63f27 100644
--- a/storage/tokudb/ft-index/src/tests/root_fifo_2.cc
+++ b/storage/tokudb/ft-index/src/tests/root_fifo_2.cc
@@ -184,11 +184,7 @@ static void root_fifo_2(int n, int create_outside) {
// cleanup
r = env->close(env, 0);
-#if TOKUDB
assert(r == 0); env = null_env;
-#else
- printf("%s:%d env close r=%d\n", __FUNCTION__, __LINE__, r);
-#endif
}
int test_main(int argc, char *const argv[]) {
diff --git a/storage/tokudb/ft-index/src/tests/rowsize.cc b/storage/tokudb/ft-index/src/tests/rowsize.cc
index 38232321915..0965231e621 100644
--- a/storage/tokudb/ft-index/src/tests/rowsize.cc
+++ b/storage/tokudb/ft-index/src/tests/rowsize.cc
@@ -102,9 +102,7 @@ static void setup_env (void) {
{int r = toku_os_mkdir(envdir, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r); }
{int r = db_env_create(&env, 0); CKERR(r); }
//env->set_errfile(env, stderr);
-#ifdef TOKUDB
CKERR(env->set_redzone(env, 0));
-#endif
{ int r = env->open(env, envdir, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r); }
{ int r = db_create(&db, env, 0); CKERR(r); }
{ int r = db->open(db, NULL, "foo.db", 0, DB_BTREE, DB_CREATE | DB_AUTO_COMMIT, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r); }
@@ -119,14 +117,11 @@ static void put (const char *keystring, int size, bool should_work) {
DBT k, v;
dbt_init(&k, keystring, 1+strlen(keystring));
dbt_init(&v, toku_xcalloc(size, 1), size);
-#ifdef USE_BDB
-#define DB_YES_OVERWRITE 0
-#endif
static DB_TXN *txn = NULL;
{ int r = env->txn_begin(env, 0, &txn, 0); CKERR(r); }
{
int r = db->put(db, NULL, &k, &v, 0);
- if (!IS_TDB || should_work) {
+ if (should_work) {
CKERR(r);
} else {
assert(r!=0);
diff --git a/storage/tokudb/ft-index/src/tests/simple.cc b/storage/tokudb/ft-index/src/tests/simple.cc
index ed55a1e847e..d51cf446f4c 100644
--- a/storage/tokudb/ft-index/src/tests/simple.cc
+++ b/storage/tokudb/ft-index/src/tests/simple.cc
@@ -136,9 +136,7 @@ test_main (int argc, char * const argv[]) {
parse_args(argc, argv);
setup(FLAGS_LOG);
env->txn_checkpoint(env, 0, 0, 0);
-#ifdef USE_TDB
print_engine_status(env);
-#endif
test_shutdown();
return 0;
}
diff --git a/storage/tokudb/ft-index/src/tests/test-prepare.cc b/storage/tokudb/ft-index/src/tests/test-prepare.cc
index a29241596f0..ea3949cf6fe 100644
--- a/storage/tokudb/ft-index/src/tests/test-prepare.cc
+++ b/storage/tokudb/ft-index/src/tests/test-prepare.cc
@@ -103,9 +103,7 @@ static void clean_env (const char *envdir) {
static void setup_env (DB_ENV **envp, const char *envdir) {
{ int chk_r = db_env_create(envp, 0); CKERR(chk_r); }
(*envp)->set_errfile(*envp, stderr);
-#ifdef TOKUDB
{ int chk_r = (*envp)->set_redzone(*envp, 0); CKERR(chk_r); }
-#endif
{ int chk_r = (*envp)->open(*envp, envdir, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|DB_RECOVER, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(chk_r); }
}
diff --git a/storage/tokudb/ft-index/src/tests/test-prepare2.cc b/storage/tokudb/ft-index/src/tests/test-prepare2.cc
index ce4cf4869ef..eb79a1e8e18 100644
--- a/storage/tokudb/ft-index/src/tests/test-prepare2.cc
+++ b/storage/tokudb/ft-index/src/tests/test-prepare2.cc
@@ -105,9 +105,7 @@ static void clean_env (const char *envdir) {
static void setup_env (DB_ENV **envp, const char *envdir) {
{ int chk_r = db_env_create(envp, 0); CKERR(chk_r); }
(*envp)->set_errfile(*envp, stderr);
-#ifdef TOKUDB
{ int chk_r = (*envp)->set_redzone(*envp, 0); CKERR(chk_r); }
-#endif
{ int chk_r = (*envp)->open(*envp, envdir, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|DB_RECOVER, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(chk_r); }
}
diff --git a/storage/tokudb/ft-index/src/tests/test-prepare3.cc b/storage/tokudb/ft-index/src/tests/test-prepare3.cc
index 4cd13050310..352518b8579 100644
--- a/storage/tokudb/ft-index/src/tests/test-prepare3.cc
+++ b/storage/tokudb/ft-index/src/tests/test-prepare3.cc
@@ -105,9 +105,7 @@ static void clean_env (const char *envdir) {
static void setup_env (DB_ENV **envp, const char *envdir) {
{ int chk_r = db_env_create(envp, 0); CKERR(chk_r); }
(*envp)->set_errfile(*envp, stderr);
-#ifdef TOKUDB
{ int chk_r = (*envp)->set_redzone(*envp, 0); CKERR(chk_r); }
-#endif
{ int chk_r = (*envp)->open(*envp, envdir, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|DB_RECOVER, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(chk_r); }
}
diff --git a/storage/tokudb/ft-index/src/tests/test-xa-prepare.cc b/storage/tokudb/ft-index/src/tests/test-xa-prepare.cc
index 751589c5d91..d409eefb382 100644
--- a/storage/tokudb/ft-index/src/tests/test-xa-prepare.cc
+++ b/storage/tokudb/ft-index/src/tests/test-xa-prepare.cc
@@ -103,9 +103,7 @@ static void clean_env (const char *envdir) {
static void setup_env (DB_ENV **envp, const char *envdir) {
{ int chk_r = db_env_create(envp, 0); CKERR(chk_r); }
(*envp)->set_errfile(*envp, stderr);
-#ifdef TOKUDB
{ int chk_r = (*envp)->set_redzone(*envp, 0); CKERR(chk_r); }
-#endif
{ int chk_r = (*envp)->open(*envp, envdir, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|DB_RECOVER, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(chk_r); }
}
diff --git a/storage/tokudb/ft-index/src/tests/test.h b/storage/tokudb/ft-index/src/tests/test.h
index b5ab33ccfee..4cbfcf426d6 100644
--- a/storage/tokudb/ft-index/src/tests/test.h
+++ b/storage/tokudb/ft-index/src/tests/test.h
@@ -107,17 +107,13 @@ PATENT RIGHTS GRANT:
#include "toku_assert.h"
#include <signal.h>
#include <time.h>
-#if defined(USE_TDB)
+
#include "ydb.h"
//TDB uses DB_NOTFOUND for c_del and DB_CURRENT errors.
#ifdef DB_KEYEMPTY
#error
#endif
#define DB_KEYEMPTY DB_NOTFOUND
-#endif
-#ifndef DB_DELETE_ANY
-#define DB_DELETE_ANY 0
-#endif
// Certain tests fail when row locks taken for read are not shared.
// This switch prevents them from failing so long as read locks are not shared.
@@ -144,13 +140,6 @@ int verbose=0;
fflush(stderr); \
} while (0)
-// If the error code depends on BDB vs TDB use this
-#ifdef USE_TDB
-#define CKERR_depending(r,tdbexpect,bdbexpect) CKERR2(r,tdbexpect)
-#else
-#define CKERR_depending(r,tdbexpect,bdbexpect) CKERR2(r,bdbexpect)
-#endif
-
static __attribute__((__unused__)) void
parse_args (int argc, char * const argv[]) {
const char *argv0=argv[0];
@@ -174,7 +163,6 @@ parse_args (int argc, char * const argv[]) {
}
}
-#ifdef USE_TDB
static __attribute__((__unused__)) void
print_engine_status(DB_ENV * UU(env)) {
if (verbose) { // verbose declared statically in this file
@@ -187,9 +175,7 @@ print_engine_status(DB_ENV * UU(env)) {
printf("%s", buff);
}
}
-#endif
-#ifdef USE_TDB
static __attribute__((__unused__)) uint64_t
get_engine_status_val(DB_ENV * UU(env), const char * keyname) {
uint64_t rval = 0;
@@ -213,7 +199,6 @@ get_engine_status_val(DB_ENV * UU(env), const char * keyname) {
CKERR2(found, 1);
return rval;
}
-#endif
static __attribute__((__unused__)) DBT *
dbt_init(DBT *dbt, const void *data, uint32_t size) {
@@ -293,13 +278,8 @@ uint_dbt_cmp (DB *db, const DBT *a, const DBT *b) {
return 0;
}
-#ifdef USE_TDB
#define SET_TRACE_FILE(x) toku_set_trace_file(x)
#define CLOSE_TRACE_FILE(x) toku_close_trace_file()
-#else
-#define SET_TRACE_FILE(x) ((void)0)
-#define CLOSE_TRACE_FILE(x) ((void)0)
-#endif
#include <memory.h>
@@ -361,19 +341,11 @@ void print_time_now(void) {
static void UU()
multiply_locks_for_n_dbs(DB_ENV *env, int num_dbs) {
-#ifdef USE_TDB
uint64_t current_max_lock_memory;
int r = env->get_lk_max_memory(env, &current_max_lock_memory);
CKERR(r);
r = env->set_lk_max_memory(env, current_max_lock_memory * num_dbs);
CKERR(r);
-#else
- uint32_t current_max_locks;
- int r = env->get_lk_max_locks(env, &current_max_locks);
- CKERR(r);
- r = env->set_lk_max_locks(env, current_max_locks * num_dbs);
- CKERR(r);
-#endif
}
static inline void
@@ -402,7 +374,6 @@ static void copy_dbt(DBT *dest, const DBT *src) {
}
// DBT_ARRAY is a toku-specific type
-#ifdef USE_TDB
UU()
static int
env_update_multiple_test_no_array(
@@ -507,7 +478,6 @@ static int env_del_multiple_test_no_array(
}
return r;
}
-#endif
/* Some macros for evaluating blocks or functions within the scope of a
* transaction. */
@@ -535,20 +505,8 @@ main(int argc, char * const argv[])
#endif
{
int r;
-#if IS_TDB && TOKU_WINDOWS
- int rinit = toku_ydb_init();
- CKERR(rinit);
-#endif
-#if !IS_TDB && DB_VERSION_MINOR==4 && DB_VERSION_MINOR == 7
- db_env_set_func_malloc(toku_malloc);
- db_env_set_func_free(toku_free);
- db_env_set_func_realloc(toku_realloc);
-#endif
toku_os_initialize_settings(1);
r = test_main(argc, argv);
-#if IS_TDB && TOKU_WINDOWS
- toku_ydb_destroy();
-#endif
return r;
}
diff --git a/storage/tokudb/ft-index/src/tests/test1426.cc b/storage/tokudb/ft-index/src/tests/test1426.cc
deleted file mode 100644
index 40ca1dee345..00000000000
--- a/storage/tokudb/ft-index/src/tests/test1426.cc
+++ /dev/null
@@ -1,196 +0,0 @@
-/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
-// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
-#ident "$Id$"
-/*
-COPYING CONDITIONS NOTICE:
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of version 2 of the GNU General Public License as
- published by the Free Software Foundation, and provided that the
- following conditions are met:
-
- * Redistributions of source code must retain this COPYING
- CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
- DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
- PATENT MARKING NOTICE (below), and the PATENT RIGHTS
- GRANT (below).
-
- * Redistributions in binary form must reproduce this COPYING
- CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
- DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
- PATENT MARKING NOTICE (below), and the PATENT RIGHTS
- GRANT (below) in the documentation and/or other materials
- provided with the distribution.
-
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-
-COPYRIGHT NOTICE:
-
- TokuDB, Tokutek Fractal Tree Indexing Library.
- Copyright (C) 2007-2013 Tokutek, Inc.
-
-DISCLAIMER:
-
- 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.
-
-UNIVERSITY PATENT NOTICE:
-
- The technology is licensed by the Massachusetts Institute of
- Technology, Rutgers State University of New Jersey, and the Research
- Foundation of State University of New York at Stony Brook under
- United States of America Serial No. 11/760379 and to the patents
- and/or patent applications resulting from it.
-
-PATENT MARKING NOTICE:
-
- This software is covered by US Patent No. 8,185,551.
- This software is covered by US Patent No. 8,489,638.
-
-PATENT RIGHTS GRANT:
-
- "THIS IMPLEMENTATION" means the copyrightable works distributed by
- Tokutek as part of the Fractal Tree project.
-
- "PATENT CLAIMS" means the claims of patents that are owned or
- licensable by Tokutek, both currently or in the future; and that in
- the absence of this license would be infringed by THIS
- IMPLEMENTATION or by using or running THIS IMPLEMENTATION.
-
- "PATENT CHALLENGE" shall mean a challenge to the validity,
- patentability, enforceability and/or non-infringement of any of the
- PATENT CLAIMS or otherwise opposing any of the PATENT CLAIMS.
-
- Tokutek hereby grants to you, for the term and geographical scope of
- the PATENT CLAIMS, a non-exclusive, no-charge, royalty-free,
- irrevocable (except as stated in this section) patent license to
- make, have made, use, offer to sell, sell, import, transfer, and
- otherwise run, modify, and propagate the contents of THIS
- IMPLEMENTATION, where such license applies only to the PATENT
- CLAIMS. This grant does not include claims that would be infringed
- only as a consequence of further modifications of THIS
- IMPLEMENTATION. If you or your agent or licensee institute or order
- or agree to the institution of patent litigation against any entity
- (including a cross-claim or counterclaim in a lawsuit) alleging that
- THIS IMPLEMENTATION constitutes direct or contributory patent
- infringement, or inducement of patent infringement, then any rights
- granted to you under this License shall terminate as of the date
- such litigation is filed. If you or your agent or exclusive
- licensee institute or order or agree to the institution of a PATENT
- CHALLENGE, then Tokutek may terminate any rights granted to you
- under this License.
-*/
-
-#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
-#include "test.h"
-/* Test for #1426. Make sure deletes and inserts in a FIFO work. */
-/* This test is run using a special makefile rule that runs the TDB version and the BDB version, dumps their outputs, and compares them */
-
-#include <db.h>
-#include <memory.h>
-#include <fcntl.h>
-
-// |DB_INIT_TXN| DB_INIT_LOG | DB_RECOVER
-const int envflags = DB_CREATE|DB_INIT_MPOOL|DB_INIT_LOCK |DB_THREAD |DB_PRIVATE;
-
-DB_ENV *env;
-DB *db;
-DB_TXN * const null_txn = NULL;
-
-static void
-empty_cachetable (void)
-// Make all the cachetable entries clean.
-// Brute force it by closing and reopening everything.
-{
- int r;
- r = db->close(db, 0); CKERR(r);
- r = env->close(env, 0); CKERR(r);
- r = db_env_create(&env, 0); CKERR(r);
-#ifdef TOKUDB
- r = env->set_cachesize(env, 0, 10000000, 1); CKERR(r);
-#endif
- r = env->open(env, TOKU_TEST_FILENAME, envflags, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
- r = db_create(&db, env, 0); CKERR(r);
- r = db->open(db, null_txn, "main", 0, DB_BTREE, 0, 0666); CKERR(r);
-}
-
-static void
-do_insert_delete_fifo (void)
-{
- int r;
- toku_os_recursive_delete(TOKU_TEST_FILENAME);
- toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO);
-
- r = db_env_create(&env, 0); CKERR(r);
-#ifdef TOKUDB
- r = env->set_cachesize(env, 0, 10000000, 1); CKERR(r);
-#endif
- r = env->open(env, TOKU_TEST_FILENAME, envflags, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
- r = db_create(&db, env, 0); CKERR(r);
- r = db->set_pagesize(db, 4096); CKERR(r);
- r = db->open(db, null_txn, "main", 0, DB_BTREE, DB_CREATE, 0666); CKERR(r);
- {
- uint64_t i;
- uint64_t n_deleted = 0;
- uint64_t N=20000; // total number to insert
- uint64_t M= 5000; // size of rolling fifo
- uint64_t D= 200; // number to delete at once
- for (i=0; i<N; i++) {
- {
- char k[100],v[100];
- int keylen = snprintf(k, sizeof k, "%016" PRIu64 "key", i);
- uint32_t rand1 = myrandom();
- uint32_t rand2 = myrandom();
- uint32_t rand3 = myrandom();
- int vallen = snprintf(v, sizeof v, "%016" PRIu64 "val%08x%08x%08x", i, rand1, rand2, rand3);
- DBT kt, vt;
- r = db->put(db, null_txn, dbt_init(&kt, k, keylen) , dbt_init(&vt, v, vallen), 0); CKERR(r);
- }
- if (i%D==0) {
- // Once every D steps, delete everything until there are only M things left.
- // Flush the data down the tree for all the values we will do
- {
- uint64_t peek_here = n_deleted;
- while (peek_here + M < i) {
- char k[100];
- int keylen = snprintf(k, sizeof k, "%016" PRIu64 "key", peek_here);
- DBT kt;
- DBT vt;
- memset(&vt, 0, sizeof(vt));
- vt.flags = DB_DBT_MALLOC;
- r = db->get(db, null_txn, dbt_init(&kt, k, keylen), &vt, 0); CKERR(r);
- peek_here++;
- toku_free(vt.data);
- }
- }
- empty_cachetable();
- while (n_deleted + M < i) {
- char k[100];
- int keylen = snprintf(k, sizeof k, "%016" PRIu64 "key", n_deleted);
- DBT kt;
- r = db->del(db, null_txn, dbt_init(&kt, k, keylen), 0);
- if (r!=0) printf("error %d %s", r, db_strerror(r));
- CKERR(r);
- n_deleted++;
- empty_cachetable();
- }
- }
- }
- }
- r = db->close(db, 0); CKERR(r);
- r = env->close(env, 0); CKERR(r);
-}
-
-int
-test_main (int argc, char *const argv[])
-{
- parse_args(argc, argv);
- do_insert_delete_fifo();
- return 0;
-}
-
diff --git a/storage/tokudb/ft-index/src/tests/test1753.cc b/storage/tokudb/ft-index/src/tests/test1753.cc
index 1eee0977f06..d4d09ecaf79 100644
--- a/storage/tokudb/ft-index/src/tests/test1753.cc
+++ b/storage/tokudb/ft-index/src/tests/test1753.cc
@@ -99,10 +99,6 @@ DB_TXN *null_txn=0;
static void do_test1753 (int do_create_on_reopen) {
- if (IS_TDB==0 && DB_VERSION_MAJOR==4 && DB_VERSION_MINOR<7 && do_create_on_reopen==0) {
- return; // do_create_on_reopen==0 segfaults in 4.6
- }
-
int r;
toku_os_recursive_delete(TOKU_TEST_FILENAME);
toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO);
diff --git a/storage/tokudb/ft-index/src/tests/test1842.cc b/storage/tokudb/ft-index/src/tests/test1842.cc
index f5fccfb54bc..43702da5694 100644
--- a/storage/tokudb/ft-index/src/tests/test1842.cc
+++ b/storage/tokudb/ft-index/src/tests/test1842.cc
@@ -137,9 +137,7 @@ setup_db (uint32_t dup_mode) {
toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO);
r = db_env_create(&env, 0); CKERR(r);
-#ifdef TOKUDB
r = env->set_default_bt_compare(env, int_dbt_cmp); CKERR(r);
-#endif
r = env->open(env, TOKU_TEST_FILENAME, DB_INIT_MPOOL | DB_INIT_LOG | DB_INIT_LOCK | DB_INIT_TXN | DB_PRIVATE | DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO);
CKERR(r);
@@ -148,9 +146,6 @@ setup_db (uint32_t dup_mode) {
r = env->txn_begin(env, 0, &txn, 0); CKERR(r);
r = db_create(&db, env, 0); CKERR(r);
-#ifndef TOKUDB
- r=db->set_bt_compare(db, int_dbt_cmp); CKERR(r);
-#endif
r = db->set_flags(db, dup_mode); assert(r == 0); CKERR(r);
r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = txn->commit(txn, 0); CKERR(r);
diff --git a/storage/tokudb/ft-index/src/tests/test3039.cc b/storage/tokudb/ft-index/src/tests/test3039.cc
index e944eb0cd00..aaaeebc7c36 100644
--- a/storage/tokudb/ft-index/src/tests/test3039.cc
+++ b/storage/tokudb/ft-index/src/tests/test3039.cc
@@ -112,11 +112,7 @@ static DB_ENV *env = NULL;
static DB *db;
// BDB cannot handle big transactions by default (runs out of locks).
-#ifdef TOKUDB
#define N_PER_XACTION 10000
-#else
-#define N_PER_XACTION 1000
-#endif
static void create_db (uint64_t N) {
n_rows = N;
@@ -124,9 +120,7 @@ static void create_db (uint64_t N) {
toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO);
{ int r = db_env_create(&env, 0); CKERR(r); }
env->set_errfile(env, stderr);
-#ifdef TOKUDB
env->set_redzone(env, 0);
-#endif
{ int r = env->set_cachesize(env, 0, 400*4096, 1); CKERR(r); }
{ int r = env->open(env, TOKU_TEST_FILENAME, envflags, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r); }
DB_TXN *txn;
diff --git a/storage/tokudb/ft-index/src/tests/test3219.cc b/storage/tokudb/ft-index/src/tests/test3219.cc
index 523b3548271..95bff0f445d 100644
--- a/storage/tokudb/ft-index/src/tests/test3219.cc
+++ b/storage/tokudb/ft-index/src/tests/test3219.cc
@@ -92,7 +92,7 @@ PATENT RIGHTS GRANT:
// This test, when run under helgrind, should detect the race problem documented in #3219.
// The test:
// checkpointing runs (in one thread)
-// another thread does a brt lookup.
+// another thread does an ft lookup.
// We expect to see a lock-acquisition error.
diff --git a/storage/tokudb/ft-index/src/tests/test4573-logtrim.cc b/storage/tokudb/ft-index/src/tests/test4573-logtrim.cc
index a7a121b5d9e..a439f886103 100644
--- a/storage/tokudb/ft-index/src/tests/test4573-logtrim.cc
+++ b/storage/tokudb/ft-index/src/tests/test4573-logtrim.cc
@@ -92,7 +92,7 @@ PATENT RIGHTS GRANT:
const int envflags = DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|DB_RECOVER;
-const int my_lg_max = IS_TDB ? 100 : (4096*2);
+const int my_lg_max = 100;
int test_main (int UU(argc), char UU(*const argv[])) {
int r;
diff --git a/storage/tokudb/ft-index/src/tests/test5092.cc b/storage/tokudb/ft-index/src/tests/test5092.cc
index 5cfc0557496..6572c4df246 100644
--- a/storage/tokudb/ft-index/src/tests/test5092.cc
+++ b/storage/tokudb/ft-index/src/tests/test5092.cc
@@ -103,9 +103,7 @@ static void clean_env (const char *envdir) {
static void setup_env (DB_ENV **envp, const char *envdir) {
{ int chk_r = db_env_create(envp, 0); CKERR(chk_r); }
(*envp)->set_errfile(*envp, stderr);
-#ifdef TOKUDB
{ int chk_r = (*envp)->set_redzone(*envp, 0); CKERR(chk_r); }
-#endif
{ int chk_r = (*envp)->open(*envp, envdir, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|DB_RECOVER, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(chk_r); }
}
diff --git a/storage/tokudb/ft-index/src/tests/test938.cc b/storage/tokudb/ft-index/src/tests/test938.cc
index 5f7af0b618e..bb4b9464a2d 100644
--- a/storage/tokudb/ft-index/src/tests/test938.cc
+++ b/storage/tokudb/ft-index/src/tests/test938.cc
@@ -215,9 +215,7 @@ test_main(int argc, char *const argv[]) {
DB_TXN *txn;
{
r = db_env_create(&env, 0); CKERR(r);
-#ifdef TOKUDB
r = env->set_redzone(env, 0); CKERR(r);
-#endif
r=env->open(env, TOKU_TEST_FILENAME, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
env->set_errfile(env, stderr);
r=env->txn_begin(env, 0, &txn, 0); CKERR(r);
diff --git a/storage/tokudb/ft-index/src/tests/test938c.cc b/storage/tokudb/ft-index/src/tests/test938c.cc
index 6d3d0a6b6e6..f3914ccb302 100644
--- a/storage/tokudb/ft-index/src/tests/test938c.cc
+++ b/storage/tokudb/ft-index/src/tests/test938c.cc
@@ -153,9 +153,7 @@ test_main(int argc, char *const argv[]) {
DB_TXN *txn;
{
r = db_env_create(&env, 0); CKERR(r);
-#ifdef TOKUDB
r = env->set_redzone(env, 0); CKERR(r);
-#endif
r=env->open(env, TOKU_TEST_FILENAME, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
env->set_errfile(env, stderr);
r=env->txn_begin(env, 0, &txn, 0); CKERR(r);
diff --git a/storage/tokudb/ft-index/src/tests/test_abort1.cc b/storage/tokudb/ft-index/src/tests/test_abort1.cc
index 456f5811b73..27f5d68348c 100644
--- a/storage/tokudb/ft-index/src/tests/test_abort1.cc
+++ b/storage/tokudb/ft-index/src/tests/test_abort1.cc
@@ -113,20 +113,6 @@ test_db_open_aborts (void) {
r=db_env_create(&env, 0); assert(r==0);
r=env->open(env, TOKU_TEST_FILENAME, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_PRIVATE|DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r);
-#if 0
- {
- DB_TXN *tid;
- r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
- r=db->open(db, tid, "foo.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
- r=tid->abort(tid); assert(r==0);
- }
- {
- toku_struct_stat buf;
- r=toku_stat(ENVDIR "/foo.db", &buf);
- assert(r!=0);
- assert(errno==ENOENT);
- }
-#endif
{
DB_TXN *tid;
r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
@@ -142,7 +128,6 @@ test_db_open_aborts (void) {
r=tid->abort(tid); assert(r==0);
}
{
-#if USE_TDB
{
DBT dname;
DBT iname;
@@ -152,7 +137,6 @@ test_db_open_aborts (void) {
r = env->get_iname(env, &dname, &iname);
CKERR2(r, DB_NOTFOUND);
}
-#endif
toku_struct_stat statbuf;
char filename[TOKU_PATH_MAX+1];
r = toku_stat(toku_path_join(filename, 2, TOKU_TEST_FILENAME, "foo.db"), &statbuf);
@@ -209,7 +193,6 @@ test_db_put_aborts (void) {
// The database should exist
{
char *filename;
-#if USE_TDB
{
DBT dname;
DBT iname;
@@ -221,9 +204,6 @@ test_db_put_aborts (void) {
CAST_FROM_VOIDP(filename, iname.data);
assert(filename);
}
-#else
- filename = toku_xstrdup("foo.db");
-#endif
toku_struct_stat statbuf;
char fullfile[TOKU_PATH_MAX+1];
r = toku_stat(toku_path_join(fullfile, 2, TOKU_TEST_FILENAME, filename), &statbuf);
diff --git a/storage/tokudb/ft-index/src/tests/test_abort2.cc b/storage/tokudb/ft-index/src/tests/test_abort2.cc
index 6c63717a99d..e8beb73dcf2 100644
--- a/storage/tokudb/ft-index/src/tests/test_abort2.cc
+++ b/storage/tokudb/ft-index/src/tests/test_abort2.cc
@@ -149,13 +149,6 @@ do_test_abort2 (void) {
r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &txn, 0); CKERR(r);
r=db->open(db, txn, "foo.db", 0, DB_BTREE, 0, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
-#ifndef TOKUDB
- {
- uint32_t ps;
- r=db->get_pagesize(db, &ps); CKERR(r);
- assert(ps==4096);
- }
-#endif
r=txn->commit(txn, 0); assert(r==0);
r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
diff --git a/storage/tokudb/ft-index/src/tests/test_abort3.cc b/storage/tokudb/ft-index/src/tests/test_abort3.cc
index 05f810efe45..705ae5cfce2 100644
--- a/storage/tokudb/ft-index/src/tests/test_abort3.cc
+++ b/storage/tokudb/ft-index/src/tests/test_abort3.cc
@@ -120,11 +120,7 @@ static void op_delete (int i) {
int r = db->del(db, txn,
dbt_init(&key, hello, strlen(hello)+1),
DB_DELETE_ANY);
-#ifdef TOKUDB
assert(r==0);
-#else
- assert(r==DB_NOTFOUND || r==0);
-#endif
}
static void lookup (int i, int expect, int expectj) {
diff --git a/storage/tokudb/ft-index/src/tests/test_abort4.cc b/storage/tokudb/ft-index/src/tests/test_abort4.cc
index 73b82d78c40..0d575c78b12 100644
--- a/storage/tokudb/ft-index/src/tests/test_abort4.cc
+++ b/storage/tokudb/ft-index/src/tests/test_abort4.cc
@@ -200,7 +200,6 @@ verify_and_tear_down(int close_first) {
int r;
{
char *filename;
-#if USE_TDB
{
DBT dname;
DBT iname;
@@ -212,9 +211,6 @@ verify_and_tear_down(int close_first) {
CAST_FROM_VOIDP(filename, iname.data);
assert(filename);
}
-#else
- filename = toku_xstrdup("foo.db");
-#endif
toku_struct_stat statbuf;
char fullfile[TOKU_PATH_MAX+1];
r = toku_stat(toku_path_join(fullfile, 2, TOKU_TEST_FILENAME, filename), &statbuf);
diff --git a/storage/tokudb/ft-index/src/tests/test_abort5.cc b/storage/tokudb/ft-index/src/tests/test_abort5.cc
index d8837238dd3..803e0c4fa22 100644
--- a/storage/tokudb/ft-index/src/tests/test_abort5.cc
+++ b/storage/tokudb/ft-index/src/tests/test_abort5.cc
@@ -231,7 +231,6 @@ verify_and_tear_down(int close_first) {
int r;
{
char *filename;
-#if USE_TDB
{
DBT dname;
DBT iname;
@@ -243,9 +242,6 @@ verify_and_tear_down(int close_first) {
CAST_FROM_VOIDP(filename, iname.data);
assert(filename);
}
-#else
- filename = toku_xstrdup("foo.db");
-#endif
toku_struct_stat statbuf;
char fullfile[TOKU_PATH_MAX+1];
r = toku_stat(toku_path_join(fullfile, 2, TOKU_TEST_FILENAME, filename), &statbuf);
diff --git a/storage/tokudb/ft-index/src/tests/test_abort_delete_first.cc b/storage/tokudb/ft-index/src/tests/test_abort_delete_first.cc
index 721414c90dd..ff55cb2e3ae 100644
--- a/storage/tokudb/ft-index/src/tests/test_abort_delete_first.cc
+++ b/storage/tokudb/ft-index/src/tests/test_abort_delete_first.cc
@@ -205,12 +205,12 @@ do_abort_delete_first_or_last(int N,
r=db->close(db, 0); CKERR(r);
r=env->close(env, 0); CKERR(r);
-#if defined(TOKUDB) && defined(__unix__)
- char cmd[sizeof("../../utils/tokudb_dump -h foo.db >") + 2 * TOKU_PATH_MAX];
- snprintf(cmd, sizeof(cmd), "../../utils/tokudb_dump -h %s foo.db > %s", TOKU_TEST_FILENAME, DEV_NULL_FILE);
+
+ // Oh man, this is gross.
+ char cmd[sizeof("../../tools/tokudb_dump -h foo.db >") + 2 * TOKU_PATH_MAX];
+ snprintf(cmd, sizeof(cmd), "../../tools/tokudb_dump -h %s foo.db > %s", TOKU_TEST_FILENAME, DEV_NULL_FILE);
r=system(cmd);
CKERR(r);
-#endif
}
int
diff --git a/storage/tokudb/ft-index/src/tests/test_archive1.cc b/storage/tokudb/ft-index/src/tests/test_archive1.cc
index 1a6f521854f..8aa045b061e 100644
--- a/storage/tokudb/ft-index/src/tests/test_archive1.cc
+++ b/storage/tokudb/ft-index/src/tests/test_archive1.cc
@@ -135,14 +135,7 @@ test_main (int argc, char *const argv[]) {
CKERR(r);
//this test no longer produces a list with any entries for TDB
// - txn_checkpoint trims unused logfiles
-#if IS_TDB
assert(list == 0);
-#else
- assert(list);
- assert(list[0]);
- if (verbose) printf("file[0]=%s\n", list[0]);
- toku_free(list);
-#endif
}
r=db->close(db, 0); CKERR(r);
diff --git a/storage/tokudb/ft-index/src/tests/test_blobs_leaf_split.cc b/storage/tokudb/ft-index/src/tests/test_blobs_leaf_split.cc
index dca73400644..e567e4d58a8 100644
--- a/storage/tokudb/ft-index/src/tests/test_blobs_leaf_split.cc
+++ b/storage/tokudb/ft-index/src/tests/test_blobs_leaf_split.cc
@@ -112,11 +112,7 @@ static void insert(DB *db, DB_TXN *txn, int k, int val_size) {
}
int test_main(int argc, char * const argv[]) {
-#if defined(TOKUDB)
const char *db_env_dir = "dir.blobs.leafsplit.env.tdb";
-#else
- const char *db_env_dir = "dir.blobs.leafsplit.env.bdb";
-#endif
int db_env_open_flags = DB_CREATE | DB_PRIVATE | DB_INIT_MPOOL | DB_INIT_TXN | DB_INIT_LOCK | DB_INIT_LOG;
const char *db_filename = "blobs.db";
int do_txn = 1;
diff --git a/storage/tokudb/ft-index/src/tests/test_cachesize.cc b/storage/tokudb/ft-index/src/tests/test_cachesize.cc
index 2c3357b584b..2af678ff53a 100644
--- a/storage/tokudb/ft-index/src/tests/test_cachesize.cc
+++ b/storage/tokudb/ft-index/src/tests/test_cachesize.cc
@@ -101,10 +101,6 @@ PATENT RIGHTS GRANT:
static uint64_t
size_from (uint32_t gbytes, uint32_t bytes) {
-#ifdef USE_BDB
- if (sizeof (intptr_t) == 4 && gbytes == 4 && bytes == 0)
- return 0xffffffff;
-#endif
return ((uint64_t)gbytes << 30) + bytes;
}
@@ -119,11 +115,6 @@ expect_le (uint64_t a, uint32_t gbytes, uint32_t bytes) {
uint64_t b = size_from(gbytes, bytes);
if (a != b && verbose)
printf("WARNING: expect %" PRIu64 " got %" PRIu64 "\n", a, b);
-#ifdef USE_BDB
- if (a > b) {
- assert(a == 4ULL<<30 && b == a-1); return;
- }
-#endif
assert(a <= b);
}
diff --git a/storage/tokudb/ft-index/src/tests/test_cursor_delete2.cc b/storage/tokudb/ft-index/src/tests/test_cursor_delete2.cc
index bb326c80fc5..73a7182e2fd 100644
--- a/storage/tokudb/ft-index/src/tests/test_cursor_delete2.cc
+++ b/storage/tokudb/ft-index/src/tests/test_cursor_delete2.cc
@@ -125,7 +125,7 @@ test_cursor_delete2 (void) {
r = txn->commit(txn, 0); CKERR(r);
r = dbenv->txn_begin(dbenv, 0, &txn, 0); CKERR(r);
- r = db->del(db, txn, dbt_init(&key, "a", 2), DB_DELETE_ANY); CKERR_depending(r,0,DB_NOTFOUND);
+ r = db->del(db, txn, dbt_init(&key, "a", 2), DB_DELETE_ANY); CKERR(r);
r = txn->commit(txn, 0); CKERR(r);
r = dbenv->txn_begin(dbenv, 0, &txn, 0); CKERR(r);
@@ -139,7 +139,7 @@ test_cursor_delete2 (void) {
r = dbenv->txn_begin(dbenv, 0, &txn, 0); CKERR(r);
r = db->del(db, txn, dbt_init(&key, "a", 2), 0); CKERR(r);
- r = db->del(db, txn, dbt_init(&key, "a", 2), DB_DELETE_ANY); CKERR_depending(r,0,DB_NOTFOUND);
+ r = db->del(db, txn, dbt_init(&key, "a", 2), DB_DELETE_ANY); CKERR(r);
r = txn->commit(txn, 0); CKERR(r);
r = db->close(db, 0); CKERR(r);
diff --git a/storage/tokudb/ft-index/src/tests/test_db_dbt_mem_behavior.cc b/storage/tokudb/ft-index/src/tests/test_db_dbt_mem_behavior.cc
index 36ff6ca45eb..eb5d7f87893 100644
--- a/storage/tokudb/ft-index/src/tests/test_db_dbt_mem_behavior.cc
+++ b/storage/tokudb/ft-index/src/tests/test_db_dbt_mem_behavior.cc
@@ -223,14 +223,12 @@ test_main(int argc, char *const argv[]) {
assert(!was_truncated);
bool ulen_should_change = false;
-#if defined(USE_TDB)
if (flags[j] == DB_DBT_REALLOC) {
ulen_should_change = (bool)(old_ulen < sizeof(DATA));
}
else if (flags[j] == DB_DBT_MALLOC) {
ulen_should_change = (bool)(old_ulen != sizeof(DATA)*2);
}
-#endif
assert(ulen_should_change == (bool)ulen_changed);
assert(size_full);
assert(doclone == !small_buffer);
diff --git a/storage/tokudb/ft-index/src/tests/test_db_delete.cc b/storage/tokudb/ft-index/src/tests/test_db_delete.cc
index 8b4337bae85..66fc506d44b 100644
--- a/storage/tokudb/ft-index/src/tests/test_db_delete.cc
+++ b/storage/tokudb/ft-index/src/tests/test_db_delete.cc
@@ -136,9 +136,7 @@ test_db_delete (int n, int dup_mode) {
/* create the dup database file */
DB_ENV *env;
r = db_env_create(&env, 0); assert(r == 0);
-#ifdef TOKUDB
r = env->set_redzone(env, 0); assert(r == 0);
-#endif
r = env->open(env, TOKU_TEST_FILENAME, DB_CREATE+DB_PRIVATE+DB_INIT_MPOOL, 0); assert(r == 0);
DB *db;
@@ -179,16 +177,7 @@ test_db_delete (int n, int dup_mode) {
}
expect_db_del(db, htonl(n), 0, DB_NOTFOUND);
-#if defined(USE_TDB)
expect_db_del(db, htonl(n), DB_DELETE_ANY, 0);
-#endif
-#if defined(USE_BDB) && defined(DB_DELETE_ANY)
- #if DB_DELETE_ANY == 0
- expect_db_del(db, htonl(n), DB_DELETE_ANY, DB_NOTFOUND);
- #else
- expect_db_del(db, htonl(n), DB_DELETE_ANY, EINVAL);
- #endif
-#endif
r = db->close(db, 0); assert(r == 0);
r = env->close(env, 0); assert(r == 0);
@@ -208,9 +197,7 @@ test_db_get_datasize0 (void) {
/* create the dup database file */
DB_ENV *env;
r = db_env_create(&env, 0); assert(r == 0);
-#ifdef TOKUDB
r = env->set_redzone(env, 0); assert(r == 0);
-#endif
r = env->open(env, TOKU_TEST_FILENAME, DB_CREATE+DB_PRIVATE+DB_INIT_MPOOL, 0); assert(r == 0);
DB *db;
diff --git a/storage/tokudb/ft-index/src/tests/test_db_env_open_nocreate.cc b/storage/tokudb/ft-index/src/tests/test_db_env_open_nocreate.cc
index be3deef6c6d..a690a4f33a9 100644
--- a/storage/tokudb/ft-index/src/tests/test_db_env_open_nocreate.cc
+++ b/storage/tokudb/ft-index/src/tests/test_db_env_open_nocreate.cc
@@ -117,11 +117,7 @@ test_main(int argc, char *const argv[]) {
int do_private;
for (do_private=0; do_private<2; do_private++) {
-#ifdef USE_TDB
if (do_private==0) continue; // See #208.
-#else
- if (do_private==1) continue; // See #530. BDB 4.6.21 segfaults if DB_PRIVATE is passed when no environment previously exists.
-#endif
int private_flags = do_private ? (DB_CREATE|DB_PRIVATE) : 0;
toku_os_recursive_delete(TOKU_TEST_FILENAME);
@@ -136,37 +132,12 @@ test_main(int argc, char *const argv[]) {
r = db_env_create(&dbenv, 0);
CKERR(r);
r = dbenv->open(dbenv, TOKU_TEST_FILENAME, private_flags|DB_INIT_MPOOL, 0);
-#ifdef USE_TDB
// TokuDB has no trouble opening an environment if the directory exists.
CKERR(r);
assert(r==0);
-#else
- if (r!=ENOENT) printf("%s:%d %d: %s\n", __FILE__, __LINE__, r,db_strerror(r));
- assert(r==ENOENT);
-#endif
dbenv->close(dbenv,0); // free memory
}
-#ifndef USE_TDB
- // Now make sure that if we have a non-private DB that we can tell if it opened or not.
- DB *db;
- toku_os_recursive_delete(TOKU_TEST_FILENAME);
- toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO);
- r = db_env_create(&dbenv, 0);
- CKERR(r);
- r = dbenv->open(dbenv, TOKU_TEST_FILENAME, DB_CREATE|DB_INIT_MPOOL, 0);
- CKERR(r);
- r=db_create(&db, dbenv, 0);
- CKERR(r);
- db->close(db, 0);
- dbenv->close(dbenv,0); // free memory
- r = db_env_create(&dbenv, 0);
- CKERR(r);
- r = dbenv->open(dbenv, TOKU_TEST_FILENAME, DB_INIT_MPOOL, 0);
- CKERR(r);
- dbenv->close(dbenv,0); // free memory
-#endif
-
return 0;
}
diff --git a/storage/tokudb/ft-index/src/tests/test_db_env_open_open_close.cc b/storage/tokudb/ft-index/src/tests/test_db_env_open_open_close.cc
index 58030826b30..d9336a8b48e 100644
--- a/storage/tokudb/ft-index/src/tests/test_db_env_open_open_close.cc
+++ b/storage/tokudb/ft-index/src/tests/test_db_env_open_open_close.cc
@@ -117,18 +117,7 @@ test_main(int argc, char*const* argv) {
r = dbenv->open(dbenv, TOKU_TEST_FILENAME, DB_CREATE|DB_INIT_MPOOL|DB_PRIVATE, 0666);
if (verbose) printf("r=%d\n", r);
-#ifdef USE_TDB
assert(r == EINVAL);
-#elif USE_BDB
-#if DB_VERSION_MAJOR >= 5
- assert(r == EINVAL);
-#else
- if (verbose) printf("test_db_env_open_open_close.bdb skipped. (BDB apparently does not follow the spec).\n");
- assert(r == 0);
-#endif
-#else
-#error
-#endif
r = dbenv->close(dbenv, 0);
assert(r == 0);
diff --git a/storage/tokudb/ft-index/src/tests/test_db_env_set_lg_dir.cc b/storage/tokudb/ft-index/src/tests/test_db_env_set_lg_dir.cc
index bdc1b6ef91a..ffdaf5cb833 100644
--- a/storage/tokudb/ft-index/src/tests/test_db_env_set_lg_dir.cc
+++ b/storage/tokudb/ft-index/src/tests/test_db_env_set_lg_dir.cc
@@ -121,13 +121,8 @@ test_main(int argc, char *const argv[]) {
r = dbenv->open(dbenv, TOKU_TEST_FILENAME, DB_INIT_TXN|DB_INIT_LOG|DB_CREATE|DB_PRIVATE|DB_INIT_MPOOL, 0);
CKERR(r);
-#ifdef USE_TDB
- // According to the BDB man page, you may not call set_lg_dir after doing the open.
- // Some versions of BDB don't actually check this or complain
r = dbenv->set_lg_dir(dbenv, ".");
assert(r == EINVAL);
-#endif
-
r = dbenv->close(dbenv, 0);
assert(r == 0);
diff --git a/storage/tokudb/ft-index/src/tests/test_db_env_set_tmp_dir.cc b/storage/tokudb/ft-index/src/tests/test_db_env_set_tmp_dir.cc
index f9e47e7add0..150b0b29049 100644
--- a/storage/tokudb/ft-index/src/tests/test_db_env_set_tmp_dir.cc
+++ b/storage/tokudb/ft-index/src/tests/test_db_env_set_tmp_dir.cc
@@ -121,13 +121,8 @@ test_main(int argc, char *const argv[]) {
r = dbenv->open(dbenv, TOKU_TEST_FILENAME, DB_CREATE|DB_PRIVATE|DB_INIT_MPOOL, 0);
CKERR(r);
-#ifdef USE_TDB
- // According to the BDB man page, you may not call set_tmp_dir after doing the open.
- // Some versions of BDB don't actually check this or complain
r = dbenv->set_tmp_dir(dbenv, ".");
assert(r == EINVAL);
-#endif
-
r = dbenv->close(dbenv, 0);
assert(r == 0);
diff --git a/storage/tokudb/ft-index/src/tests/test_db_env_strdup_null.cc b/storage/tokudb/ft-index/src/tests/test_db_env_strdup_null.cc
index aa9d50c424f..1f65f7a54ed 100644
--- a/storage/tokudb/ft-index/src/tests/test_db_env_strdup_null.cc
+++ b/storage/tokudb/ft-index/src/tests/test_db_env_strdup_null.cc
@@ -108,13 +108,10 @@ test_main (int UU(argc), char UU(*const argv[])) {
toku_os_recursive_delete(TOKU_TEST_FILENAME);
r=toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0);
-// None of this stuff works with BDB. TDB does more error checking.
-#ifdef USE_TDB
r=env->set_data_dir(env, NULL); assert(r==EINVAL);
r=env->open(env, TOKU_TEST_FILENAME, DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
env->set_errpfx(env, NULL); assert(1); //Did not crash.
r=env->set_tmp_dir(env, NULL); assert(r==EINVAL);
-#endif
r=env->close(env, 0); assert(r==0);
return 0;
}
diff --git a/storage/tokudb/ft-index/src/tests/test_db_get_put_flags.cc b/storage/tokudb/ft-index/src/tests/test_db_get_put_flags.cc
index 328436b4cd3..bb5403732b5 100644
--- a/storage/tokudb/ft-index/src/tests/test_db_get_put_flags.cc
+++ b/storage/tokudb/ft-index/src/tests/test_db_get_put_flags.cc
@@ -136,9 +136,7 @@ setup (uint32_t flags) {
toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO);
/* Open/create primary */
r = db_env_create(&dbenv, 0); assert(r == 0);
-#ifdef USE_TDB
r = dbenv->set_redzone(dbenv, 0); CKERR(r);
-#endif
r = dbenv->open(dbenv, TOKU_TEST_FILENAME, DB_CREATE+DB_PRIVATE+DB_INIT_MPOOL, 0); assert(r == 0);
r = db_create(&dbp, dbenv, 0); CKERR(r);
dbp->set_errfile(dbp,0); // Turn off those annoying errors
@@ -182,13 +180,6 @@ get_bad_flags (DB* db, uint32_t flags, int r_expect, int keyint, int dataint) {
assert(*(int*)data.data == dataint);
}
-#ifdef USE_TDB
-#define EINVAL_FOR_TDB_OK_FOR_BDB EINVAL
-#else
-#define EINVAL_FOR_TDB_OK_FOR_BDB 0
-#endif
-
-
PUT_TEST put_tests[] = {
{0, DB_NODUPDATA, EINVAL, 0, 0}, //r_expect must change to 0, once implemented.
{0, 0, 0, 0, 0},
diff --git a/storage/tokudb/ft-index/src/tests/test_db_remove.cc b/storage/tokudb/ft-index/src/tests/test_db_remove.cc
index f254fbee17c..7c5009a703d 100644
--- a/storage/tokudb/ft-index/src/tests/test_db_remove.cc
+++ b/storage/tokudb/ft-index/src/tests/test_db_remove.cc
@@ -114,11 +114,7 @@ static void test_db_remove (void) {
// Now remove it, while it is open.
r = env->dbremove(env, NULL, fname, 0, 0);
-#ifdef USE_TDB
assert(r!=0);
-#else
- assert(r==0);
-#endif
r = db1->close(db1, 0); assert(r==0);
r = env->close(env, 0); assert(r == 0);
diff --git a/storage/tokudb/ft-index/src/tests/test_db_txn_locks_nonheaviside.cc b/storage/tokudb/ft-index/src/tests/test_db_txn_locks_nonheaviside.cc
index f0eb79d5527..9451b107e1a 100644
--- a/storage/tokudb/ft-index/src/tests/test_db_txn_locks_nonheaviside.cc
+++ b/storage/tokudb/ft-index/src/tests/test_db_txn_locks_nonheaviside.cc
@@ -236,10 +236,8 @@ setup_dbs (void) {
/* Open/create primary */
r = db_env_create(&dbenv, 0);
CKERR(r);
-#ifdef TOKUDB
r = dbenv->set_default_bt_compare(dbenv, int_dbt_cmp);
CKERR(r);
-#endif
uint32_t env_txn_flags = DB_INIT_TXN | DB_INIT_LOCK;
uint32_t env_open_flags = DB_CREATE | DB_PRIVATE | DB_INIT_MPOOL;
r = dbenv->open(dbenv, TOKU_TEST_FILENAME, env_open_flags | env_txn_flags, 0600);
@@ -247,10 +245,6 @@ setup_dbs (void) {
r = db_create(&db, dbenv, 0);
CKERR(r);
-#ifndef TOKUDB
- r = db->set_bt_compare( db, int_dbt_cmp);
- CKERR(r);
-#endif
char a;
for (a = 'a'; a <= 'z'; a++) init_txn(a);
@@ -665,16 +659,6 @@ test (void) {
int
test_main(int argc, char *const argv[]) {
parse_args(argc, argv);
- if (!IS_TDB) {
- if (verbose) {
- printf("Warning: " __FILE__" does not work in BDB.\n");
- }
- } else {
- test();
- /*
- test_abort(0);
- test_abort(DB_DUP | DB_DUPSORT);
- */
- }
+ test();
return 0;
}
diff --git a/storage/tokudb/ft-index/src/tests/test_db_txn_locks_read_uncommitted.cc b/storage/tokudb/ft-index/src/tests/test_db_txn_locks_read_uncommitted.cc
index 5e9a947b9e6..277fbaee8be 100644
--- a/storage/tokudb/ft-index/src/tests/test_db_txn_locks_read_uncommitted.cc
+++ b/storage/tokudb/ft-index/src/tests/test_db_txn_locks_read_uncommitted.cc
@@ -178,10 +178,8 @@ setup_dbs (void) {
/* Open/create primary */
r = db_env_create(&dbenv, 0);
CKERR(r);
-#ifdef TOKUDB
r = dbenv->set_default_bt_compare(dbenv, int_dbt_cmp);
CKERR(r);
-#endif
uint32_t env_txn_flags = DB_INIT_TXN | DB_INIT_LOCK;
uint32_t env_open_flags = DB_CREATE | DB_PRIVATE | DB_INIT_MPOOL;
r = dbenv->open(dbenv, TOKU_TEST_FILENAME, env_open_flags | env_txn_flags, 0600);
@@ -189,10 +187,6 @@ setup_dbs (void) {
r = db_create(&db, dbenv, 0);
CKERR(r);
-#ifndef TOKUDB
- r = db->set_bt_compare( db, int_dbt_cmp);
- CKERR(r);
-#endif
char a;
for (a = 'a'; a <= 'z'; a++) init_txn(a, 0);
@@ -256,28 +250,9 @@ table_scan(char txn, bool success) {
static void
table_prelock(char txn, bool success) {
int r;
-#if defined USE_TDB && USE_TDB
r = db->pre_acquire_table_lock(db, txns[(int)txn]);
if (success) CKERR(r);
else CKERR2s(r, DB_LOCK_NOTGRANTED, DB_LOCK_DEADLOCK);
-#else
- DBT key;
- DBT data;
-
- assert(txns[(int)txn] && cursors[(int)txn]);
- r = cursors[(int)txn]->c_get(cursors[(int)txn],
- dbt_init(&key, 0, 0),
- dbt_init(&data, 0, 0),
- DB_FIRST | DB_RMW);
- while (r==0) {
- r = cursors[(int)txn]->c_get(cursors[(int)txn],
- dbt_init(&key, 0, 0),
- dbt_init(&data, 0, 0),
- DB_NEXT | DB_RMW);
- }
- if (success) CKERR2(r, DB_NOTFOUND);
- else CKERR2s(r, DB_LOCK_NOTGRANTED, DB_LOCK_DEADLOCK);
-#endif
}
static void
diff --git a/storage/tokudb/ft-index/src/tests/test_env_close_flags.cc b/storage/tokudb/ft-index/src/tests/test_env_close_flags.cc
index b393c5e1399..50fcd3fa50a 100644
--- a/storage/tokudb/ft-index/src/tests/test_env_close_flags.cc
+++ b/storage/tokudb/ft-index/src/tests/test_env_close_flags.cc
@@ -114,12 +114,7 @@ test_main (int argc __attribute__((__unused__)), char *const argv[] __attribute
r=db_env_create(&env, 0); assert(r==0);
env->set_errfile(env,0); // Turn off those annoying errors
r=env->close (env, 1);
- //BDB does not check this in some versions
-#if defined(USE_TDB) || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3)
assert(r==EINVAL);
-#else
- assert(r==0);
-#endif
toku_os_recursive_delete(TOKU_TEST_FILENAME);
r=toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
@@ -135,11 +130,6 @@ test_main (int argc __attribute__((__unused__)), char *const argv[] __attribute
env->set_errfile(env,0); // Turn off those annoying errors
r=env->open(env, TOKU_TEST_FILENAME, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_PRIVATE|DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=env->close (env, 1);
- //BDB does not check this.
-#if defined(USE_TDB) || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3)
assert(r==EINVAL);
-#else
- assert(r==0);
-#endif
return 0;
}
diff --git a/storage/tokudb/ft-index/src/tests/test_env_create_db_create.cc b/storage/tokudb/ft-index/src/tests/test_env_create_db_create.cc
index 0425b2191d4..8e706ebf04e 100644
--- a/storage/tokudb/ft-index/src/tests/test_env_create_db_create.cc
+++ b/storage/tokudb/ft-index/src/tests/test_env_create_db_create.cc
@@ -104,13 +104,7 @@ test_main (int UU(argc), char UU(*const argv[])) {
r = db_env_create(&env, 0);
assert(r == 0);
r = db_create(&db, env, 0);
-// BDB doesnt' actually barf on this case.
-#ifdef USE_TDB
assert(r != 0);
-#else
- r = db->close(db, 0);
- assert(r == 0);
-#endif
r = env->close(env, 0);
assert(r == 0);
return 0;
diff --git a/storage/tokudb/ft-index/src/tests/test_env_open_flags.cc b/storage/tokudb/ft-index/src/tests/test_env_open_flags.cc
index 7bded023a29..8d9b147e46d 100644
--- a/storage/tokudb/ft-index/src/tests/test_env_open_flags.cc
+++ b/storage/tokudb/ft-index/src/tests/test_env_open_flags.cc
@@ -125,25 +125,19 @@ test_main(int argc, char *const argv[]) {
toku_os_recursive_delete(TOKU_TEST_FILENAME);
toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO);
-#ifdef USE_TDB
char tracefile[TOKU_PATH_MAX+1];
toku_set_trace_file(toku_path_join(tracefile, 2, TOKU_TEST_FILENAME, "trace.tktrace"));
-#endif
/* test flags */
test_env_open_flags(0, ENOENT);
-#ifdef TOKUDB
// This one segfaults in BDB 4.6.21
test_env_open_flags(DB_PRIVATE, ENOENT);
-#endif
test_env_open_flags(DB_PRIVATE+DB_CREATE, 0);
test_env_open_flags(DB_PRIVATE+DB_CREATE+DB_INIT_MPOOL, 0);
test_env_open_flags(DB_PRIVATE+DB_RECOVER, EINVAL);
test_env_open_flags(DB_PRIVATE+DB_CREATE+DB_INIT_MPOOL+DB_RECOVER, EINVAL);
-#ifdef USE_TDB
toku_close_trace_file();
-#endif
return 0;
}
diff --git a/storage/tokudb/ft-index/src/tests/test_txn_abort8.cc b/storage/tokudb/ft-index/src/tests/test_equal_keys_with_different_bytes.cc
index 176b5544c78..6567822c929 100644
--- a/storage/tokudb/ft-index/src/tests/test_txn_abort8.cc
+++ b/storage/tokudb/ft-index/src/tests/test_equal_keys_with_different_bytes.cc
@@ -30,7 +30,7 @@ COPYING CONDITIONS NOTICE:
COPYRIGHT NOTICE:
TokuDB, Tokutek Fractal Tree Indexing Library.
- Copyright (C) 2007-2013 Tokutek, Inc.
+ Copyright (C) 2014 Tokutek, Inc.
DISCLAIMER:
@@ -86,71 +86,64 @@ PATENT RIGHTS GRANT:
under this License.
*/
-#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
+#ident "Copyright (c) 2014 Tokutek Inc. All rights reserved."
+
+#include <string>
+
#include "test.h"
-#include <stdio.h>
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <memory.h>
-#include <sys/stat.h>
-#include <db.h>
-
-//
-static void
-test_abort_close (void) {
-
-#ifndef USE_TDB
-#if DB_VERSION_MAJOR==4 && DB_VERSION_MINOR==3
- if (verbose) fprintf(stderr, "%s does not work for BDB %d.%d. Not running\n", __FILE__, DB_VERSION_MAJOR, DB_VERSION_MINOR);
- return;
-#else
- toku_os_recursive_delete(TOKU_TEST_FILENAME);
- toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO);
+static int compare_strings_case_insensitive(DB *db, const DBT *a, const DBT *b) {
+ invariant_notnull(db);
+ return strcasecmp(reinterpret_cast<char *>(a->data),
+ reinterpret_cast<char *>(b->data));
+}
+
+static void test_equal_keys_with_different_bytes(void) {
int r;
- DB_ENV *env;
- r = db_env_create(&env, 0); assert(r == 0);
- r = env->set_data_dir(env, TOKU_TEST_FILENAME);
- r = env->set_lg_dir(env, TOKU_TEST_FILENAME);
- env->set_errfile(env, stdout);
- r = env->open(env, 0, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO);
- if (r != 0) printf("%s:%d:%d:%s\n", __FILE__, __LINE__, r, db_strerror(r));
- assert(r == 0);
- DB_TXN *txn = 0;
- r = env->txn_begin(env, 0, &txn, 0); assert(r == 0);
+ DB_ENV *env;
+ r = db_env_create(&env, 0); CKERR(r);
+ r = env->set_default_bt_compare(env, compare_strings_case_insensitive);
+ r = env->open(env, TOKU_TEST_FILENAME, DB_CREATE+DB_PRIVATE+DB_INIT_MPOOL+DB_INIT_TXN, 0); CKERR(r);
DB *db;
- r = db_create(&db, env, 0); assert(r == 0);
- r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
-
- {
- toku_struct_stat statbuf;
- char fullfile[TOKU_PATH_MAX+1];
- r = toku_stat(toku_path_join(fullfile, 2, TOKU_TEST_FILENAME, "test.db"), &statbuf);
- assert(r==0);
- }
-
- // Close before abort.
- r = db->close(db, 0);
-
- r = txn->abort(txn); assert(r == 0);
-
- r = env->close(env, 0); assert(r == 0);
-
- {
- toku_struct_stat statbuf;
- char fullfile[TOKU_PATH_MAX+1];
- r = toku_stat(toku_path_join(fullfile, 2, TOKU_TEST_FILENAME, "test.db"), &statbuf);
- assert(r!=0);
- }
-#endif
-#endif
+ r = db_create(&db, env, 0); CKERR(r);
+ r = db->open(db, NULL, "db", NULL, DB_BTREE, DB_CREATE, 0666); CKERR(r);
+
+ DBT key;
+
+ // put 'key'
+ dbt_init(&key, "key", sizeof("key"));
+ r = db->put(db, NULL, &key, &key, 0); CKERR(r);
+
+ // del 'KEY' - should match 'key'
+ dbt_init(&key, "KEY", sizeof("KEY"));
+ r = db->del(db, NULL, &key, 0); CKERR(r);
+
+ DBT val;
+ char val_buf[10];
+ dbt_init(&val, val_buf, sizeof(val_buf));
+
+ // search should fail for 'key'
+ dbt_init(&key, "key", sizeof("key"));
+ r = db->get(db, NULL, &key, &val, 0); CKERR2(r, DB_NOTFOUND);
+
+ // search should fail for 'KEY'
+ dbt_init(&key, "KEY", sizeof("KEY"));
+ r = db->get(db, NULL, &key, &val, 0); CKERR2(r, DB_NOTFOUND);
+
+ r = db->close(db, 0); CKERR(r);
+ r = env->close(env, 0); CKERR(r);
}
int
-test_main(int UU(argc), char UU(*const argv[])) {
- test_abort_close();
+test_main(int argc, char *const argv[]) {
+ parse_args(argc, argv);
+
+ toku_os_recursive_delete(TOKU_TEST_FILENAME);
+ int r = toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
+
+ test_equal_keys_with_different_bytes();
+
return 0;
}
diff --git a/storage/tokudb/ft-index/src/tests/test_groupcommit_count.cc b/storage/tokudb/ft-index/src/tests/test_groupcommit_count.cc
index acf0d5f7076..c24efb5562f 100644
--- a/storage/tokudb/ft-index/src/tests/test_groupcommit_count.cc
+++ b/storage/tokudb/ft-index/src/tests/test_groupcommit_count.cc
@@ -101,12 +101,7 @@ DB_ENV *env;
DB *db;
int do_sync=1;
-#ifdef TOKUDB
#define NITER 100
-#else
-// BDB is slow. Reduce the work.
-#define NITER 25
-#endif
static void *start_a_thread (void *i_p) {
int *CAST_FROM_VOIDP(which_thread_p, i_p);
@@ -214,12 +209,7 @@ do_test (int N) {
}
}
-#ifdef TOKUDB
int log_max_n_threads_over_10 = 3;
-#else
-// BDB is slow. Reduce the work.
-int log_max_n_threads_over_10 = 2;
-#endif
static void
my_parse_args (int argc, char *const argv[]) {
@@ -267,9 +257,7 @@ test_main (int argc, char *const argv[]) {
prev_count=0;
db_env_set_func_fsync(do_fsync);
-#if TOKUDB
db_env_set_num_bucket_mutexes(32);
-#endif
toku_os_recursive_delete(env_path);
{ int r=toku_os_mkdir(env_path, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0); }
diff --git a/storage/tokudb/ft-index/src/tests/test_locktree_close.cc b/storage/tokudb/ft-index/src/tests/test_locktree_close.cc
index f3d220059b6..10efefd0b62 100644
--- a/storage/tokudb/ft-index/src/tests/test_locktree_close.cc
+++ b/storage/tokudb/ft-index/src/tests/test_locktree_close.cc
@@ -106,7 +106,7 @@ test_cursor (void) {
DB_ENV * env;
DB *db;
DB_TXN * const null_txn = 0;
- const char * const fname = "test.cursor.brt";
+ const char * const fname = "test.cursor.ft";
int r;
/* create the dup database file */
diff --git a/storage/tokudb/ft-index/src/tests/test_log1.cc b/storage/tokudb/ft-index/src/tests/test_log1.cc
index 11e402d7be9..3c03249c845 100644
--- a/storage/tokudb/ft-index/src/tests/test_log1.cc
+++ b/storage/tokudb/ft-index/src/tests/test_log1.cc
@@ -123,7 +123,6 @@ static void make_db (bool close_env) {
CKERR(r);
}
char *filename;
-#if USE_TDB
{
DBT dname;
DBT iname;
@@ -135,10 +134,6 @@ static void make_db (bool close_env) {
CAST_FROM_VOIDP(filename, iname.data);
assert(filename);
}
-#else
- filename = toku_xstrdup("foo.db");
-#endif
-
r=tid->commit(tid, 0); assert(r==0);
r=db->close(db, 0); assert(r==0);
diff --git a/storage/tokudb/ft-index/src/tests/test_log10.cc b/storage/tokudb/ft-index/src/tests/test_log10.cc
index 48535f1871a..599eb16d3ae 100644
--- a/storage/tokudb/ft-index/src/tests/test_log10.cc
+++ b/storage/tokudb/ft-index/src/tests/test_log10.cc
@@ -120,9 +120,7 @@ static void insert_some (int outeri, bool close_env) {
DB *db;
DB_TXN *tid;
r=db_env_create(&env, 0); assert(r==0);
-#if IS_TDB
db_env_enable_engine_status(0); // disable engine status on crash because test is expected to fail
-#endif
r=env->open(env, TOKU_TEST_FILENAME, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|create_flag, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r);
@@ -148,13 +146,6 @@ static void insert_some (int outeri, bool close_env) {
key.data = hello; key.size=strlen(hello)+1;
data.data = there; data.size=strlen(there)+1;
r=db->put(db, tid, &key, &data, 0); CKERR(r);
-#ifndef TOKUDB
- // BDB cannot handle such a big txn.
- if (i%1000==999) {
- r=tid->commit(tid, 0); assert(r==0);
- r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
- }
-#endif
}
r=tid->commit(tid, 0); assert(r==0);
r=db->close(db, 0); assert(r==0);
@@ -173,9 +164,7 @@ static void make_db (bool close_env) {
toku_os_recursive_delete(TOKU_TEST_FILENAME);
r=toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0);
-#if IS_TDB
db_env_enable_engine_status(0); // disable engine status on crash because test is expected to fail
-#endif
r=env->open(env, TOKU_TEST_FILENAME, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r);
diff --git a/storage/tokudb/ft-index/src/tests/test_log1_abort.cc b/storage/tokudb/ft-index/src/tests/test_log1_abort.cc
index 4cc37daec28..f1f8269239e 100644
--- a/storage/tokudb/ft-index/src/tests/test_log1_abort.cc
+++ b/storage/tokudb/ft-index/src/tests/test_log1_abort.cc
@@ -129,15 +129,7 @@ test_main (int UU(argc), char UU(*const argv[])) {
r=tid->abort(tid);
assert(r==0);
r=env->close(env, 0);
-#ifdef USE_BDB
-#if DB_VERSION_MAJOR >= 5
assert(r==0);
-#else
- assert(r==ENOENT);
-#endif
-#else
- assert(r==0);
-#endif
{
toku_struct_stat statbuf;
char filename[TOKU_PATH_MAX+1];
diff --git a/storage/tokudb/ft-index/src/tests/test_log7.cc b/storage/tokudb/ft-index/src/tests/test_log7.cc
index cc38ae92ae3..ca5eb168028 100644
--- a/storage/tokudb/ft-index/src/tests/test_log7.cc
+++ b/storage/tokudb/ft-index/src/tests/test_log7.cc
@@ -122,9 +122,6 @@ static void make_db (bool close_env) {
toku_os_recursive_delete(TOKU_TEST_FILENAME);
r=toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0);
-#ifdef TOKUDB
-
-#endif
r=env->open(env, TOKU_TEST_FILENAME, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
@@ -147,13 +144,11 @@ static void make_db (bool close_env) {
key.data = hello; key.size=strlen(hello)+1;
data.data = there; data.size=strlen(there)+1;
r=db->put(db, tid, &key, &data, 0); assert(r==0);
-#ifndef TOKUDB
// BDB cannot handle this huge transaction even with a lot of locks.
if (i%1000==599) {
r=tid->commit(tid, 0); assert(r==0);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
}
-#endif
}
r=tid->commit(tid, 0); assert(r==0);
r=db->close(db, 0); assert(r==0);
diff --git a/storage/tokudb/ft-index/src/tests/test_log8.cc b/storage/tokudb/ft-index/src/tests/test_log8.cc
index a2c59400013..bf6cad4c66b 100644
--- a/storage/tokudb/ft-index/src/tests/test_log8.cc
+++ b/storage/tokudb/ft-index/src/tests/test_log8.cc
@@ -119,9 +119,7 @@ static void insert_some (int outeri, bool close_env) {
DB *db;
DB_TXN *tid;
r=db_env_create(&env, 0); assert(r==0);
-#if IS_TDB
db_env_enable_engine_status(0); // disable engine status on crash because test is expected to fail
-#endif
r=env->open(env, TOKU_TEST_FILENAME, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|create_flag, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
@@ -166,9 +164,7 @@ static void make_db (bool close_env) {
toku_os_recursive_delete(TOKU_TEST_FILENAME);
r=toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0);
-#if IS_TDB
db_env_enable_engine_status(0); // disable engine status on crash because test is expected to fail
-#endif
r=env->open(env, TOKU_TEST_FILENAME, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r);
diff --git a/storage/tokudb/ft-index/src/tests/test_log9.cc b/storage/tokudb/ft-index/src/tests/test_log9.cc
index c61312f90d2..302eaefb976 100644
--- a/storage/tokudb/ft-index/src/tests/test_log9.cc
+++ b/storage/tokudb/ft-index/src/tests/test_log9.cc
@@ -119,9 +119,7 @@ static void insert_some (int outeri, bool close_env) {
DB *db;
DB_TXN *tid;
r=db_env_create(&env, 0); assert(r==0);
-#if IS_TDB
db_env_enable_engine_status(0); // disable engine status on crash because test is expected to fail
-#endif
r=env->open(env, TOKU_TEST_FILENAME, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE|create_flag, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r);
@@ -165,9 +163,7 @@ static void make_db (bool close_env) {
toku_os_recursive_delete(TOKU_TEST_FILENAME);
r=toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0);
-#if IS_TDB
db_env_enable_engine_status(0); // disable engine status on crash because test is expected to fail
-#endif
r=env->open(env, TOKU_TEST_FILENAME, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r);
diff --git a/storage/tokudb/ft-index/src/tests/test_logflush.cc b/storage/tokudb/ft-index/src/tests/test_logflush.cc
index f7870bee5ce..0c813d4b131 100644
--- a/storage/tokudb/ft-index/src/tests/test_logflush.cc
+++ b/storage/tokudb/ft-index/src/tests/test_logflush.cc
@@ -96,11 +96,7 @@ PATENT RIGHTS GRANT:
// Return the offset
static int
grep_for_in_logs (const char *str) {
-#ifdef TOKUDB
#define lfname "log000000000000.tokulog[0-9]*"
-#else
-#define lfname "log.0000000001"
-#endif
#define COMMAND "grep -F -q"
char lname[TOKU_PATH_MAX+1];
toku_path_join(lname, 2, TOKU_TEST_FILENAME, lfname);
diff --git a/storage/tokudb/ft-index/src/tests/test_logmax.cc b/storage/tokudb/ft-index/src/tests/test_logmax.cc
index 2ff773a043a..6c8b5a43ee2 100644
--- a/storage/tokudb/ft-index/src/tests/test_logmax.cc
+++ b/storage/tokudb/ft-index/src/tests/test_logmax.cc
@@ -152,11 +152,7 @@ test_logmax (int logmax) {
int effective_max;
if (logmax>0) effective_max = logmax;
else {
-#ifdef TOKUDB
effective_max = 100<<20;
-#else
- effective_max = 10<<20;
-#endif
}
r=env->txn_begin(env, 0, &tid, 0); CKERR(r);
diff --git a/storage/tokudb/ft-index/src/tests/test_reverse_compare_fun.cc b/storage/tokudb/ft-index/src/tests/test_reverse_compare_fun.cc
index 7d569c5bf97..774a78d23b1 100644
--- a/storage/tokudb/ft-index/src/tests/test_reverse_compare_fun.cc
+++ b/storage/tokudb/ft-index/src/tests/test_reverse_compare_fun.cc
@@ -155,10 +155,8 @@ test_reverse_compare (int n) {
/* create the dup database file */
DB_ENV *env;
r = db_env_create(&env, 0); assert(r == 0);
-#ifdef TOKUDB
r = env->set_default_bt_compare(env, reverse_compare);
CKERR(r);
-#endif
r = env->open(env, TOKU_TEST_FILENAME, DB_CREATE+DB_PRIVATE+DB_INIT_MPOOL, 0); assert(r == 0);
DB *db;
@@ -166,10 +164,6 @@ test_reverse_compare (int n) {
CKERR(r);
r = db->set_pagesize(db, 4096);
CKERR(r);
-#ifndef TOKUDB
- r = db->set_bt_compare(db, reverse_compare);
- CKERR(r);
-#endif
r = db->open(db, null_txn, fname, "main", DB_BTREE, DB_CREATE, 0666);
CKERR(r);
@@ -192,10 +186,6 @@ test_reverse_compare (int n) {
CKERR(r);
r = db->set_pagesize(db, 4096);
CKERR(r);
-#ifndef TOKUDB
- r = db->set_bt_compare(db, reverse_compare);
- CKERR(r);
-#endif
r = db->open(db, null_txn, fname, "main", DB_BTREE, 0, 0666);
CKERR(r);
diff --git a/storage/tokudb/ft-index/src/tests/test_set_func_malloc.cc b/storage/tokudb/ft-index/src/tests/test_set_func_malloc.cc
index eea9a913c1c..8efa786b7fd 100644
--- a/storage/tokudb/ft-index/src/tests/test_set_func_malloc.cc
+++ b/storage/tokudb/ft-index/src/tests/test_set_func_malloc.cc
@@ -153,7 +153,6 @@ test1 (void)
db_env_set_func_realloc(brealloc);
db_env_set_func_free(bfree);
-#ifdef USE_TDB
// toku_malloc isn't affected by calling the BDB set_fun_malloc calls.
malloc_counter = realloc_counter = free_counter = 0;
@@ -166,8 +165,6 @@ test1 (void)
db_env_set_func_malloc(NULL);
db_env_set_func_realloc(NULL);
db_env_set_func_free(NULL);
-
-#endif
}
int
diff --git a/storage/tokudb/ft-index/src/tests/test_txn_abort7.cc b/storage/tokudb/ft-index/src/tests/test_txn_abort7.cc
index 144591ca650..8832e950310 100644
--- a/storage/tokudb/ft-index/src/tests/test_txn_abort7.cc
+++ b/storage/tokudb/ft-index/src/tests/test_txn_abort7.cc
@@ -119,7 +119,6 @@ test_abort_create (void) {
{
char *filename;
-#if USE_TDB
{
DBT dname;
DBT iname;
@@ -131,9 +130,6 @@ test_abort_create (void) {
CAST_FROM_VOIDP(filename, iname.data);
assert(filename);
}
-#else
- filename = toku_xstrdup("test.db");
-#endif
toku_struct_stat statbuf;
char fullfile[TOKU_PATH_MAX+1];
r = toku_stat(toku_path_join(fullfile, 2, TOKU_TEST_FILENAME, filename), &statbuf);
@@ -145,7 +141,6 @@ test_abort_create (void) {
r = txn->abort(txn); assert(r == 0);
{
-#if USE_TDB
{
DBT dname;
DBT iname;
@@ -155,7 +150,6 @@ test_abort_create (void) {
r = env->get_iname(env, &dname, &iname);
CKERR2(r, DB_NOTFOUND);
}
-#endif
toku_struct_stat statbuf;
char fullfile[TOKU_PATH_MAX+1];
r = toku_stat(toku_path_join(fullfile, 2, TOKU_TEST_FILENAME, "test.db"), &statbuf);
diff --git a/storage/tokudb/ft-index/src/tests/test_txn_abort9.cc b/storage/tokudb/ft-index/src/tests/test_txn_abort9.cc
deleted file mode 100644
index 48c4ae120e8..00000000000
--- a/storage/tokudb/ft-index/src/tests/test_txn_abort9.cc
+++ /dev/null
@@ -1,162 +0,0 @@
-/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
-// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
-#ident "$Id$"
-/*
-COPYING CONDITIONS NOTICE:
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of version 2 of the GNU General Public License as
- published by the Free Software Foundation, and provided that the
- following conditions are met:
-
- * Redistributions of source code must retain this COPYING
- CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
- DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
- PATENT MARKING NOTICE (below), and the PATENT RIGHTS
- GRANT (below).
-
- * Redistributions in binary form must reproduce this COPYING
- CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
- DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
- PATENT MARKING NOTICE (below), and the PATENT RIGHTS
- GRANT (below) in the documentation and/or other materials
- provided with the distribution.
-
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-
-COPYRIGHT NOTICE:
-
- TokuDB, Tokutek Fractal Tree Indexing Library.
- Copyright (C) 2007-2013 Tokutek, Inc.
-
-DISCLAIMER:
-
- 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.
-
-UNIVERSITY PATENT NOTICE:
-
- The technology is licensed by the Massachusetts Institute of
- Technology, Rutgers State University of New Jersey, and the Research
- Foundation of State University of New York at Stony Brook under
- United States of America Serial No. 11/760379 and to the patents
- and/or patent applications resulting from it.
-
-PATENT MARKING NOTICE:
-
- This software is covered by US Patent No. 8,185,551.
- This software is covered by US Patent No. 8,489,638.
-
-PATENT RIGHTS GRANT:
-
- "THIS IMPLEMENTATION" means the copyrightable works distributed by
- Tokutek as part of the Fractal Tree project.
-
- "PATENT CLAIMS" means the claims of patents that are owned or
- licensable by Tokutek, both currently or in the future; and that in
- the absence of this license would be infringed by THIS
- IMPLEMENTATION or by using or running THIS IMPLEMENTATION.
-
- "PATENT CHALLENGE" shall mean a challenge to the validity,
- patentability, enforceability and/or non-infringement of any of the
- PATENT CLAIMS or otherwise opposing any of the PATENT CLAIMS.
-
- Tokutek hereby grants to you, for the term and geographical scope of
- the PATENT CLAIMS, a non-exclusive, no-charge, royalty-free,
- irrevocable (except as stated in this section) patent license to
- make, have made, use, offer to sell, sell, import, transfer, and
- otherwise run, modify, and propagate the contents of THIS
- IMPLEMENTATION, where such license applies only to the PATENT
- CLAIMS. This grant does not include claims that would be infringed
- only as a consequence of further modifications of THIS
- IMPLEMENTATION. If you or your agent or licensee institute or order
- or agree to the institution of patent litigation against any entity
- (including a cross-claim or counterclaim in a lawsuit) alleging that
- THIS IMPLEMENTATION constitutes direct or contributory patent
- infringement, or inducement of patent infringement, then any rights
- granted to you under this License shall terminate as of the date
- such litigation is filed. If you or your agent or exclusive
- licensee institute or order or agree to the institution of a PATENT
- CHALLENGE, then Tokutek may terminate any rights granted to you
- under this License.
-*/
-
-#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
-#include "test.h"
-#include <stdio.h>
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <memory.h>
-#include <sys/stat.h>
-#include <db.h>
-
-//
-static void
-test_abort_close (void) {
-
-#ifndef USE_TDB
-#if DB_VERSION_MAJOR==4 && DB_VERSION_MINOR==3
- if (verbose) fprintf(stderr, "%s does not work for BDB %d.%d. Not running\n", __FILE__, DB_VERSION_MAJOR, DB_VERSION_MINOR);
- return;
-#else
- toku_os_recursive_delete(TOKU_TEST_FILENAME);
- toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO);
-
- int r;
- DB_ENV *env;
- r = db_env_create(&env, 0); assert(r == 0);
- r = env->set_data_dir(env, TOKU_TEST_FILENAME);
- r = env->set_lg_dir(env, TOKU_TEST_FILENAME);
- env->set_errfile(env, stdout);
- r = env->open(env, 0, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO);
- if (r != 0) printf("%s:%d:%d:%s\n", __FILE__, __LINE__, r, db_strerror(r));
- assert(r == 0);
-
- DB_TXN *txn = 0;
- r = env->txn_begin(env, 0, &txn, 0); assert(r == 0);
-
- DB *db;
- r = db_create(&db, env, 0); assert(r == 0);
- r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
-
- {
- toku_struct_stat statbuf;
- char fullfile[TOKU_PATH_MAX+1];
- r = toku_stat(toku_path_join(fullfile, 2, TOKU_TEST_FILENAME, "test.db"), &statbuf);
- assert(r==0);
- }
-
- // Close before commit.
- r = db->close(db, 0);
- r = txn->commit(txn, 0); CKERR(r);
-
- // Now reopen it
- r = env->txn_begin(env, 0, &txn, 0); CKERR(r);
- r = db_create(&db, env, 0); assert(r == 0);
- r = db->open(db, txn, "test.db", 0, DB_BTREE, 0, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
-
- DBT k,v;
- r = db->put(db, txn, dbt_init(&k, "hello", 6), dbt_init(&v, "there", 6), 0);
- CKERR(r);
-
- r = db->close(db, 0);
-
- r = txn->abort(txn); assert(r == 0);
-
- r = env->close(env, 0); CKERR(r);
-
-#endif
-#endif
-}
-
-int
-test_main(int UU(argc), char UU(*const argv[])) {
- test_abort_close();
- return 0;
-}
diff --git a/storage/tokudb/ft-index/src/tests/test_txn_commit8.cc b/storage/tokudb/ft-index/src/tests/test_txn_commit8.cc
deleted file mode 100644
index 4f4d732dc8b..00000000000
--- a/storage/tokudb/ft-index/src/tests/test_txn_commit8.cc
+++ /dev/null
@@ -1,156 +0,0 @@
-/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
-// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
-#ident "$Id$"
-/*
-COPYING CONDITIONS NOTICE:
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of version 2 of the GNU General Public License as
- published by the Free Software Foundation, and provided that the
- following conditions are met:
-
- * Redistributions of source code must retain this COPYING
- CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
- DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
- PATENT MARKING NOTICE (below), and the PATENT RIGHTS
- GRANT (below).
-
- * Redistributions in binary form must reproduce this COPYING
- CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
- DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
- PATENT MARKING NOTICE (below), and the PATENT RIGHTS
- GRANT (below) in the documentation and/or other materials
- provided with the distribution.
-
- 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., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-
-COPYRIGHT NOTICE:
-
- TokuDB, Tokutek Fractal Tree Indexing Library.
- Copyright (C) 2007-2013 Tokutek, Inc.
-
-DISCLAIMER:
-
- 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.
-
-UNIVERSITY PATENT NOTICE:
-
- The technology is licensed by the Massachusetts Institute of
- Technology, Rutgers State University of New Jersey, and the Research
- Foundation of State University of New York at Stony Brook under
- United States of America Serial No. 11/760379 and to the patents
- and/or patent applications resulting from it.
-
-PATENT MARKING NOTICE:
-
- This software is covered by US Patent No. 8,185,551.
- This software is covered by US Patent No. 8,489,638.
-
-PATENT RIGHTS GRANT:
-
- "THIS IMPLEMENTATION" means the copyrightable works distributed by
- Tokutek as part of the Fractal Tree project.
-
- "PATENT CLAIMS" means the claims of patents that are owned or
- licensable by Tokutek, both currently or in the future; and that in
- the absence of this license would be infringed by THIS
- IMPLEMENTATION or by using or running THIS IMPLEMENTATION.
-
- "PATENT CHALLENGE" shall mean a challenge to the validity,
- patentability, enforceability and/or non-infringement of any of the
- PATENT CLAIMS or otherwise opposing any of the PATENT CLAIMS.
-
- Tokutek hereby grants to you, for the term and geographical scope of
- the PATENT CLAIMS, a non-exclusive, no-charge, royalty-free,
- irrevocable (except as stated in this section) patent license to
- make, have made, use, offer to sell, sell, import, transfer, and
- otherwise run, modify, and propagate the contents of THIS
- IMPLEMENTATION, where such license applies only to the PATENT
- CLAIMS. This grant does not include claims that would be infringed
- only as a consequence of further modifications of THIS
- IMPLEMENTATION. If you or your agent or licensee institute or order
- or agree to the institution of patent litigation against any entity
- (including a cross-claim or counterclaim in a lawsuit) alleging that
- THIS IMPLEMENTATION constitutes direct or contributory patent
- infringement, or inducement of patent infringement, then any rights
- granted to you under this License shall terminate as of the date
- such litigation is filed. If you or your agent or exclusive
- licensee institute or order or agree to the institution of a PATENT
- CHALLENGE, then Tokutek may terminate any rights granted to you
- under this License.
-*/
-
-#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
-#include "test.h"
-#include <stdio.h>
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <memory.h>
-#include <sys/stat.h>
-#include <db.h>
-
-// like test_txn_abort8.c except commit
-static void
-test_abort_close (void) {
-
-#ifndef USE_TDB
-#if DB_VERSION_MAJOR==4 && DB_VERSION_MINOR==3
- if (verbose) fprintf(stderr, "%s does not work for BDB %d.%d. Not running\n", __FILE__, DB_VERSION_MAJOR, DB_VERSION_MINOR);
- return;
-#else
- toku_os_recursive_delete(TOKU_TEST_FILENAME);
- toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO);
-
- int r;
- DB_ENV *env;
- r = db_env_create(&env, 0); assert(r == 0);
- r = env->set_data_dir(env, TOKU_TEST_FILENAME);
- r = env->set_lg_dir(env, TOKU_TEST_FILENAME);
- env->set_errfile(env, stdout);
- r = env->open(env, 0, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO);
- if (r != 0) printf("%s:%d:%d:%s\n", __FILE__, __LINE__, r, db_strerror(r));
- assert(r == 0);
-
- DB_TXN *txn = 0;
- r = env->txn_begin(env, 0, &txn, 0); assert(r == 0);
-
- DB *db;
- r = db_create(&db, env, 0); assert(r == 0);
- r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
-
- {
- toku_struct_stat statbuf;
- char fullfile[TOKU_PATH_MAX+1];
- r = toku_stat(toku_path_join(fullfile, 2, TOKU_TEST_FILENAME, "test.db"), &statbuf);
- assert(r==0);
- }
-
- // Close before commit
- r = db->close(db, 0);
-
- r = txn->commit(txn, 0); assert(r == 0);
-
- r = env->close(env, 0); assert(r == 0);
-
- {
- toku_struct_stat statbuf;
- char fullfile[TOKU_PATH_MAX+1];
- r = toku_stat(toku_path_join(fullfile, 2, TOKU_TEST_FILENAME, "test.db"), &statbuf);
- assert(r==0);
- }
-#endif
-#endif
-}
-
-int
-test_main(int UU(argc), char UU(*const argv[])) {
- test_abort_close();
- return 0;
-}
diff --git a/storage/tokudb/ft-index/src/tests/test_txn_cursor_last.cc b/storage/tokudb/ft-index/src/tests/test_txn_cursor_last.cc
index 62813ab86c3..62cb3984b79 100644
--- a/storage/tokudb/ft-index/src/tests/test_txn_cursor_last.cc
+++ b/storage/tokudb/ft-index/src/tests/test_txn_cursor_last.cc
@@ -291,12 +291,10 @@ test_main(int argc, char *const argv[]) {
parse_args(argc, argv);
- if (IS_TDB) {
- test_txn_cursor_last_1(0);
- test_txn_cursor_last_1(1);
- test_txn_cursor_last_2(0);
- test_txn_cursor_last_2(1);
- }
+ test_txn_cursor_last_1(0);
+ test_txn_cursor_last_1(1);
+ test_txn_cursor_last_2(0);
+ test_txn_cursor_last_2(1);
return 0;
}
diff --git a/storage/tokudb/ft-index/src/tests/test_txn_nested1.cc b/storage/tokudb/ft-index/src/tests/test_txn_nested1.cc
index a5ba6afdfb1..d25e7c61ce2 100644
--- a/storage/tokudb/ft-index/src/tests/test_txn_nested1.cc
+++ b/storage/tokudb/ft-index/src/tests/test_txn_nested1.cc
@@ -125,9 +125,7 @@ setup_db (void) {
toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO);
r = db_env_create(&env, 0); CKERR(r);
-#ifdef TOKUDB
r = env->set_default_bt_compare(env, int_dbt_cmp); CKERR(r);
-#endif
r = env->open(env, TOKU_TEST_FILENAME, DB_INIT_MPOOL | DB_INIT_LOG | DB_INIT_LOCK | DB_INIT_TXN | DB_PRIVATE | DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO);
CKERR(r);
@@ -136,9 +134,6 @@ setup_db (void) {
r = env->txn_begin(env, 0, &txn, 0); CKERR(r);
r = db_create(&db, env, 0); CKERR(r);
-#ifndef TOKUDB
- r = db->set_bt_compare(db, int_dbt_cmp); CKERR(r);
-#endif
r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = txn->commit(txn, 0); CKERR(r);
}
@@ -219,74 +214,6 @@ test_txn_nesting (int depth) {
}
}
-
-#if 0
-static void
-test_txn_abort (int insert, int secondnum) {
- if (verbose) { fprintf(stderr, "%s (%s):%d [%d,%d]\n", __FILE__, __FUNCTION__, __LINE__, insert, secondnum); fflush(stderr); }
- setup_db();
-
- DBT key, val;
- int r;
-
-
- DB_TXN *parent = NULL, *child = NULL;
-
- int i = 1;
- r = env->txn_begin(env, 0, &parent, 0); CKERR(r);
-
- //Insert something as a child
- r = env->txn_begin(env, parent, &child, 0); CKERR(r);
- i = 1;
- r = db->put(db, child, dbt_init(&key, &i, sizeof i), dbt_init(&val, &i, sizeof i), 0);
- CKERR(r);
- r = child->commit(child,DB_TXN_NOSYNC);
- child = NULL;
-
-
- //delete it as a child
- r = env->txn_begin(env, parent, &child, 0); CKERR(r);
- i = secondnum;
- if (insert) {
- r = db->put(db, child, dbt_init(&key, &i, sizeof i), dbt_init(&val, &i, sizeof i), 0);
- CKERR(r);
- }
- else { // delete
- r = db->del(db, child, dbt_init(&key, &i, sizeof i), DB_DELETE_ANY);
- if (IS_TDB) {
- CKERR(r);
- } else {
- CKERR2(r, (secondnum==1 ? 0 : DB_NOTFOUND));
- }
- }
- r = child->commit(child,DB_TXN_NOSYNC);
- child = NULL;
-
- r = parent->abort(parent);
- CKERR(r);
- parent = NULL;
-
-
- {
- DB_TXN *txn = NULL;
- /* walk the db, should be empty */
- r = env->txn_begin(env, 0, &txn, 0); CKERR(r);
- DBC *cursor;
- r = db->cursor(db, txn, &cursor, 0); CKERR(r);
- memset(&key, 0, sizeof key);
- memset(&val, 0, sizeof val);
- r = cursor->c_get(cursor, &key, &val, DB_FIRST);
- CKERR2(r, DB_NOTFOUND);
- r = cursor->c_close(cursor); CKERR(r);
- r = txn->commit(txn, 0);
- }
- r=db->close(db, 0); CKERR(r);
- r=env->close(env, 0); CKERR(r);
-
-}
-
-#endif
-
int
test_main(int argc, char *const argv[]) {
parse_args(argc, argv);
diff --git a/storage/tokudb/ft-index/src/tests/test_txn_nested_abort4.cc b/storage/tokudb/ft-index/src/tests/test_txn_nested_abort4.cc
index 729c5ed44dd..164f1c26d11 100644
--- a/storage/tokudb/ft-index/src/tests/test_txn_nested_abort4.cc
+++ b/storage/tokudb/ft-index/src/tests/test_txn_nested_abort4.cc
@@ -160,11 +160,7 @@ test_txn_abort (int insert, int secondnum) {
}
else { // delete
r = db->del(db, child, dbt_init(&key, &i, sizeof i), DB_DELETE_ANY);
- if (IS_TDB) {
CKERR(r);
- } else {
- CKERR2(r, (secondnum==1 ? 0 : DB_NOTFOUND));
- }
}
r = child->commit(child,DB_TXN_NOSYNC);
child = NULL;
diff --git a/storage/tokudb/ft-index/src/tests/test_weakxaction.cc b/storage/tokudb/ft-index/src/tests/test_weakxaction.cc
index b1ca7e19ba3..3e9e1f25234 100644
--- a/storage/tokudb/ft-index/src/tests/test_weakxaction.cc
+++ b/storage/tokudb/ft-index/src/tests/test_weakxaction.cc
@@ -128,9 +128,6 @@ test_autotxn (uint32_t env_flags, uint32_t db_flags) {
DB_TXN *x1, *x2 = NULL;
r = env->txn_begin(env, 0, &x1, DB_TXN_NOWAIT); CKERR(r);
- #ifdef USE_BDB
- r = env->txn_begin(env, 0, &x2, DB_TXN_NOWAIT); CKERR(r);
- #endif
DBT k1,k2,v1,v2;
dbt_init(&k1, "hello", sizeof "hello");
dbt_init(&k2, "hello", sizeof "hello");
@@ -141,9 +138,6 @@ test_autotxn (uint32_t env_flags, uint32_t db_flags) {
r = db->put(db, x1, &k1, &v1, 0); CKERR(r);
r = db->get(db, x2, &k2, &v2, 0); assert(r==DB_LOCK_DEADLOCK || r==DB_LOCK_NOTGRANTED);
r = x1->commit(x1, 0); CKERR(r);
- #ifdef USE_BDB
- r = x2->commit(x2, 0); assert(r==0);
- #endif
r = db->close(db, 0); CKERR(r);
r = env->close(env, 0); assert(r==0);
}
diff --git a/storage/tokudb/ft-index/src/tests/test_txn_close_open_commit.cc b/storage/tokudb/ft-index/src/tests/time_create_db.cc
index 4f5060b3871..2cc2496f33a 100644
--- a/storage/tokudb/ft-index/src/tests/test_txn_close_open_commit.cc
+++ b/storage/tokudb/ft-index/src/tests/time_create_db.cc
@@ -1,6 +1,6 @@
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
-#ident "$Id$"
+
/*
COPYING CONDITIONS NOTICE:
@@ -86,83 +86,90 @@ PATENT RIGHTS GRANT:
under this License.
*/
-#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
-#include "test.h"
-#include <stdio.h>
+#ident "Copyright (c) 2009-2013 Tokutek Inc. All rights reserved."
+#ident "$Id$"
-#include <stdlib.h>
-#include <unistd.h>
-#include <memory.h>
-#include <sys/stat.h>
+#include "test.h"
+#include <vector>
#include <db.h>
+#include "toku_time.h"
-// Recreate a mysqld crash by closing and opening a db within a transaction.
-// The crash occurs when writing a dirty cachetable pair, so we insert one
-// row.
-static void
-test_txn_close_open_commit (void) {
-
-#ifndef USE_TDB
-#if DB_VERSION_MAJOR==4 && DB_VERSION_MINOR==3
- if (verbose) fprintf(stderr, "%s does not work for BDB %d.%d. Not running\n", __FILE__, DB_VERSION_MAJOR, DB_VERSION_MINOR);
- return;
-#else
- toku_os_recursive_delete(TOKU_TEST_FILENAME);
- toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO);
-
- int r;
- DB_ENV *env;
- r = db_env_create(&env, 0); assert(r == 0);
- r = env->set_data_dir(env, TOKU_TEST_FILENAME);
- r = env->set_lg_dir(env, TOKU_TEST_FILENAME);
- env->set_errfile(env, stdout);
- r = env->open(env, 0, DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_LOCK + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO);
- if (r != 0) printf("%s:%d:%d:%s\n", __FILE__, __LINE__, r, db_strerror(r));
- assert(r == 0);
-
- DB_TXN *txn = 0;
- r = env->txn_begin(env, 0, &txn, 0); assert(r == 0);
-
- DB *db;
- r = db_create(&db, env, 0); assert(r == 0);
- r = db->open(db, txn, "test.db", 0, DB_BTREE, DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
+static void open_dbs(DB_ENV *env, int max_dbs) {
+ std::vector<DB *> dbs;
+ uint64_t t_start = toku_current_time_microsec();
+ // open db's
{
- toku_struct_stat statbuf;
- char fullfile[TOKU_PATH_MAX+1];
- r = toku_stat(toku_path_join(fullfile, 2, TOKU_TEST_FILENAME, "test.db"), &statbuf);
- assert(r==0);
+ uint64_t t0 = toku_current_time_microsec();
+ for (int i = 1; i <= max_dbs; i++) {
+ int r;
+ DB *db = NULL;
+ r = db_create(&db, env, 0);
+ assert(r == 0);
+ char db_name[32];
+ sprintf(db_name, "db%d", i);
+ r = db->open(db, NULL, db_name, NULL, DB_BTREE, DB_CREATE, 0666);
+ assert(r == 0);
+ dbs.push_back(db);
+ if ((i % 100) == 0) {
+ uint64_t t = toku_current_time_microsec();
+ fprintf(stderr, "open %d %" PRIu64 "\n", i, t - t0);
+ t0 = t;
+ }
+ }
}
+ uint64_t t_end = toku_current_time_microsec();
+ fprintf(stderr, "%" PRIu64 "\n", t_end - t_start);
- DBT key, val;
- int k = 1, v = 1;
- r = db->put(db, txn, dbt_init(&key, &k, sizeof k), dbt_init(&val, &v, sizeof v), 0);
- assert(r == 0);
-
- // Close before commit
- r = db->close(db, 0); assert(r == 0);
+ // close db's
+ {
+ uint64_t t0 = toku_current_time_microsec();
+ int i = 1;
+ for (std::vector<DB *>::iterator dbi = dbs.begin(); dbi != dbs.end(); dbi++, i++) {
+ DB *db = *dbi;
+ int r = db->close(db, 0);
+ assert(r == 0);
+ if ((i % 100) == 0) {
+ uint64_t t = toku_current_time_microsec();
+ printf("close %d %" PRIu64 "\n", i, t - t0);
+ t0 = t;
+ }
+ }
+ }
+}
- r = db_create(&db, env, 0); assert(r == 0);
- r = db->open(db, txn, "test.db", 0, DB_UNKNOWN, 0, S_IRWXU+S_IRWXG+S_IRWXO); assert(r == 0);
+int test_main (int argc, char * const argv[]) {
+ int r;
+ int max_dbs = 1;
+
+ // parse_args(argc, argv);
+ for (int i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-v") == 0) {
+ verbose++;
+ continue;
+ }
+ if (strcmp(argv[i], "-q") == 0) {
+ if (verbose > 0) verbose--;
+ continue;
+ }
+ max_dbs = atoi(argv[i]);
+ continue;
+ }
- r = txn->commit(txn, 0); assert(r == 0);
+ toku_os_recursive_delete(TOKU_TEST_FILENAME);
+ r = toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO);
- r = db->close(db, 0); assert(r == 0);
+ DB_ENV *env = NULL;
+ r = db_env_create(&env, 0);
+ assert(r == 0);
+ env->set_errfile(env, stderr);
+ r = env->open(env, TOKU_TEST_FILENAME, DB_INIT_LOCK+DB_INIT_MPOOL+DB_INIT_TXN+DB_INIT_LOG + DB_CREATE + DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO);
+ assert(r == 0);
- r = env->close(env, 0); assert(r == 0);
+ open_dbs(env, max_dbs);
- {
- toku_struct_stat statbuf;
- char fullfile[TOKU_PATH_MAX+1];
- r = toku_stat(toku_path_join(fullfile, 2, TOKU_TEST_FILENAME, "test.db"), &statbuf);
- assert(r==0);
- }
-#endif
-#endif
-}
+ r = env->close(env, 0);
+ assert(r == 0);
-int
-test_main(int UU(argc), char UU(*const argv[])) {
- test_txn_close_open_commit();
return 0;
}
diff --git a/storage/tokudb/ft-index/src/tests/upgrade-test-1.cc b/storage/tokudb/ft-index/src/tests/upgrade-test-1.cc
index 7897f9eb2e3..ef638e3fa8c 100644
--- a/storage/tokudb/ft-index/src/tests/upgrade-test-1.cc
+++ b/storage/tokudb/ft-index/src/tests/upgrade-test-1.cc
@@ -117,7 +117,7 @@ char *db_v4_dir = OLDDATADIR "env_preload.4.2.0.cleanshutdown";
char *db_v4_dir_node4k = OLDDATADIR "env_preload.4.2.0.node4k.cleanshutdown";
char *db_v4_dir_flat = OLDDATADIR "env_preload.4.2.0.flat.cleanshutdown";
-// HACK: Newer versions of the database/brt to use with this old
+// HACK: Newer versions of the database/ft to use with this old
// upgrade test code.
char *db_v6_dir = OLDDATADIR "env_preload.5.0.8.cleanshutdown";
char *db_v6_dir_node4k = OLDDATADIR "env_preload.5.0.8.node4k.cleanshutdown";