MCPcopy Create free account
hub / github.com/MariaDB/server / check_value

Method check_value

sql/sql_expression_cache.cc:215–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213*/
214
215Expression_cache::result Expression_cache_tmptable::check_value(Item **value)
216{
217 int res;
218 DBUG_ENTER("Expression_cache_tmptable::check_value");
219
220 if (cache_table)
221 {
222 DBUG_PRINT("info", ("status: %u has_record %u",
223 (uint)cache_table->status, (uint)ref.has_record));
224 if ((res= join_read_key2(table_thd, NULL, cache_table, &ref)) == 1)
225 DBUG_RETURN(ERROR);
226
227 if (res)
228 {
229 if (((++miss) == EXPCACHE_CHECK_HIT_RATIO_AFTER) &&
230 ((double)hit / ((double)hit + miss)) <
231 EXPCACHE_MIN_HIT_RATE_FOR_MEM_TABLE)
232 {
233 DBUG_PRINT("info",
234 ("Early check: hit rate is not so good to keep the cache"));
235 disable_cache();
236 }
237
238 DBUG_RETURN(MISS);
239 }
240
241 hit++;
242 *value= cached_result;
243 DBUG_RETURN(Expression_cache::HIT);
244 }
245 DBUG_RETURN(Expression_cache::MISS);
246}
247
248
249/**

Callers 1

check_cacheMethod · 0.80

Calls 1

join_read_key2Function · 0.85

Tested by

no test coverage detected