mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 12:01:42 +01:00
8511ea7372
Also the file numbers can thus be reused. Don't pass the BRT into the flush commands, since the BRT may no longer be present. Put a counter in to see how many rollback records are present. (Addresses #698.) Increment the file version to 4. Fixes #545, #703. Note: All the tests pass except * Many cxx tests are getting valgrind errors. (Addresses #716. Possibly causes #716.) * {{{test_log9.recover}}} fails with "Binary files ... differ". These will presumably be fixed by #711 or #714. (Addresses #711, #714.) * {{{test_log10.recover}}} fails. There are two failures: 1. A valgrind problem (see #718.) (Addresses #718. Possibly causes #718.) 1. The "Binary files ... differ" issue. git-svn-id: file:///svn/tokudb@3486 c7de825b-a66e-492c-adef-691d508d4ae1
54 lines
1.6 KiB
C
54 lines
1.6 KiB
C
/* -*- mode: C; c-basic-offset: 4 -*- */
|
|
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
|
|
|
|
#include "brt.h"
|
|
#include "key.h"
|
|
#include "test.h"
|
|
#include "toku_assert.h"
|
|
#include <unistd.h>
|
|
|
|
static TOKUTXN const null_txn = 0;
|
|
static DB * const null_db = 0;
|
|
|
|
static void test_named_db (void) {
|
|
const char *n0 = "brt-test-named-db-0.brt";
|
|
CACHETABLE ct;
|
|
BRT t0;
|
|
int r;
|
|
DBT k,v;
|
|
|
|
if (verbose) printf("test_named_db\n");
|
|
unlink(n0);
|
|
toku_memory_check_all_free();
|
|
r = toku_brt_create_cachetable(&ct, 0, ZERO_LSN, NULL_LOGGER); assert(r==0);
|
|
r = toku_open_brt(n0, "db1", 1, &t0, 1<<12, ct, null_txn, toku_default_compare_fun, null_db); assert(r==0);
|
|
|
|
toku_brt_insert(t0, toku_fill_dbt(&k, "good", 5), toku_fill_dbt(&v, "day", 4), null_txn); assert(r==0);
|
|
|
|
r = toku_close_brt(t0, 0); assert(r==0);
|
|
r = toku_cachetable_close(&ct); assert(r==0);
|
|
toku_memory_check_all_free();
|
|
|
|
toku_memory_check_all_free();
|
|
r = toku_brt_create_cachetable(&ct, 0, ZERO_LSN, NULL_LOGGER); assert(r==0);
|
|
r = toku_open_brt(n0, "db1", 0, &t0, 1<<12, ct, null_txn, toku_default_compare_fun, null_db); assert(r==0);
|
|
|
|
{
|
|
r = toku_brt_lookup(t0, toku_fill_dbt(&k, "good", 5), toku_init_dbt(&v));
|
|
assert(r==0);
|
|
assert(v.size==4);
|
|
assert(strcmp(v.data,"day")==0);
|
|
}
|
|
|
|
r = toku_close_brt(t0, 0); assert(r==0);
|
|
r = toku_cachetable_close(&ct); assert(r==0);
|
|
toku_memory_check_all_free();
|
|
}
|
|
|
|
int main (int argc , const char *argv[]) {
|
|
default_parse_args(argc, argv);
|
|
test_named_db();
|
|
toku_malloc_cleanup();
|
|
if (verbose) printf("test_named_db ok\n");
|
|
return 0;
|
|
}
|