Commit f7f778a7 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

#3004 verify the undo test callback arguments refs[t:3004]

git-svn-id: file:///svn/toku/tokudb@25613 c7de825b-a66e-492c-adef-691d508d4ae1
parent 3cc827a4
...@@ -185,16 +185,20 @@ put_callback(DB *dest_db, DB *src_db, DBT *dest_key, DBT *dest_data, const DBT * ...@@ -185,16 +185,20 @@ put_callback(DB *dest_db, DB *src_db, DBT *dest_key, DBT *dest_data, const DBT *
return 0; return 0;
} }
static DB_INDEXER *test_indexer = NULL;
static DB *test_hotdb = NULL;
static int static int
test_is_xid_live(DB_INDEXER *indexer, TXNID xid) { test_is_xid_live(DB_INDEXER *indexer, TXNID xid) {
indexer = indexer; invariant(indexer == test_indexer);
int r = is_live(&live_xids, xid); int r = is_live(&live_xids, xid);
return r; return r;
} }
static int static int
test_maybe_lock_provisional_key(DB_INDEXER *indexer, TXNID xid, DB *hotdb, DBT *key) { test_maybe_lock_provisional_key(DB_INDEXER *indexer, TXNID xid, DB *hotdb, DBT *key) {
hotdb = hotdb; invariant(indexer == test_indexer);
invariant(hotdb == test_hotdb);
if (test_is_xid_live(indexer, xid)) { if (test_is_xid_live(indexer, xid)) {
printf("lock [%lu] ", xid); printf("lock [%lu] ", xid);
print_dbt(key); print_dbt(key);
...@@ -205,7 +209,8 @@ test_maybe_lock_provisional_key(DB_INDEXER *indexer, TXNID xid, DB *hotdb, DBT * ...@@ -205,7 +209,8 @@ test_maybe_lock_provisional_key(DB_INDEXER *indexer, TXNID xid, DB *hotdb, DBT *
static int static int
test_delete_provisional(DB_INDEXER *indexer, DB *hotdb, DBT *hotkey, XIDS xids) { test_delete_provisional(DB_INDEXER *indexer, DB *hotdb, DBT *hotkey, XIDS xids) {
indexer = indexer; hotdb = hotdb; invariant(indexer == test_indexer);
invariant(hotdb == test_hotdb);
printf("delete_provisional "); printf("delete_provisional ");
print_xids(xids); print_xids(xids);
print_dbt(hotkey); print_dbt(hotkey);
...@@ -215,7 +220,8 @@ test_delete_provisional(DB_INDEXER *indexer, DB *hotdb, DBT *hotkey, XIDS xids) ...@@ -215,7 +220,8 @@ test_delete_provisional(DB_INDEXER *indexer, DB *hotdb, DBT *hotkey, XIDS xids)
static int static int
test_delete_committed(DB_INDEXER *indexer, DB *hotdb, DBT *hotkey, XIDS xids) { test_delete_committed(DB_INDEXER *indexer, DB *hotdb, DBT *hotkey, XIDS xids) {
indexer = indexer; hotdb = hotdb; invariant(indexer == test_indexer);
invariant(hotdb == test_hotdb);
printf("delete_committed "); printf("delete_committed ");
print_xids(xids); print_xids(xids);
print_dbt(hotkey); print_dbt(hotkey);
...@@ -225,7 +231,8 @@ test_delete_committed(DB_INDEXER *indexer, DB *hotdb, DBT *hotkey, XIDS xids) { ...@@ -225,7 +231,8 @@ test_delete_committed(DB_INDEXER *indexer, DB *hotdb, DBT *hotkey, XIDS xids) {
static int static int
test_insert_provisional(DB_INDEXER *indexer, DB *hotdb, DBT *hotkey, DBT *hotval, XIDS xids) { test_insert_provisional(DB_INDEXER *indexer, DB *hotdb, DBT *hotkey, DBT *hotval, XIDS xids) {
indexer = indexer; hotdb = hotdb; invariant(indexer == test_indexer);
invariant(hotdb == test_hotdb);
printf("insert_provisional "); printf("insert_provisional ");
print_xids(xids); print_xids(xids);
print_dbt(hotkey); print_dbt(hotkey);
...@@ -236,7 +243,8 @@ test_insert_provisional(DB_INDEXER *indexer, DB *hotdb, DBT *hotkey, DBT *hotval ...@@ -236,7 +243,8 @@ test_insert_provisional(DB_INDEXER *indexer, DB *hotdb, DBT *hotkey, DBT *hotval
static int static int
test_insert_committed(DB_INDEXER *indexer, DB *hotdb, DBT *hotkey, DBT *hotval, XIDS xids) { test_insert_committed(DB_INDEXER *indexer, DB *hotdb, DBT *hotkey, DBT *hotval, XIDS xids) {
indexer = indexer; hotdb = hotdb; invariant(indexer == test_indexer);
invariant(hotdb == test_hotdb);
printf("insert_committed "); printf("insert_committed ");
print_xids(xids); print_xids(xids);
print_dbt(hotkey); print_dbt(hotkey);
...@@ -247,7 +255,8 @@ test_insert_committed(DB_INDEXER *indexer, DB *hotdb, DBT *hotkey, DBT *hotval, ...@@ -247,7 +255,8 @@ test_insert_committed(DB_INDEXER *indexer, DB *hotdb, DBT *hotkey, DBT *hotval,
static int static int
test_commit_any(DB_INDEXER *indexer, DB *hotdb, DBT *hotkey, XIDS xids) { test_commit_any(DB_INDEXER *indexer, DB *hotdb, DBT *hotkey, XIDS xids) {
indexer = indexer; hotdb = hotdb; invariant(indexer == test_indexer);
invariant(hotdb == test_hotdb);
printf("commit_any "); printf("commit_any ");
print_xids(xids); print_xids(xids);
print_dbt(hotkey); print_dbt(hotkey);
...@@ -402,6 +411,10 @@ run_test(char *envdir, char *testname) { ...@@ -402,6 +411,10 @@ run_test(char *envdir, char *testname) {
indexer->i->test_insert_committed = test_insert_committed; indexer->i->test_insert_committed = test_insert_committed;
indexer->i->test_commit_any = test_commit_any; indexer->i->test_commit_any = test_commit_any;
// verify indexer and hotdb in the callbacks
test_indexer = indexer;
test_hotdb = dest_db;
// create a ule // create a ule
ULE ule = ule_create(); ULE ule = ule_create();
ule_init(ule); ule_init(ule);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment