mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 23:04:20 +01:00
Addresses #1040
Moved a couple of functions out of the critical path for the common case (only needed for uncommon case) git-svn-id: file:///svn/tokudb@5298 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
ab7a3ca9d3
commit
31aa0af04e
1 changed files with 5 additions and 5 deletions
10
src/ydb.c
10
src/ydb.c
|
@ -1567,17 +1567,12 @@ cleanup:
|
|||
static int toku_c_get_noassociate(DBC * c, DBT * key, DBT * val, u_int32_t flag) {
|
||||
HANDLE_PANICKED_DB(c->dbp);
|
||||
int r = ENOSYS;
|
||||
int r_cursor_op = 0;
|
||||
C_GET_VARS g;
|
||||
memset(&g, 0, sizeof(g));
|
||||
/* Initialize variables. */
|
||||
g.c = c;
|
||||
g.db = c->dbp;
|
||||
g.flag = flag;
|
||||
if (c->i->txn) {
|
||||
g.txn_anc = toku_txn_ancestor(c->i->txn);
|
||||
g.id_anc = toku_txn_get_txnid(g.txn_anc->i->tokutxn);
|
||||
}
|
||||
unsigned int brtflags;
|
||||
toku_brt_get_flags(g.db->i->brt, &brtflags);
|
||||
g.duplicates = (brtflags & TOKU_DB_DUPSORT) != 0;
|
||||
|
@ -1590,6 +1585,11 @@ static int toku_c_get_noassociate(DBC * c, DBT * key, DBT * val, u_int32_t flag)
|
|||
r = toku_brt_cursor_get(c->i->c, key, val, g.flag, txn);
|
||||
goto cleanup;
|
||||
}
|
||||
int r_cursor_op = 0;
|
||||
if (c->i->txn) {
|
||||
g.txn_anc = toku_txn_ancestor(c->i->txn);
|
||||
g.id_anc = toku_txn_get_txnid(g.txn_anc->i->tokutxn);
|
||||
}
|
||||
|
||||
/* If we know what to lock before the cursor op, lock now. */
|
||||
if ((r = toku_c_get_pre_acquire_lock_if_possible(&g, key, val))) goto cleanup;
|
||||
|
|
Loading…
Add table
Reference in a new issue