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

Method queries_dump

sql/sql_cache.cc:4784–4848  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4782
4783
4784void Query_cache::queries_dump()
4785{
4786#ifdef DBUG_TRACE
4787 if (!initialized)
4788 {
4789 DBUG_PRINT("qcache", ("Query Cache not initialized"));
4790 return;
4791 }
4792
4793 DBUG_PRINT("qcache", ("------------------"));
4794 DBUG_PRINT("qcache", (" QUERIES"));
4795 DBUG_PRINT("qcache", ("------------------"));
4796 if (queries_blocks != 0)
4797 {
4798 Query_cache_block *block = queries_blocks;
4799 do
4800 {
4801 size_t len;
4802 char *str = (char*) query_cache_query_get_key((uchar*) block, &len, 0);
4803 len-= QUERY_CACHE_FLAGS_SIZE; // Point at flags
4804 Query_cache_query_flags flags;
4805 memcpy(&flags, str+len, QUERY_CACHE_FLAGS_SIZE);
4806 str[len]= 0; // make zero ending DB name
4807 DBUG_PRINT("qcache", ("F: %u C: %u L: %llu T: '%s' (%zu) '%s' '%s'",
4808 flags.client_long_flag,
4809 flags.character_set_client_num,
4810 flags.limit,
4811 flags.time_zone->get_name()->ptr(),
4812 len, str, strend(str)+1));
4813 DBUG_PRINT("qcache", ("-b- %p %p %p %p %p", block,
4814 block->next, block->prev,
4815 block->pnext,block->pprev));
4816 memcpy(str + len, &flags, QUERY_CACHE_FLAGS_SIZE); // restore flags
4817 for (TABLE_COUNTER_TYPE t= 0; t < block->n_tables; t++)
4818 {
4819 Query_cache_table *table= block->table(t)->parent;
4820 DBUG_PRINT("qcache", ("-t- '%s' '%s'", table->db(), table->table()));
4821 }
4822 Query_cache_query *header = block->query();
4823 if (header->result())
4824 {
4825 Query_cache_block *result_block = header->result();
4826 Query_cache_block *result_beg = result_block;
4827 do
4828 {
4829 DBUG_PRINT("qcache", ("-r- %u %zu/%zu %p %p %p %p %p",
4830 (uint) result_block->type,
4831 result_block->length, result_block->used,
4832 result_block,
4833 result_block->next,
4834 result_block->prev,
4835 result_block->pnext,
4836 result_block->pprev));
4837 result_block = result_block->next;
4838 } while ( result_block != result_beg );
4839 }
4840 } while ((block=block->next) != queries_blocks);
4841 }

Callers

nothing calls this directly

Calls 8

strendFunction · 0.85
ptrMethod · 0.45
get_nameMethod · 0.45
tableMethod · 0.45
dbMethod · 0.45
queryMethod · 0.45
resultMethod · 0.45

Tested by

no test coverage detected