Skip to content
Snippets Groups Projects
Commit a0d9bd78 authored by Howard Chu's avatar Howard Chu
Browse files

ITS#4223 don't store negative results in IDL cache

parent 22f05c67
No related branches found
No related tags found
No related merge requests found
......@@ -1006,7 +1006,7 @@ synced:
if ( !BDB_IDL_IS_RANGE( cx->tmp ) && cx->tmp[0] > 3 )
bdb_idl_sort( cx->tmp, cx->buf );
if ( cx->bdb->bi_idl_cache_max_size ) {
if ( cx->bdb->bi_idl_cache_max_size && !BDB_IDL_IS_ZERO( cx->tmp )) {
char *ptr = ((char *)&cx->id)-1;
cx->key.data = ptr;
cx->key.size = sizeof(ID)+1;
......
......@@ -325,17 +325,17 @@ bdb_idl_cache_put(
bdb_idl_cache_entry_t idl_tmp;
bdb_idl_cache_entry_t *ee;
if ( rc == DB_NOTFOUND || BDB_IDL_IS_ZERO( ids ))
return;
DBT2bv( key, &idl_tmp.kstr );
ee = (bdb_idl_cache_entry_t *) ch_malloc(
sizeof( bdb_idl_cache_entry_t ) );
ee->db = db;
if ( rc == DB_NOTFOUND || BDB_IDL_IS_ZERO( ids )) {
ee->idl = NULL;
} else {
ee->idl = (ID*) ch_malloc( BDB_IDL_SIZEOF ( ids ) );
BDB_IDL_CPY( ee->idl, ids );
}
ee->idl = (ID*) ch_malloc( BDB_IDL_SIZEOF ( ids ) );
BDB_IDL_CPY( ee->idl, ids );
ee->idl_lru_prev = NULL;
ee->idl_lru_next = NULL;
ber_dupbv( &ee->kstr, &idl_tmp.kstr );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment