| 4247 | */ |
| 4248 | |
| 4249 | void Query_cache::pack_cache() |
| 4250 | { |
| 4251 | DBUG_ENTER("Query_cache::pack_cache"); |
| 4252 | |
| 4253 | DBUG_EXECUTE("check_querycache",query_cache.check_integrity(1);); |
| 4254 | |
| 4255 | uchar *border = 0; |
| 4256 | Query_cache_block *before = 0; |
| 4257 | size_t gap = 0; |
| 4258 | my_bool ok = 1; |
| 4259 | Query_cache_block *block = first_block; |
| 4260 | DUMP(this); |
| 4261 | |
| 4262 | if (first_block) |
| 4263 | { |
| 4264 | do |
| 4265 | { |
| 4266 | Query_cache_block *next=block->pnext; |
| 4267 | ok = move_by_type(&border, &before, &gap, block); |
| 4268 | block = next; |
| 4269 | } while (ok && block != first_block); |
| 4270 | |
| 4271 | if (border != 0) |
| 4272 | { |
| 4273 | Query_cache_block *new_block = (Query_cache_block *) border; |
| 4274 | new_block->init(gap); |
| 4275 | total_blocks++; |
| 4276 | new_block->pnext = before->pnext; |
| 4277 | before->pnext = new_block; |
| 4278 | new_block->pprev = before; |
| 4279 | new_block->pnext->pprev = new_block; |
| 4280 | insert_into_free_memory_list(new_block); |
| 4281 | } |
| 4282 | DUMP(this); |
| 4283 | } |
| 4284 | |
| 4285 | DBUG_EXECUTE("check_querycache",query_cache.check_integrity(1);); |
| 4286 | DBUG_VOID_RETURN; |
| 4287 | } |
| 4288 | |
| 4289 | |
| 4290 | my_bool Query_cache::move_by_type(uchar **border, |
nothing calls this directly
no test coverage detected