Commit 568d3c45 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Start logging an insert (but don't deal with the bt_compare issue yet. Addresses #27.

git-svn-id: file:///svn/tokudb@745 c7de825b-a66e-492c-adef-691d508d4ae1
parent 3b26eb0b
......@@ -24,7 +24,7 @@ endif
# When debugging, try: valgrind --show-reachable=yes --leak-check=full ./brt-test
default: bins libs
default: bins libs recover tdb_logprint
# Put these one-per-line so that if we insert a new one the svn diff can understand it better.
# Also keep them sorted.
REGRESSION_TESTS = \
......
......@@ -183,6 +183,8 @@ int tokulogger_log_brt_insert_with_no_overwrite (TOKULOGGER logger,
int keylen,
unsigned char *val,
int vallen) {
printf("%s:%d\n", __FILE__, __LINE__);
return 0;
int buflen=(keylen+vallen+4+4 // key and value
+1 // command
+8 // lsn
......@@ -205,6 +207,13 @@ int tokulogger_log_brt_insert_with_no_overwrite (TOKULOGGER logger,
}
int tokulogger_log_phys_add_or_delete_in_leaf (DB *db, TOKUTXN txn, DISKOFF diskoff, int is_add, const struct kv_pair *pair) {
if (is_add) {
BYTESTRING key = { pair->keylen, (char*)kv_pair_key_const(pair) };
BYTESTRING data = { pair->vallen, (char*)kv_pair_val_const(pair) };
printf("Logging insertinleaf\n");
return toku_log_insertinleaf (txn, txn->txnid64, db->i->fileid, diskoff, key, data);
}
assert(0);
if (txn==0) return 0;
assert(db);
int keylen = pair->keylen;
......
......@@ -58,7 +58,11 @@ const struct logtype logtypes[] = {
{"BYTESTRING", "fname"},
{"FILENUM", "filenum"},
NULLFIELD}},
{"insertinleaf", 'I', FA{{"TXNID", "txnid"},
{"FILENUM", "filenum"},
{"DISKOFF", "diskoff"},
{"BYTESTRING", "key"},
{"BYTESTRING", "data"}}},
{0,0,FA{NULLFIELD}}
};
......
......@@ -121,6 +121,9 @@ static void toku_recover_fopen (struct logtype_fopen *c) {
toku_free(fname);
toku_free(c->fname.data);
}
static void toku_recover_insertinleaf (struct logtype_insertinleaf *c) {
c=c;
}
int main (int argc, char *argv[]) {
const char *dir;
......
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