mirror of
https://github.com/MariaDB/server.git
synced 2025-01-23 07:14:17 +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
53 lines
1.6 KiB
C
53 lines
1.6 KiB
C
/* Check to see that delete_both works on both dup and nodup databases. *
|
|
* For recovery to work right, delete_both must work on both cases.
|
|
* Specifically, for a nodup database delete_both must not remove pairs unless
|
|
* they match both key and value.
|
|
*/
|
|
|
|
#include <unistd.h>
|
|
|
|
#include "brt.h"
|
|
#include "test.h"
|
|
#include "toku_assert.h"
|
|
|
|
static TOKUTXN const null_txn = 0;
|
|
|
|
void doit (void) {
|
|
int r;
|
|
CACHETABLE ct;
|
|
BRT t;
|
|
char fname[] = __FILE__ ".tdb";
|
|
DBT k,v;
|
|
if (verbose) printf("%s\n", __FUNCTION__);
|
|
r = toku_brt_create_cachetable(&ct, 0, ZERO_LSN, NULL_LOGGER); assert(r==0);
|
|
unlink(fname);
|
|
r = toku_brt_create(&t); assert(r==0);
|
|
r = toku_brt_open(t, fname, fname, 0, 1, 1, 0, ct, null_txn, (DB*)0); assert(r==0);
|
|
|
|
r = toku_brt_insert(t, toku_fill_dbt(&k, "a", 2), toku_fill_dbt(&v, "x", 2), null_txn);
|
|
assert(r==0);
|
|
|
|
r = toku_brt_delete_both(t, toku_fill_dbt(&k, "a", 2), toku_fill_dbt(&v, "y", 2), null_txn);
|
|
assert(r==0);
|
|
|
|
r = toku_brt_lookup(t, toku_fill_dbt(&k, "a", 2), toku_init_dbt(&v));
|
|
assert(r==0);
|
|
assert(v.size==2 && strcmp(v.data, "x")==0);
|
|
|
|
r = toku_brt_delete_both(t, toku_fill_dbt(&k, "a", 2), toku_fill_dbt(&v, "x", 2), null_txn);
|
|
assert(r==0);
|
|
|
|
r = toku_brt_lookup(t, toku_fill_dbt(&k, "a", 2), toku_init_dbt(&v));
|
|
assert(r==DB_NOTFOUND);
|
|
|
|
r = toku_close_brt(t, 0); assert(r==0);
|
|
r = toku_cachetable_close(&ct); assert(r==0);
|
|
}
|
|
|
|
int main (int argc, const char *argv[]) {
|
|
default_parse_args(argc, argv);
|
|
doit();
|
|
if (verbose) printf("test ok\n");
|
|
toku_malloc_cleanup();
|
|
return 0;
|
|
}
|