[MDEV-25264] Include extended metadata in Query_cache_query_flags Created: 2021-03-26  Updated: 2022-01-20

Status: Stalled
Project: MariaDB Server
Component/s: Query Cache
Affects Version/s: 10.5.9
Fix Version/s: 10.5

Type: Bug Priority: Major
Reporter: Daniel Black Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

https://github.com/MariaDB/server/pull/1756

from wlad - "there will be more to that in 10.6, there is a "skip result set metadata" capability"



 Comments   
Comment by Oleksandr Byelkin [ 2021-04-06 ]

The patch is OK, but it lask test case, please add it.

Comment by Anel Husakovic [ 2021-04-07 ]

sanja I would like to write a test case, some hint where to look for the example ?

Comment by Anel Husakovic [ 2021-04-19 ]

Well this is just extension used when server started with debug variable.

$ ./sql/mysqld   --debug

MariaDB [test]> select @@debug;
+-----------------------------+
| @@debug                     |
+-----------------------------+
| d:i:o,/tmp/mariadbd.trace:t |
+-----------------------------+
1 row in set (0.001 sec)
 
MariaDB [test]> SET LOCAL query_cache_type= ON;
ERROR 1925 (HY000): Query cache is globally disabled and you can't enable it only for this session
MariaDB [test]> SET GLOBAL query_cache_type= ON;
Query OK, 0 rows affected (0.001 sec)
 
 
MariaDB [test]> SET LOCAL query_cache_type= ON;
Query OK, 0 rows affected (0.001 sec)
 
MariaDB [test]> drop table t1,t2,t3;
Query OK, 0 rows affected (0.003 sec)
 
MariaDB [test]> create table t1 (a int not null) ENGINE=MyISAM;
Query OK, 0 rows affected (0.002 sec)
 
MariaDB [test]> insert into t1 values (1),(2),(3);
Query OK, 3 rows affected (0.002 sec)
Records: 3  Duplicates: 0  Warnings: 0
 
MariaDB [test]> create table t2 (a int not null) ENGINE=MyISAM;
Query OK, 0 rows affected (0.010 sec)
 
MariaDB [test]> insert into t2 values (4),(5),(6);
Query OK, 3 rows affected (0.002 sec)
Records: 3  Duplicates: 0  Warnings: 0
 
MariaDB [test]> create table t3 (a int not null) engine=MERGE UNION=(t1,t2) INSERT_METHOD=FIRST;
Query OK, 0 rows affected (0.007 sec)
 
MariaDB [test]> # insert
MariaDB [test]> select * from t3;
+---+
| a |
+---+
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
+---+
6 rows in set (0.002 sec)
 
MariaDB [test]> select * from t3;
+---+
| a |
+---+
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
+---+
6 rows in set (0.000 sec)
 
MariaDB [test]> show status like "Qcache_hits";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Qcache_hits   | 1     |
+---------------+-------+
1 row in set (0.003 sec)
 
MariaDB [test]> show status like "Qcache_queries_in_cache";
+-------------------------+-------+
| Variable_name           | Value |
+-------------------------+-------+
| Qcache_queries_in_cache | 1     |
+-------------------------+-------+
1 row in set (0.003 sec)

Now inspecting the mariadb.trace file, we can get information about the simple change, used by patch from PR #1756:

$ cat /tmp/mariadbd.trace|grep extended
T@18   : | | | | qcache: long 1, 4.1: 1, eof: 0, extended: 1, bin_proto: 0, more results 0, pkt_nr: 1, CS client: 33, CS result: 33, CS conn: 33, limit: 18446744073709551615, TZ: 0x555690098d08, sql mode: 0x54200000, sort len: 1024, concat len: 1048576, div_precision: 4, def_week_frmt: 0, in_trans: 0, autocommit: 1
T@18   : | | | | | qcache: long 1, 4.1: 1, eof: 0, extended: 1, bin_proto: 0, more results 0, pkt_nr: 1, CS client: 33, CS result: 33, CS conn: 33, limit: 18446744073709551615, TZ: 0x555690098d08, sql mode: 0x54200000, sort len: 1024, concat len: 1048576, div_precision: 4, def_week_frmt: 0, in_trans: 0, autocommit: 1
T@18   : | | | | qcache: long 1, 4.1: 1, eof: 0, extended: 1, bin_proto: 0, more results 0, pkt_nr: 1, CS client: 33, CS result: 33, CS conn: 33, limit: 18446744073709551615, TZ: 0x555690098d08, sql mode: 0x54200000, sort len: 1024, concat len: 1048576, div_precision: 4, def_week_frmt: 0, in_trans: 0, autocommit: 1

Above example is used from query_qache.test, however the same patch doesn't have any outputs related to the trace file.

sanja only what can be done is to create debug test file with above commands, but there is no meaning, since it will not record trace file output.

Generated at Thu Feb 08 09:36:23 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.