mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 03:51:50 +01:00
#3623 change the stat64 test to not expect exact stats. messages may be buffered in the tree and not yet pushed to the leaf refs[t:3623]
git-svn-id: file:///svn/toku/tokudb@32756 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
223071f1e2
commit
a9da862336
1 changed files with 50 additions and 13 deletions
|
@ -56,24 +56,61 @@ test_stat64 (unsigned int N) {
|
|||
}
|
||||
r=txn->commit(txn, 0); CKERR(r);
|
||||
|
||||
// get and verify stats, should be treated as estimates
|
||||
r=env->txn_begin(env, 0, &txn, 0); CKERR(r);
|
||||
DB_BTREE_STAT64 s;
|
||||
r=db->stat64(db, txn, &s); CKERR(r);
|
||||
if (verbose) {
|
||||
r = system("ls -l " ENVDIR);
|
||||
CKERR(r);
|
||||
printf("nkeys=%" PRIu64 "\nndata=%" PRIu64 "\ndsize=%" PRIu64 "\n",
|
||||
s.bt_nkeys, s.bt_ndata, s.bt_dsize);
|
||||
printf("fsize=%" PRIu64 "\n", s.bt_fsize);
|
||||
printf("expected dsize=%" PRIu64 "\n", dsize);
|
||||
{
|
||||
DB_BTREE_STAT64 s;
|
||||
r=db->stat64(db, txn, &s); CKERR(r);
|
||||
if (verbose) {
|
||||
r = system("ls -l " ENVDIR);
|
||||
CKERR(r);
|
||||
printf("nkeys=%" PRIu64 "\nndata=%" PRIu64 "\ndsize=%" PRIu64 "\n",
|
||||
s.bt_nkeys, s.bt_ndata, s.bt_dsize);
|
||||
printf("fsize=%" PRIu64 "\n", s.bt_fsize);
|
||||
printf("expected dsize=%" PRIu64 "\n", dsize);
|
||||
}
|
||||
assert(s.bt_nkeys <= N);
|
||||
assert(s.bt_ndata <= N);
|
||||
assert(s.bt_dsize <= dsize);
|
||||
assert(s.bt_fsize > N);
|
||||
}
|
||||
r=txn->commit(txn, 0); CKERR(r);
|
||||
|
||||
// get the last row, this forces the root estimates to be updated
|
||||
{
|
||||
r = env->txn_begin(env, NULL, &txn, 0); CKERR(r);
|
||||
DBC *c = NULL;
|
||||
r = db->cursor(db, txn, &c, 0); CKERR(r);
|
||||
DBT key = {.size = 0};
|
||||
DBT val = {.size = 0};
|
||||
r = c->c_get(c, &key, &val, DB_LAST);
|
||||
CKERR(r);
|
||||
r = c->c_close(c); CKERR(r);
|
||||
r = txn->commit(txn, 0); CKERR(r);
|
||||
}
|
||||
|
||||
// get and verify stats
|
||||
r=env->txn_begin(env, 0, &txn, 0); CKERR(r);
|
||||
{
|
||||
DB_BTREE_STAT64 s;
|
||||
r=db->stat64(db, txn, &s); CKERR(r);
|
||||
if (verbose) {
|
||||
r = system("ls -l " ENVDIR);
|
||||
CKERR(r);
|
||||
printf("nkeys=%" PRIu64 "\nndata=%" PRIu64 "\ndsize=%" PRIu64 "\n",
|
||||
s.bt_nkeys, s.bt_ndata, s.bt_dsize);
|
||||
printf("fsize=%" PRIu64 "\n", s.bt_fsize);
|
||||
printf("expected dsize=%" PRIu64 "\n", dsize);
|
||||
}
|
||||
assert(s.bt_nkeys == N);
|
||||
assert(s.bt_ndata == N);
|
||||
assert(s.bt_dsize == dsize);
|
||||
assert(s.bt_fsize > N);
|
||||
}
|
||||
assert(s.bt_nkeys==N);
|
||||
assert(s.bt_ndata==N);
|
||||
assert(s.bt_dsize==dsize);
|
||||
assert(s.bt_fsize>N);
|
||||
r=txn->commit(txn, 0); CKERR(r);
|
||||
|
||||
r=db->close(db, 0); CKERR(r);
|
||||
|
||||
r=env->close(env, 0); CKERR(r);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue