Hi guys i'm reading query cache code, and i have some doubts...
mariadb-10.0.1 source:

1)PROTOCOL_LOCAL:
at line: 1412 (Query_cache::store_query)
we have this comment:
/* PROTOCOL_LOCAL results are not cached. */

what's PROTOCOL_LOCAL ? it's the unix socket? windows pipe? embedded? memcache? mysql? another thing like this? or it's the internal mariadb source running queries?


2)the query_size=0 (MDEV-4516)
i was reading at line 1680

  if (is_disabled() || thd->locked_tables_mode || thd->variables.query_cache_type == 0)
    goto err;

and line : 1694
DBUG_ASSERT(query_cache_size != 0);           // otherwise cache would be disabled


why it's isn't used in query_cache_information plugin? 
check that in line 1680 it test the "query_cache_type" too, 
in MDEV-4516 report about size=0 we didn't tested this case!!!

3) i was at line 1886:
  DBUG_PRINT("qcache", ("\
long %d, 4.1: %d, bin_proto: %d, more results %d, pkt_nr: %d, \
CS client: %u, CS result: %u, CS conn: %u, limit: %lu, TZ: 0x%lx, \
sql mode: 0x%llx, sort len: %lu, conncat len: %lu, div_precision: %lu, \
def_week_frmt: %lu, in_trans: %d, autocommit: %d",

is this the "primary key" of the query cache!?!?!?!?!?!?!
could we use a sha1 or another "primary key" method (index [] of the query in cache + '';'+ 5 bytes of a hash key to compare if the index still with the same query)
to easly show query entry "number", and allow a "delete from query_cache_information where key=xxx" function?

at line 1938 we have this maybe the query position on cache ("primary key of query cache")?:
DBUG_PRINT("qcache", ("Query have result 0x%lx", (ulong) query));


4)
there's some more ideas about query cache information plugin  at MDEV-4571, if anyone could read it =)

well that's all =]

--
Roberto Spadim