Commit 2100ec9e authored by Davi Arnaut's avatar Davi Arnaut

Bug#33362: Query cache invalidation (truncate) may hang

           if cached query uses many tables

The problem was that query cache would not properly cache
queries which used 256 or more tables but yet would leave
behind query cache blocks pointing to freed (destroyed)
data. Later when invalidating (due to a truncate) query cache
would attempt to grab a lock which resided in the freed data,
leading to hangs or undefined behavior.

This was happening due to a improper return value from the
function responsible for registering the tables used in the
query (so the cache can be invalidated later if one of the
tables is modified). The function expected a return value of
type boolean (char, 8 bits) indicating success (1) or failure
(0) but the number of tables registered (unsigned int, 32 bits)
was being returned instead. This caused the function to return
failure for cases where it had actually succeed because when
a type (unsigned int) is converted to a narrower type (char),
the excess bits on the left are discarded. Thus if the 8
rightmost bits are zero, the return value will be 0 (failure).

The solution is to simply return true (1) only if the number of
registered table is greater than zero and false (0) otherwise.

mysql-test/r/query_cache_merge.result:
  Add test case result for Bug#33362
mysql-test/t/query_cache_merge.test:
  Add test case for Bug#33362
sql/sql_cache.cc:
  Return 1 or 0 depending on the number of registered tables.
parent 8d7fcad1
...@@ -19,3 +19,1677 @@ Qcache_queries_in_cache 0 ...@@ -19,3 +19,1677 @@ Qcache_queries_in_cache 0
drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t250,t251,t252,t253,t254,t255,t256,t257,t00; drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t250,t251,t252,t253,t254,t255,t256,t257,t00;
SET @@global.query_cache_size=0; SET @@global.query_cache_size=0;
set @@global.table_definition_cache=@save_table_definition_cache; set @@global.table_definition_cache=@save_table_definition_cache;
SET @save_table_definition_cache = @@global.table_definition_cache;
SET @@global.table_definition_cache = 512;
CREATE TABLE t255 (a INT);
INSERT INTO t255 VALUES (255);
CREATE TABLE t254 (a INT);
INSERT INTO t254 VALUES (254);
CREATE TABLE t253 (a INT);
INSERT INTO t253 VALUES (253);
CREATE TABLE t252 (a INT);
INSERT INTO t252 VALUES (252);
CREATE TABLE t251 (a INT);
INSERT INTO t251 VALUES (251);
CREATE TABLE t250 (a INT);
INSERT INTO t250 VALUES (250);
CREATE TABLE t249 (a INT);
INSERT INTO t249 VALUES (249);
CREATE TABLE t248 (a INT);
INSERT INTO t248 VALUES (248);
CREATE TABLE t247 (a INT);
INSERT INTO t247 VALUES (247);
CREATE TABLE t246 (a INT);
INSERT INTO t246 VALUES (246);
CREATE TABLE t245 (a INT);
INSERT INTO t245 VALUES (245);
CREATE TABLE t244 (a INT);
INSERT INTO t244 VALUES (244);
CREATE TABLE t243 (a INT);
INSERT INTO t243 VALUES (243);
CREATE TABLE t242 (a INT);
INSERT INTO t242 VALUES (242);
CREATE TABLE t241 (a INT);
INSERT INTO t241 VALUES (241);
CREATE TABLE t240 (a INT);
INSERT INTO t240 VALUES (240);
CREATE TABLE t239 (a INT);
INSERT INTO t239 VALUES (239);
CREATE TABLE t238 (a INT);
INSERT INTO t238 VALUES (238);
CREATE TABLE t237 (a INT);
INSERT INTO t237 VALUES (237);
CREATE TABLE t236 (a INT);
INSERT INTO t236 VALUES (236);
CREATE TABLE t235 (a INT);
INSERT INTO t235 VALUES (235);
CREATE TABLE t234 (a INT);
INSERT INTO t234 VALUES (234);
CREATE TABLE t233 (a INT);
INSERT INTO t233 VALUES (233);
CREATE TABLE t232 (a INT);
INSERT INTO t232 VALUES (232);
CREATE TABLE t231 (a INT);
INSERT INTO t231 VALUES (231);
CREATE TABLE t230 (a INT);
INSERT INTO t230 VALUES (230);
CREATE TABLE t229 (a INT);
INSERT INTO t229 VALUES (229);
CREATE TABLE t228 (a INT);
INSERT INTO t228 VALUES (228);
CREATE TABLE t227 (a INT);
INSERT INTO t227 VALUES (227);
CREATE TABLE t226 (a INT);
INSERT INTO t226 VALUES (226);
CREATE TABLE t225 (a INT);
INSERT INTO t225 VALUES (225);
CREATE TABLE t224 (a INT);
INSERT INTO t224 VALUES (224);
CREATE TABLE t223 (a INT);
INSERT INTO t223 VALUES (223);
CREATE TABLE t222 (a INT);
INSERT INTO t222 VALUES (222);
CREATE TABLE t221 (a INT);
INSERT INTO t221 VALUES (221);
CREATE TABLE t220 (a INT);
INSERT INTO t220 VALUES (220);
CREATE TABLE t219 (a INT);
INSERT INTO t219 VALUES (219);
CREATE TABLE t218 (a INT);
INSERT INTO t218 VALUES (218);
CREATE TABLE t217 (a INT);
INSERT INTO t217 VALUES (217);
CREATE TABLE t216 (a INT);
INSERT INTO t216 VALUES (216);
CREATE TABLE t215 (a INT);
INSERT INTO t215 VALUES (215);
CREATE TABLE t214 (a INT);
INSERT INTO t214 VALUES (214);
CREATE TABLE t213 (a INT);
INSERT INTO t213 VALUES (213);
CREATE TABLE t212 (a INT);
INSERT INTO t212 VALUES (212);
CREATE TABLE t211 (a INT);
INSERT INTO t211 VALUES (211);
CREATE TABLE t210 (a INT);
INSERT INTO t210 VALUES (210);
CREATE TABLE t209 (a INT);
INSERT INTO t209 VALUES (209);
CREATE TABLE t208 (a INT);
INSERT INTO t208 VALUES (208);
CREATE TABLE t207 (a INT);
INSERT INTO t207 VALUES (207);
CREATE TABLE t206 (a INT);
INSERT INTO t206 VALUES (206);
CREATE TABLE t205 (a INT);
INSERT INTO t205 VALUES (205);
CREATE TABLE t204 (a INT);
INSERT INTO t204 VALUES (204);
CREATE TABLE t203 (a INT);
INSERT INTO t203 VALUES (203);
CREATE TABLE t202 (a INT);
INSERT INTO t202 VALUES (202);
CREATE TABLE t201 (a INT);
INSERT INTO t201 VALUES (201);
CREATE TABLE t200 (a INT);
INSERT INTO t200 VALUES (200);
CREATE TABLE t199 (a INT);
INSERT INTO t199 VALUES (199);
CREATE TABLE t198 (a INT);
INSERT INTO t198 VALUES (198);
CREATE TABLE t197 (a INT);
INSERT INTO t197 VALUES (197);
CREATE TABLE t196 (a INT);
INSERT INTO t196 VALUES (196);
CREATE TABLE t195 (a INT);
INSERT INTO t195 VALUES (195);
CREATE TABLE t194 (a INT);
INSERT INTO t194 VALUES (194);
CREATE TABLE t193 (a INT);
INSERT INTO t193 VALUES (193);
CREATE TABLE t192 (a INT);
INSERT INTO t192 VALUES (192);
CREATE TABLE t191 (a INT);
INSERT INTO t191 VALUES (191);
CREATE TABLE t190 (a INT);
INSERT INTO t190 VALUES (190);
CREATE TABLE t189 (a INT);
INSERT INTO t189 VALUES (189);
CREATE TABLE t188 (a INT);
INSERT INTO t188 VALUES (188);
CREATE TABLE t187 (a INT);
INSERT INTO t187 VALUES (187);
CREATE TABLE t186 (a INT);
INSERT INTO t186 VALUES (186);
CREATE TABLE t185 (a INT);
INSERT INTO t185 VALUES (185);
CREATE TABLE t184 (a INT);
INSERT INTO t184 VALUES (184);
CREATE TABLE t183 (a INT);
INSERT INTO t183 VALUES (183);
CREATE TABLE t182 (a INT);
INSERT INTO t182 VALUES (182);
CREATE TABLE t181 (a INT);
INSERT INTO t181 VALUES (181);
CREATE TABLE t180 (a INT);
INSERT INTO t180 VALUES (180);
CREATE TABLE t179 (a INT);
INSERT INTO t179 VALUES (179);
CREATE TABLE t178 (a INT);
INSERT INTO t178 VALUES (178);
CREATE TABLE t177 (a INT);
INSERT INTO t177 VALUES (177);
CREATE TABLE t176 (a INT);
INSERT INTO t176 VALUES (176);
CREATE TABLE t175 (a INT);
INSERT INTO t175 VALUES (175);
CREATE TABLE t174 (a INT);
INSERT INTO t174 VALUES (174);
CREATE TABLE t173 (a INT);
INSERT INTO t173 VALUES (173);
CREATE TABLE t172 (a INT);
INSERT INTO t172 VALUES (172);
CREATE TABLE t171 (a INT);
INSERT INTO t171 VALUES (171);
CREATE TABLE t170 (a INT);
INSERT INTO t170 VALUES (170);
CREATE TABLE t169 (a INT);
INSERT INTO t169 VALUES (169);
CREATE TABLE t168 (a INT);
INSERT INTO t168 VALUES (168);
CREATE TABLE t167 (a INT);
INSERT INTO t167 VALUES (167);
CREATE TABLE t166 (a INT);
INSERT INTO t166 VALUES (166);
CREATE TABLE t165 (a INT);
INSERT INTO t165 VALUES (165);
CREATE TABLE t164 (a INT);
INSERT INTO t164 VALUES (164);
CREATE TABLE t163 (a INT);
INSERT INTO t163 VALUES (163);
CREATE TABLE t162 (a INT);
INSERT INTO t162 VALUES (162);
CREATE TABLE t161 (a INT);
INSERT INTO t161 VALUES (161);
CREATE TABLE t160 (a INT);
INSERT INTO t160 VALUES (160);
CREATE TABLE t159 (a INT);
INSERT INTO t159 VALUES (159);
CREATE TABLE t158 (a INT);
INSERT INTO t158 VALUES (158);
CREATE TABLE t157 (a INT);
INSERT INTO t157 VALUES (157);
CREATE TABLE t156 (a INT);
INSERT INTO t156 VALUES (156);
CREATE TABLE t155 (a INT);
INSERT INTO t155 VALUES (155);
CREATE TABLE t154 (a INT);
INSERT INTO t154 VALUES (154);
CREATE TABLE t153 (a INT);
INSERT INTO t153 VALUES (153);
CREATE TABLE t152 (a INT);
INSERT INTO t152 VALUES (152);
CREATE TABLE t151 (a INT);
INSERT INTO t151 VALUES (151);
CREATE TABLE t150 (a INT);
INSERT INTO t150 VALUES (150);
CREATE TABLE t149 (a INT);
INSERT INTO t149 VALUES (149);
CREATE TABLE t148 (a INT);
INSERT INTO t148 VALUES (148);
CREATE TABLE t147 (a INT);
INSERT INTO t147 VALUES (147);
CREATE TABLE t146 (a INT);
INSERT INTO t146 VALUES (146);
CREATE TABLE t145 (a INT);
INSERT INTO t145 VALUES (145);
CREATE TABLE t144 (a INT);
INSERT INTO t144 VALUES (144);
CREATE TABLE t143 (a INT);
INSERT INTO t143 VALUES (143);
CREATE TABLE t142 (a INT);
INSERT INTO t142 VALUES (142);
CREATE TABLE t141 (a INT);
INSERT INTO t141 VALUES (141);
CREATE TABLE t140 (a INT);
INSERT INTO t140 VALUES (140);
CREATE TABLE t139 (a INT);
INSERT INTO t139 VALUES (139);
CREATE TABLE t138 (a INT);
INSERT INTO t138 VALUES (138);
CREATE TABLE t137 (a INT);
INSERT INTO t137 VALUES (137);
CREATE TABLE t136 (a INT);
INSERT INTO t136 VALUES (136);
CREATE TABLE t135 (a INT);
INSERT INTO t135 VALUES (135);
CREATE TABLE t134 (a INT);
INSERT INTO t134 VALUES (134);
CREATE TABLE t133 (a INT);
INSERT INTO t133 VALUES (133);
CREATE TABLE t132 (a INT);
INSERT INTO t132 VALUES (132);
CREATE TABLE t131 (a INT);
INSERT INTO t131 VALUES (131);
CREATE TABLE t130 (a INT);
INSERT INTO t130 VALUES (130);
CREATE TABLE t129 (a INT);
INSERT INTO t129 VALUES (129);
CREATE TABLE t128 (a INT);
INSERT INTO t128 VALUES (128);
CREATE TABLE t127 (a INT);
INSERT INTO t127 VALUES (127);
CREATE TABLE t126 (a INT);
INSERT INTO t126 VALUES (126);
CREATE TABLE t125 (a INT);
INSERT INTO t125 VALUES (125);
CREATE TABLE t124 (a INT);
INSERT INTO t124 VALUES (124);
CREATE TABLE t123 (a INT);
INSERT INTO t123 VALUES (123);
CREATE TABLE t122 (a INT);
INSERT INTO t122 VALUES (122);
CREATE TABLE t121 (a INT);
INSERT INTO t121 VALUES (121);
CREATE TABLE t120 (a INT);
INSERT INTO t120 VALUES (120);
CREATE TABLE t119 (a INT);
INSERT INTO t119 VALUES (119);
CREATE TABLE t118 (a INT);
INSERT INTO t118 VALUES (118);
CREATE TABLE t117 (a INT);
INSERT INTO t117 VALUES (117);
CREATE TABLE t116 (a INT);
INSERT INTO t116 VALUES (116);
CREATE TABLE t115 (a INT);
INSERT INTO t115 VALUES (115);
CREATE TABLE t114 (a INT);
INSERT INTO t114 VALUES (114);
CREATE TABLE t113 (a INT);
INSERT INTO t113 VALUES (113);
CREATE TABLE t112 (a INT);
INSERT INTO t112 VALUES (112);
CREATE TABLE t111 (a INT);
INSERT INTO t111 VALUES (111);
CREATE TABLE t110 (a INT);
INSERT INTO t110 VALUES (110);
CREATE TABLE t109 (a INT);
INSERT INTO t109 VALUES (109);
CREATE TABLE t108 (a INT);
INSERT INTO t108 VALUES (108);
CREATE TABLE t107 (a INT);
INSERT INTO t107 VALUES (107);
CREATE TABLE t106 (a INT);
INSERT INTO t106 VALUES (106);
CREATE TABLE t105 (a INT);
INSERT INTO t105 VALUES (105);
CREATE TABLE t104 (a INT);
INSERT INTO t104 VALUES (104);
CREATE TABLE t103 (a INT);
INSERT INTO t103 VALUES (103);
CREATE TABLE t102 (a INT);
INSERT INTO t102 VALUES (102);
CREATE TABLE t101 (a INT);
INSERT INTO t101 VALUES (101);
CREATE TABLE t100 (a INT);
INSERT INTO t100 VALUES (100);
CREATE TABLE t99 (a INT);
INSERT INTO t99 VALUES (99);
CREATE TABLE t98 (a INT);
INSERT INTO t98 VALUES (98);
CREATE TABLE t97 (a INT);
INSERT INTO t97 VALUES (97);
CREATE TABLE t96 (a INT);
INSERT INTO t96 VALUES (96);
CREATE TABLE t95 (a INT);
INSERT INTO t95 VALUES (95);
CREATE TABLE t94 (a INT);
INSERT INTO t94 VALUES (94);
CREATE TABLE t93 (a INT);
INSERT INTO t93 VALUES (93);
CREATE TABLE t92 (a INT);
INSERT INTO t92 VALUES (92);
CREATE TABLE t91 (a INT);
INSERT INTO t91 VALUES (91);
CREATE TABLE t90 (a INT);
INSERT INTO t90 VALUES (90);
CREATE TABLE t89 (a INT);
INSERT INTO t89 VALUES (89);
CREATE TABLE t88 (a INT);
INSERT INTO t88 VALUES (88);
CREATE TABLE t87 (a INT);
INSERT INTO t87 VALUES (87);
CREATE TABLE t86 (a INT);
INSERT INTO t86 VALUES (86);
CREATE TABLE t85 (a INT);
INSERT INTO t85 VALUES (85);
CREATE TABLE t84 (a INT);
INSERT INTO t84 VALUES (84);
CREATE TABLE t83 (a INT);
INSERT INTO t83 VALUES (83);
CREATE TABLE t82 (a INT);
INSERT INTO t82 VALUES (82);
CREATE TABLE t81 (a INT);
INSERT INTO t81 VALUES (81);
CREATE TABLE t80 (a INT);
INSERT INTO t80 VALUES (80);
CREATE TABLE t79 (a INT);
INSERT INTO t79 VALUES (79);
CREATE TABLE t78 (a INT);
INSERT INTO t78 VALUES (78);
CREATE TABLE t77 (a INT);
INSERT INTO t77 VALUES (77);
CREATE TABLE t76 (a INT);
INSERT INTO t76 VALUES (76);
CREATE TABLE t75 (a INT);
INSERT INTO t75 VALUES (75);
CREATE TABLE t74 (a INT);
INSERT INTO t74 VALUES (74);
CREATE TABLE t73 (a INT);
INSERT INTO t73 VALUES (73);
CREATE TABLE t72 (a INT);
INSERT INTO t72 VALUES (72);
CREATE TABLE t71 (a INT);
INSERT INTO t71 VALUES (71);
CREATE TABLE t70 (a INT);
INSERT INTO t70 VALUES (70);
CREATE TABLE t69 (a INT);
INSERT INTO t69 VALUES (69);
CREATE TABLE t68 (a INT);
INSERT INTO t68 VALUES (68);
CREATE TABLE t67 (a INT);
INSERT INTO t67 VALUES (67);
CREATE TABLE t66 (a INT);
INSERT INTO t66 VALUES (66);
CREATE TABLE t65 (a INT);
INSERT INTO t65 VALUES (65);
CREATE TABLE t64 (a INT);
INSERT INTO t64 VALUES (64);
CREATE TABLE t63 (a INT);
INSERT INTO t63 VALUES (63);
CREATE TABLE t62 (a INT);
INSERT INTO t62 VALUES (62);
CREATE TABLE t61 (a INT);
INSERT INTO t61 VALUES (61);
CREATE TABLE t60 (a INT);
INSERT INTO t60 VALUES (60);
CREATE TABLE t59 (a INT);
INSERT INTO t59 VALUES (59);
CREATE TABLE t58 (a INT);
INSERT INTO t58 VALUES (58);
CREATE TABLE t57 (a INT);
INSERT INTO t57 VALUES (57);
CREATE TABLE t56 (a INT);
INSERT INTO t56 VALUES (56);
CREATE TABLE t55 (a INT);
INSERT INTO t55 VALUES (55);
CREATE TABLE t54 (a INT);
INSERT INTO t54 VALUES (54);
CREATE TABLE t53 (a INT);
INSERT INTO t53 VALUES (53);
CREATE TABLE t52 (a INT);
INSERT INTO t52 VALUES (52);
CREATE TABLE t51 (a INT);
INSERT INTO t51 VALUES (51);
CREATE TABLE t50 (a INT);
INSERT INTO t50 VALUES (50);
CREATE TABLE t49 (a INT);
INSERT INTO t49 VALUES (49);
CREATE TABLE t48 (a INT);
INSERT INTO t48 VALUES (48);
CREATE TABLE t47 (a INT);
INSERT INTO t47 VALUES (47);
CREATE TABLE t46 (a INT);
INSERT INTO t46 VALUES (46);
CREATE TABLE t45 (a INT);
INSERT INTO t45 VALUES (45);
CREATE TABLE t44 (a INT);
INSERT INTO t44 VALUES (44);
CREATE TABLE t43 (a INT);
INSERT INTO t43 VALUES (43);
CREATE TABLE t42 (a INT);
INSERT INTO t42 VALUES (42);
CREATE TABLE t41 (a INT);
INSERT INTO t41 VALUES (41);
CREATE TABLE t40 (a INT);
INSERT INTO t40 VALUES (40);
CREATE TABLE t39 (a INT);
INSERT INTO t39 VALUES (39);
CREATE TABLE t38 (a INT);
INSERT INTO t38 VALUES (38);
CREATE TABLE t37 (a INT);
INSERT INTO t37 VALUES (37);
CREATE TABLE t36 (a INT);
INSERT INTO t36 VALUES (36);
CREATE TABLE t35 (a INT);
INSERT INTO t35 VALUES (35);
CREATE TABLE t34 (a INT);
INSERT INTO t34 VALUES (34);
CREATE TABLE t33 (a INT);
INSERT INTO t33 VALUES (33);
CREATE TABLE t32 (a INT);
INSERT INTO t32 VALUES (32);
CREATE TABLE t31 (a INT);
INSERT INTO t31 VALUES (31);
CREATE TABLE t30 (a INT);
INSERT INTO t30 VALUES (30);
CREATE TABLE t29 (a INT);
INSERT INTO t29 VALUES (29);
CREATE TABLE t28 (a INT);
INSERT INTO t28 VALUES (28);
CREATE TABLE t27 (a INT);
INSERT INTO t27 VALUES (27);
CREATE TABLE t26 (a INT);
INSERT INTO t26 VALUES (26);
CREATE TABLE t25 (a INT);
INSERT INTO t25 VALUES (25);
CREATE TABLE t24 (a INT);
INSERT INTO t24 VALUES (24);
CREATE TABLE t23 (a INT);
INSERT INTO t23 VALUES (23);
CREATE TABLE t22 (a INT);
INSERT INTO t22 VALUES (22);
CREATE TABLE t21 (a INT);
INSERT INTO t21 VALUES (21);
CREATE TABLE t20 (a INT);
INSERT INTO t20 VALUES (20);
CREATE TABLE t19 (a INT);
INSERT INTO t19 VALUES (19);
CREATE TABLE t18 (a INT);
INSERT INTO t18 VALUES (18);
CREATE TABLE t17 (a INT);
INSERT INTO t17 VALUES (17);
CREATE TABLE t16 (a INT);
INSERT INTO t16 VALUES (16);
CREATE TABLE t15 (a INT);
INSERT INTO t15 VALUES (15);
CREATE TABLE t14 (a INT);
INSERT INTO t14 VALUES (14);
CREATE TABLE t13 (a INT);
INSERT INTO t13 VALUES (13);
CREATE TABLE t12 (a INT);
INSERT INTO t12 VALUES (12);
CREATE TABLE t11 (a INT);
INSERT INTO t11 VALUES (11);
CREATE TABLE t10 (a INT);
INSERT INTO t10 VALUES (10);
CREATE TABLE t9 (a INT);
INSERT INTO t9 VALUES (9);
CREATE TABLE t8 (a INT);
INSERT INTO t8 VALUES (8);
CREATE TABLE t7 (a INT);
INSERT INTO t7 VALUES (7);
CREATE TABLE t6 (a INT);
INSERT INTO t6 VALUES (6);
CREATE TABLE t5 (a INT);
INSERT INTO t5 VALUES (5);
CREATE TABLE t4 (a INT);
INSERT INTO t4 VALUES (4);
CREATE TABLE t3 (a INT);
INSERT INTO t3 VALUES (3);
CREATE TABLE t2 (a INT);
INSERT INTO t2 VALUES (2);
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1);
CREATE TABLE t0 (a INT) ENGINE=MERGE UNION(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t250,t251,t252,t253,t254,t255);
SET GLOBAL query_cache_size = 1048576;
FLUSH STATUS;
SELECT a FROM t0 WHERE a = 1;
a
1
SHOW STATUS LIKE "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
TRUNCATE TABLE t255;
SELECT a FROM t1;
a
1
TRUNCATE TABLE t254;
SELECT a FROM t2;
a
2
TRUNCATE TABLE t253;
SELECT a FROM t3;
a
3
TRUNCATE TABLE t252;
SELECT a FROM t4;
a
4
TRUNCATE TABLE t251;
SELECT a FROM t5;
a
5
TRUNCATE TABLE t250;
SELECT a FROM t6;
a
6
TRUNCATE TABLE t249;
SELECT a FROM t7;
a
7
TRUNCATE TABLE t248;
SELECT a FROM t8;
a
8
TRUNCATE TABLE t247;
SELECT a FROM t9;
a
9
TRUNCATE TABLE t246;
SELECT a FROM t10;
a
10
TRUNCATE TABLE t245;
SELECT a FROM t11;
a
11
TRUNCATE TABLE t244;
SELECT a FROM t12;
a
12
TRUNCATE TABLE t243;
SELECT a FROM t13;
a
13
TRUNCATE TABLE t242;
SELECT a FROM t14;
a
14
TRUNCATE TABLE t241;
SELECT a FROM t15;
a
15
TRUNCATE TABLE t240;
SELECT a FROM t16;
a
16
TRUNCATE TABLE t239;
SELECT a FROM t17;
a
17
TRUNCATE TABLE t238;
SELECT a FROM t18;
a
18
TRUNCATE TABLE t237;
SELECT a FROM t19;
a
19
TRUNCATE TABLE t236;
SELECT a FROM t20;
a
20
TRUNCATE TABLE t235;
SELECT a FROM t21;
a
21
TRUNCATE TABLE t234;
SELECT a FROM t22;
a
22
TRUNCATE TABLE t233;
SELECT a FROM t23;
a
23
TRUNCATE TABLE t232;
SELECT a FROM t24;
a
24
TRUNCATE TABLE t231;
SELECT a FROM t25;
a
25
TRUNCATE TABLE t230;
SELECT a FROM t26;
a
26
TRUNCATE TABLE t229;
SELECT a FROM t27;
a
27
TRUNCATE TABLE t228;
SELECT a FROM t28;
a
28
TRUNCATE TABLE t227;
SELECT a FROM t29;
a
29
TRUNCATE TABLE t226;
SELECT a FROM t30;
a
30
TRUNCATE TABLE t225;
SELECT a FROM t31;
a
31
TRUNCATE TABLE t224;
SELECT a FROM t32;
a
32
TRUNCATE TABLE t223;
SELECT a FROM t33;
a
33
TRUNCATE TABLE t222;
SELECT a FROM t34;
a
34
TRUNCATE TABLE t221;
SELECT a FROM t35;
a
35
TRUNCATE TABLE t220;
SELECT a FROM t36;
a
36
TRUNCATE TABLE t219;
SELECT a FROM t37;
a
37
TRUNCATE TABLE t218;
SELECT a FROM t38;
a
38
TRUNCATE TABLE t217;
SELECT a FROM t39;
a
39
TRUNCATE TABLE t216;
SELECT a FROM t40;
a
40
TRUNCATE TABLE t215;
SELECT a FROM t41;
a
41
TRUNCATE TABLE t214;
SELECT a FROM t42;
a
42
TRUNCATE TABLE t213;
SELECT a FROM t43;
a
43
TRUNCATE TABLE t212;
SELECT a FROM t44;
a
44
TRUNCATE TABLE t211;
SELECT a FROM t45;
a
45
TRUNCATE TABLE t210;
SELECT a FROM t46;
a
46
TRUNCATE TABLE t209;
SELECT a FROM t47;
a
47
TRUNCATE TABLE t208;
SELECT a FROM t48;
a
48
TRUNCATE TABLE t207;
SELECT a FROM t49;
a
49
TRUNCATE TABLE t206;
SELECT a FROM t50;
a
50
TRUNCATE TABLE t205;
SELECT a FROM t51;
a
51
TRUNCATE TABLE t204;
SELECT a FROM t52;
a
52
TRUNCATE TABLE t203;
SELECT a FROM t53;
a
53
TRUNCATE TABLE t202;
SELECT a FROM t54;
a
54
TRUNCATE TABLE t201;
SELECT a FROM t55;
a
55
TRUNCATE TABLE t200;
SELECT a FROM t56;
a
56
TRUNCATE TABLE t199;
SELECT a FROM t57;
a
57
TRUNCATE TABLE t198;
SELECT a FROM t58;
a
58
TRUNCATE TABLE t197;
SELECT a FROM t59;
a
59
TRUNCATE TABLE t196;
SELECT a FROM t60;
a
60
TRUNCATE TABLE t195;
SELECT a FROM t61;
a
61
TRUNCATE TABLE t194;
SELECT a FROM t62;
a
62
TRUNCATE TABLE t193;
SELECT a FROM t63;
a
63
TRUNCATE TABLE t192;
SELECT a FROM t64;
a
64
TRUNCATE TABLE t191;
SELECT a FROM t65;
a
65
TRUNCATE TABLE t190;
SELECT a FROM t66;
a
66
TRUNCATE TABLE t189;
SELECT a FROM t67;
a
67
TRUNCATE TABLE t188;
SELECT a FROM t68;
a
68
TRUNCATE TABLE t187;
SELECT a FROM t69;
a
69
TRUNCATE TABLE t186;
SELECT a FROM t70;
a
70
TRUNCATE TABLE t185;
SELECT a FROM t71;
a
71
TRUNCATE TABLE t184;
SELECT a FROM t72;
a
72
TRUNCATE TABLE t183;
SELECT a FROM t73;
a
73
TRUNCATE TABLE t182;
SELECT a FROM t74;
a
74
TRUNCATE TABLE t181;
SELECT a FROM t75;
a
75
TRUNCATE TABLE t180;
SELECT a FROM t76;
a
76
TRUNCATE TABLE t179;
SELECT a FROM t77;
a
77
TRUNCATE TABLE t178;
SELECT a FROM t78;
a
78
TRUNCATE TABLE t177;
SELECT a FROM t79;
a
79
TRUNCATE TABLE t176;
SELECT a FROM t80;
a
80
TRUNCATE TABLE t175;
SELECT a FROM t81;
a
81
TRUNCATE TABLE t174;
SELECT a FROM t82;
a
82
TRUNCATE TABLE t173;
SELECT a FROM t83;
a
83
TRUNCATE TABLE t172;
SELECT a FROM t84;
a
84
TRUNCATE TABLE t171;
SELECT a FROM t85;
a
85
TRUNCATE TABLE t170;
SELECT a FROM t86;
a
86
TRUNCATE TABLE t169;
SELECT a FROM t87;
a
87
TRUNCATE TABLE t168;
SELECT a FROM t88;
a
88
TRUNCATE TABLE t167;
SELECT a FROM t89;
a
89
TRUNCATE TABLE t166;
SELECT a FROM t90;
a
90
TRUNCATE TABLE t165;
SELECT a FROM t91;
a
91
TRUNCATE TABLE t164;
SELECT a FROM t92;
a
92
TRUNCATE TABLE t163;
SELECT a FROM t93;
a
93
TRUNCATE TABLE t162;
SELECT a FROM t94;
a
94
TRUNCATE TABLE t161;
SELECT a FROM t95;
a
95
TRUNCATE TABLE t160;
SELECT a FROM t96;
a
96
TRUNCATE TABLE t159;
SELECT a FROM t97;
a
97
TRUNCATE TABLE t158;
SELECT a FROM t98;
a
98
TRUNCATE TABLE t157;
SELECT a FROM t99;
a
99
TRUNCATE TABLE t156;
SELECT a FROM t100;
a
100
TRUNCATE TABLE t155;
SELECT a FROM t101;
a
101
TRUNCATE TABLE t154;
SELECT a FROM t102;
a
102
TRUNCATE TABLE t153;
SELECT a FROM t103;
a
103
TRUNCATE TABLE t152;
SELECT a FROM t104;
a
104
TRUNCATE TABLE t151;
SELECT a FROM t105;
a
105
TRUNCATE TABLE t150;
SELECT a FROM t106;
a
106
TRUNCATE TABLE t149;
SELECT a FROM t107;
a
107
TRUNCATE TABLE t148;
SELECT a FROM t108;
a
108
TRUNCATE TABLE t147;
SELECT a FROM t109;
a
109
TRUNCATE TABLE t146;
SELECT a FROM t110;
a
110
TRUNCATE TABLE t145;
SELECT a FROM t111;
a
111
TRUNCATE TABLE t144;
SELECT a FROM t112;
a
112
TRUNCATE TABLE t143;
SELECT a FROM t113;
a
113
TRUNCATE TABLE t142;
SELECT a FROM t114;
a
114
TRUNCATE TABLE t141;
SELECT a FROM t115;
a
115
TRUNCATE TABLE t140;
SELECT a FROM t116;
a
116
TRUNCATE TABLE t139;
SELECT a FROM t117;
a
117
TRUNCATE TABLE t138;
SELECT a FROM t118;
a
118
TRUNCATE TABLE t137;
SELECT a FROM t119;
a
119
TRUNCATE TABLE t136;
SELECT a FROM t120;
a
120
TRUNCATE TABLE t135;
SELECT a FROM t121;
a
121
TRUNCATE TABLE t134;
SELECT a FROM t122;
a
122
TRUNCATE TABLE t133;
SELECT a FROM t123;
a
123
TRUNCATE TABLE t132;
SELECT a FROM t124;
a
124
TRUNCATE TABLE t131;
SELECT a FROM t125;
a
125
TRUNCATE TABLE t130;
SELECT a FROM t126;
a
126
TRUNCATE TABLE t129;
SELECT a FROM t127;
a
127
TRUNCATE TABLE t128;
SELECT a FROM t128;
a
TRUNCATE TABLE t127;
SELECT a FROM t129;
a
TRUNCATE TABLE t126;
SELECT a FROM t130;
a
TRUNCATE TABLE t125;
SELECT a FROM t131;
a
TRUNCATE TABLE t124;
SELECT a FROM t132;
a
TRUNCATE TABLE t123;
SELECT a FROM t133;
a
TRUNCATE TABLE t122;
SELECT a FROM t134;
a
TRUNCATE TABLE t121;
SELECT a FROM t135;
a
TRUNCATE TABLE t120;
SELECT a FROM t136;
a
TRUNCATE TABLE t119;
SELECT a FROM t137;
a
TRUNCATE TABLE t118;
SELECT a FROM t138;
a
TRUNCATE TABLE t117;
SELECT a FROM t139;
a
TRUNCATE TABLE t116;
SELECT a FROM t140;
a
TRUNCATE TABLE t115;
SELECT a FROM t141;
a
TRUNCATE TABLE t114;
SELECT a FROM t142;
a
TRUNCATE TABLE t113;
SELECT a FROM t143;
a
TRUNCATE TABLE t112;
SELECT a FROM t144;
a
TRUNCATE TABLE t111;
SELECT a FROM t145;
a
TRUNCATE TABLE t110;
SELECT a FROM t146;
a
TRUNCATE TABLE t109;
SELECT a FROM t147;
a
TRUNCATE TABLE t108;
SELECT a FROM t148;
a
TRUNCATE TABLE t107;
SELECT a FROM t149;
a
TRUNCATE TABLE t106;
SELECT a FROM t150;
a
TRUNCATE TABLE t105;
SELECT a FROM t151;
a
TRUNCATE TABLE t104;
SELECT a FROM t152;
a
TRUNCATE TABLE t103;
SELECT a FROM t153;
a
TRUNCATE TABLE t102;
SELECT a FROM t154;
a
TRUNCATE TABLE t101;
SELECT a FROM t155;
a
TRUNCATE TABLE t100;
SELECT a FROM t156;
a
TRUNCATE TABLE t99;
SELECT a FROM t157;
a
TRUNCATE TABLE t98;
SELECT a FROM t158;
a
TRUNCATE TABLE t97;
SELECT a FROM t159;
a
TRUNCATE TABLE t96;
SELECT a FROM t160;
a
TRUNCATE TABLE t95;
SELECT a FROM t161;
a
TRUNCATE TABLE t94;
SELECT a FROM t162;
a
TRUNCATE TABLE t93;
SELECT a FROM t163;
a
TRUNCATE TABLE t92;
SELECT a FROM t164;
a
TRUNCATE TABLE t91;
SELECT a FROM t165;
a
TRUNCATE TABLE t90;
SELECT a FROM t166;
a
TRUNCATE TABLE t89;
SELECT a FROM t167;
a
TRUNCATE TABLE t88;
SELECT a FROM t168;
a
TRUNCATE TABLE t87;
SELECT a FROM t169;
a
TRUNCATE TABLE t86;
SELECT a FROM t170;
a
TRUNCATE TABLE t85;
SELECT a FROM t171;
a
TRUNCATE TABLE t84;
SELECT a FROM t172;
a
TRUNCATE TABLE t83;
SELECT a FROM t173;
a
TRUNCATE TABLE t82;
SELECT a FROM t174;
a
TRUNCATE TABLE t81;
SELECT a FROM t175;
a
TRUNCATE TABLE t80;
SELECT a FROM t176;
a
TRUNCATE TABLE t79;
SELECT a FROM t177;
a
TRUNCATE TABLE t78;
SELECT a FROM t178;
a
TRUNCATE TABLE t77;
SELECT a FROM t179;
a
TRUNCATE TABLE t76;
SELECT a FROM t180;
a
TRUNCATE TABLE t75;
SELECT a FROM t181;
a
TRUNCATE TABLE t74;
SELECT a FROM t182;
a
TRUNCATE TABLE t73;
SELECT a FROM t183;
a
TRUNCATE TABLE t72;
SELECT a FROM t184;
a
TRUNCATE TABLE t71;
SELECT a FROM t185;
a
TRUNCATE TABLE t70;
SELECT a FROM t186;
a
TRUNCATE TABLE t69;
SELECT a FROM t187;
a
TRUNCATE TABLE t68;
SELECT a FROM t188;
a
TRUNCATE TABLE t67;
SELECT a FROM t189;
a
TRUNCATE TABLE t66;
SELECT a FROM t190;
a
TRUNCATE TABLE t65;
SELECT a FROM t191;
a
TRUNCATE TABLE t64;
SELECT a FROM t192;
a
TRUNCATE TABLE t63;
SELECT a FROM t193;
a
TRUNCATE TABLE t62;
SELECT a FROM t194;
a
TRUNCATE TABLE t61;
SELECT a FROM t195;
a
TRUNCATE TABLE t60;
SELECT a FROM t196;
a
TRUNCATE TABLE t59;
SELECT a FROM t197;
a
TRUNCATE TABLE t58;
SELECT a FROM t198;
a
TRUNCATE TABLE t57;
SELECT a FROM t199;
a
TRUNCATE TABLE t56;
SELECT a FROM t200;
a
TRUNCATE TABLE t55;
SELECT a FROM t201;
a
TRUNCATE TABLE t54;
SELECT a FROM t202;
a
TRUNCATE TABLE t53;
SELECT a FROM t203;
a
TRUNCATE TABLE t52;
SELECT a FROM t204;
a
TRUNCATE TABLE t51;
SELECT a FROM t205;
a
TRUNCATE TABLE t50;
SELECT a FROM t206;
a
TRUNCATE TABLE t49;
SELECT a FROM t207;
a
TRUNCATE TABLE t48;
SELECT a FROM t208;
a
TRUNCATE TABLE t47;
SELECT a FROM t209;
a
TRUNCATE TABLE t46;
SELECT a FROM t210;
a
TRUNCATE TABLE t45;
SELECT a FROM t211;
a
TRUNCATE TABLE t44;
SELECT a FROM t212;
a
TRUNCATE TABLE t43;
SELECT a FROM t213;
a
TRUNCATE TABLE t42;
SELECT a FROM t214;
a
TRUNCATE TABLE t41;
SELECT a FROM t215;
a
TRUNCATE TABLE t40;
SELECT a FROM t216;
a
TRUNCATE TABLE t39;
SELECT a FROM t217;
a
TRUNCATE TABLE t38;
SELECT a FROM t218;
a
TRUNCATE TABLE t37;
SELECT a FROM t219;
a
TRUNCATE TABLE t36;
SELECT a FROM t220;
a
TRUNCATE TABLE t35;
SELECT a FROM t221;
a
TRUNCATE TABLE t34;
SELECT a FROM t222;
a
TRUNCATE TABLE t33;
SELECT a FROM t223;
a
TRUNCATE TABLE t32;
SELECT a FROM t224;
a
TRUNCATE TABLE t31;
SELECT a FROM t225;
a
TRUNCATE TABLE t30;
SELECT a FROM t226;
a
TRUNCATE TABLE t29;
SELECT a FROM t227;
a
TRUNCATE TABLE t28;
SELECT a FROM t228;
a
TRUNCATE TABLE t27;
SELECT a FROM t229;
a
TRUNCATE TABLE t26;
SELECT a FROM t230;
a
TRUNCATE TABLE t25;
SELECT a FROM t231;
a
TRUNCATE TABLE t24;
SELECT a FROM t232;
a
TRUNCATE TABLE t23;
SELECT a FROM t233;
a
TRUNCATE TABLE t22;
SELECT a FROM t234;
a
TRUNCATE TABLE t21;
SELECT a FROM t235;
a
TRUNCATE TABLE t20;
SELECT a FROM t236;
a
TRUNCATE TABLE t19;
SELECT a FROM t237;
a
TRUNCATE TABLE t18;
SELECT a FROM t238;
a
TRUNCATE TABLE t17;
SELECT a FROM t239;
a
TRUNCATE TABLE t16;
SELECT a FROM t240;
a
TRUNCATE TABLE t15;
SELECT a FROM t241;
a
TRUNCATE TABLE t14;
SELECT a FROM t242;
a
TRUNCATE TABLE t13;
SELECT a FROM t243;
a
TRUNCATE TABLE t12;
SELECT a FROM t244;
a
TRUNCATE TABLE t11;
SELECT a FROM t245;
a
TRUNCATE TABLE t10;
SELECT a FROM t246;
a
TRUNCATE TABLE t9;
SELECT a FROM t247;
a
TRUNCATE TABLE t8;
SELECT a FROM t248;
a
TRUNCATE TABLE t7;
SELECT a FROM t249;
a
TRUNCATE TABLE t6;
SELECT a FROM t250;
a
TRUNCATE TABLE t5;
SELECT a FROM t251;
a
TRUNCATE TABLE t4;
SELECT a FROM t252;
a
TRUNCATE TABLE t3;
SELECT a FROM t253;
a
TRUNCATE TABLE t2;
SELECT a FROM t254;
a
TRUNCATE TABLE t1;
SELECT a FROM t255;
a
SELECT a FROM t0;
a
DROP TABLE t0;
DROP TABLE t255;
DROP TABLE t254;
DROP TABLE t253;
DROP TABLE t252;
DROP TABLE t251;
DROP TABLE t250;
DROP TABLE t249;
DROP TABLE t248;
DROP TABLE t247;
DROP TABLE t246;
DROP TABLE t245;
DROP TABLE t244;
DROP TABLE t243;
DROP TABLE t242;
DROP TABLE t241;
DROP TABLE t240;
DROP TABLE t239;
DROP TABLE t238;
DROP TABLE t237;
DROP TABLE t236;
DROP TABLE t235;
DROP TABLE t234;
DROP TABLE t233;
DROP TABLE t232;
DROP TABLE t231;
DROP TABLE t230;
DROP TABLE t229;
DROP TABLE t228;
DROP TABLE t227;
DROP TABLE t226;
DROP TABLE t225;
DROP TABLE t224;
DROP TABLE t223;
DROP TABLE t222;
DROP TABLE t221;
DROP TABLE t220;
DROP TABLE t219;
DROP TABLE t218;
DROP TABLE t217;
DROP TABLE t216;
DROP TABLE t215;
DROP TABLE t214;
DROP TABLE t213;
DROP TABLE t212;
DROP TABLE t211;
DROP TABLE t210;
DROP TABLE t209;
DROP TABLE t208;
DROP TABLE t207;
DROP TABLE t206;
DROP TABLE t205;
DROP TABLE t204;
DROP TABLE t203;
DROP TABLE t202;
DROP TABLE t201;
DROP TABLE t200;
DROP TABLE t199;
DROP TABLE t198;
DROP TABLE t197;
DROP TABLE t196;
DROP TABLE t195;
DROP TABLE t194;
DROP TABLE t193;
DROP TABLE t192;
DROP TABLE t191;
DROP TABLE t190;
DROP TABLE t189;
DROP TABLE t188;
DROP TABLE t187;
DROP TABLE t186;
DROP TABLE t185;
DROP TABLE t184;
DROP TABLE t183;
DROP TABLE t182;
DROP TABLE t181;
DROP TABLE t180;
DROP TABLE t179;
DROP TABLE t178;
DROP TABLE t177;
DROP TABLE t176;
DROP TABLE t175;
DROP TABLE t174;
DROP TABLE t173;
DROP TABLE t172;
DROP TABLE t171;
DROP TABLE t170;
DROP TABLE t169;
DROP TABLE t168;
DROP TABLE t167;
DROP TABLE t166;
DROP TABLE t165;
DROP TABLE t164;
DROP TABLE t163;
DROP TABLE t162;
DROP TABLE t161;
DROP TABLE t160;
DROP TABLE t159;
DROP TABLE t158;
DROP TABLE t157;
DROP TABLE t156;
DROP TABLE t155;
DROP TABLE t154;
DROP TABLE t153;
DROP TABLE t152;
DROP TABLE t151;
DROP TABLE t150;
DROP TABLE t149;
DROP TABLE t148;
DROP TABLE t147;
DROP TABLE t146;
DROP TABLE t145;
DROP TABLE t144;
DROP TABLE t143;
DROP TABLE t142;
DROP TABLE t141;
DROP TABLE t140;
DROP TABLE t139;
DROP TABLE t138;
DROP TABLE t137;
DROP TABLE t136;
DROP TABLE t135;
DROP TABLE t134;
DROP TABLE t133;
DROP TABLE t132;
DROP TABLE t131;
DROP TABLE t130;
DROP TABLE t129;
DROP TABLE t128;
DROP TABLE t127;
DROP TABLE t126;
DROP TABLE t125;
DROP TABLE t124;
DROP TABLE t123;
DROP TABLE t122;
DROP TABLE t121;
DROP TABLE t120;
DROP TABLE t119;
DROP TABLE t118;
DROP TABLE t117;
DROP TABLE t116;
DROP TABLE t115;
DROP TABLE t114;
DROP TABLE t113;
DROP TABLE t112;
DROP TABLE t111;
DROP TABLE t110;
DROP TABLE t109;
DROP TABLE t108;
DROP TABLE t107;
DROP TABLE t106;
DROP TABLE t105;
DROP TABLE t104;
DROP TABLE t103;
DROP TABLE t102;
DROP TABLE t101;
DROP TABLE t100;
DROP TABLE t99;
DROP TABLE t98;
DROP TABLE t97;
DROP TABLE t96;
DROP TABLE t95;
DROP TABLE t94;
DROP TABLE t93;
DROP TABLE t92;
DROP TABLE t91;
DROP TABLE t90;
DROP TABLE t89;
DROP TABLE t88;
DROP TABLE t87;
DROP TABLE t86;
DROP TABLE t85;
DROP TABLE t84;
DROP TABLE t83;
DROP TABLE t82;
DROP TABLE t81;
DROP TABLE t80;
DROP TABLE t79;
DROP TABLE t78;
DROP TABLE t77;
DROP TABLE t76;
DROP TABLE t75;
DROP TABLE t74;
DROP TABLE t73;
DROP TABLE t72;
DROP TABLE t71;
DROP TABLE t70;
DROP TABLE t69;
DROP TABLE t68;
DROP TABLE t67;
DROP TABLE t66;
DROP TABLE t65;
DROP TABLE t64;
DROP TABLE t63;
DROP TABLE t62;
DROP TABLE t61;
DROP TABLE t60;
DROP TABLE t59;
DROP TABLE t58;
DROP TABLE t57;
DROP TABLE t56;
DROP TABLE t55;
DROP TABLE t54;
DROP TABLE t53;
DROP TABLE t52;
DROP TABLE t51;
DROP TABLE t50;
DROP TABLE t49;
DROP TABLE t48;
DROP TABLE t47;
DROP TABLE t46;
DROP TABLE t45;
DROP TABLE t44;
DROP TABLE t43;
DROP TABLE t42;
DROP TABLE t41;
DROP TABLE t40;
DROP TABLE t39;
DROP TABLE t38;
DROP TABLE t37;
DROP TABLE t36;
DROP TABLE t35;
DROP TABLE t34;
DROP TABLE t33;
DROP TABLE t32;
DROP TABLE t31;
DROP TABLE t30;
DROP TABLE t29;
DROP TABLE t28;
DROP TABLE t27;
DROP TABLE t26;
DROP TABLE t25;
DROP TABLE t24;
DROP TABLE t23;
DROP TABLE t22;
DROP TABLE t21;
DROP TABLE t20;
DROP TABLE t19;
DROP TABLE t18;
DROP TABLE t17;
DROP TABLE t16;
DROP TABLE t15;
DROP TABLE t14;
DROP TABLE t13;
DROP TABLE t12;
DROP TABLE t11;
DROP TABLE t10;
DROP TABLE t9;
DROP TABLE t8;
DROP TABLE t7;
DROP TABLE t6;
DROP TABLE t5;
DROP TABLE t4;
DROP TABLE t3;
DROP TABLE t2;
DROP TABLE t1;
SET @@global.query_cache_size = 0;
SET @@global.table_definition_cache = @save_table_definition_cache;
End of 5.1 tests
...@@ -48,3 +48,61 @@ SET @@global.query_cache_size=0; ...@@ -48,3 +48,61 @@ SET @@global.query_cache_size=0;
set @@global.table_definition_cache=@save_table_definition_cache; set @@global.table_definition_cache=@save_table_definition_cache;
# End of 4.1 tests # End of 4.1 tests
#
# Bug#33362: Query cache invalidation (truncate) may hang if cached query uses many tables
#
SET @save_table_definition_cache = @@global.table_definition_cache;
SET @@global.table_definition_cache = 512;
let $c= 255;
while ($c)
{
eval CREATE TABLE t$c (a INT);
eval INSERT INTO t$c VALUES ($c);
dec $c;
}
let $c= 254;
let $str= t255;
while ($c)
{
let $str= t$c,$str;
dec $c;
}
eval CREATE TABLE t0 (a INT) ENGINE=MERGE UNION($str);
SET GLOBAL query_cache_size = 1048576;
FLUSH STATUS;
SELECT a FROM t0 WHERE a = 1;
SHOW STATUS LIKE "Qcache_queries_in_cache";
let $c= 255;
let $i= 1;
while ($c)
{
eval TRUNCATE TABLE t$c;
eval SELECT a FROM t$i;
dec $c;
inc $i;
}
SELECT a FROM t0;
DROP TABLE t0;
let $c= 255;
while ($c)
{
eval DROP TABLE t$c;
dec $c;
}
SET @@global.query_cache_size = 0;
SET @@global.table_definition_cache = @save_table_definition_cache;
--echo End of 5.1 tests
...@@ -2746,7 +2746,7 @@ my_bool Query_cache::register_all_tables(Query_cache_block *block, ...@@ -2746,7 +2746,7 @@ my_bool Query_cache::register_all_tables(Query_cache_block *block,
tmp++) tmp++)
unlink_table(tmp); unlink_table(tmp);
} }
return (n); return test(n);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment