Skip to content

Commit 11da991

Browse files
committed
WL#10837: Deprecate query cache
This patch is for 5.7.
1 parent 80d2774 commit 11da991

File tree

138 files changed

+2308
-27
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+2308
-27
lines changed

mysql-test/include/range.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,8 @@ CREATE TABLE t1 (f1 TINYINT(11) UNSIGNED NOT NULL, PRIMARY KEY (f1));
984984

985985
INSERT INTO t1 VALUES (127),(254),(0),(1),(255);
986986

987+
--disable_ps_protocol
988+
987989
# test upper bound
988990
# count 5
989991
SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 < 256;
@@ -1019,6 +1021,8 @@ SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 > -129.0;
10191021
# count 4
10201022
SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 > -128;
10211023

1024+
--enable_ps_protocol
1025+
10221026
DROP TABLE t1;
10231027

10241028
# End of 5.0 tests

mysql-test/r/cache_innodb.result

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
SET SESSION DEFAULT_STORAGE_ENGINE = InnoDB;
22
drop table if exists t1,t2,t3;
33
set @save_query_cache_size = @@global.query_cache_size;
4+
Warnings:
5+
Warning 1287 '@@query_cache_size' is deprecated and will be removed in a future release.
46
set GLOBAL query_cache_size = 1355776;
7+
Warnings:
8+
Warning 1287 '@@query_cache_size' is deprecated and will be removed in a future release.
59
flush status;
610
set autocommit=0;
711
create table t1 (a int not null);
@@ -136,6 +140,8 @@ SHOW VARIABLES LIKE 'have_query_cache';
136140
Variable_name Value
137141
have_query_cache YES
138142
SET GLOBAL query_cache_size = 204800;
143+
Warnings:
144+
Warning 1287 '@@query_cache_size' is deprecated and will be removed in a future release.
139145
flush status;
140146
SET @@autocommit=1;
141147
SET SESSION DEFAULT_STORAGE_ENGINE = InnoDB;
@@ -146,10 +152,14 @@ START TRANSACTION;
146152
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
147153
count(*)
148154
0
155+
Warnings:
156+
Warning 1681 'SQL_CACHE' is deprecated and will be removed in a future release.
149157
UPDATE t2 SET s2 = 'w' WHERE s1 = 3;
150158
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
151159
count(*)
152160
1
161+
Warnings:
162+
Warning 1681 'SQL_CACHE' is deprecated and will be removed in a future release.
153163
show status like "Qcache_queries_in_cache";
154164
Variable_name Value
155165
Qcache_queries_in_cache 0
@@ -158,68 +168,93 @@ START TRANSACTION;
158168
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
159169
count(*)
160170
0
171+
Warnings:
172+
Warning 1681 'SQL_CACHE' is deprecated and will be removed in a future release.
161173
INSERT INTO t2 VALUES (5,'w');
162174
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
163175
count(*)
164176
1
177+
Warnings:
178+
Warning 1681 'SQL_CACHE' is deprecated and will be removed in a future release.
165179
COMMIT;
166180
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
167181
count(*)
168182
1
183+
Warnings:
184+
Warning 1681 'SQL_CACHE' is deprecated and will be removed in a future release.
169185
show status like "Qcache_queries_in_cache";
170186
Variable_name Value
171187
Qcache_queries_in_cache 0
172188
connection default
173189
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
174190
count(*)
175191
1
192+
Warnings:
193+
Warning 1681 'SQL_CACHE' is deprecated and will be removed in a future release.
176194
COMMIT;
177195
show status like "Qcache_queries_in_cache";
178196
Variable_name Value
179197
Qcache_queries_in_cache 0
180198
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
181199
count(*)
182200
2
201+
Warnings:
202+
Warning 1681 'SQL_CACHE' is deprecated and will be removed in a future release.
183203
show status like "Qcache_queries_in_cache";
184204
Variable_name Value
185205
Qcache_queries_in_cache 1
186206
connection connection1
187207
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
188208
count(*)
189209
2
210+
Warnings:
190211
START TRANSACTION;
191212
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
192213
count(*)
193214
2
215+
Warnings:
216+
Warning 1681 'SQL_CACHE' is deprecated and will be removed in a future release.
194217
INSERT INTO t2 VALUES (6,'w');
195218
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
196219
count(*)
197220
3
221+
Warnings:
222+
Warning 1681 'SQL_CACHE' is deprecated and will be removed in a future release.
198223
connection default
199224
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
200225
count(*)
201226
2
227+
Warnings:
228+
Warning 1681 'SQL_CACHE' is deprecated and will be removed in a future release.
202229
START TRANSACTION;
203230
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
204231
count(*)
205232
2
233+
Warnings:
234+
Warning 1681 'SQL_CACHE' is deprecated and will be removed in a future release.
206235
DELETE from t2 WHERE s1=3;
207236
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
208237
count(*)
209238
1
239+
Warnings:
240+
Warning 1681 'SQL_CACHE' is deprecated and will be removed in a future release.
210241
COMMIT;
211242
connection connection1
212243
COMMIT;
213244
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
214245
count(*)
215246
2
247+
Warnings:
248+
Warning 1681 'SQL_CACHE' is deprecated and will be removed in a future release.
216249
show status like "Qcache_queries_in_cache";
217250
Variable_name Value
218251
Qcache_queries_in_cache 1
219252
show status like "Qcache_hits";
220253
Variable_name Value
221254
Qcache_hits 1
222255
set @@global.query_cache_size = @save_query_cache_size;
256+
Warnings:
257+
Warning 1287 '@@query_cache_size' is deprecated and will be removed in a future release.
223258
drop table t2;
224259
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
225260
BEGIN;

mysql-test/r/deprecate_eof.result

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,11 @@ BEGIN
371371
SELECT * FROM t1 ORDER BY 1;
372372
END |
373373
SET GLOBAL query_cache_size=1048576;
374+
Warnings:
375+
Warning 1287 '@@query_cache_size' is deprecated and will be removed in a future release.
374376
RESET QUERY CACHE;
377+
Warnings:
378+
Warning 1681 'RESET QUERY CACHE' is deprecated and will be removed in a future release.
375379
SHOW STATUS LIKE 'Qcache_queries_in_cache';
376380
Variable_name Value
377381
Qcache_queries_in_cache 0
@@ -399,6 +403,8 @@ a
399403
1
400404
2
401405
RESET QUERY CACHE;
406+
Warnings:
407+
Warning 1681 'RESET QUERY CACHE' is deprecated and will be removed in a future release.
402408
SHOW STATUS LIKE 'Qcache_queries_in_cache';
403409
Variable_name Value
404410
Qcache_queries_in_cache 0
@@ -429,6 +435,8 @@ SHOW STATUS LIKE 'Qcache_queries_in_cache';
429435
Variable_name Value
430436
Qcache_queries_in_cache 1
431437
SET GLOBAL query_cache_size= default;
438+
Warnings:
439+
Warning 1287 '@@query_cache_size' is deprecated and will be removed in a future release.
432440
#cleanup
433441
DROP DATABASE bug19550875;
434442
-- Tracker : SESSION_TRACK_SCHEMA

mysql-test/r/func_group.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,8 @@ WHERE ttt.a = ccc.b AND ttt.a = t.a GROUP BY ttt.a) AS minid
11081108
FROM t1 t, t2 c WHERE t.a = c.b;
11091109
minid
11101110
1
1111+
Warnings:
1112+
Warning 1681 'SQL_NO_CACHE' is deprecated and will be removed in a future release.
11111113
DROP TABLE t1,t2;
11121114
create table t1 select variance(0);
11131115
show create table t1;

mysql-test/r/func_in_all.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,8 @@ DROP TABLE t1;
936936
SELECT LEFT(ST_GEOMFROMTEXT("POINT(0 0)"),1) IN (@@global.query_cache_type,1,"");
937937
LEFT(ST_GEOMFROMTEXT("POINT(0 0)"),1) IN (@@global.query_cache_type,1,"")
938938
0
939+
Warnings:
940+
Warning 1287 '@@query_cache_type' is deprecated and will be removed in a future release.
939941
# End of test BUG#11764651-57510
940942
End of 5.1 tests
941943
set optimizer_switch=default;

mysql-test/r/func_in_icp.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,8 @@ DROP TABLE t1;
936936
SELECT LEFT(ST_GEOMFROMTEXT("POINT(0 0)"),1) IN (@@global.query_cache_type,1,"");
937937
LEFT(ST_GEOMFROMTEXT("POINT(0 0)"),1) IN (@@global.query_cache_type,1,"")
938938
0
939+
Warnings:
940+
Warning 1287 '@@query_cache_type' is deprecated and will be removed in a future release.
939941
# End of test BUG#11764651-57510
940942
End of 5.1 tests
941943
set optimizer_switch=default;

mysql-test/r/func_in_icp_mrr.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,8 @@ DROP TABLE t1;
936936
SELECT LEFT(ST_GEOMFROMTEXT("POINT(0 0)"),1) IN (@@global.query_cache_type,1,"");
937937
LEFT(ST_GEOMFROMTEXT("POINT(0 0)"),1) IN (@@global.query_cache_type,1,"")
938938
0
939+
Warnings:
940+
Warning 1287 '@@query_cache_type' is deprecated and will be removed in a future release.
939941
# End of test BUG#11764651-57510
940942
End of 5.1 tests
941943
set optimizer_switch=default;

mysql-test/r/func_in_mrr.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,8 @@ DROP TABLE t1;
936936
SELECT LEFT(ST_GEOMFROMTEXT("POINT(0 0)"),1) IN (@@global.query_cache_type,1,"");
937937
LEFT(ST_GEOMFROMTEXT("POINT(0 0)"),1) IN (@@global.query_cache_type,1,"")
938938
0
939+
Warnings:
940+
Warning 1287 '@@query_cache_type' is deprecated and will be removed in a future release.
939941
# End of test BUG#11764651-57510
940942
End of 5.1 tests
941943
set optimizer_switch=default;

mysql-test/r/func_in_mrr_cost.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,8 @@ DROP TABLE t1;
936936
SELECT LEFT(ST_GEOMFROMTEXT("POINT(0 0)"),1) IN (@@global.query_cache_type,1,"");
937937
LEFT(ST_GEOMFROMTEXT("POINT(0 0)"),1) IN (@@global.query_cache_type,1,"")
938938
0
939+
Warnings:
940+
Warning 1287 '@@query_cache_type' is deprecated and will be removed in a future release.
939941
# End of test BUG#11764651-57510
940942
End of 5.1 tests
941943
set optimizer_switch=default;

mysql-test/r/func_in_none.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,8 @@ DROP TABLE t1;
935935
SELECT LEFT(ST_GEOMFROMTEXT("POINT(0 0)"),1) IN (@@global.query_cache_type,1,"");
936936
LEFT(ST_GEOMFROMTEXT("POINT(0 0)"),1) IN (@@global.query_cache_type,1,"")
937937
0
938+
Warnings:
939+
Warning 1287 '@@query_cache_type' is deprecated and will be removed in a future release.
938940
# End of test BUG#11764651-57510
939941
End of 5.1 tests
940942
set optimizer_switch=default;

mysql-test/r/func_misc.result

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ SET @row_count = 4;
105105
SET @sleep_time_per_result_row = 1;
106106
SET @max_acceptable_delay = 2;
107107
SET @@global.query_cache_size = 1024 * 64;
108+
Warnings:
109+
Warning 1287 '@@query_cache_size' is deprecated and will be removed in a future release.
108110
DROP TEMPORARY TABLE IF EXISTS t_history;
109111
DROP TABLE IF EXISTS t1;
110112
CREATE TEMPORARY TABLE t_history (attempt SMALLINT,
@@ -192,6 +194,8 @@ Expect 1
192194
DROP TABLE t1;
193195
DROP TEMPORARY TABLE t_history;
194196
SET @@global.query_cache_size = default;
197+
Warnings:
198+
Warning 1287 '@@query_cache_size' is deprecated and will be removed in a future release.
195199
create table t1 select INET_ATON('255.255.0.1') as `a`;
196200
show create table t1;
197201
Table Create Table

mysql-test/r/grant_cache.result

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
drop table if exists test.t1,mysqltest.t1,mysqltest.t2;
22
drop database if exists mysqltest;
33
set GLOBAL query_cache_size=1355776;
4+
Warnings:
5+
Warning 1287 '@@query_cache_size' is deprecated and will be removed in a future release.
46
reset query cache;
7+
Warnings:
8+
Warning 1681 'RESET QUERY CACHE' is deprecated and will be removed in a future release.
59
flush status;
610
----- establish connection root -----
711
show grants for current_user;
@@ -232,3 +236,5 @@ flush privileges;
232236
drop table test.t1,mysqltest.t1,mysqltest.t2;
233237
drop database mysqltest;
234238
set GLOBAL query_cache_size=default;
239+
Warnings:
240+
Warning 1287 '@@query_cache_size' is deprecated and will be removed in a future release.

mysql-test/r/group_by.result

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,7 @@ id select_type table partitions type possible_keys key key_len ref rows filtered
909909
1 SIMPLE t2 NULL index b b 2 NULL 10 100.00 Using where; Using index
910910
1 SIMPLE t1 NULL eq_ref PRIMARY PRIMARY 1 test.t2.b 1 100.00 NULL
911911
Warnings:
912+
Warning 1681 'SQL_NO_CACHE' is deprecated and will be removed in a future release.
912913
Note 1003 /* select#1 */ select straight_join sql_no_cache `test`.`t1`.`a` AS `a`,concat(`test`.`t1`.`b`,'') AS `b`,`test`.`t1`.`b` AS `real_b` from `test`.`t2` join `test`.`t1` where (`test`.`t1`.`a` = `test`.`t2`.`b`) group by `test`.`t2`.`b`
913914
SELECT straight_join sql_no_cache v1.a, v1.b, v1.real_b from t2, v1
914915
where t2.b=v1.a GROUP BY t2.b;
@@ -920,6 +921,8 @@ a b real_b
920921
54 Danemark Danemark
921922
62 Espagne Espagne
922923
68 France France
924+
Warnings:
925+
Warning 1681 'SQL_NO_CACHE' is deprecated and will be removed in a future release.
923926
DROP VIEW v1;
924927
DROP TABLE t1,t2;
925928
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, key (b));

mysql-test/r/index_merge_innodb.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2027,6 +2027,7 @@ EXPLAIN SELECT SQL_NO_CACHE count(*) FROM t1 WHERE id2=7 AND id3=0;
20272027
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
20282028
1 SIMPLE t1 NULL ref id2,id3,covering_index covering_index 8 const,const 16 100.00 Using index
20292029
Warnings:
2030+
Warning 1681 'SQL_NO_CACHE' is deprecated and will be removed in a future release.
20302031
Note 1003 /* select#1 */ select sql_no_cache count(0) AS `count(*)` from `test`.`t1` where ((`test`.`t1`.`id3` = 0) and (`test`.`t1`.`id2` = 7))
20312032
DROP TABLE t1;
20322033
#

mysql-test/r/log_tables.result

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,12 +827,18 @@ INSERT INTO t1 VALUES (4,4,4);
827827
SELECT SQL_NO_CACHE 'Bug#31700 - SCAN',f1,f2,f3,SLEEP(1.1) FROM t1 WHERE f3=4;
828828
Bug#31700 - SCAN f1 f2 f3 SLEEP(1.1)
829829
Bug#31700 - SCAN 4 4 4 0
830+
Warnings:
831+
Warning 1681 'SQL_NO_CACHE' is deprecated and will be removed in a future release.
830832
SELECT SQL_NO_CACHE 'Bug#31700 - KEY', f1,f2,f3,SLEEP(1.1) FROM t1 WHERE f2=3;
831833
Bug#31700 - KEY f1 f2 f3 SLEEP(1.1)
832834
Bug#31700 - KEY 3 3 3 0
835+
Warnings:
836+
Warning 1681 'SQL_NO_CACHE' is deprecated and will be removed in a future release.
833837
SELECT SQL_NO_CACHE 'Bug#31700 - PK', f1,f2,f3,SLEEP(1.1) FROM t1 WHERE f1=2;
834838
Bug#31700 - PK f1 f2 f3 SLEEP(1.1)
835839
Bug#31700 - PK 2 2 2 0
840+
Warnings:
841+
Warning 1681 'SQL_NO_CACHE' is deprecated and will be removed in a future release.
836842
SELECT start_time, rows_examined, rows_sent, sql_text FROM mysql.slow_log WHERE sql_text LIKE '%Bug#31700%' ORDER BY start_time;
837843
start_time rows_examined rows_sent sql_text
838844
TIMESTAMP 4 1 SELECT SQL_NO_CACHE 'Bug#31700 - SCAN',f1,f2,f3,SLEEP(1.1) FROM t1 WHERE f3=4

mysql-test/r/lowercase_table_qcache.result

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
set GLOBAL query_cache_size=1355776;
2+
Warnings:
3+
Warning 1287 '@@query_cache_size' is deprecated and will be removed in a future release.
24
drop database if exists MySQLtesT;
35
create database MySQLtesT;
46
create table MySQLtesT.t1 (a int);
@@ -22,3 +24,5 @@ show status like "Qcache_queries_in_cache";
2224
Variable_name Value
2325
Qcache_queries_in_cache 0
2426
set GLOBAL query_cache_size=DEFAULT;
27+
Warnings:
28+
Warning 1287 '@@query_cache_size' is deprecated and will be removed in a future release.

mysql-test/r/max_statement_time.result

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
SET SESSION query_cache_type= 0;
2+
Warnings:
3+
Warning 1287 '@@query_cache_type' is deprecated and will be removed in a future release.
24
#
35
# 1. Test MAX_EXECUTION_TIME option syntax.
46
#
@@ -320,11 +322,15 @@ STATUS
320322
# 10. Test Query cache behavior with max_execution_time.
321323
#
322324
SET SESSION query_cache_type= 1;
325+
Warnings:
326+
Warning 1287 '@@query_cache_type' is deprecated and will be removed in a future release.
323327
SET @@SESSION.max_execution_time= 0;
324328
CREATE TABLE t1 (fld1 int);
325329
INSERT INTO t1 VALUES (1), (2), (3);
326330
INSERT INTO t1 SELECT * FROM t1;
327331
FLUSH QUERY CACHE;
332+
Warnings:
333+
Warning 1681 'FLUSH QUERY CACHE' is deprecated and will be removed in a future release.
328334
SELECT CONVERT(VARIABLE_VALUE, UNSIGNED) INTO @qc_inserts
329335
FROM INFORMATION_SCHEMA.GLOBAL_STATUS
330336
WHERE VARIABLE_NAME= 'Qcache_inserts';
@@ -404,5 +410,7 @@ WHERE VARIABLE_NAME= 'Qcache_inserts'
404410
AND CONVERT(VARIABLE_VALUE, UNSIGNED) > @qc_inserts;
405411
STATUS
406412
FLUSH QUERY CACHE;
413+
Warnings:
414+
Warning 1681 'FLUSH QUERY CACHE' is deprecated and will be removed in a future release.
407415
DROP TABLE t1;
408416
SET @@SESSION.max_execution_time= 0;

mysql-test/r/mysqld--help-notwin.result

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -858,17 +858,26 @@ The following options may be given as the first argument:
858858
--query-alloc-block-size=#
859859
Allocation block size for query parsing and execution
860860
--query-cache-limit=#
861-
Don't cache results that are bigger than this
861+
Don't cache results that are bigger than this. This
862+
variable is deprecated and will be removed in a future
863+
release.
862864
--query-cache-min-res-unit=#
863-
The minimum size for blocks allocated by the query cache
865+
The minimum size for blocks allocated by the query cache.
866+
This variable is deprecated and will be removed in a
867+
future release.
864868
--query-cache-size=#
865-
The memory allocated to store results from old queries
869+
The memory allocated to store results from old queries.
870+
This variable is deprecated and will be removed in a
871+
future release.
866872
--query-cache-type=name
867873
OFF = Don't cache or retrieve results. ON = Cache all
868874
results except SELECT SQL_NO_CACHE ... queries. DEMAND =
869-
Cache only SELECT SQL_CACHE ... queries
875+
Cache only SELECT SQL_CACHE ... queries. This variable is
876+
deprecated and will be removed in a future release.
870877
--query-cache-wlock-invalidate
871-
Invalidate queries in query cache on LOCK for write
878+
Invalidate queries in query cache on LOCK for write. This
879+
variable is deprecated and will be removed in a future
880+
release.
872881
--query-prealloc-size=#
873882
Persistent buffer for query parsing and execution
874883
--range-alloc-block-size=#

0 commit comments

Comments
 (0)