bug with query cache when using views

Description

must check if this is a bug of query cache, or mdev-4682 qc_info plugin, but looking at sql_cache.cc i think that's something wrong with sql_cache.cc

with qc_info plugin:

QUERY_CACHE_ID

STATEMENT_SCHEMA

STATEMENT_TEXT

1

teste

select * from t

2

teste

select * from v2

3

teste

select * from v

QUERY_CACHE_ID

SCHEMA

TABLE

1

teste

t

2

teste

2 <- THIS SHOULD BE v2

2

teste

t

3

teste

<- THIS SHOULD BE v

3

teste

t

TABLE_SCHEMA

TABLE_NAME

TABLE_HASHED

TABLE_TYPE

QUERIES_IN_CACHE

teste

<- THIS SHOULD BE v

1

NON_TRANSACT <- this should be view?

1

teste

t

1

NON_TRANSACT

3

teste

2 <- THIS SHOULD BE v2

1

NON_TRANSACT <- this should be view?

1


from sql_cache.cc


about non transact with views, i think it's an old point about how store cache information since myisam merge use it as nontransact and connect too, and both don't store anything (like a view)
maybe we could include a HA_CACHE_TBL_VIEW or HA_CACHE_TBL_NO_STORAGE just to look better than NON_TRANSACT (ok it's =0 and don't change anything)


solved:
yeap that's a bug

different (and correct) result with patch:

TABLE_SCHEMA

TABLE_NAME

TABLE_HASHED

TABLE_TYPE

QUERIES_IN_CACHE

teste

vtv

1

NON_TRANSACT

1

teste

tt

1

NON_TRANSACT

3

teste

v

1

NON_TRANSACT

1

QUERY_CACHE_ID

SCHEMA

TABLE

1

teste

v

1

teste

tt

2

teste

tt

3

teste

vtv

3

teste

tt

Environment

None

Status

Assignee

Oleksandr Byelkin

Reporter

Roberto Spadim

Labels

None

External issue ID

None

External issue ID

None

Components

Fix versions

Affects versions

Priority

Critical
Configure