Skip to content

Commit cac2517

Browse files
committed
sql_cacher: Document lookup optimization fields
1 parent 1370ed7 commit cac2517

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

modules/sql_cacher/sql_cacher.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -437,9 +437,7 @@ static int parse_cache_entry(unsigned int type, void *val)
437437
}
438438

439439
end_parsing:
440-
new_entry->next = NULL;
441-
if (*entry_list)
442-
new_entry->next = *entry_list;
440+
new_entry->next = *entry_list;
443441
*entry_list = new_entry;
444442

445443
pkg_free(parse_str_copy.s);

modules/sql_cacher/sql_cacher.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ typedef struct _cache_entry {
8585
unsigned int on_demand;
8686
unsigned int expire;
8787
unsigned int nr_ints, nr_strs;
88+
89+
/* 0=int/1=str bitmask; bits 0 - n, represent each column,
90+
* where n = (entry.nr_columns - 1) */
8891
long long column_types;
92+
8993
rw_lock_t *ref_lock;
9094
struct _cache_entry *next;
9195
} cache_entry_t;
@@ -115,9 +119,9 @@ typedef struct _pv_name_fix
115119
cache_entry_t *c_entry;
116120
db_handlers_t *db_hdls;
117121
pv_elem_t *pv_elem_list;
118-
int col_offset;
119-
int col_nr;
120-
int last_str;
122+
int col_offset; /* this column's data offset in a cachedb value */
123+
int col_nr; /* index of this column in entry->columns */
124+
int last_str; /* 1 if this column is a str and is the last one */
121125
} pv_name_fix_t;
122126

123127
#endif

0 commit comments

Comments
 (0)