Commit 41c80004 authored by Mattias Jonsson's avatar Mattias Jonsson

merge before pushing

parents a8af693b 2100ec9e
......@@ -149,7 +149,7 @@ test-bt:
echo "no program found for 'ndbcluster' tests - skipped testing" ; \
fi
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --force --comment=funcs1+ps --ps-protocol --suite=funcs_1
@PERL@ ./mysql-test-run.pl --force --comment=funcs1+ps --ps-protocol --reorder --suite=funcs_1
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --force --comment=funcs2 --suite=funcs_2
-cd mysql-test ; MTR_BUILD_THREAD=auto \
......@@ -190,7 +190,7 @@ test-force-full-pl: test-force-full
test-ext-funcs:
cd mysql-test ; \
@PERL@ ./mysql-test-run.pl --force --suite=funcs_1 ; \
@PERL@ ./mysql-test-run.pl --force --reorder --suite=funcs_1 ; \
@PERL@ ./mysql-test-run.pl --force --suite=funcs_2
test-ext-rpl:
......
......@@ -173,7 +173,7 @@ WHERE attempt = 4 - 1 + 1;
UPDATE t_history SET end_cached = 0
WHERE attempt = 4 - 1 + 1;
# Test 1: Does the query with SLEEP need a reasonable time?
SELECT COUNT(*) > 4 - 1 INTO @aux1 FROM t_history
SELECT COUNT(*) >= 4 - 1 INTO @aux1 FROM t_history
WHERE TIMEDIFF(end_ts,start_ts) - @sleep_time_per_result_row * @row_count
BETWEEN 0 AND @max_acceptable_delay;
SELECT @aux1 AS "Expect 1";
......@@ -181,7 +181,7 @@ Expect 1
1
# Test 2: Does the query with SLEEP need a reasonable time even in case
# of the non first execution?
SELECT COUNT(*) > 4 - 1 - 1 INTO @aux2 FROM t_history
SELECT COUNT(*) >= 4 - 1 - 1 INTO @aux2 FROM t_history
WHERE TIMEDIFF(end_ts,start_ts) - @sleep_time_per_result_row * @row_count
BETWEEN 0 AND @max_acceptable_delay
AND attempt > 1;
......
......@@ -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;
SET @@global.query_cache_size=0;
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
##### suite/funcs_1/include/tb3.inc
#
# This auxiliary script is used in several Trigger tests.
#
# If the table need data than the file std_data_ln/funcs_1/memory_tb3.txt
# could be used.
#
--disable_warnings
drop table if exists tb3;
--enable_warnings
--replace_result $engine_type <engine_to_be_used>
eval create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 char(50),
f122 char(50),
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
f132 tinyint zerofill not null DEFAULT 99,
f133 tinyint unsigned zerofill not null DEFAULT 99,
f134 smallint not null DEFAULT 999,
f135 smallint unsigned not null DEFAULT 999,
f136 smallint zerofill not null DEFAULT 999,
f137 smallint unsigned zerofill not null DEFAULT 999,
f138 mediumint not null DEFAULT 9999,
f139 mediumint unsigned not null DEFAULT 9999,
f140 mediumint zerofill not null DEFAULT 9999,
f141 mediumint unsigned zerofill not null DEFAULT 9999,
f142 int not null DEFAULT 99999,
f143 int unsigned not null DEFAULT 99999,
f144 int zerofill not null DEFAULT 99999,
f145 int unsigned zerofill not null DEFAULT 99999,
f146 bigint not null DEFAULT 999999,
f147 bigint unsigned not null DEFAULT 999999,
f148 bigint zerofill not null DEFAULT 999999,
f149 bigint unsigned zerofill not null DEFAULT 999999,
f150 decimal not null DEFAULT 999.999,
f151 decimal unsigned not null DEFAULT 999.17,
f152 decimal zerofill not null DEFAULT 999.999,
f153 decimal unsigned zerofill,
f154 decimal (0),
f155 decimal (64),
f156 decimal (0) unsigned,
f157 decimal (64) unsigned,
f158 decimal (0) zerofill,
f159 decimal (64) zerofill,
f160 decimal (0) unsigned zerofill,
f161 decimal (64) unsigned zerofill,
f162 decimal (0,0),
f163 decimal (63,30),
f164 decimal (0,0) unsigned,
f165 decimal (63,30) unsigned,
f166 decimal (0,0) zerofill,
f167 decimal (63,30) zerofill,
f168 decimal (0,0) unsigned zerofill,
f169 decimal (63,30) unsigned zerofill,
f170 numeric,
f171 numeric unsigned,
f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = $engine_type;
USE test;
drop table if exists tb3 ;
drop table if exists tb3;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f121 char(50),
f122 char(50),
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
......@@ -59,13 +53,11 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = innodb;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
into table tb3;
Testcase: 3.5.1.1:
------------------
......@@ -194,7 +186,7 @@ Testcase 3.5.1.7: - need to fix
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
create table t1 (f1 int, f2 char(25),f3 int) engine=innodb;
create table t1 (f1 int, f2 char(25),f3 int) engine = <engine_to_be_used>;
CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1
for each row set new.f3 = '14';
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
......@@ -238,7 +230,7 @@ ERROR HY000: Trigger in wrong schema
drop database if exists trig_db;
create database trig_db;
use trig_db;
create table t1 (f1 integer) engine = innodb;
create table t1 (f1 integer) engine = <engine_to_be_used>;
use test;
CREATE TRIGGER trig_db.trg6_2 AFTER INSERT on tb3
for each row set @ret_trg6_2 = 5;
......@@ -266,8 +258,8 @@ Testcase 3.5.1.?:
-----------------
drop table if exists t1;
drop table if exists t2;
create table t1 (f1 char(50), f2 integer) engine = innodb;
create table t2 (f1 char(50), f2 integer) engine = innodb;
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create table t2 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig before insert on t1
for each row set new.f1 ='trig t1';
create trigger trig before update on t2
......@@ -299,15 +291,15 @@ create database trig_db1;
create database trig_db2;
create database trig_db3;
use trig_db1;
create table t1 (f1 char(50), f2 integer) engine = innodb;
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig before insert on t1
for each row set new.f1 ='trig1', @test_var1='trig1';
use trig_db2;
create table t2 (f1 char(50), f2 integer) engine = innodb;
create table t2 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig before insert on t2
for each row set new.f1 ='trig2', @test_var2='trig2';
use trig_db3;
create table t1 (f1 char(50), f2 integer) engine = innodb;
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig before insert on t1
for each row set new.f1 ='trig3', @test_var3='trig3';
set @test_var1= '', @test_var2= '', @test_var3= '';
......@@ -345,8 +337,8 @@ drop database if exists trig_db2;
create database trig_db1;
create database trig_db2;
use trig_db1;
create table t1 (f1 char(50), f2 integer) engine = innodb;
create table trig_db2.t1 (f1 char(50), f2 integer) engine = innodb;
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create table trig_db2.t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig1_b before insert on t1
for each row set @test_var1='trig1_b';
create trigger trig_db1.trig1_a after insert on t1
......
USE test;
drop table if exists tb3 ;
drop table if exists tb3;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f121 char(50),
f122 char(50),
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
......@@ -59,20 +53,18 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = innodb;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
into table tb3;
Testcase 3.5.3:
---------------
drop database if exists priv_db;
create database priv_db;
use priv_db;
create table t1 (f1 char(20)) engine= innodb;
create table t1 (f1 char(20)) engine= <engine_to_be_used>;
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
create User test_yesprivs@localhost;
......@@ -608,8 +600,8 @@ Testcase: 3.5.3.x:
use priv_db;
drop table if exists t1;
drop table if exists t2;
create table t1 (f1 int) engine= innodb;
create table t2 (f2 int) engine= innodb;
create table t1 (f1 int) engine= <engine_to_be_used>;
create table t2 (f2 int) engine= <engine_to_be_used>;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost;
......@@ -698,4 +690,5 @@ drop database if exists priv_db;
drop user test_yesprivs@localhost;
drop user test_noprivs@localhost;
drop user test_noprivs;
DROP TABLE test.tb3;
use test;
drop table tb3;
USE test;
drop table if exists tb3 ;
drop table if exists tb3;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f121 char(50),
f122 char(50),
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
......@@ -59,13 +53,11 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = innodb;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
into table tb3;
Testcase: 3.5:
--------------
......@@ -86,7 +78,7 @@ Testcase 3.5.4.1:
-----------------
create database db_drop;
Use db_drop;
create table t1 (f1 char(30)) engine=innodb;
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
grant INSERT, SELECT on db_drop.t1 to test_general;
Use db_drop;
Create trigger trg1 BEFORE INSERT on t1
......@@ -114,7 +106,7 @@ Testcase 3.5.4.2:
create database db_drop2;
Use db_drop2;
drop table if exists t1_432 ;
create table t1_432 (f1 char (30)) engine=innodb;
create table t1_432 (f1 char (30)) engine = <engine_to_be_used>;
Drop trigger tr_does_not_exit;
ERROR HY000: Trigger does not exist
drop table if exists t1_432 ;
......@@ -126,8 +118,8 @@ create database db_drop3;
Use db_drop3;
drop table if exists t1_433 ;
drop table if exists t1_433a ;
create table t1_433 (f1 char (30)) engine=innodb;
create table t1_433a (f1a char (5)) engine=innodb;
create table t1_433 (f1 char (30)) engine = <engine_to_be_used>;
create table t1_433a (f1a char (5)) engine = <engine_to_be_used>;
CREATE TRIGGER trg3 BEFORE INSERT on t1_433 for each row
set new.f1 = 'Trigger 3.5.4.3';
Drop trigger t1.433.trg3;
......@@ -147,7 +139,7 @@ Testcase 3.5.4.4:
-----------------
create database db_drop4;
Use db_drop4;
create table t1 (f1 char(30)) engine=innodb;
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
grant INSERT, SELECT on db_drop4.t1 to test_general;
Create trigger trg4 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.4';
......@@ -168,7 +160,7 @@ where information_schema.triggers.trigger_name='trg4';
trigger_schema trigger_name event_object_table
create database db_drop4;
Use db_drop4;
create table t1 (f1 char(30)) engine=innodb;
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
grant INSERT, SELECT on db_drop4.t1 to test_general;
Insert into t1 values ('2nd Insert 3.5.4.4');
Select * from t1;
......@@ -183,7 +175,7 @@ Testcase 3.5.4.5:
-----------------
create database db_drop5;
Use db_drop5;
create table t1 (f1 char(50)) engine=innodb;
create table t1 (f1 char(50)) engine = <engine_to_be_used>;
grant INSERT, SELECT on t1 to test_general;
Create trigger trg5 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.5';
......@@ -199,7 +191,7 @@ select trigger_schema, trigger_name, event_object_table
from information_schema.triggers
where information_schema.triggers.trigger_name='trg5';
trigger_schema trigger_name event_object_table
create table t1 (f1 char(50)) engine=innodb;
create table t1 (f1 char(50)) engine = <engine_to_be_used>;
grant INSERT, SELECT on t1 to test_general;
Insert into t1 values ('2nd Insert 3.5.4.5');
Select * from t1;
......@@ -240,7 +232,7 @@ Testcase 3.5.5.4:
create database dbtest_one;
create database dbtest_two;
use dbtest_two;
create table t2 (f1 char(15)) engine=innodb;
create table t2 (f1 char(15)) engine = <engine_to_be_used>;
use dbtest_one;
create trigger trg4 before INSERT
on dbtest_two.t2 for each row set new.f1='trig 3.5.5.4';
......
USE test;
drop table if exists tb3 ;
drop table if exists tb3;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f121 char(50),
f122 char(50),
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
......@@ -59,13 +53,11 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = innodb;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
into table tb3;
Testcase: 3.5:
--------------
......@@ -94,17 +86,17 @@ create table t1_i (
i120 char ascii not null DEFAULT b'101',
i136 smallint zerofill not null DEFAULT 999,
i144 int zerofill not null DEFAULT 99999,
i163 decimal (63,30)) engine=innodb;
i163 decimal (63,30)) engine=<engine_to_be_used>;
create table t1_u (
u120 char ascii not null DEFAULT b'101',
u136 smallint zerofill not null DEFAULT 999,
u144 int zerofill not null DEFAULT 99999,
u163 decimal (63,30)) engine=innodb;
u163 decimal (63,30)) engine=<engine_to_be_used>;
create table t1_d (
d120 char ascii not null DEFAULT b'101',
d136 smallint zerofill not null DEFAULT 999,
d144 int zerofill not null DEFAULT 99999,
d163 decimal (63,30)) engine=innodb;
d163 decimal (63,30)) engine=<engine_to_be_used>;
Insert into t1_u values ('a',111,99999,999.99);
Insert into t1_u values ('b',222,99999,999.99);
Insert into t1_u values ('c',333,99999,999.99);
......
USE test;
drop table if exists tb3 ;
drop table if exists tb3;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f121 char(50),
f122 char(50),
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
......@@ -59,12 +53,12 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = innodb;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
Testcase 3.5.9.1/2:
......@@ -74,9 +68,9 @@ set new.f142 = 94087, @counter=@counter+1;
TotalRows
10
Affected
8
9
NotAffected
2
1
NewValuew
0
set @counter=0;
......@@ -84,7 +78,7 @@ Update tb3 Set f142='1' where f130<100;
select count(*) as ExpectedChanged, @counter as TrigCounter
from tb3 where f142=94087;
ExpectedChanged TrigCounter
8 8
9 9
select count(*) as ExpectedNotChange from tb3
where f130<100 and f142<>94087;
ExpectedNotChange
......
USE test;
drop table if exists tb3 ;
drop table if exists tb3;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f121 char(50),
f122 char(50),
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
......@@ -59,12 +53,12 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = innodb;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
Testcase 3.5.10.1/2/3:
......@@ -135,7 +129,7 @@ delete from tb3 where f122 like 'Test 3.5.10.1/2/3%';
Testcase 3.5.10.4:
------------------
create table tb_load (f1 int, f2 char(25),f3 int) engine=innodb;
create table tb_load (f1 int, f2 char(25),f3 int) engine = <engine_to_be_used>;
Create trigger trg4 before insert on tb_load
for each row set new.f3=-(new.f1 div 5), @counter= @counter+1;
set @counter= 0;
......@@ -169,7 +163,7 @@ Testcase 3.5.10.6: (implemented in trig_frkey.test)
Testcase 3.5.10.extra:
----------------------
create table t1_sp (var136 tinyint, var151 decimal) engine=innodb;
create table t1_sp (var136 tinyint, var151 decimal) engine = <engine_to_be_used>;
create trigger trg before insert on t1_sp
for each row set @counter=@counter+1;
create procedure trig_sp()
......@@ -218,12 +212,12 @@ drop table if exists t2_2;
drop table if exists t2_3;
drop table if exists t2_4;
drop table if exists t3;
create table t1 (f1 integer) engine=innodb;
create table t2_1 (f1 integer) engine=innodb;
create table t2_2 (f1 integer) engine=innodb;
create table t2_3 (f1 integer) engine=innodb;
create table t2_4 (f1 integer) engine=innodb;
create table t3 (f1 integer) engine=innodb;
create table t1 (f1 integer) engine = <engine_to_be_used>;
create table t2_1 (f1 integer) engine = <engine_to_be_used>;
create table t2_2 (f1 integer) engine = <engine_to_be_used>;
create table t2_3 (f1 integer) engine = <engine_to_be_used>;
create table t2_4 (f1 integer) engine = <engine_to_be_used>;
create table t3 (f1 integer) engine = <engine_to_be_used>;
insert into t1 values (1);
create trigger tr1 after insert on t1 for each row
BEGIN
......@@ -261,10 +255,10 @@ drop table if exists t1;
drop table if exists t2;
drop table if exists t3;
drop table if exists t4;
create table t1 (f1 integer) engine = innodb;
create table t2 (f2 integer) engine = innodb;
create table t3 (f3 integer) engine = innodb;
create table t4 (f4 integer) engine = innodb;
create table t1 (f1 integer) engine = <engine_to_be_used>;
create table t2 (f2 integer) engine = <engine_to_be_used>;
create table t3 (f3 integer) engine = <engine_to_be_used>;
create table t4 (f4 integer) engine = <engine_to_be_used>;
insert into t1 values (0);
create trigger tr1 after insert on t1
for each row insert into t2 (f2) values (new.f1+1);
......@@ -300,7 +294,7 @@ set @sql_mode='traditional';
create table t1_sp (
count integer,
var136 tinyint,
var151 decimal) engine=innodb;
var151 decimal) engine = <engine_to_be_used>;
create procedure trig_sp()
begin
declare done int default 0;
......@@ -354,7 +348,7 @@ drop procedure trig_sp;
drop trigger trg;
drop table t1_sp;
Testcase y.y.y.5: Roleback of nested trigger references
Testcase y.y.y.5: Rollback of nested trigger references
-------------------------------------------------------
set @@sql_mode='traditional';
use test;
......@@ -362,10 +356,10 @@ drop table if exists t1;
drop table if exists t2;
drop table if exists t3;
drop table if exists t4;
create table t1 (f1 integer) engine = innodb;
create table t2 (f2 integer) engine = innodb;
create table t3 (f3 integer) engine = innodb;
create table t4 (f4 tinyint) engine = innodb;
create table t1 (f1 integer) engine = <engine_to_be_used>;
create table t2 (f2 integer) engine = <engine_to_be_used>;
create table t3 (f3 integer) engine = <engine_to_be_used>;
create table t4 (f4 tinyint) engine = <engine_to_be_used>;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
......
......@@ -53,13 +53,11 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = memory;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
Testcase: 3.5.1.1:
------------------
......@@ -188,7 +186,7 @@ Testcase 3.5.1.7: - need to fix
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
create table t1 (f1 int, f2 char(25),f3 int) engine=memory;
create table t1 (f1 int, f2 char(25),f3 int) engine = <engine_to_be_used>;
CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1
for each row set new.f3 = '14';
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
......@@ -232,7 +230,7 @@ ERROR HY000: Trigger in wrong schema
drop database if exists trig_db;
create database trig_db;
use trig_db;
create table t1 (f1 integer) engine = memory;
create table t1 (f1 integer) engine = <engine_to_be_used>;
use test;
CREATE TRIGGER trig_db.trg6_2 AFTER INSERT on tb3
for each row set @ret_trg6_2 = 5;
......@@ -260,8 +258,8 @@ Testcase 3.5.1.?:
-----------------
drop table if exists t1;
drop table if exists t2;
create table t1 (f1 char(50), f2 integer) engine = memory;
create table t2 (f1 char(50), f2 integer) engine = memory;
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create table t2 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig before insert on t1
for each row set new.f1 ='trig t1';
create trigger trig before update on t2
......@@ -293,15 +291,15 @@ create database trig_db1;
create database trig_db2;
create database trig_db3;
use trig_db1;
create table t1 (f1 char(50), f2 integer) engine = memory;
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig before insert on t1
for each row set new.f1 ='trig1', @test_var1='trig1';
use trig_db2;
create table t2 (f1 char(50), f2 integer) engine = memory;
create table t2 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig before insert on t2
for each row set new.f1 ='trig2', @test_var2='trig2';
use trig_db3;
create table t1 (f1 char(50), f2 integer) engine = memory;
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig before insert on t1
for each row set new.f1 ='trig3', @test_var3='trig3';
set @test_var1= '', @test_var2= '', @test_var3= '';
......@@ -339,8 +337,8 @@ drop database if exists trig_db2;
create database trig_db1;
create database trig_db2;
use trig_db1;
create table t1 (f1 char(50), f2 integer) engine = memory;
create table trig_db2.t1 (f1 char(50), f2 integer) engine = memory;
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create table trig_db2.t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig1_b before insert on t1
for each row set @test_var1='trig1_b';
create trigger trig_db1.trig1_a after insert on t1
......
......@@ -53,20 +53,18 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = memory;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
Testcase 3.5.3:
---------------
drop database if exists priv_db;
create database priv_db;
use priv_db;
create table t1 (f1 char(20)) engine= memory;
create table t1 (f1 char(20)) engine= <engine_to_be_used>;
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
create User test_yesprivs@localhost;
......@@ -602,8 +600,8 @@ Testcase: 3.5.3.x:
use priv_db;
drop table if exists t1;
drop table if exists t2;
create table t1 (f1 int) engine= memory;
create table t2 (f2 int) engine= memory;
create table t1 (f1 int) engine= <engine_to_be_used>;
create table t2 (f2 int) engine= <engine_to_be_used>;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost;
......@@ -692,4 +690,5 @@ drop database if exists priv_db;
drop user test_yesprivs@localhost;
drop user test_noprivs@localhost;
drop user test_noprivs;
DROP TABLE test.tb3;
use test;
drop table tb3;
......@@ -53,13 +53,11 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = memory;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
Testcase: 3.5:
--------------
......@@ -80,7 +78,7 @@ Testcase 3.5.4.1:
-----------------
create database db_drop;
Use db_drop;
create table t1 (f1 char(30)) engine=memory;
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
grant INSERT, SELECT on db_drop.t1 to test_general;
Use db_drop;
Create trigger trg1 BEFORE INSERT on t1
......@@ -108,7 +106,7 @@ Testcase 3.5.4.2:
create database db_drop2;
Use db_drop2;
drop table if exists t1_432 ;
create table t1_432 (f1 char (30)) engine=memory;
create table t1_432 (f1 char (30)) engine = <engine_to_be_used>;
Drop trigger tr_does_not_exit;
ERROR HY000: Trigger does not exist
drop table if exists t1_432 ;
......@@ -120,8 +118,8 @@ create database db_drop3;
Use db_drop3;
drop table if exists t1_433 ;
drop table if exists t1_433a ;
create table t1_433 (f1 char (30)) engine=memory;
create table t1_433a (f1a char (5)) engine=memory;
create table t1_433 (f1 char (30)) engine = <engine_to_be_used>;
create table t1_433a (f1a char (5)) engine = <engine_to_be_used>;
CREATE TRIGGER trg3 BEFORE INSERT on t1_433 for each row
set new.f1 = 'Trigger 3.5.4.3';
Drop trigger t1.433.trg3;
......@@ -141,7 +139,7 @@ Testcase 3.5.4.4:
-----------------
create database db_drop4;
Use db_drop4;
create table t1 (f1 char(30)) engine=memory;
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
grant INSERT, SELECT on db_drop4.t1 to test_general;
Create trigger trg4 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.4';
......@@ -162,7 +160,7 @@ where information_schema.triggers.trigger_name='trg4';
trigger_schema trigger_name event_object_table
create database db_drop4;
Use db_drop4;
create table t1 (f1 char(30)) engine=memory;
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
grant INSERT, SELECT on db_drop4.t1 to test_general;
Insert into t1 values ('2nd Insert 3.5.4.4');
Select * from t1;
......@@ -177,7 +175,7 @@ Testcase 3.5.4.5:
-----------------
create database db_drop5;
Use db_drop5;
create table t1 (f1 char(50)) engine=memory;
create table t1 (f1 char(50)) engine = <engine_to_be_used>;
grant INSERT, SELECT on t1 to test_general;
Create trigger trg5 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.5';
......@@ -193,7 +191,7 @@ select trigger_schema, trigger_name, event_object_table
from information_schema.triggers
where information_schema.triggers.trigger_name='trg5';
trigger_schema trigger_name event_object_table
create table t1 (f1 char(50)) engine=memory;
create table t1 (f1 char(50)) engine = <engine_to_be_used>;
grant INSERT, SELECT on t1 to test_general;
Insert into t1 values ('2nd Insert 3.5.4.5');
Select * from t1;
......@@ -234,7 +232,7 @@ Testcase 3.5.5.4:
create database dbtest_one;
create database dbtest_two;
use dbtest_two;
create table t2 (f1 char(15)) engine=memory;
create table t2 (f1 char(15)) engine = <engine_to_be_used>;
use dbtest_one;
create trigger trg4 before INSERT
on dbtest_two.t2 for each row set new.f1='trig 3.5.5.4';
......
......@@ -53,13 +53,11 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = memory;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
Testcase: 3.5:
--------------
......@@ -88,17 +86,17 @@ create table t1_i (
i120 char ascii not null DEFAULT b'101',
i136 smallint zerofill not null DEFAULT 999,
i144 int zerofill not null DEFAULT 99999,
i163 decimal (63,30)) engine=memory;
i163 decimal (63,30)) engine=<engine_to_be_used>;
create table t1_u (
u120 char ascii not null DEFAULT b'101',
u136 smallint zerofill not null DEFAULT 999,
u144 int zerofill not null DEFAULT 99999,
u163 decimal (63,30)) engine=memory;
u163 decimal (63,30)) engine=<engine_to_be_used>;
create table t1_d (
d120 char ascii not null DEFAULT b'101',
d136 smallint zerofill not null DEFAULT 999,
d144 int zerofill not null DEFAULT 99999,
d163 decimal (63,30)) engine=memory;
d163 decimal (63,30)) engine=<engine_to_be_used>;
Insert into t1_u values ('a',111,99999,999.99);
Insert into t1_u values ('b',222,99999,999.99);
Insert into t1_u values ('c',333,99999,999.99);
......
......@@ -53,7 +53,7 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = memory;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
......
......@@ -53,7 +53,7 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = memory;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
......@@ -129,7 +129,7 @@ delete from tb3 where f122 like 'Test 3.5.10.1/2/3%';
Testcase 3.5.10.4:
------------------
create table tb_load (f1 int, f2 char(25),f3 int) engine=memory;
create table tb_load (f1 int, f2 char(25),f3 int) engine = <engine_to_be_used>;
Create trigger trg4 before insert on tb_load
for each row set new.f3=-(new.f1 div 5), @counter= @counter+1;
set @counter= 0;
......@@ -163,7 +163,7 @@ Testcase 3.5.10.6: (implemented in trig_frkey.test)
Testcase 3.5.10.extra:
----------------------
create table t1_sp (var136 tinyint, var151 decimal) engine=memory;
create table t1_sp (var136 tinyint, var151 decimal) engine = <engine_to_be_used>;
create trigger trg before insert on t1_sp
for each row set @counter=@counter+1;
create procedure trig_sp()
......@@ -212,12 +212,12 @@ drop table if exists t2_2;
drop table if exists t2_3;
drop table if exists t2_4;
drop table if exists t3;
create table t1 (f1 integer) engine=memory;
create table t2_1 (f1 integer) engine=memory;
create table t2_2 (f1 integer) engine=memory;
create table t2_3 (f1 integer) engine=memory;
create table t2_4 (f1 integer) engine=memory;
create table t3 (f1 integer) engine=memory;
create table t1 (f1 integer) engine = <engine_to_be_used>;
create table t2_1 (f1 integer) engine = <engine_to_be_used>;
create table t2_2 (f1 integer) engine = <engine_to_be_used>;
create table t2_3 (f1 integer) engine = <engine_to_be_used>;
create table t2_4 (f1 integer) engine = <engine_to_be_used>;
create table t3 (f1 integer) engine = <engine_to_be_used>;
insert into t1 values (1);
create trigger tr1 after insert on t1 for each row
BEGIN
......@@ -255,10 +255,10 @@ drop table if exists t1;
drop table if exists t2;
drop table if exists t3;
drop table if exists t4;
create table t1 (f1 integer) engine = memory;
create table t2 (f2 integer) engine = memory;
create table t3 (f3 integer) engine = memory;
create table t4 (f4 integer) engine = memory;
create table t1 (f1 integer) engine = <engine_to_be_used>;
create table t2 (f2 integer) engine = <engine_to_be_used>;
create table t3 (f3 integer) engine = <engine_to_be_used>;
create table t4 (f4 integer) engine = <engine_to_be_used>;
insert into t1 values (0);
create trigger tr1 after insert on t1
for each row insert into t2 (f2) values (new.f1+1);
......@@ -298,7 +298,7 @@ set @sql_mode='traditional';
create table t1_sp (
count integer,
var136 tinyint,
var151 decimal) engine=memory;
var151 decimal) engine = <engine_to_be_used>;
create procedure trig_sp()
begin
declare done int default 0;
......@@ -352,7 +352,7 @@ drop procedure trig_sp;
drop trigger trg;
drop table t1_sp;
Testcase y.y.y.5: Roleback of nested trigger references
Testcase y.y.y.5: Rollback of nested trigger references
-------------------------------------------------------
set @@sql_mode='traditional';
use test;
......@@ -360,10 +360,10 @@ drop table if exists t1;
drop table if exists t2;
drop table if exists t3;
drop table if exists t4;
create table t1 (f1 integer) engine = memory;
create table t2 (f2 integer) engine = memory;
create table t3 (f3 integer) engine = memory;
create table t4 (f4 tinyint) engine = memory;
create table t1 (f1 integer) engine = <engine_to_be_used>;
create table t2 (f2 integer) engine = <engine_to_be_used>;
create table t3 (f3 integer) engine = <engine_to_be_used>;
create table t4 (f4 tinyint) engine = <engine_to_be_used>;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
......
USE test;
drop table if exists tb3 ;
drop table if exists tb3;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f121 char(50),
f122 char(50),
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
......@@ -59,13 +53,11 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) Engine = myisam;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb3.txt'
into table tb3;
Testcase: 3.5.1.1:
------------------
......@@ -194,7 +186,7 @@ Testcase 3.5.1.7: - need to fix
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
create table t1 (f1 int, f2 char(25),f3 int) engine=myisam;
create table t1 (f1 int, f2 char(25),f3 int) engine = <engine_to_be_used>;
CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1
for each row set new.f3 = '14';
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
......@@ -238,7 +230,7 @@ ERROR HY000: Trigger in wrong schema
drop database if exists trig_db;
create database trig_db;
use trig_db;
create table t1 (f1 integer) engine = myisam;
create table t1 (f1 integer) engine = <engine_to_be_used>;
use test;
CREATE TRIGGER trig_db.trg6_2 AFTER INSERT on tb3
for each row set @ret_trg6_2 = 5;
......@@ -266,8 +258,8 @@ Testcase 3.5.1.?:
-----------------
drop table if exists t1;
drop table if exists t2;
create table t1 (f1 char(50), f2 integer) engine = myisam;
create table t2 (f1 char(50), f2 integer) engine = myisam;
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create table t2 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig before insert on t1
for each row set new.f1 ='trig t1';
create trigger trig before update on t2
......@@ -299,15 +291,15 @@ create database trig_db1;
create database trig_db2;
create database trig_db3;
use trig_db1;
create table t1 (f1 char(50), f2 integer) engine = myisam;
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig before insert on t1
for each row set new.f1 ='trig1', @test_var1='trig1';
use trig_db2;
create table t2 (f1 char(50), f2 integer) engine = myisam;
create table t2 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig before insert on t2
for each row set new.f1 ='trig2', @test_var2='trig2';
use trig_db3;
create table t1 (f1 char(50), f2 integer) engine = myisam;
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig before insert on t1
for each row set new.f1 ='trig3', @test_var3='trig3';
set @test_var1= '', @test_var2= '', @test_var3= '';
......@@ -345,8 +337,8 @@ drop database if exists trig_db2;
create database trig_db1;
create database trig_db2;
use trig_db1;
create table t1 (f1 char(50), f2 integer) engine = myisam;
create table trig_db2.t1 (f1 char(50), f2 integer) engine = myisam;
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create table trig_db2.t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig1_b before insert on t1
for each row set @test_var1='trig1_b';
create trigger trig_db1.trig1_a after insert on t1
......
USE test;
drop table if exists tb3 ;
drop table if exists tb3;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f121 char(50),
f122 char(50),
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
......@@ -59,20 +53,18 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) Engine = myisam;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb3.txt'
into table tb3;
Testcase 3.5.3:
---------------
drop database if exists priv_db;
create database priv_db;
use priv_db;
create table t1 (f1 char(20)) engine= myisam;
create table t1 (f1 char(20)) engine= <engine_to_be_used>;
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
create User test_yesprivs@localhost;
......@@ -608,8 +600,8 @@ Testcase: 3.5.3.x:
use priv_db;
drop table if exists t1;
drop table if exists t2;
create table t1 (f1 int) engine= myisam;
create table t2 (f2 int) engine= myisam;
create table t1 (f1 int) engine= <engine_to_be_used>;
create table t2 (f2 int) engine= <engine_to_be_used>;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost;
......@@ -698,4 +690,5 @@ drop database if exists priv_db;
drop user test_yesprivs@localhost;
drop user test_noprivs@localhost;
drop user test_noprivs;
DROP TABLE test.tb3;
use test;
drop table tb3;
USE test;
drop table if exists tb3 ;
drop table if exists tb3;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f121 char(50),
f122 char(50),
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
......@@ -59,13 +53,11 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) Engine = myisam;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb3.txt'
into table tb3;
Testcase: 3.5:
--------------
......@@ -86,7 +78,7 @@ Testcase 3.5.4.1:
-----------------
create database db_drop;
Use db_drop;
create table t1 (f1 char(30)) engine=myisam;
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
grant INSERT, SELECT on db_drop.t1 to test_general;
Use db_drop;
Create trigger trg1 BEFORE INSERT on t1
......@@ -114,7 +106,7 @@ Testcase 3.5.4.2:
create database db_drop2;
Use db_drop2;
drop table if exists t1_432 ;
create table t1_432 (f1 char (30)) engine=myisam;
create table t1_432 (f1 char (30)) engine = <engine_to_be_used>;
Drop trigger tr_does_not_exit;
ERROR HY000: Trigger does not exist
drop table if exists t1_432 ;
......@@ -126,8 +118,8 @@ create database db_drop3;
Use db_drop3;
drop table if exists t1_433 ;
drop table if exists t1_433a ;
create table t1_433 (f1 char (30)) engine=myisam;
create table t1_433a (f1a char (5)) engine=myisam;
create table t1_433 (f1 char (30)) engine = <engine_to_be_used>;
create table t1_433a (f1a char (5)) engine = <engine_to_be_used>;
CREATE TRIGGER trg3 BEFORE INSERT on t1_433 for each row
set new.f1 = 'Trigger 3.5.4.3';
Drop trigger t1.433.trg3;
......@@ -147,7 +139,7 @@ Testcase 3.5.4.4:
-----------------
create database db_drop4;
Use db_drop4;
create table t1 (f1 char(30)) engine=myisam;
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
grant INSERT, SELECT on db_drop4.t1 to test_general;
Create trigger trg4 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.4';
......@@ -168,7 +160,7 @@ where information_schema.triggers.trigger_name='trg4';
trigger_schema trigger_name event_object_table
create database db_drop4;
Use db_drop4;
create table t1 (f1 char(30)) engine=myisam;
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
grant INSERT, SELECT on db_drop4.t1 to test_general;
Insert into t1 values ('2nd Insert 3.5.4.4');
Select * from t1;
......@@ -183,7 +175,7 @@ Testcase 3.5.4.5:
-----------------
create database db_drop5;
Use db_drop5;
create table t1 (f1 char(50)) engine=myisam;
create table t1 (f1 char(50)) engine = <engine_to_be_used>;
grant INSERT, SELECT on t1 to test_general;
Create trigger trg5 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.5';
......@@ -199,7 +191,7 @@ select trigger_schema, trigger_name, event_object_table
from information_schema.triggers
where information_schema.triggers.trigger_name='trg5';
trigger_schema trigger_name event_object_table
create table t1 (f1 char(50)) engine=myisam;
create table t1 (f1 char(50)) engine = <engine_to_be_used>;
grant INSERT, SELECT on t1 to test_general;
Insert into t1 values ('2nd Insert 3.5.4.5');
Select * from t1;
......@@ -240,7 +232,7 @@ Testcase 3.5.5.4:
create database dbtest_one;
create database dbtest_two;
use dbtest_two;
create table t2 (f1 char(15)) engine=myisam;
create table t2 (f1 char(15)) engine = <engine_to_be_used>;
use dbtest_one;
create trigger trg4 before INSERT
on dbtest_two.t2 for each row set new.f1='trig 3.5.5.4';
......
USE test;
drop table if exists tb3 ;
drop table if exists tb3;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f121 char(50),
f122 char(50),
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
......@@ -59,13 +53,11 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) Engine = myisam;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb3.txt'
into table tb3;
Testcase: 3.5:
--------------
......@@ -94,17 +86,17 @@ create table t1_i (
i120 char ascii not null DEFAULT b'101',
i136 smallint zerofill not null DEFAULT 999,
i144 int zerofill not null DEFAULT 99999,
i163 decimal (63,30)) engine=myisam;
i163 decimal (63,30)) engine=<engine_to_be_used>;
create table t1_u (
u120 char ascii not null DEFAULT b'101',
u136 smallint zerofill not null DEFAULT 999,
u144 int zerofill not null DEFAULT 99999,
u163 decimal (63,30)) engine=myisam;
u163 decimal (63,30)) engine=<engine_to_be_used>;
create table t1_d (
d120 char ascii not null DEFAULT b'101',
d136 smallint zerofill not null DEFAULT 999,
d144 int zerofill not null DEFAULT 99999,
d163 decimal (63,30)) engine=myisam;
d163 decimal (63,30)) engine=<engine_to_be_used>;
Insert into t1_u values ('a',111,99999,999.99);
Insert into t1_u values ('b',222,99999,999.99);
Insert into t1_u values ('c',333,99999,999.99);
......
USE test;
drop table if exists tb3 ;
drop table if exists tb3;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f121 char(50),
f122 char(50),
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
......@@ -59,12 +53,12 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) Engine = myisam;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb3.txt'
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
Testcase 3.5.9.1/2:
......@@ -74,9 +68,9 @@ set new.f142 = 94087, @counter=@counter+1;
TotalRows
10
Affected
8
9
NotAffected
2
1
NewValuew
0
set @counter=0;
......@@ -84,7 +78,7 @@ Update tb3 Set f142='1' where f130<100;
select count(*) as ExpectedChanged, @counter as TrigCounter
from tb3 where f142=94087;
ExpectedChanged TrigCounter
8 8
9 9
select count(*) as ExpectedNotChange from tb3
where f130<100 and f142<>94087;
ExpectedNotChange
......
USE test;
drop table if exists tb3 ;
drop table if exists tb3;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f121 char(50),
f122 char(50),
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
......@@ -59,12 +53,12 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) Engine = myisam;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb3.txt'
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
Testcase 3.5.10.1/2/3:
......@@ -135,7 +129,7 @@ delete from tb3 where f122 like 'Test 3.5.10.1/2/3%';
Testcase 3.5.10.4:
------------------
create table tb_load (f1 int, f2 char(25),f3 int) engine=myisam;
create table tb_load (f1 int, f2 char(25),f3 int) engine = <engine_to_be_used>;
Create trigger trg4 before insert on tb_load
for each row set new.f3=-(new.f1 div 5), @counter= @counter+1;
set @counter= 0;
......@@ -169,7 +163,7 @@ Testcase 3.5.10.6: (implemented in trig_frkey.test)
Testcase 3.5.10.extra:
----------------------
create table t1_sp (var136 tinyint, var151 decimal) engine=myisam;
create table t1_sp (var136 tinyint, var151 decimal) engine = <engine_to_be_used>;
create trigger trg before insert on t1_sp
for each row set @counter=@counter+1;
create procedure trig_sp()
......@@ -218,12 +212,12 @@ drop table if exists t2_2;
drop table if exists t2_3;
drop table if exists t2_4;
drop table if exists t3;
create table t1 (f1 integer) engine=myisam;
create table t2_1 (f1 integer) engine=myisam;
create table t2_2 (f1 integer) engine=myisam;
create table t2_3 (f1 integer) engine=myisam;
create table t2_4 (f1 integer) engine=myisam;
create table t3 (f1 integer) engine=myisam;
create table t1 (f1 integer) engine = <engine_to_be_used>;
create table t2_1 (f1 integer) engine = <engine_to_be_used>;
create table t2_2 (f1 integer) engine = <engine_to_be_used>;
create table t2_3 (f1 integer) engine = <engine_to_be_used>;
create table t2_4 (f1 integer) engine = <engine_to_be_used>;
create table t3 (f1 integer) engine = <engine_to_be_used>;
insert into t1 values (1);
create trigger tr1 after insert on t1 for each row
BEGIN
......@@ -261,10 +255,10 @@ drop table if exists t1;
drop table if exists t2;
drop table if exists t3;
drop table if exists t4;
create table t1 (f1 integer) engine = myisam;
create table t2 (f2 integer) engine = myisam;
create table t3 (f3 integer) engine = myisam;
create table t4 (f4 integer) engine = myisam;
create table t1 (f1 integer) engine = <engine_to_be_used>;
create table t2 (f2 integer) engine = <engine_to_be_used>;
create table t3 (f3 integer) engine = <engine_to_be_used>;
create table t4 (f4 integer) engine = <engine_to_be_used>;
insert into t1 values (0);
create trigger tr1 after insert on t1
for each row insert into t2 (f2) values (new.f1+1);
......@@ -304,7 +298,7 @@ set @sql_mode='traditional';
create table t1_sp (
count integer,
var136 tinyint,
var151 decimal) engine=myisam;
var151 decimal) engine = <engine_to_be_used>;
create procedure trig_sp()
begin
declare done int default 0;
......@@ -358,7 +352,7 @@ drop procedure trig_sp;
drop trigger trg;
drop table t1_sp;
Testcase y.y.y.5: Roleback of nested trigger references
Testcase y.y.y.5: Rollback of nested trigger references
-------------------------------------------------------
set @@sql_mode='traditional';
use test;
......@@ -366,10 +360,10 @@ drop table if exists t1;
drop table if exists t2;
drop table if exists t3;
drop table if exists t4;
create table t1 (f1 integer) engine = myisam;
create table t2 (f2 integer) engine = myisam;
create table t3 (f3 integer) engine = myisam;
create table t4 (f4 tinyint) engine = myisam;
create table t1 (f1 integer) engine = <engine_to_be_used>;
create table t2 (f2 integer) engine = <engine_to_be_used>;
create table t3 (f3 integer) engine = <engine_to_be_used>;
create table t4 (f4 tinyint) engine = <engine_to_be_used>;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
......
USE test;
drop table if exists tb3 ;
drop table if exists tb3;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f121 char(50),
f122 char(50),
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
......@@ -59,14 +53,11 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = ndb;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/ndb_tb3.txt'
into table tb3;
Testcase: 3.5.1.1:
------------------
......@@ -121,8 +112,8 @@ set @test_before = 0;
set @test_after = 0;
select f121, f122, f142, f144, f134 from tb3 where f121 = 'Test 3.5.1.1';
f121 f122 f142 f144 f134
Test 3.5.1.1 Second Row 2 0000000006 2
Test 3.5.1.1 Before Update Trigger 27 0000000008 1
Test 3.5.1.1 Second Row 2 0000000006 2
select @test_before, @test_after;
@test_before @test_after
0 0
......@@ -195,7 +186,7 @@ Testcase 3.5.1.7: - need to fix
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
create table t1 (f1 int, f2 char(25),f3 int) engine=ndb;
create table t1 (f1 int, f2 char(25),f3 int) engine = <engine_to_be_used>;
CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1
for each row set new.f3 = '14';
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
......@@ -239,7 +230,7 @@ ERROR HY000: Trigger in wrong schema
drop database if exists trig_db;
create database trig_db;
use trig_db;
create table t1 (f1 integer) engine = ndb;
create table t1 (f1 integer) engine = <engine_to_be_used>;
use test;
CREATE TRIGGER trig_db.trg6_2 AFTER INSERT on tb3
for each row set @ret_trg6_2 = 5;
......@@ -267,8 +258,8 @@ Testcase 3.5.1.?:
-----------------
drop table if exists t1;
drop table if exists t2;
create table t1 (f1 char(50), f2 integer) engine = ndb;
create table t2 (f1 char(50), f2 integer) engine = ndb;
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create table t2 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig before insert on t1
for each row set new.f1 ='trig t1';
create trigger trig before update on t2
......@@ -300,15 +291,15 @@ create database trig_db1;
create database trig_db2;
create database trig_db3;
use trig_db1;
create table t1 (f1 char(50), f2 integer) engine = ndb;
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig before insert on t1
for each row set new.f1 ='trig1', @test_var1='trig1';
use trig_db2;
create table t2 (f1 char(50), f2 integer) engine = ndb;
create table t2 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig before insert on t2
for each row set new.f1 ='trig2', @test_var2='trig2';
use trig_db3;
create table t1 (f1 char(50), f2 integer) engine = ndb;
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig before insert on t1
for each row set new.f1 ='trig3', @test_var3='trig3';
set @test_var1= '', @test_var2= '', @test_var3= '';
......@@ -346,8 +337,8 @@ drop database if exists trig_db2;
create database trig_db1;
create database trig_db2;
use trig_db1;
create table t1 (f1 char(50), f2 integer) engine = ndb;
create table trig_db2.t1 (f1 char(50), f2 integer) engine = ndb;
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create table trig_db2.t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig1_b before insert on t1
for each row set @test_var1='trig1_b';
create trigger trig_db1.trig1_a after insert on t1
......
USE test;
drop table if exists tb3 ;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
f132 tinyint zerofill not null DEFAULT 99,
f133 tinyint unsigned zerofill not null DEFAULT 99,
f134 smallint not null DEFAULT 999,
f135 smallint unsigned not null DEFAULT 999,
f136 smallint zerofill not null DEFAULT 999,
f137 smallint unsigned zerofill not null DEFAULT 999,
f138 mediumint not null DEFAULT 9999,
f139 mediumint unsigned not null DEFAULT 9999,
f140 mediumint zerofill not null DEFAULT 9999,
f141 mediumint unsigned zerofill not null DEFAULT 9999,
f142 int not null DEFAULT 99999,
f143 int unsigned not null DEFAULT 99999,
f144 int zerofill not null DEFAULT 99999,
f145 int unsigned zerofill not null DEFAULT 99999,
f146 bigint not null DEFAULT 999999,
f147 bigint unsigned not null DEFAULT 999999,
f148 bigint zerofill not null DEFAULT 999999,
f149 bigint unsigned zerofill not null DEFAULT 999999,
f150 decimal not null DEFAULT 999.999,
f151 decimal unsigned not null DEFAULT 999.17,
f152 decimal zerofill not null DEFAULT 999.999,
f153 decimal unsigned zerofill,
f154 decimal (0),
f155 decimal (64),
f156 decimal (0) unsigned,
f157 decimal (64) unsigned,
f158 decimal (0) zerofill,
f159 decimal (64) zerofill,
f160 decimal (0) unsigned zerofill,
f161 decimal (64) unsigned zerofill,
f162 decimal (0,0),
f163 decimal (63,30),
f164 decimal (0,0) unsigned,
f165 decimal (63,30) unsigned,
f166 decimal (0,0) zerofill,
f167 decimal (63,30) zerofill,
f168 decimal (0,0) unsigned zerofill,
f169 decimal (63,30) unsigned zerofill,
f170 numeric,
f171 numeric unsigned,
f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = ndb;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/ndb_tb3.txt'
into table tb3;
Testcase: 3.5.1.1:
------------------
use test;
Create trigger trg1_1 BEFORE INSERT
on tb3 for each row set @test_before = 2, new.f142 = @test_before;
Create trigger trg1_2 AFTER INSERT
on tb3 for each row set @test_after = 6;
Create trigger trg1_4 BEFORE UPDATE
on tb3 for each row set @test_before = 27,
new.f142 = @test_before,
new.f122 = 'Before Update Trigger';
Create trigger trg1_3 AFTER UPDATE
on tb3 for each row set @test_after = '15';
Create trigger trg1_5 BEFORE DELETE on tb3 for each row
select count(*) into @test_before from tb3 as tr_tb3
where f121 = 'Test 3.5.1.1';
Create trigger trg1_6 AFTER DELETE on tb3 for each row
select count(*) into @test_after from tb3 as tr_tb3
where f121 = 'Test 3.5.1.1';
set @test_before = 1;
set @test_after = 5;
select @test_before, @test_after;
@test_before @test_after
1 5
Insert into tb3 (f121, f122, f142, f144, f134)
values ('Test 3.5.1.1', 'First Row', @test_before, @test_after, 1);
select f121, f122, f142, f144, f134 from tb3 where f121 = 'Test 3.5.1.1';
f121 f122 f142 f144 f134
Test 3.5.1.1 First Row 2 0000000005 1
select @test_before, @test_after;
@test_before @test_after
2 6
set @test_before = 18;
set @test_after = 8;
select @test_before, @test_after;
@test_before @test_after
18 8
Update tb3 set tb3.f122 = 'Update',
tb3.f142 = @test_before,
tb3.f144 = @test_after
where tb3.f121 = 'Test 3.5.1.1';
select f121, f122, f142, f144, f134 from tb3 where f121 = 'Test 3.5.1.1';
f121 f122 f142 f144 f134
Test 3.5.1.1 Before Update Trigger 27 0000000008 1
select @test_before, @test_after;
@test_before @test_after
27 15
Insert into tb3 (f121, f122, f142, f144, f134)
values ('Test 3.5.1.1', 'Second Row', 5, 6, 2);
set @test_before = 0;
set @test_after = 0;
select f121, f122, f142, f144, f134 from tb3 where f121 = 'Test 3.5.1.1';
f121 f122 f142 f144 f134
Test 3.5.1.1 Second Row 2 0000000006 2
Test 3.5.1.1 Before Update Trigger 27 0000000008 1
select @test_before, @test_after;
@test_before @test_after
0 0
Delete from tb3 where f121 = 'Test 3.5.1.1' and f134 = 2;
select f121, f122, f142, f144, f134 from tb3 where f121 = 'Test 3.5.1.1';
f121 f122 f142 f144 f134
Test 3.5.1.1 Before Update Trigger 27 0000000008 1
select @test_before, @test_after;
@test_before @test_after
2 1
drop trigger trg1_1;
drop trigger trg1_2;
drop trigger trg1_3;
drop trigger trg1_4;
drop trigger trg1_5;
drop trigger trg1_6;
delete from tb3 where f121='Test 3.5.1.1';
Testcase: 3.5.1.2:
------------------
Create trigger trg_1 after insert
on tb3 for each statement set @x= 1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'statement set @x= 1' at line 2
drop trigger trg_1;
Testcase 3.5.1.3:
-----------------
CREATE TRIGGER trg3_1 on tb3 BEFORE INSERT for each row set new.f120 = 't';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on tb3 BEFORE INSERT for each row set new.f120 = 't'' at line 1
CREATE trg3_2 TRIGGER AFTER INSERT on tb3 for each row set new.f120 = 's';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trg3_2 TRIGGER AFTER INSERT on tb3 for each row set new.f120 = 's'' at line 1
CREATE TRIGGER trg3_3 Before DELETE on tb3 set @ret1 = 'test' for each row;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set @ret1 = 'test' for each row' at line 1
CREATE TRIGGER trg3_4 DELETE AFTER on tb3 set @ret1 = 'test' for each row;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELETE AFTER on tb3 set @ret1 = 'test' for each row' at line 1
CREATE for each row TRIGGER trg3_5 AFTER UPDATE on tb3 set @ret1 = 'test';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'for each row TRIGGER trg3_5 AFTER UPDATE on tb3 set @ret1 = 'test'' at line 1
drop trigger trg3_1;
drop trigger trg3_2;
drop trigger trg3_3;
drop trigger trg3_4;
drop trigger trg3_5;
Testcase: 3.5.1.5:
------------------
CREATE TRIGGER trg4_1 AFTER on tb3 for each row set new.f120 = 'e';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on tb3 for each row set new.f120 = 'e'' at line 1
CREATE TRIGGER trg4_2 INSERT on tb3 for each set row new.f120 = 'f';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT on tb3 for each set row new.f120 = 'f'' at line 1
CREATE TRIGGER trg4_3 BEFORE INSERT tb3 for each row set new.f120 = 'g';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tb3 for each row set new.f120 = 'g'' at line 1
CREATE TRIGGER trg4_4 AFTER UPDATE on tb3 for each set new.f120 = 'g';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set new.f120 = 'g'' at line 1
CREATE trg4_5 AFTER DELETE on tb3 for each set new.f120 = 'g';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trg4_5 AFTER DELETE on tb3 for each set new.f120 = 'g'' at line 1
CREATE TRIGGER trg4_6 BEFORE DELETE for each row set new.f120 = 'g';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'for each row set new.f120 = 'g'' at line 1
drop trigger trg4_1;
drop trigger trg4_2;
drop trigger trg4_3;
drop trigger trg4_4;
drop trigger trg4_5;
drop trigger trg4_6;
Testcase 3.5.1.6: - Need to fix
-------------------------------
Testcase 3.5.1.7: - need to fix
-------------------------------
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
create table t1 (f1 int, f2 char(25),f3 int) engine=ndb;
CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1
for each row set new.f3 = '14';
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
insert into t1 (f2) values ('insert 3.5.1.7');
select * from t1;
f1 f2 f3
NULL insert 3.5.1.7 14
update t1 set f2='update 3.5.1.7';
select * from t1;
f1 f2 f3
NULL update 3.5.1.7 42
select trigger_name from information_schema.triggers order by trigger_name;
trigger_name
trg5_1
trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
drop trigger trg5_1;
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;
ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX;
drop table t1;
Testcase 3.5.1.8:
-----------------
CREATE TRIGGER trg12* before insert on tb3 for each row set new.f120 = 't';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* before insert on tb3 for each row set new.f120 = 't'' at line 1
CREATE TRIGGER trigger before insert on tb3 for each row set new.f120 = 't';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trigger before insert on tb3 for each row set new.f120 = 't'' at line 1
CREATE TRIGGER 100 before insert on tb3 for each row set new.f120 = 't';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '100 before insert on tb3 for each row set new.f120 = 't'' at line 1
CREATE TRIGGER @@view before insert on tb3 for each row set new.f120 = 't';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@@view before insert on tb3 for each row set new.f120 = 't'' at line 1
CREATE TRIGGER @name before insert on tb3 for each row set new.f120 = 't';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@name before insert on tb3 for each row set new.f120 = 't'' at line 1
CREATE TRIGGER tb3.trg6_1 BEFORE INSERT on test.tb3
for each row set new.f120 ='X';
ERROR HY000: Trigger in wrong schema
drop database if exists trig_db;
create database trig_db;
use trig_db;
create table t1 (f1 integer) engine = ndb;
use test;
CREATE TRIGGER trig_db.trg6_2 AFTER INSERT on tb3
for each row set @ret_trg6_2 = 5;
ERROR 42S02: Table 'trig_db.tb3' doesn't exist
use trig_db;
CREATE TRIGGER trg6_3 AFTER INSERT on test.tb3
for each row set @ret_trg6_3 = 18;
ERROR HY000: Trigger in wrong schema
use test;
drop database trig_db;
drop trigger trg6_1;
drop trigger trg6_3;
Testcase 3.5.1.9:(cannot be inplemented at this point)
------------------------------------------------------
Testcase 3.5.1.10:
------------------
CREATE TRIGGER trg7_1 BEFORE UPDATE on tb3 for each row set new.f120 ='X';
CREATE TRIGGER trg7_1 AFTER INSERT on tb3 for each row set @x ='Y';
ERROR HY000: Trigger already exists
drop trigger trg7_1;
Testcase 3.5.1.?:
-----------------
drop table if exists t1;
drop table if exists t2;
create table t1 (f1 char(50), f2 integer) engine = ndb;
create table t2 (f1 char(50), f2 integer) engine = ndb;
create trigger trig before insert on t1
for each row set new.f1 ='trig t1';
create trigger trig before update on t2
for each row set new.f1 ='trig t2';
ERROR HY000: Trigger already exists
insert into t1 value ('insert to t1',1);
select * from t1;
f1 f2
trig t1 1
update t1 set f1='update to t1';
select * from t1;
f1 f2
update to t1 1
insert into t2 value ('insert to t2',2);
update t2 set f1='update to t1';
select * from t2;
f1 f2
update to t1 2
drop table t1;
drop table t2;
drop trigger trig;
Testcase 3.5.1.11:
------------------
drop database if exists trig_db1;
drop database if exists trig_db2;
drop database if exists trig_db3;
create database trig_db1;
create database trig_db2;
create database trig_db3;
use trig_db1;
create table t1 (f1 char(50), f2 integer) engine = ndb;
create trigger trig before insert on t1
for each row set new.f1 ='trig1', @test_var1='trig1';
use trig_db2;
create table t2 (f1 char(50), f2 integer) engine = ndb;
create trigger trig before insert on t2
for each row set new.f1 ='trig2', @test_var2='trig2';
use trig_db3;
create table t1 (f1 char(50), f2 integer) engine = ndb;
create trigger trig before insert on t1
for each row set new.f1 ='trig3', @test_var3='trig3';
set @test_var1= '', @test_var2= '', @test_var3= '';
use trig_db1;
insert into t1 (f1,f2) values ('insert to db1 t1',1);
insert into trig_db1.t1 (f1,f2) values ('insert to db1 t1 from db1',2);
insert into trig_db2.t2 (f1,f2) values ('insert to db2 t2 from db1',3);
insert into trig_db3.t1 (f1,f2) values ('insert to db3 t1 from db1',4);
select @test_var1, @test_var2, @test_var3;
@test_var1 @test_var2 @test_var3
trig1 trig2 trig3
select * from t1 order by f2;
f1 f2
trig1 1
trig1 2
select * from trig_db2.t2;
f1 f2
trig2 3
select * from trig_db3.t1;
f1 f2
trig3 4
select * from t1 order by f2;
f1 f2
trig1 1
trig1 2
use test;
drop database trig_db1;
drop database trig_db2;
drop database trig_db3;
Testcase 3.5.2.1/2/3:
---------------------
drop database if exists trig_db1;
drop database if exists trig_db2;
create database trig_db1;
create database trig_db2;
use trig_db1;
create table t1 (f1 char(50), f2 integer) engine = ndb;
create table trig_db2.t1 (f1 char(50), f2 integer) engine = ndb;
create trigger trig1_b before insert on t1
for each row set @test_var1='trig1_b';
create trigger trig_db1.trig1_a after insert on t1
for each row set @test_var2='trig1_a';
create trigger trig_db2.trig2 before insert on trig_db2.t1
for each row set @test_var3='trig2';
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers order by trigger_name;
trigger_schema trigger_name event_object_table
trig_db1 trig1_a t1
trig_db1 trig1_b t1
trig_db2 trig2 t1
set @test_var1= '', @test_var2= '', @test_var3= '';
insert into t1 (f1,f2) values ('insert to db1 t1 from db1',352);
insert into trig_db2.t1 (f1,f2) values ('insert to db2 t1 from db1',352);
select @test_var1, @test_var2, @test_var3;
@test_var1 @test_var2 @test_var3
trig1_b trig1_a trig2
drop database trig_db1;
drop database trig_db2;
DROP TABLE test.tb3;
USE test;
drop table if exists tb3 ;
drop table if exists tb3;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f121 char(50),
f122 char(50),
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
......@@ -59,21 +53,18 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = ndb;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/ndb_tb3.txt'
into table tb3;
Testcase 3.5.3:
---------------
drop database if exists priv_db;
create database priv_db;
use priv_db;
create table t1 (f1 char(20)) engine= ndb;
create table t1 (f1 char(20)) engine= <engine_to_be_used>;
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
create User test_yesprivs@localhost;
......@@ -609,8 +600,8 @@ Testcase: 3.5.3.x:
use priv_db;
drop table if exists t1;
drop table if exists t2;
create table t1 (f1 int) engine= ndb;
create table t2 (f2 int) engine= ndb;
create table t1 (f1 int) engine= <engine_to_be_used>;
create table t2 (f2 int) engine= <engine_to_be_used>;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost;
......@@ -699,4 +690,5 @@ drop database if exists priv_db;
drop user test_yesprivs@localhost;
drop user test_noprivs@localhost;
drop user test_noprivs;
DROP TABLE test.tb3;
use test;
drop table tb3;
USE test;
drop table if exists tb3 ;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
f132 tinyint zerofill not null DEFAULT 99,
f133 tinyint unsigned zerofill not null DEFAULT 99,
f134 smallint not null DEFAULT 999,
f135 smallint unsigned not null DEFAULT 999,
f136 smallint zerofill not null DEFAULT 999,
f137 smallint unsigned zerofill not null DEFAULT 999,
f138 mediumint not null DEFAULT 9999,
f139 mediumint unsigned not null DEFAULT 9999,
f140 mediumint zerofill not null DEFAULT 9999,
f141 mediumint unsigned zerofill not null DEFAULT 9999,
f142 int not null DEFAULT 99999,
f143 int unsigned not null DEFAULT 99999,
f144 int zerofill not null DEFAULT 99999,
f145 int unsigned zerofill not null DEFAULT 99999,
f146 bigint not null DEFAULT 999999,
f147 bigint unsigned not null DEFAULT 999999,
f148 bigint zerofill not null DEFAULT 999999,
f149 bigint unsigned zerofill not null DEFAULT 999999,
f150 decimal not null DEFAULT 999.999,
f151 decimal unsigned not null DEFAULT 999.17,
f152 decimal zerofill not null DEFAULT 999.999,
f153 decimal unsigned zerofill,
f154 decimal (0),
f155 decimal (64),
f156 decimal (0) unsigned,
f157 decimal (64) unsigned,
f158 decimal (0) zerofill,
f159 decimal (64) zerofill,
f160 decimal (0) unsigned zerofill,
f161 decimal (64) unsigned zerofill,
f162 decimal (0,0),
f163 decimal (63,30),
f164 decimal (0,0) unsigned,
f165 decimal (63,30) unsigned,
f166 decimal (0,0) zerofill,
f167 decimal (63,30) zerofill,
f168 decimal (0,0) unsigned zerofill,
f169 decimal (63,30) unsigned zerofill,
f170 numeric,
f171 numeric unsigned,
f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = ndb;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/ndb_tb3.txt'
into table tb3;
Testcase 3.5.3:
---------------
drop database if exists priv_db;
create database priv_db;
use priv_db;
create table t1 (f1 char(20)) engine= ndb;
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
create User test_yesprivs@localhost;
set password for test_yesprivs@localhost = password('PWD');
Testcase 3.5.3.2/6:
-------------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant ALL on *.* to test_noprivs@localhost;
revoke TRIGGER on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
Testcase 3.5.3.2:
-----------------
select current_user;
current_user
test_noprivs@localhost
use priv_db;
create trigger trg1_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.2_1-no';
ERROR 42000: TRIGGER command denied to user 'test_noprivs'@'localhost' for table 't1'
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.2-no');
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
select current_user;
current_user
test_yesprivs@localhost
use priv_db;
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.2_2-yes';
select current_user;
current_user
root@localhost
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.2-yes');
ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.2-yes');
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
Testcase 3.5.3.6:
-----------------
use priv_db;
drop trigger trg1_2;
ERROR 42000: TRIGGER command denied to user 'test_noprivs'@'localhost' for table 't1'
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.6-yes');
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
use priv_db;
drop trigger trg1_2;
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.6-no');
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
insert 3.5.3.6-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
drop trigger trg1_2;
Testcase 3.5.3.7a:
------------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant ALL on *.* to test_noprivs@localhost;
revoke UPDATE on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
select current_user;
current_user
test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
insert 3.5.3.6-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
create trigger trg4a_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1a';
insert into t1 (f1) values ('insert 3.5.3.7-1a');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
insert 3.5.3.6-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
drop trigger trg4a_1;
use priv_db;
select current_user;
current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg4a_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2a';
insert into t1 (f1) values ('insert 3.5.3.7-2b');
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
insert 3.5.3.6-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
drop trigger trg4a_2;
Testcase 3.5.3.7b:
------------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs;
grant ALL on priv_db.* to test_noprivs@localhost;
revoke UPDATE on priv_db.* from test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant UPDATE on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
show grants;
Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
use priv_db;
create trigger trg4b_1 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-1b';
insert into t1 (f1) values ('insert 3.5.3.7-1b');
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
insert 3.5.3.6-no
insert 3.5.3.7-1b
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update t1 set f1 = 'update 3.5.3.7-1b' where f1 = 'insert 3.5.3.7-1b';
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
insert 3.5.3.6-no
insert 3.5.3.7-1b
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
drop trigger trg4b_1;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4b_2 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-2b';
insert into t1 (f1) values ('insert 3.5.3.7-2b');
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
insert 3.5.3.6-no
insert 3.5.3.7-1b
insert 3.5.3.7-2b
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
insert 3.5.3.6-no
insert 3.5.3.7-1b
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
trig 3.5.3.7-2b
drop trigger trg4b_2;
Testcase 3.5.3.7c
-----------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant ALL on priv_db.t1 to test_noprivs@localhost;
revoke UPDATE on priv_db.t1 from test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
create trigger trg4c_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1c';
insert into t1 (f1) values ('insert 3.5.3.7-1c');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
insert 3.5.3.6-no
insert 3.5.3.7-1b
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
trig 3.5.3.7-2b
drop trigger trg4c_1;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4c_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2c';
insert into t1 (f1) values ('insert 3.5.3.7-2c');
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
insert 3.5.3.6-no
insert 3.5.3.7-1b
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
trig 3.5.3.7-2b
trig 3.5.3.7-2c
drop trigger trg4c_2;
Testcase 3.5.3.7d:
------------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant SELECT (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
create trigger trg4d_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1d';
insert into t1 (f1) values ('insert 3.5.3.7-1d');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
insert 3.5.3.6-no
insert 3.5.3.7-1b
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
trig 3.5.3.7-2b
trig 3.5.3.7-2c
drop trigger trg4d_1;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4d_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2d';
insert into t1 (f1) values ('insert 3.5.3.7-2d');
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
insert 3.5.3.6-no
insert 3.5.3.7-1b
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
trig 3.5.3.7-2b
trig 3.5.3.7-2c
trig 3.5.3.7-2d
drop trigger trg4d_2;
Testcase 3.5.3.8a:
------------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant ALL on *.* to test_noprivs@localhost;
revoke SELECT on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
select current_user;
current_user
test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
set @test_var = 'before trig 3.5.3.8-1a';
select @test_var;
@test_var
before trig 3.5.3.8-1a
insert into t1 (f1) values ('insert 3.5.3.8-1a');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1a
drop trigger trg5a_1;
use priv_db;
select current_user;
current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_2 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var= 'before trig 3.5.3.8-2a';
select @test_var;
@test_var
before trig 3.5.3.8-2a
insert into t1 (f1) values ('insert 3.5.3.8-2a');
select @test_var;
@test_var
insert 3.5.3.8-2a
drop trigger trg5a_2;
Testcase: 3.5.3.8b
------------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant ALL on priv_db.* to test_noprivs@localhost;
revoke SELECT on priv_db.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
use priv_db;
create trigger trg5b_1 before UPDATE on t1 for each row
set @test_var= new.f1;
set @test_var= 'before trig 3.5.3.8-1b';
insert into t1 (f1) values ('insert 3.5.3.8-1b');
select @test_var;
@test_var
before trig 3.5.3.8-1b
update t1 set f1= 'update 3.5.3.8-1b' where f1 = 'insert 3.5.3.8-1b';
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1b
drop trigger trg5b_1;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg5b_2 before UPDATE on t1 for each row
set @test_var= new.f1;
set @test_var= 'before trig 3.5.3.8-2b';
insert into t1 (f1) values ('insert 3.5.3.8-2b');
select @test_var;
@test_var
before trig 3.5.3.8-2b
update t1 set f1= 'update 3.5.3.8-2b' where f1 = 'insert 3.5.3.8-2b';
select @test_var;
@test_var
update 3.5.3.8-2b
drop trigger trg5b_2;
Testcase 3.5.3.8c:
------------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant ALL on priv_db.t1 to test_noprivs@localhost;
revoke SELECT on priv_db.t1 from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
create trigger trg5c_1 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var= 'before trig 3.5.3.8-1c';
insert into t1 (f1) values ('insert 3.5.3.8-1c');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1c
drop trigger trg5c_1;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg5c_2 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var='before trig 3.5.3.8-2c';
insert into t1 (f1) values ('insert 3.5.3.8-2c');
select @test_var;
@test_var
insert 3.5.3.8-2c
drop trigger trg5c_2;
Testcase: 3.5.3.8d:
-------------------
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant TRIGGER on *.* to test_noprivs@localhost;
grant UPDATE (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
connect(localhost,test_noprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
create trigger trg5d_1 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var='before trig 3.5.3.8-1d';
insert into t1 (f1) values ('insert 3.5.3.8-1d');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1d
drop trigger trg5d_1;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg5d_2 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var='before trig 3.5.3.8-2d';
insert into t1 (f1) values ('insert 3.5.3.8-2d');
select @test_var;
@test_var
insert 3.5.3.8-2d
drop trigger trg5d_2;
Testcase: 3.5.3.x:
------------------
use priv_db;
drop table if exists t1;
drop table if exists t2;
create table t1 (f1 int) engine= ndb;
create table t2 (f2 int) engine= ndb;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost;
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
GRANT SELECT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
select current_user;
current_user
test_yesprivs@localhost
use priv_db;
create trigger trg1 before insert on t1 for each row
insert into t2 values (new.f1);
use priv_db;
insert into t1 (f1) values (4);
ERROR 42000: INSERT command denied to user 'test_yesprivs'@'localhost' for table 't2'
revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
grant INSERT on priv_db.t2 to test_yesprivs@localhost;
insert into t1 (f1) values (4);
select f1 from t1 order by f1;
f1
4
select f2 from t2 order by f2;
f2
4
use priv_db;
drop trigger trg1;
create trigger trg2 before insert on t1 for each row
update t2 set f2=new.f1-1;
use priv_db;
insert into t1 (f1) values (2);
ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for table 't2'
revoke INSERT on priv_db.t2 from test_yesprivs@localhost;
grant UPDATE on priv_db.t2 to test_yesprivs@localhost;
insert into t1 (f1) values (2);
select f1 from t1 order by f1;
f1
2
4
select f2 from t2 order by f2;
f2
1
use priv_db;
drop trigger trg2;
create trigger trg3 before insert on t1 for each row
select f2 into @aaa from t2 where f2=new.f1;
use priv_db;
insert into t1 (f1) values (1);
ERROR 42000: SELECT command denied to user 'test_yesprivs'@'localhost' for table 't2'
revoke UPDATE on priv_db.t2 from test_yesprivs@localhost;
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
insert into t1 (f1) values (1);
select f1 from t1 order by f1;
f1
1
2
4
select f2 from t2 order by f2;
f2
1
select @aaa;
@aaa
1
use priv_db;
drop trigger trg3;
create trigger trg4 before insert on t1 for each row
delete from t2;
use priv_db;
insert into t1 (f1) values (1);
ERROR 42000: DELETE command denied to user 'test_yesprivs'@'localhost' for table 't2'
revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
grant DELETE on priv_db.t2 to test_yesprivs@localhost;
insert into t1 (f1) values (1);
select f1 from t1 order by f1;
f1
1
1
2
4
select f2 from t2 order by f2;
f2
drop database if exists priv_db;
drop user test_yesprivs@localhost;
drop user test_noprivs@localhost;
drop user test_noprivs;
DROP TABLE test.tb3;
USE test;
drop table if exists tb3 ;
drop table if exists tb3;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f121 char(50),
f122 char(50),
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
......@@ -59,14 +53,11 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = ndb;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/ndb_tb3.txt'
into table tb3;
Testcase: 3.5:
--------------
......@@ -87,7 +78,7 @@ Testcase 3.5.4.1:
-----------------
create database db_drop;
Use db_drop;
create table t1 (f1 char(30)) engine=ndb;
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
grant INSERT, SELECT on db_drop.t1 to test_general;
Use db_drop;
Create trigger trg1 BEFORE INSERT on t1
......@@ -115,7 +106,7 @@ Testcase 3.5.4.2:
create database db_drop2;
Use db_drop2;
drop table if exists t1_432 ;
create table t1_432 (f1 char (30)) engine=ndb;
create table t1_432 (f1 char (30)) engine = <engine_to_be_used>;
Drop trigger tr_does_not_exit;
ERROR HY000: Trigger does not exist
drop table if exists t1_432 ;
......@@ -127,8 +118,8 @@ create database db_drop3;
Use db_drop3;
drop table if exists t1_433 ;
drop table if exists t1_433a ;
create table t1_433 (f1 char (30)) engine=ndb;
create table t1_433a (f1a char (5)) engine=ndb;
create table t1_433 (f1 char (30)) engine = <engine_to_be_used>;
create table t1_433a (f1a char (5)) engine = <engine_to_be_used>;
CREATE TRIGGER trg3 BEFORE INSERT on t1_433 for each row
set new.f1 = 'Trigger 3.5.4.3';
Drop trigger t1.433.trg3;
......@@ -148,7 +139,7 @@ Testcase 3.5.4.4:
-----------------
create database db_drop4;
Use db_drop4;
create table t1 (f1 char(30)) engine=ndb;
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
grant INSERT, SELECT on db_drop4.t1 to test_general;
Create trigger trg4 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.4';
......@@ -169,7 +160,7 @@ where information_schema.triggers.trigger_name='trg4';
trigger_schema trigger_name event_object_table
create database db_drop4;
Use db_drop4;
create table t1 (f1 char(30)) engine=ndb;
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
grant INSERT, SELECT on db_drop4.t1 to test_general;
Insert into t1 values ('2nd Insert 3.5.4.4');
Select * from t1;
......@@ -184,7 +175,7 @@ Testcase 3.5.4.5:
-----------------
create database db_drop5;
Use db_drop5;
create table t1 (f1 char(50)) engine=ndb;
create table t1 (f1 char(50)) engine = <engine_to_be_used>;
grant INSERT, SELECT on t1 to test_general;
Create trigger trg5 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.5';
......@@ -200,7 +191,7 @@ select trigger_schema, trigger_name, event_object_table
from information_schema.triggers
where information_schema.triggers.trigger_name='trg5';
trigger_schema trigger_name event_object_table
create table t1 (f1 char(50)) engine=ndb;
create table t1 (f1 char(50)) engine = <engine_to_be_used>;
grant INSERT, SELECT on t1 to test_general;
Insert into t1 values ('2nd Insert 3.5.4.5');
Select * from t1;
......@@ -241,7 +232,7 @@ Testcase 3.5.5.4:
create database dbtest_one;
create database dbtest_two;
use dbtest_two;
create table t2 (f1 char(15)) engine=ndb;
create table t2 (f1 char(15)) engine = <engine_to_be_used>;
use dbtest_one;
create trigger trg4 before INSERT
on dbtest_two.t2 for each row set new.f1='trig 3.5.5.4';
......
USE test;
drop table if exists tb3 ;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
f132 tinyint zerofill not null DEFAULT 99,
f133 tinyint unsigned zerofill not null DEFAULT 99,
f134 smallint not null DEFAULT 999,
f135 smallint unsigned not null DEFAULT 999,
f136 smallint zerofill not null DEFAULT 999,
f137 smallint unsigned zerofill not null DEFAULT 999,
f138 mediumint not null DEFAULT 9999,
f139 mediumint unsigned not null DEFAULT 9999,
f140 mediumint zerofill not null DEFAULT 9999,
f141 mediumint unsigned zerofill not null DEFAULT 9999,
f142 int not null DEFAULT 99999,
f143 int unsigned not null DEFAULT 99999,
f144 int zerofill not null DEFAULT 99999,
f145 int unsigned zerofill not null DEFAULT 99999,
f146 bigint not null DEFAULT 999999,
f147 bigint unsigned not null DEFAULT 999999,
f148 bigint zerofill not null DEFAULT 999999,
f149 bigint unsigned zerofill not null DEFAULT 999999,
f150 decimal not null DEFAULT 999.999,
f151 decimal unsigned not null DEFAULT 999.17,
f152 decimal zerofill not null DEFAULT 999.999,
f153 decimal unsigned zerofill,
f154 decimal (0),
f155 decimal (64),
f156 decimal (0) unsigned,
f157 decimal (64) unsigned,
f158 decimal (0) zerofill,
f159 decimal (64) zerofill,
f160 decimal (0) unsigned zerofill,
f161 decimal (64) unsigned zerofill,
f162 decimal (0,0),
f163 decimal (63,30),
f164 decimal (0,0) unsigned,
f165 decimal (63,30) unsigned,
f166 decimal (0,0) zerofill,
f167 decimal (63,30) zerofill,
f168 decimal (0,0) unsigned zerofill,
f169 decimal (63,30) unsigned zerofill,
f170 numeric,
f171 numeric unsigned,
f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = ndb;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/ndb_tb3.txt'
into table tb3;
Testcase: 3.5:
--------------
create User test_general@localhost;
set password for test_general@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_general@localhost;
create User test_super@localhost;
set password for test_super@localhost = password('PWD');
grant ALL on *.* to test_super@localhost with grant OPTION;
connect(localhost,test_general,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_super,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
Testcase 3.5.4:
---------------
use test;
Testcase 3.5.4.1:
-----------------
create database db_drop;
Use db_drop;
create table t1 (f1 char(30)) engine=ndb;
grant INSERT, SELECT on db_drop.t1 to test_general;
Use db_drop;
Create trigger trg1 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.1';
Use db_drop;
Insert into t1 values ('Insert error 3.5.4.1');
Select * from t1 order by f1;
f1
Trigger 3.5.4.1
drop trigger trg1;
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers order by trigger_name;
trigger_schema trigger_name event_object_table
Insert into t1 values ('Insert no trigger 3.5.4.1');
Select * from t1 order by f1;
f1
Insert no trigger 3.5.4.1
Trigger 3.5.4.1
drop trigger trg1;
drop database if exists db_drop;
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
Testcase 3.5.4.2:
-----------------
create database db_drop2;
Use db_drop2;
drop table if exists t1_432 ;
create table t1_432 (f1 char (30)) engine=ndb;
Drop trigger tr_does_not_exit;
ERROR HY000: Trigger does not exist
drop table if exists t1_432 ;
drop database if exists db_drop2;
Testcase 3.5.4.3:
-----------------
create database db_drop3;
Use db_drop3;
drop table if exists t1_433 ;
drop table if exists t1_433a ;
create table t1_433 (f1 char (30)) engine=ndb;
create table t1_433a (f1a char (5)) engine=ndb;
CREATE TRIGGER trg3 BEFORE INSERT on t1_433 for each row
set new.f1 = 'Trigger 3.5.4.3';
Drop trigger t1.433.trg3;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.trg3' at line 1
Drop trigger db_drop3.t1.433.trg3;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.433.trg3' at line 1
Drop trigger mysql.trg3;
ERROR HY000: Trigger does not exist
Drop trigger tbx.trg3;
ERROR HY000: Trigger does not exist
Drop trigger db_drop3.trg3;
drop table if exists t1_433;
drop table if exists t1_433a;
drop database if exists db_drop3;
Testcase 3.5.4.4:
-----------------
create database db_drop4;
Use db_drop4;
create table t1 (f1 char(30)) engine=ndb;
grant INSERT, SELECT on db_drop4.t1 to test_general;
Create trigger trg4 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.4';
Use db_drop4;
Insert into t1 values ('Insert 3.5.4.4');
Select * from t1;
f1
Trigger 3.5.4.4
Drop database db_drop4;
Show databases;
Database
information_schema
mysql
test
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers
where information_schema.triggers.trigger_name='trg4';
trigger_schema trigger_name event_object_table
create database db_drop4;
Use db_drop4;
create table t1 (f1 char(30)) engine=ndb;
grant INSERT, SELECT on db_drop4.t1 to test_general;
Insert into t1 values ('2nd Insert 3.5.4.4');
Select * from t1;
f1
2nd Insert 3.5.4.4
drop trigger trg4;
ERROR HY000: Trigger does not exist
drop database if exists db_drop4;
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
Testcase 3.5.4.5:
-----------------
create database db_drop5;
Use db_drop5;
create table t1 (f1 char(50)) engine=ndb;
grant INSERT, SELECT on t1 to test_general;
Create trigger trg5 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.5';
Use db_drop5;
Insert into t1 values ('Insert 3.5.4.5');
Select * from t1;
f1
Trigger 3.5.4.5
Drop table t1;
Show tables;
Tables_in_db_drop5
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers
where information_schema.triggers.trigger_name='trg5';
trigger_schema trigger_name event_object_table
create table t1 (f1 char(50)) engine=ndb;
grant INSERT, SELECT on t1 to test_general;
Insert into t1 values ('2nd Insert 3.5.4.5');
Select * from t1;
f1
2nd Insert 3.5.4.5
drop trigger trg5;
ERROR HY000: Trigger does not exist
drop database if exists db_drop5;
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
Testcase 3.5.5:
---------------
use test;
Testcase 3.5.5.1:
-----------------
Create trigger trg1 before INSERT on t100 for each row set new.f2=1000;
ERROR 42S02: Table 'test.t100' doesn't exist
Testcase 3.5.5.2:
-----------------
Create temporary table t1_temp (f1 bigint signed, f2 bigint unsigned);
Create trigger trg2 before INSERT
on t1_temp for each row set new.f2=9999;
ERROR HY000: Trigger's 't1_temp' is view or temporary table
drop table t1_temp;
Testcase 3.5.5.3:
-----------------
Create view vw3 as select f118 from tb3;
Create trigger trg3 before INSERT
on vw3 for each row set new.f118='s';
ERROR HY000: 'test.vw3' is not BASE TABLE
drop view vw3;
Testcase 3.5.5.4:
-----------------
create database dbtest_one;
create database dbtest_two;
use dbtest_two;
create table t2 (f1 char(15)) engine=ndb;
use dbtest_one;
create trigger trg4 before INSERT
on dbtest_two.t2 for each row set new.f1='trig 3.5.5.4';
ERROR HY000: Trigger in wrong schema
grant INSERT, SELECT on dbtest_two.t2 to test_general;
grant SELECT on dbtest_one.* to test_general;
use dbtest_two;
Insert into t2 values ('1st Insert 3.5.5.4');
Warnings:
Warning 1265 Data truncated for column 'f1' at row 1
Select * from t2;
f1
1st Insert 3.5.
use dbtest_one;
Insert into dbtest_two.t2 values ('2nd Insert 3.5.5.4');
Warnings:
Warning 1265 Data truncated for column 'f1' at row 1
Select * from dbtest_two.t2 order by f1;
f1
1st Insert 3.5.
2nd Insert 3.5.
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
DROP DATABASE if exists dbtest_one;
drop database if EXISTS dbtest_two;
Testcase 3.5.6:
---------------
use test;
Testcase 3.5.6.1 (see Testcase 3.5.1.1)
---------------------------------------
Testcase 3.5.6.2 (see Testcase 3.5.1.1)
---------------------------------------
Testcase 3.5.6.3:
-----------------
Create trigger trg3_1 DURING UPDATE on tb3 for each row set new.f132=25;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DURING UPDATE on tb3 for each row set new.f132=25' at line 1
Create trigger trg3_2 TIME INSERT on tb3 for each row set new.f132=15;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TIME INSERT on tb3 for each row set new.f132=15' at line 1
drop trigger tb3.trg3_1;
drop trigger tb3.trg3_2;
Testcase 3.5.6.4 (see Testcase 3.5.1.1)
---------------------------------------
Testcase 3.5.6.5 (see Testcase 3.5.1.1)
---------------------------------------
Testcase 3.5.7.1 (see Testcase 3.5.1.1)
---------------------------------------
Testcase 3.5.7.2 (see Testcase 3.5.1.1)
---------------------------------------
Testcase 3.5.7.3 (see Testcase 3.5.1.1)
---------------------------------------
Testcase 3.5.7.4:
-----------------
Create trigger trg4_1 BEFORE SELECT on tb3 for each row set new.f132=5;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT on tb3 for each row set new.f132=5' at line 1
Create trigger trg4_2 AFTER VALUE on tb3 for each row set new.f132=1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VALUE on tb3 for each row set new.f132=1' at line 1
drop trigger tb3.trg4_1;
drop trigger tb3.trg4_2;
Testcase 3.5.7.5 / 3.5.7.6:
---------------------------
Create trigger trg5_1 BEFORE INSERT
on tb3 for each row set new.f122='Trigger1 3.5.7.5/6';
Create trigger trg5_2 BEFORE INSERT
on tb3 for each row set new.f122='Trigger2 3.5.7.5';
ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
Insert into tb3 (f121,f122) values ('Test 3.5.7.5/6','Insert 3.5.7.5');
Select f121,f122 from tb3 where f121='Test 3.5.7.5/6';
f121 f122
Test 3.5.7.5/6 Trigger1 3.5.7.5/6
update tb3 set f122='Update 3.5.7.6' where f121= 'Test 3.5.7.5/6';
Select f121,f122 from tb3 where f121='Test 3.5.7.5/6';
f121 f122
Test 3.5.7.5/6 Update 3.5.7.6
drop trigger trg5_1;
drop trigger trg5_2;
delete from tb3 where f121='Test 3.5.7.5/6';
Testcase 3.5.7.7 / 3.5.7.8:
---------------------------
set @test_var='Before trig 3.5.7.7';
Create trigger trg6_1 AFTER INSERT
on tb3 for each row set @test_var='Trigger1 3.5.7.7/8';
Create trigger trg6_2 AFTER INSERT
on tb3 for each row set @test_var='Trigger2 3.5.7.7';
ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
select @test_var;
@test_var
Before trig 3.5.7.7
Insert into tb3 (f121,f122) values ('Test 3.5.7.7/8','Insert 3.5.7.7');
Select f121,f122 from tb3 where f121='Test 3.5.7.7/8';
f121 f122
Test 3.5.7.7/8 Insert 3.5.7.7
select @test_var;
@test_var
Trigger1 3.5.7.7/8
update tb3 set f122='Update 3.5.7.8' where f121= 'Test 3.5.7.7/8';
Select f121,f122 from tb3 where f121='Test 3.5.7.7/8';
f121 f122
Test 3.5.7.7/8 Update 3.5.7.8
select @test_var;
@test_var
Trigger1 3.5.7.7/8
drop trigger trg6_1;
drop trigger trg6_2;
delete from tb3 where f121='Test 3.5.7.7/8';
Testcase 3.5.7.9/10:
--------------------
Create trigger trg7_1 BEFORE UPDATE
on tb3 for each row set new.f122='Trigger1 3.5.7.9/10';
Create trigger trg7_2 BEFORE UPDATE
on tb3 for each row set new.f122='Trigger2 3.5.7.9';
ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
Insert into tb3 (f121,f122) values ('Test 3.5.7.9/10','Insert 3.5.7.9');
Select f121,f122 from tb3 where f121='Test 3.5.7.9/10';
f121 f122
Test 3.5.7.9/10 Insert 3.5.7.9
update tb3 set f122='update 3.5.7.10' where f121='Test 3.5.7.9/10';
Select f121,f122 from tb3 where f121='Test 3.5.7.9/10';
f121 f122
Test 3.5.7.9/10 Trigger1 3.5.7.9/10
drop trigger trg7_1;
drop trigger trg7_2;
delete from tb3 where f121='Test 3.5.7.9/10';
Testcase 3.5.7.11/12:
---------------------
set @test_var='Before trig 3.5.7.11';
Create trigger trg8_1 AFTER UPDATE
on tb3 for each row set @test_var='Trigger 3.5.7.11/12';
Create trigger trg8_2 AFTER UPDATE
on tb3 for each row set @test_var='Trigger2 3.5.7.11';
ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
select @test_var;
@test_var
Before trig 3.5.7.11
Insert into tb3 (f121,f122) values ('Test 3.5.7.11/12','Insert 3.5.7.11/12');
select @test_var;
@test_var
Before trig 3.5.7.11
Select f121,f122 from tb3 where f121='Test 3.5.7.11/12';
f121 f122
Test 3.5.7.11/12 Insert 3.5.7.11/12
update tb3 set f122='update 3.5.7.12' where f121='Test 3.5.7.11/12';
Select f121,f122 from tb3 where f121='Test 3.5.7.11/12';
f121 f122
Test 3.5.7.11/12 update 3.5.7.12
select @test_var;
@test_var
Trigger 3.5.7.11/12
delete from tb3 where f121='Test 3.5.7.11/12';
drop trigger trg8_1;
drop trigger trg8_2;
delete from tb3 where f121='Test 3.5.7.11/12';
Testcase 3.5.7.13/14:
---------------------
set @test_var=1;
Create trigger trg9_1 BEFORE DELETE
on tb3 for each row set @test_var=@test_var+1;
Create trigger trg9_2 BEFORE DELETE
on tb3 for each row set @test_var=@test_var+10;
ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
select @test_var;
@test_var
1
Insert into tb3 (f121,f122) values ('Test 3.5.7.13/14','Insert 3.5.7.13');
Select f121,f122 from tb3 where f121='Test 3.5.7.13/14';
f121 f122
Test 3.5.7.13/14 Insert 3.5.7.13
select @test_var;
@test_var
1
delete from tb3 where f121='Test 3.5.7.13/14';
Select f121,f122 from tb3 where f121='Test 3.5.7.13/14';
f121 f122
select @test_var;
@test_var
2
delete from tb3 where f121='Test 3.5.7.13/14';
select @test_var;
@test_var
2
drop trigger trg9_1;
drop trigger trg9_2;
delete from tb3 where f121='Test 3.5.7.13/14';
Testcase 3.5.7.15/16:
---------------------
set @test_var=1;
Create trigger trg_3_406010_1 AFTER DELETE
on tb3 for each row set @test_var=@test_var+5;
Create trigger trg_3_406010_2 AFTER DELETE
on tb3 for each row set @test_var=@test_var+50;
ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
Create trigger trg_3_406010_1 AFTER INSERT
on tb3 for each row set @test_var=@test_var+1;
ERROR HY000: Trigger already exists
select @test_var;
@test_var
1
Insert into tb3 (f121,f122) values ('Test 3.5.7.15/16','Insert 3.5.7.15/16');
Select f121,f122 from tb3 where f121='Test 3.5.7.15/16';
f121 f122
Test 3.5.7.15/16 Insert 3.5.7.15/16
select @test_var;
@test_var
1
delete from tb3 where f121='Test 3.5.7.15/16';
Select f121,f122 from tb3 where f121='Test 3.5.7.15/16';
f121 f122
select @test_var;
@test_var
6
delete from tb3 where f121='Test 3.5.7.15/16';
select @test_var;
@test_var
6
drop trigger trg_3_406010_1;
drop trigger trg_3_406010_2;
delete from tb3 where f121='Test 3.5.7.15/16';
Testcase 3.5.7.17 (see Testcase 3.5.1.1)
----------------------------------------
drop user test_general@localhost;
drop user test_general;
drop user test_super@localhost;
DROP TABLE test.tb3;
USE test;
drop table if exists tb3 ;
drop table if exists tb3;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f121 char(50),
f122 char(50),
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
......@@ -59,14 +53,11 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = ndb;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/ndb_tb3.txt'
into table tb3;
Testcase: 3.5:
--------------
......@@ -95,17 +86,17 @@ create table t1_i (
i120 char ascii not null DEFAULT b'101',
i136 smallint zerofill not null DEFAULT 999,
i144 int zerofill not null DEFAULT 99999,
i163 decimal (63,30)) engine=ndb;
i163 decimal (63,30)) engine=<engine_to_be_used>;
create table t1_u (
u120 char ascii not null DEFAULT b'101',
u136 smallint zerofill not null DEFAULT 999,
u144 int zerofill not null DEFAULT 99999,
u163 decimal (63,30)) engine=ndb;
u163 decimal (63,30)) engine=<engine_to_be_used>;
create table t1_d (
d120 char ascii not null DEFAULT b'101',
d136 smallint zerofill not null DEFAULT 999,
d144 int zerofill not null DEFAULT 99999,
d163 decimal (63,30)) engine=ndb;
d163 decimal (63,30)) engine=<engine_to_be_used>;
Insert into t1_u values ('a',111,99999,999.99);
Insert into t1_u values ('b',222,99999,999.99);
Insert into t1_u values ('c',333,99999,999.99);
......
USE test;
drop table if exists tb3 ;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
f132 tinyint zerofill not null DEFAULT 99,
f133 tinyint unsigned zerofill not null DEFAULT 99,
f134 smallint not null DEFAULT 999,
f135 smallint unsigned not null DEFAULT 999,
f136 smallint zerofill not null DEFAULT 999,
f137 smallint unsigned zerofill not null DEFAULT 999,
f138 mediumint not null DEFAULT 9999,
f139 mediumint unsigned not null DEFAULT 9999,
f140 mediumint zerofill not null DEFAULT 9999,
f141 mediumint unsigned zerofill not null DEFAULT 9999,
f142 int not null DEFAULT 99999,
f143 int unsigned not null DEFAULT 99999,
f144 int zerofill not null DEFAULT 99999,
f145 int unsigned zerofill not null DEFAULT 99999,
f146 bigint not null DEFAULT 999999,
f147 bigint unsigned not null DEFAULT 999999,
f148 bigint zerofill not null DEFAULT 999999,
f149 bigint unsigned zerofill not null DEFAULT 999999,
f150 decimal not null DEFAULT 999.999,
f151 decimal unsigned not null DEFAULT 999.17,
f152 decimal zerofill not null DEFAULT 999.999,
f153 decimal unsigned zerofill,
f154 decimal (0),
f155 decimal (64),
f156 decimal (0) unsigned,
f157 decimal (64) unsigned,
f158 decimal (0) zerofill,
f159 decimal (64) zerofill,
f160 decimal (0) unsigned zerofill,
f161 decimal (64) unsigned zerofill,
f162 decimal (0,0),
f163 decimal (63,30),
f164 decimal (0,0) unsigned,
f165 decimal (63,30) unsigned,
f166 decimal (0,0) zerofill,
f167 decimal (63,30) zerofill,
f168 decimal (0,0) unsigned zerofill,
f169 decimal (63,30) unsigned zerofill,
f170 numeric,
f171 numeric unsigned,
f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = ndb;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/ndb_tb3.txt'
into table tb3;
Testcase: 3.5:
--------------
create User test_general@localhost;
set password for test_general@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_general@localhost;
create User test_super@localhost;
set password for test_super@localhost = password('PWD');
grant ALL on *.* to test_super@localhost with grant OPTION;
connect(localhost,test_general,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
connect(localhost,test_super,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
Testcase 3.5.8.1: (implied in previous tests)
---------------------------------------------
Testcase 3.5.8.2: (implied in previous tests)
---------------------------------------------
Testcase 3.5.8.3/4:
-------------------
create database db_test;
grant SELECT, INSERT, UPDATE, DELETE on db_test.* to test_general;
grant LOCK TABLES on db_test.* to test_general;
Use db_test;
create table t1_i (
i120 char ascii not null DEFAULT b'101',
i136 smallint zerofill not null DEFAULT 999,
i144 int zerofill not null DEFAULT 99999,
i163 decimal (63,30)) engine=ndb;
create table t1_u (
u120 char ascii not null DEFAULT b'101',
u136 smallint zerofill not null DEFAULT 999,
u144 int zerofill not null DEFAULT 99999,
u163 decimal (63,30)) engine=ndb;
create table t1_d (
d120 char ascii not null DEFAULT b'101',
d136 smallint zerofill not null DEFAULT 999,
d144 int zerofill not null DEFAULT 99999,
d163 decimal (63,30)) engine=ndb;
Insert into t1_u values ('a',111,99999,999.99);
Insert into t1_u values ('b',222,99999,999.99);
Insert into t1_u values ('c',333,99999,999.99);
Insert into t1_u values ('d',222,99999,999.99);
Insert into t1_u values ('e',222,99999,999.99);
Insert into t1_u values ('f',333,99999,999.99);
Insert into t1_d values ('a',111,99999,999.99);
Insert into t1_d values ('b',222,99999,999.99);
Insert into t1_d values ('c',333,99999,999.99);
Insert into t1_d values ('d',444,99999,999.99);
Insert into t1_d values ('e',222,99999,999.99);
Insert into t1_d values ('f',222,99999,999.99);
3.5.8.4 - multiple SQL
----------------------
use test;
Create trigger trg1 AFTER INSERT on tb3 for each row
BEGIN
insert into db_test.t1_i
values (new.f120, new.f136, new.f144, new.f163);
update db_test.t1_u
set u144=new.f144, u163=new.f163
where u136=new.f136;
delete from db_test.t1_d where d136= new.f136;
select sum(db_test.t1_u.u163) into @test_var from db_test.t1_u
where u136= new.f136;
END//
Use test;
set @test_var=0;
Insert into tb3 (f120, f122, f136, f144, f163)
values ('1', 'Test 3.5.8.4', 222, 23456, 1.05);
Select f120, f122, f136, f144, f163 from tb3 where f122= 'Test 3.5.8.4';
f120 f122 f136 f144 f163
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_i;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_u;
u120 u136 u144 u163
a 00111 0000099999 999.990000000000000000000000000000
b 00222 0000023456 1.050000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
d 00222 0000023456 1.050000000000000000000000000000
e 00222 0000023456 1.050000000000000000000000000000
f 00333 0000099999 999.990000000000000000000000000000
select * from db_test.t1_d;
d120 d136 d144 d163
a 00111 0000099999 999.990000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
d 00444 0000099999 999.990000000000000000000000000000
select @test_var;
@test_var
3.150000000000000000000000000000
3.5.8.4 - single SQL - insert
-----------------------------
Create trigger trg2 BEFORE UPDATE on tb3 for each row
BEGIN
insert into db_test.t1_i
values (new.f120, new.f136, new.f144, new.f163);
END//
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_i order by i120;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
update tb3 set f120='I', f122='Test 3.5.8.4-Single Insert'
where f122='Test 3.5.8.4';
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
I Test 3.5.8.4-Single Insert 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_i order by i120;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
I 00222 0000023456 1.050000000000000000000000000000
3.5.8.4 - single SQL - update
-----------------------------
drop trigger trg2;
Create trigger trg3 BEFORE UPDATE on tb3 for each row
update db_test.t1_u
set u120=new.f120
where u136=new.f136;
update tb3 set f120='U', f122='Test 3.5.8.4-Single Update'
where f122='Test 3.5.8.4-Single Insert';
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
U Test 3.5.8.4-Single Update 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_u order by u120;
u120 u136 u144 u163
a 00111 0000099999 999.990000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
f 00333 0000099999 999.990000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
3.5.8.3/4 - single SQL - delete
-------------------------------
drop trigger trg3;
Create trigger trg4 AFTER UPDATE on tb3 for each row
delete from db_test.t1_d where d136= new.f136;
update tb3 set f120='D', f136=444,
f122='Test 3.5.8.4-Single Delete'
where f122='Test 3.5.8.4-Single Update';
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
D Test 3.5.8.4-Single Delete 00444 0000023456 1.050000000000000000000000000000
select * from db_test.t1_d order by d120;
d120 d136 d144 d163
a 00111 0000099999 999.990000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
3.5.8.3/4 - single SQL - select
-------------------------------
drop trigger trg4;
Create trigger trg5 AFTER UPDATE on tb3 for each row
select sum(db_test.t1_u.u163) into @test_var from db_test.t1_u
where u136= new.f136;
set @test_var=0;
update tb3 set f120='S', f136=111,
f122='Test 3.5.8.4-Single Select'
where f122='Test 3.5.8.4-Single Delete';
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
S Test 3.5.8.4-Single Select 00111 0000023456 1.050000000000000000000000000000
select @test_var;
@test_var
999.990000000000000000000000000000
drop trigger trg1;
drop trigger trg5;
drop database if exists db_test;
delete from tb3 where f122 like 'Test 3.5.8.4%';
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
Testcase 3.5.8.5 (IF):
----------------------
create trigger trg2 before insert on tb3 for each row
BEGIN
IF new.f120='1' then
set @test_var='one', new.f120='2';
ELSEIF new.f120='2' then
set @test_var='two', new.f120='3';
ELSEIF new.f120='3' then
set @test_var='three', new.f120='4';
END IF;
IF (new.f120='4') and (new.f136=10) then
set @test_var2='2nd if', new.f120='d';
ELSE
set @test_var2='2nd else', new.f120='D';
END IF;
END//
set @test_var='Empty', @test_var2=0;
Insert into tb3 (f120, f122, f136) values ('1', 'Test 3.5.8.5-if', 101);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
D Test 3.5.8.5-if 00101 one 2nd else
Insert into tb3 (f120, f122, f136) values ('2', 'Test 3.5.8.5-if', 102);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
D Test 3.5.8.5-if 00101 two 2nd else
D Test 3.5.8.5-if 00102 two 2nd else
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 10);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
d Test 3.5.8.5-if 00010 three 2nd if
D Test 3.5.8.5-if 00101 three 2nd if
D Test 3.5.8.5-if 00102 three 2nd if
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 103);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
d Test 3.5.8.5-if 00010 three 2nd else
D Test 3.5.8.5-if 00101 three 2nd else
D Test 3.5.8.5-if 00102 three 2nd else
D Test 3.5.8.5-if 00103 three 2nd else
create trigger trg3 before update on tb3 for each row
BEGIN
ELSEIF new.f120='2' then
END IF;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ELSEIF new.f120='2' then
END IF;
END' at line 3
drop trigger trg3//
create trigger trg4 before update on tb3 for each row
BEGIN
IF (new.f120='4') and (new.f136=10) then
set @test_var2='2nd if', new.f120='d';
ELSE
set @test_var2='2nd else', new.f120='D';
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 7
drop trigger trg4;
drop trigger trg2;
delete from tb3 where f121='Test 3.5.8.5-if';
Testcase 3.5.8.5-case:
----------------------
create trigger trg3 before insert on tb3 for each row
BEGIN
SET new.f120=char(ascii(new.f120)-32);
CASE
when new.f136<100 then set new.f136=new.f136+120;
when new.f136<10 then set new.f144=777;
when new.f136>100 then set new.f120=new.f136-1;
END case;
CASE
when new.f136=200 then set @test_var=CONCAT(new.f120, '=');
ELSE set @test_var=concat(new.f120, '*');
END case;
CASE new.f144
when 1 then set @test_var=concat(@test_var, 'one');
when 2 then set @test_var=concat(@test_var, 'two');
when 3 then set @test_var=concat(@test_var, 'three');
when 4 then set @test_var=concat(@test_var, 'four');
when 5 then set @test_var=concat(@test_var, 'five');
when 6 then set @test_var=concat(@test_var, 'six');
when 7 then set @test_var=concat(@test_var, 'seven');
when 8 then set @test_var=concat(@test_var, 'eight');
when 9 then set @test_var=concat(@test_var, 'nine');
when 10 then set @test_var=concat(@test_var, 'ten');
when 11 then set @test_var=concat(@test_var, 'eleven');
when 12 then set @test_var=concat(@test_var, 'twelve');
when 13 then set @test_var=concat(@test_var, 'thirteen');
when 14 then set @test_var=concat(@test_var, 'fourteen');
when 15 then set @test_var=concat(@test_var, 'fifteen');
ELSE set @test_var=CONCAT(new.f120, '*', new.f144);
END case;
END//
set @test_var='Empty';
Insert into tb3 (f120, f122, f136, f144)
values ('a', 'Test 3.5.8.5-case', 5, 7);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 A*seven
Insert into tb3 (f120, f122, f136, f144)
values ('b', 'Test 3.5.8.5-case', 71,16);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 B*0000000016
B Test 3.5.8.5-case 00191 0000000016 B*0000000016
Insert into tb3 (f120, f122, f136, f144)
values ('c', 'Test 3.5.8.5-case', 80,1);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 C=one
B Test 3.5.8.5-case 00191 0000000016 C=one
C Test 3.5.8.5-case 00200 0000000001 C=one
Insert into tb3 (f120, f122, f136)
values ('d', 'Test 3.5.8.5-case', 152);
Warnings:
Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
A Test 3.5.8.5-case 00125 0000000007 1*0000099999
B Test 3.5.8.5-case 00191 0000000016 1*0000099999
C Test 3.5.8.5-case 00200 0000000001 1*0000099999
Insert into tb3 (f120, f122, f136, f144)
values ('e', 'Test 3.5.8.5-case', 200, 8);
Warnings:
Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
A Test 3.5.8.5-case 00125 0000000007 1=eight
B Test 3.5.8.5-case 00191 0000000016 1=eight
C Test 3.5.8.5-case 00200 0000000001 1=eight
Insert into tb3 (f120, f122, f136, f144)
values ('f', 'Test 3.5.8.5-case', 100, 8);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
A Test 3.5.8.5-case 00125 0000000007 1=eight
B Test 3.5.8.5-case 00191 0000000016 1=eight
C Test 3.5.8.5-case 00200 0000000001 1=eight
create trigger trg3a before update on tb3 for each row
BEGIN
CASE
when new.f136<100 then set new.f120='p';
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 5
drop trigger trg3a;
drop trigger trg3;
delete from tb3 where f121='Test 3.5.8.5-case';
Testcase 3.5.8.5-loop/leave:
----------------------------
Create trigger trg4 after insert on tb3 for each row
BEGIN
set @counter=0, @flag='Initial';
Label1: loop
if new.f136<new.f144 then
set @counter='Nothing to loop';
leave Label1;
else
set @counter=@counter+1;
if new.f136=new.f144+@counter then
set @counter=concat(@counter, ' loops');
leave Label1;
end if;
end if;
iterate label1;
set @flag='Final';
END loop Label1;
END//
Insert into tb3 (f122, f136, f144)
values ('Test 3.5.8.5-loop', 2, 8);
select @counter, @flag;
@counter @flag
Nothing to loop Initial
Insert into tb3 (f122, f136, f144)
values ('Test 3.5.8.5-loop', 11, 8);
select @counter, @flag;
@counter @flag
3 loops Initial
Create trigger trg4_2 after update on tb3 for each row
BEGIN
Label1: loop
set @counter=@counter+1;
END;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';
END' at line 5
drop trigger trg4_2;
drop trigger trg4;
delete from tb3 where f122='Test 3.5.8.5-loop';
Testcase 3.5.8.5-repeat:
------------------------
Create trigger trg6 after insert on tb3 for each row
BEGIN
rp_label: REPEAT
SET @counter1 = @counter1 + 1;
IF (@counter1 MOD 2 = 0) THEN ITERATE rp_label;
END IF;
SET @counter2 = @counter2 + 1;
UNTIL @counter1> new.f136 END REPEAT rp_label;
END//
set @counter1= 0, @counter2= 0;
Insert into tb3 (f122, f136)
values ('Test 3.5.8.5-repeat', 13);
select @counter1, @counter2;
@counter1 @counter2
15 8
Create trigger trg6_2 after update on tb3 for each row
BEGIN
REPEAT
SET @counter2 = @counter2 + 1;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END' at line 5
drop trigger trg6;
delete from tb3 where f122='Test 3.5.8.5-repeat';
Testcase 3.5.8.5-while:
-----------------------
Create trigger trg7 after insert on tb3 for each row
wl_label: WHILE @counter1 < new.f136 DO
SET @counter1 = @counter1 + 1;
IF (@counter1 MOD 2 = 0) THEN ITERATE wl_label;
END IF;
SET @counter2 = @counter2 + 1;
END WHILE wl_label//
set @counter1= 0, @counter2= 0;
Insert into tb3 (f122, f136)
values ('Test 3.5.8.5-while', 7);
select @counter1, @counter2;
@counter1 @counter2
7 4
Create trigger trg7_2 after update on tb3 for each row
BEGIN
WHILE @counter1 < new.f136
SET @counter1 = @counter1 + 1;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET @counter1 = @counter1 + 1;
END' at line 4
delete from tb3 where f122='Test 3.5.8.5-while';
drop trigger trg7;
Testcase 3.5.8.6: (requirement void)
------------------------------------
CREATE PROCEDURE sp_01 () BEGIN set @v1=1; END//
CREATE TRIGGER trg8_1 BEFORE UPDATE ON tb3 FOR EACH ROW
BEGIN
CALL sp_01 ();
END//
Insert into tb3 (f120, f122, f136) values ('6', 'Test 3.5.8.6-insert', 101);
update tb3 set f120='S', f136=111,
f122='Test 3.5.8.6-tr8_1'
where f122='Test 3.5.8.6-insert';
select f120, f122
from tb3 where f122 like 'Test 3.5.8.6%' order by f120;
f120 f122
S Test 3.5.8.6-tr8_1
DROP TRIGGER trg8_1;
DROP PROCEDURE sp_01;
Testcase 3.5.8.7
----------------
Create trigger trg9_1 before update on tb3 for each row
BEGIN
Start transaction;
Set new.f120='U';
Commit;
END//
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
Create trigger trg9_2 before delete on tb3 for each row
BEGIN
Start transaction;
Set @var2=old.f120;
Rollback;
END//
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
drop user test_general@localhost;
drop user test_general;
drop user test_super@localhost;
DROP TABLE test.tb3;
USE test;
drop table if exists tb3 ;
drop table if exists tb3;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f121 char(50),
f122 char(50),
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
......@@ -59,13 +53,12 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = ndb;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/ndb_tb3.txt'
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
Testcase 3.5.9.1/2:
......@@ -75,9 +68,9 @@ set new.f142 = 94087, @counter=@counter+1;
TotalRows
10
Affected
8
9
NotAffected
2
1
NewValuew
0
set @counter=0;
......@@ -85,7 +78,7 @@ Update tb3 Set f142='1' where f130<100;
select count(*) as ExpectedChanged, @counter as TrigCounter
from tb3 where f142=94087;
ExpectedChanged TrigCounter
8 8
9 9
select count(*) as ExpectedNotChange from tb3
where f130<100 and f142<>94087;
ExpectedNotChange
......
USE test;
drop table if exists tb3 ;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
f132 tinyint zerofill not null DEFAULT 99,
f133 tinyint unsigned zerofill not null DEFAULT 99,
f134 smallint not null DEFAULT 999,
f135 smallint unsigned not null DEFAULT 999,
f136 smallint zerofill not null DEFAULT 999,
f137 smallint unsigned zerofill not null DEFAULT 999,
f138 mediumint not null DEFAULT 9999,
f139 mediumint unsigned not null DEFAULT 9999,
f140 mediumint zerofill not null DEFAULT 9999,
f141 mediumint unsigned zerofill not null DEFAULT 9999,
f142 int not null DEFAULT 99999,
f143 int unsigned not null DEFAULT 99999,
f144 int zerofill not null DEFAULT 99999,
f145 int unsigned zerofill not null DEFAULT 99999,
f146 bigint not null DEFAULT 999999,
f147 bigint unsigned not null DEFAULT 999999,
f148 bigint zerofill not null DEFAULT 999999,
f149 bigint unsigned zerofill not null DEFAULT 999999,
f150 decimal not null DEFAULT 999.999,
f151 decimal unsigned not null DEFAULT 999.17,
f152 decimal zerofill not null DEFAULT 999.999,
f153 decimal unsigned zerofill,
f154 decimal (0),
f155 decimal (64),
f156 decimal (0) unsigned,
f157 decimal (64) unsigned,
f158 decimal (0) zerofill,
f159 decimal (64) zerofill,
f160 decimal (0) unsigned zerofill,
f161 decimal (64) unsigned zerofill,
f162 decimal (0,0),
f163 decimal (63,30),
f164 decimal (0,0) unsigned,
f165 decimal (63,30) unsigned,
f166 decimal (0,0) zerofill,
f167 decimal (63,30) zerofill,
f168 decimal (0,0) unsigned zerofill,
f169 decimal (63,30) unsigned zerofill,
f170 numeric,
f171 numeric unsigned,
f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = ndb;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/ndb_tb3.txt'
into table tb3;
Testcase 3.5.9.1/2:
-------------------
Create trigger trg1 BEFORE UPDATE on tb3 for each row
set new.f142 = 94087, @counter=@counter+1;
TotalRows
10
Affected
8
NotAffected
2
NewValuew
0
set @counter=0;
Update tb3 Set f142='1' where f130<100;
select count(*) as ExpectedChanged, @counter as TrigCounter
from tb3 where f142=94087;
ExpectedChanged TrigCounter
8 8
select count(*) as ExpectedNotChange from tb3
where f130<100 and f142<>94087;
ExpectedNotChange
0
select count(*) as NonExpectedChanged from tb3
where f130>=130 and f142=94087;
NonExpectedChanged
0
drop trigger trg1;
Testcase 3.5.9.3:
-----------------
Create trigger trg2_a before update on tb3 for each row
set @tr_var_b4_118=old.f118, @tr_var_b4_121=old.f121,
@tr_var_b4_122=old.f122, @tr_var_b4_136=old.f136,
@tr_var_b4_163=old.f163;
Create trigger trg2_b after update on tb3 for each row
set @tr_var_af_118=old.f118, @tr_var_af_121=old.f121,
@tr_var_af_122=old.f122, @tr_var_af_136=old.f136,
@tr_var_af_163=old.f163;
Create trigger trg2_c before delete on tb3 for each row
set @tr_var_b4_118=old.f118, @tr_var_b4_121=old.f121,
@tr_var_b4_122=old.f122, @tr_var_b4_136=old.f136,
@tr_var_b4_163=old.f163;
Create trigger trg2_d after delete on tb3 for each row
set @tr_var_af_118=old.f118, @tr_var_af_121=old.f121,
@tr_var_af_122=old.f122, @tr_var_af_136=old.f136,
@tr_var_af_163=old.f163;
@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_163
0 0 0 0 0
@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
0 0 0 0 0
Insert into tb3 (f122, f136, f163)
values ('Test 3.5.9.3', 7, 123.17);
Update tb3 Set f136=8 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
f118 f121 f122 f136 f163
a NULL Test 3.5.9.3 00008 123.170000000000000000000000000000
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_163;
@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_163
a NULL Test 3.5.9.3 7 123.170000000000000000000000000000
select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
@tr_var_af_136, @tr_var_af_163;
@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
a NULL Test 3.5.9.3 7 123.170000000000000000000000000000
@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_163
0 0 0 0 0
@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
0 0 0 0 0
delete from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
f118 f121 f122 f136 f163
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_163;
@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_163
a NULL Test 3.5.9.3 8 123.170000000000000000000000000000
select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
@tr_var_af_136, @tr_var_af_163;
@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
a NULL Test 3.5.9.3 8 123.170000000000000000000000000000
drop trigger trg2_a;
drop trigger trg2_b;
drop trigger trg2_c;
drop trigger trg2_d;
Testcase 3.5.9.4:
-----------------
Create trigger trg3_a before insert on tb3 for each row
set @tr_var_b4_118=new.f118, @tr_var_b4_121=new.f121,
@tr_var_b4_122=new.f122, @tr_var_b4_136=new.f136,
@tr_var_b4_151=new.f151, @tr_var_b4_163=new.f163;
Create trigger trg3_b after insert on tb3 for each row
set @tr_var_af_118=new.f118, @tr_var_af_121=new.f121,
@tr_var_af_122=new.f122, @tr_var_af_136=new.f136,
@tr_var_af_151=new.f151, @tr_var_af_163=new.f163;
Create trigger trg3_c before update on tb3 for each row
set @tr_var_b4_118=new.f118, @tr_var_b4_121=new.f121,
@tr_var_b4_122=new.f122, @tr_var_b4_136=new.f136,
@tr_var_b4_151=new.f151, @tr_var_b4_163=new.f163;
Create trigger trg3_d after update on tb3 for each row
set @tr_var_af_118=new.f118, @tr_var_af_121=new.f121,
@tr_var_af_122=new.f122, @tr_var_af_136=new.f136,
@tr_var_af_151=new.f151, @tr_var_af_163=new.f163;
@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_151 @tr_var_b4_163
0 0 0 0 0 0
@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_151 @tr_var_af_163
0 0 0 0 0 0
Insert into tb3 (f122, f136, f151, f163)
values ('Test 3.5.9.4', 7, DEFAULT, 995.24);
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4%' order by f163;
f118 f121 f122 f136 f151 f163
a NULL Test 3.5.9.4 00007 999 995.240000000000000000000000000000
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_151, @tr_var_b4_163;
@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_151 @tr_var_b4_163
a NULL Test 3.5.9.4 7 999 995.240000000000000000000000000000
select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
@tr_var_af_136, @tr_var_af_151, @tr_var_af_163;
@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_151 @tr_var_af_163
a NULL Test 3.5.9.4 7 999 995.240000000000000000000000000000
@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_151 @tr_var_b4_163
0 0 0 0 0 0
@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_151 @tr_var_af_163
0 0 0 0 0 0
Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
ERROR 23000: Column 'f136' cannot be null
Update tb3 Set f122='Test 3.5.9.4-trig', f136=0, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4-trig' order by f163;
f118 f121 f122 f136 f151 f163
a NULL Test 3.5.9.4-trig 00000 999 NULL
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_151, @tr_var_b4_163;
@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_151 @tr_var_b4_163
a NULL Test 3.5.9.4-trig 0 999 NULL
select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
@tr_var_af_136, @tr_var_af_151, @tr_var_af_163;
@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_151 @tr_var_af_163
a NULL Test 3.5.9.4-trig 0 999 NULL
drop trigger trg3_a;
drop trigger trg3_b;
drop trigger trg3_c;
drop trigger trg3_d;
delete from tb3 where f122='Test 3.5.9.4-trig';
Testcase 3.5.9.5: (implied in previous tests)
---------------------------------------------
Testcase 3.5.9.6:
-----------------
create trigger trg4a before insert on tb3 for each row
set @temp1= old.f120;
ERROR HY000: There is no OLD row in on INSERT trigger
create trigger trg4b after insert on tb3 for each row
set old.f120= 'test';
ERROR HY000: Updating of OLD row is not allowed in trigger
drop trigger trg4a;
drop trigger trg4b;
Testcase 3.5.9.7: (implied in previous tests)
---------------------------------------------
Testcase 3.5.9.8: (implied in previous tests)
---------------------------------------------
Testcase 3.5.9.9:
-----------------
create trigger trg5a before DELETE on tb3 for each row
set @temp1=new.f122;
ERROR HY000: There is no NEW row in on DELETE trigger
create trigger trg5b after DELETE on tb3 for each row
set new.f122='test';
ERROR HY000: There is no NEW row in on DELETE trigger
drop trigger trg5a;
drop trigger trg5b;
Testcase 3.5.9.10: (implied in previous tests)
----------------------------------------------
Testcase 3.5.9.11: covered by 3.5.9.9
-------------------------------------
Testcase 3.5.9.12: covered by 3.5.9.6
-------------------------------------
Testcase 3.5.9.13:
------------------
create trigger trg6a before UPDATE on tb3 for each row
set old.f118='C', new.f118='U';
ERROR HY000: Updating of OLD row is not allowed in trigger
create trigger trg6b after INSERT on tb3 for each row
set old.f136=163, new.f118='U';
ERROR HY000: Updating of OLD row is not allowed in trigger
create trigger trg6c after UPDATE on tb3 for each row
set old.f136=NULL;
ERROR HY000: Updating of OLD row is not allowed in trigger
drop trigger trg6a;
drop trigger trg6b;
drop trigger trg6c;
Testcase 3.5.9.14: (implied in previous tests)
----------------------------------------------
DROP TABLE test.tb3;
USE test;
drop table if exists tb3 ;
drop table if exists tb3;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f121 char(50),
f122 char(50),
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
......@@ -59,13 +53,12 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = ndb;
) engine = <engine_to_be_used>;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/ndb_tb3.txt'
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
Testcase 3.5.10.1/2/3:
......@@ -94,8 +87,8 @@ NULL Test 3.5.10.1/2/3 1 111.110000000000000000000000000000
NULL Test 3.5.10.1/2/3 2 111.110000000000000000000000000000
select f121, f122, f151, f163 from vw11;
f121 f122 f151 f163
NULL Test 3.5.10.1/2/3 2 111.110000000000000000000000000000
NULL Test 3.5.10.1/2/3 1 111.110000000000000000000000000000
NULL Test 3.5.10.1/2/3 2 111.110000000000000000000000000000
select f121, f122, f151, f163
from tb3 where f122 like 'Not in View';
f121 f122 f151 f163
......@@ -108,8 +101,8 @@ Y Test 3.5.10.1/2/3-Update 1 1.000000000000000000000000000000
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
select f121, f122, f151, f163 from vw11;
f121 f122 f151 f163
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
Y Test 3.5.10.1/2/3-Update 1 1.000000000000000000000000000000
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
set @test_var=0;
Select @test_var as 'before delete';
before delete
......@@ -136,7 +129,7 @@ delete from tb3 where f122 like 'Test 3.5.10.1/2/3%';
Testcase 3.5.10.4:
------------------
create table tb_load (f1 int, f2 char(25),f3 int) engine=ndb;
create table tb_load (f1 int, f2 char(25),f3 int) engine = <engine_to_be_used>;
Create trigger trg4 before insert on tb_load
for each row set new.f3=-(new.f1 div 5), @counter= @counter+1;
set @counter= 0;
......@@ -170,7 +163,7 @@ Testcase 3.5.10.6: (implemented in trig_frkey.test)
Testcase 3.5.10.extra:
----------------------
create table t1_sp (var136 tinyint, var151 decimal) engine=ndb;
create table t1_sp (var136 tinyint, var151 decimal) engine = <engine_to_be_used>;
create trigger trg before insert on t1_sp
for each row set @counter=@counter+1;
create procedure trig_sp()
......@@ -219,12 +212,12 @@ drop table if exists t2_2;
drop table if exists t2_3;
drop table if exists t2_4;
drop table if exists t3;
create table t1 (f1 integer) engine=ndb;
create table t2_1 (f1 integer) engine=ndb;
create table t2_2 (f1 integer) engine=ndb;
create table t2_3 (f1 integer) engine=ndb;
create table t2_4 (f1 integer) engine=ndb;
create table t3 (f1 integer) engine=ndb;
create table t1 (f1 integer) engine = <engine_to_be_used>;
create table t2_1 (f1 integer) engine = <engine_to_be_used>;
create table t2_2 (f1 integer) engine = <engine_to_be_used>;
create table t2_3 (f1 integer) engine = <engine_to_be_used>;
create table t2_4 (f1 integer) engine = <engine_to_be_used>;
create table t3 (f1 integer) engine = <engine_to_be_used>;
insert into t1 values (1);
create trigger tr1 after insert on t1 for each row
BEGIN
......@@ -262,10 +255,10 @@ drop table if exists t1;
drop table if exists t2;
drop table if exists t3;
drop table if exists t4;
create table t1 (f1 integer) engine = ndb;
create table t2 (f2 integer) engine = ndb;
create table t3 (f3 integer) engine = ndb;
create table t4 (f4 integer) engine = ndb;
create table t1 (f1 integer) engine = <engine_to_be_used>;
create table t2 (f2 integer) engine = <engine_to_be_used>;
create table t3 (f3 integer) engine = <engine_to_be_used>;
create table t4 (f4 integer) engine = <engine_to_be_used>;
insert into t1 values (0);
create trigger tr1 after insert on t1
for each row insert into t2 (f2) values (new.f1+1);
......@@ -301,7 +294,7 @@ set @sql_mode='traditional';
create table t1_sp (
count integer,
var136 tinyint,
var151 decimal) engine=ndb;
var151 decimal) engine = <engine_to_be_used>;
create procedure trig_sp()
begin
declare done int default 0;
......@@ -355,7 +348,7 @@ drop procedure trig_sp;
drop trigger trg;
drop table t1_sp;
Testcase y.y.y.5: Roleback of nested trigger references
Testcase y.y.y.5: Rollback of nested trigger references
-------------------------------------------------------
set @@sql_mode='traditional';
use test;
......@@ -363,15 +356,15 @@ drop table if exists t1;
drop table if exists t2;
drop table if exists t3;
drop table if exists t4;
create table t1 (f1 integer) engine = ndb;
create table t2 (f2 integer) engine = ndb;
create table t3 (f3 integer) engine = ndb;
create table t4 (f4 tinyint) engine = ndb;
create table t1 (f1 integer) engine = <engine_to_be_used>;
create table t2 (f2 integer) engine = <engine_to_be_used>;
create table t3 (f3 integer) engine = <engine_to_be_used>;
create table t4 (f4 tinyint) engine = <engine_to_be_used>;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
`f1` int(11) default NULL
) ENGINE=<engine_to_be_used> DEFAULT CHARSET=latin1
insert into t1 values (1);
create trigger tr1 after insert on t1
for each row insert into t2 (f2) values (new.f1+1);
......@@ -382,18 +375,15 @@ for each row insert into t4 (f4) values (new.f3+1000);
set autocommit=0;
start transaction;
insert into t1 values (1);
ERROR 22003: Out of range value for column 'f4' at row 1
ERROR 22003: Out of range value adjusted for column 'f4' at row 1
commit;
select * from t1 order by f1;
f1
1
1
select * from t2 order by f2;
f2
2
select * from t3 order by f3;
f3
3
drop trigger tr1;
drop trigger tr2;
drop trigger tr3;
......
USE test;
drop table if exists tb3 ;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
f132 tinyint zerofill not null DEFAULT 99,
f133 tinyint unsigned zerofill not null DEFAULT 99,
f134 smallint not null DEFAULT 999,
f135 smallint unsigned not null DEFAULT 999,
f136 smallint zerofill not null DEFAULT 999,
f137 smallint unsigned zerofill not null DEFAULT 999,
f138 mediumint not null DEFAULT 9999,
f139 mediumint unsigned not null DEFAULT 9999,
f140 mediumint zerofill not null DEFAULT 9999,
f141 mediumint unsigned zerofill not null DEFAULT 9999,
f142 int not null DEFAULT 99999,
f143 int unsigned not null DEFAULT 99999,
f144 int zerofill not null DEFAULT 99999,
f145 int unsigned zerofill not null DEFAULT 99999,
f146 bigint not null DEFAULT 999999,
f147 bigint unsigned not null DEFAULT 999999,
f148 bigint zerofill not null DEFAULT 999999,
f149 bigint unsigned zerofill not null DEFAULT 999999,
f150 decimal not null DEFAULT 999.999,
f151 decimal unsigned not null DEFAULT 999.17,
f152 decimal zerofill not null DEFAULT 999.999,
f153 decimal unsigned zerofill,
f154 decimal (0),
f155 decimal (64),
f156 decimal (0) unsigned,
f157 decimal (64) unsigned,
f158 decimal (0) zerofill,
f159 decimal (64) zerofill,
f160 decimal (0) unsigned zerofill,
f161 decimal (64) unsigned zerofill,
f162 decimal (0,0),
f163 decimal (63,30),
f164 decimal (0,0) unsigned,
f165 decimal (63,30) unsigned,
f166 decimal (0,0) zerofill,
f167 decimal (63,30) zerofill,
f168 decimal (0,0) unsigned zerofill,
f169 decimal (63,30) unsigned zerofill,
f170 numeric,
f171 numeric unsigned,
f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = ndb;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/ndb_tb3.txt'
into table tb3;
Testcase 3.5.10.1/2/3:
----------------------
Create view vw11 as select * from tb3
where f122 like 'Test 3.5.10.1/2/3%';
Create trigger trg1a before insert on tb3
for each row set new.f163=111.11;
Create trigger trg1b after insert on tb3
for each row set @test_var='After Insert';
Create trigger trg1c before update on tb3
for each row set new.f121='Y', new.f122='Test 3.5.10.1/2/3-Update';
Create trigger trg1d after update on tb3
for each row set @test_var='After Update';
Create trigger trg1e before delete on tb3
for each row set @test_var=5;
Create trigger trg1f after delete on tb3
for each row set @test_var= 2* @test_var+7;
Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 1);
Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 2);
Insert into vw11 (f122, f151) values ('Not in View', 3);
select f121, f122, f151, f163
from tb3 where f122 like 'Test 3.5.10.1/2/3%' order by f151;
f121 f122 f151 f163
NULL Test 3.5.10.1/2/3 1 111.110000000000000000000000000000
NULL Test 3.5.10.1/2/3 2 111.110000000000000000000000000000
select f121, f122, f151, f163 from vw11;
f121 f122 f151 f163
NULL Test 3.5.10.1/2/3 2 111.110000000000000000000000000000
NULL Test 3.5.10.1/2/3 1 111.110000000000000000000000000000
select f121, f122, f151, f163
from tb3 where f122 like 'Not in View';
f121 f122 f151 f163
NULL Not in View 3 111.110000000000000000000000000000
Update vw11 set f163=1;
select f121, f122, f151, f163 from tb3
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
f121 f122 f151 f163
Y Test 3.5.10.1/2/3-Update 1 1.000000000000000000000000000000
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
select f121, f122, f151, f163 from vw11;
f121 f122 f151 f163
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
Y Test 3.5.10.1/2/3-Update 1 1.000000000000000000000000000000
set @test_var=0;
Select @test_var as 'before delete';
before delete
0
delete from vw11 where f151=1;
select f121, f122, f151, f163 from tb3
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
f121 f122 f151 f163
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
select f121, f122, f151, f163 from vw11;
f121 f122 f151 f163
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
Select @test_var as 'after delete';
after delete
17
drop view vw11;
drop trigger trg1a;
drop trigger trg1b;
drop trigger trg1c;
drop trigger trg1d;
drop trigger trg1e;
drop trigger trg1f;
delete from tb3 where f122 like 'Test 3.5.10.1/2/3%';
Testcase 3.5.10.4:
------------------
create table tb_load (f1 int, f2 char(25),f3 int) engine=ndb;
Create trigger trg4 before insert on tb_load
for each row set new.f3=-(new.f1 div 5), @counter= @counter+1;
set @counter= 0;
select @counter as 'Rows Loaded Before';
Rows Loaded Before
0
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table tb_load;
select @counter as 'Rows Loaded After';
Rows Loaded After
10
Select * from tb_load order by f1 limit 10;
f1 f2 f3
-5000 a` 1000
-4999 aaa 999
-4998 abaa 999
-4997 acaaa 999
-4996 adaaaa 999
-4995 aeaaaaa 999
-4994 afaaaaaa 998
-4993 agaaaaaaa 998
-4992 a^aaaaaaaa 998
-4991 a_aaaaaaaaa 998
drop trigger trg4;
drop table tb_load;
Testcase 3.5.10.5: (implemented in trig_frkey.test)
---------------------------------------------------
Testcase 3.5.10.6: (implemented in trig_frkey.test)
---------------------------------------------------
Testcase 3.5.10.extra:
----------------------
create table t1_sp (var136 tinyint, var151 decimal) engine=ndb;
create trigger trg before insert on t1_sp
for each row set @counter=@counter+1;
create procedure trig_sp()
begin
declare done int default 0;
declare var151 decimal;
declare var136 tinyint;
declare cur1 cursor for select f136, f151 from tb3;
declare continue handler for sqlstate '01000' set done = 1;
open cur1;
fetch cur1 into var136, var151;
wl_loop: WHILE NOT done DO
insert into t1_sp values (var136, var151);
fetch cur1 into var136, var151;
END WHILE wl_loop;
close cur1;
end//
set @counter=0;
select @counter;
@counter
0
call trig_sp();
ERROR 02000: No data - zero rows fetched, selected, or processed
select @counter;
@counter
11
select count(*) from tb3;
count(*)
11
select count(*) from t1_sp;
count(*)
11
drop procedure trig_sp;
drop trigger trg;
drop table t1_sp;
Testcase 3.5.11.1 (implemented in trig_perf.test)
-------------------------------------------------
Testcase y.y.y.2: Check for triggers starting triggers
------------------------------------------------------
use test;
drop table if exists t1;
drop table if exists t2_1;
drop table if exists t2_2;
drop table if exists t2_3;
drop table if exists t2_4;
drop table if exists t3;
create table t1 (f1 integer) engine=ndb;
create table t2_1 (f1 integer) engine=ndb;
create table t2_2 (f1 integer) engine=ndb;
create table t2_3 (f1 integer) engine=ndb;
create table t2_4 (f1 integer) engine=ndb;
create table t3 (f1 integer) engine=ndb;
insert into t1 values (1);
create trigger tr1 after insert on t1 for each row
BEGIN
insert into t2_1 (f1) values (new.f1+1);
insert into t2_2 (f1) values (new.f1+1);
insert into t2_3 (f1) values (new.f1+1);
insert into t2_4 (f1) values (new.f1+1);
END//
create trigger tr2_1 after insert on t2_1 for each row
insert into t3 (f1) values (new.f1+10);
create trigger tr2_2 after insert on t2_2 for each row
insert into t3 (f1) values (new.f1+100);
create trigger tr2_3 after insert on t2_3 for each row
insert into t3 (f1) values (new.f1+1000);
create trigger tr2_4 after insert on t2_4 for each row
insert into t3 (f1) values (new.f1+10000);
insert into t1 values (1);
select * from t3 order by f1;
f1
12
102
1002
10002
drop trigger tr1;
drop trigger tr2_1;
drop trigger tr2_2;
drop trigger tr2_3;
drop trigger tr2_4;
drop table t1, t2_1, t2_2, t2_3, t2_4, t3;
Testcase y.y.y.3: Circular trigger reference
--------------------------------------------
use test;
drop table if exists t1;
drop table if exists t2;
drop table if exists t3;
drop table if exists t4;
create table t1 (f1 integer) engine = ndb;
create table t2 (f2 integer) engine = ndb;
create table t3 (f3 integer) engine = ndb;
create table t4 (f4 integer) engine = ndb;
insert into t1 values (0);
create trigger tr1 after insert on t1
for each row insert into t2 (f2) values (new.f1+1);
create trigger tr2 after insert on t2
for each row insert into t3 (f3) values (new.f2+1);
create trigger tr3 after insert on t3
for each row insert into t4 (f4) values (new.f3+1);
create trigger tr4 after insert on t4
for each row insert into t1 (f1) values (new.f4+1);
insert into t1 values (1);
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
select * from t1 order by f1;
f1
0
select * from t2 order by f2;
f2
select * from t3 order by f3;
f3
select * from t4 order by f4;
f4
drop trigger tr1;
drop trigger tr2;
drop trigger tr3;
drop trigger tr4;
drop table t1;
drop table t2;
drop table t3;
drop table t4;
Testcase y.y.y.4: Recursive trigger/SP references
-------------------------------------------------
set @sql_mode='traditional';
create table t1_sp (
count integer,
var136 tinyint,
var151 decimal) engine=ndb;
create procedure trig_sp()
begin
declare done int default 0;
declare var151 decimal;
declare var136 tinyint;
declare cur1 cursor for select f136, f151 from tb3;
declare continue handler for sqlstate '01000' set done = 1;
set @counter= @counter+1;
open cur1;
fetch cur1 into var136, var151;
wl_loop: WHILE NOT done DO
insert into t1_sp values (@counter, var136, var151);
fetch cur1 into var136, var151;
END WHILE wl_loop;
close cur1;
end//
create trigger trg before insert on t1_sp
for each row call trig_sp();
set @counter=0;
select @counter;
@counter
0
call trig_sp();
ERROR HY000: Recursive limit 0 (as set by the max_sp_recursion_depth variable) was exceeded for routine trig_sp
select @counter;
@counter
1
select count(*) from tb3;
count(*)
11
select count(*) from t1_sp;
count(*)
0
set @@max_sp_recursion_depth= 10;
set @counter=0;
select @counter;
@counter
0
call trig_sp();
ERROR HY000: Can't update table 't1_sp' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
select @counter;
@counter
2
select count(*) from tb3;
count(*)
11
select count(*) from t1_sp;
count(*)
0
drop procedure trig_sp;
drop trigger trg;
drop table t1_sp;
Testcase y.y.y.5: Roleback of nested trigger references
-------------------------------------------------------
set @@sql_mode='traditional';
use test;
drop table if exists t1;
drop table if exists t2;
drop table if exists t3;
drop table if exists t4;
create table t1 (f1 integer) engine = ndb;
create table t2 (f2 integer) engine = ndb;
create table t3 (f3 integer) engine = ndb;
create table t4 (f4 tinyint) engine = ndb;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
insert into t1 values (1);
create trigger tr1 after insert on t1
for each row insert into t2 (f2) values (new.f1+1);
create trigger tr2 after insert on t2
for each row insert into t3 (f3) values (new.f2+1);
create trigger tr3 after insert on t3
for each row insert into t4 (f4) values (new.f3+1000);
set autocommit=0;
start transaction;
insert into t1 values (1);
ERROR 22003: Out of range value for column 'f4' at row 1
commit;
select * from t1 order by f1;
f1
1
1
select * from t2 order by f2;
f2
2
select * from t3 order by f3;
f3
3
drop trigger tr1;
drop trigger tr2;
drop trigger tr3;
drop table t1;
drop table t2;
drop table t3;
drop table t4;
DROP TABLE test.tb3;
......@@ -9,3 +9,5 @@
# Don't use any TAB characters for whitespace.
#
##############################################################################
ndb_trig_1011ext: Bug#32656 NDB: Duplicate key error aborts transaction in handler. Doesn't talk back to SQL
\ No newline at end of file
#### suite/funcs_1/t/innodb_triggers.test
#### suite/funcs_1/t/innodb_trig_0102.test
# InnoDB tables should be used
#
......@@ -7,10 +7,4 @@
# 2. Set $engine_type
let $engine_type= innodb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/innodb_tb3.inc
--source suite/funcs_1/triggers/triggers_0102.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/innodb_triggers.test
#### suite/funcs_1/t/innodb_trig_03.test
# InnoDB tables should be used
#
......@@ -7,10 +7,4 @@
# 2. Set $engine_type
let $engine_type= innodb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/innodb_tb3.inc
--source suite/funcs_1/triggers/triggers_03.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/innodb_triggers.test
#### suite/funcs_1/t/innodb_trig_0407.test
# InnoDB tables should be used
#
......@@ -7,10 +7,4 @@
# 2. Set $engine_type
let $engine_type= innodb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/innodb_tb3.inc
--source suite/funcs_1/triggers/triggers_0407.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/innodb_triggers.test
#### suite/funcs_1/t/innodb_trig_08.test
# InnoDB tables should be used
#
......@@ -7,10 +7,4 @@
# 2. Set $engine_type
let $engine_type= innodb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/innodb_tb3.inc
--source suite/funcs_1/triggers/triggers_08.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/innodb_triggers.test
#### suite/funcs_1/t/innodb_trig_09.test
# InnoDB tables should be used
#
......@@ -7,10 +7,4 @@
# 2. Set $engine_type
let $engine_type= innodb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/innodb_tb3.inc
--source suite/funcs_1/triggers/triggers_09.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/innodb_triggers.test
#### suite/funcs_1/t/innodb_trig_1011ext.test
# InnoDB tables should be used
#
......@@ -7,10 +7,4 @@
# 2. Set $engine_type
let $engine_type= innodb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/innodb_tb3.inc
--source suite/funcs_1/triggers/triggers_1011ext.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/memory_triggers.test
#### suite/funcs_1/t/memory_trig_0102.test
# Memory tables should be used
#
# Set $engine_type
let $engine_type= memory;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/memory_tb3.inc
--source suite/funcs_1/triggers/triggers_0102.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/memory_triggers.test
#### suite/funcs_1/t/memory_trig_03.test
# Memory tables should be used
#
# Set $engine_type
let $engine_type= memory;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/memory_tb3.inc
--source suite/funcs_1/triggers/triggers_03.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/memory_triggers.test
#### suite/funcs_1/t/memory_trig_0407.test
# Memory tables should be used
#
# Set $engine_type
let $engine_type= memory;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/memory_tb3.inc
--source suite/funcs_1/triggers/triggers_0407.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/memory_triggers.test
#### suite/funcs_1/t/memory_trig_08.test
# Memory tables should be used
#
# Set $engine_type
let $engine_type= memory;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/memory_tb3.inc
--source suite/funcs_1/triggers/triggers_08.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/memory_triggers.test
#### suite/funcs_1/t/memory_trig_09.test
# Memory tables should be used
#
# Set $engine_type
let $engine_type= memory;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/memory_tb3.inc
--source suite/funcs_1/triggers/triggers_09.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/memory_triggers.test
#### suite/funcs_1/t/memory_trig_1011ext.test
# Memory tables should be used
#
# Set $engine_type
let $engine_type= memory;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/memory_tb3.inc
--source suite/funcs_1/triggers/triggers_1011ext.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/myisam_triggers.test
#### suite/funcs_1/t/myisam_trig_0102.test
# MyISAM tables should be used
#
# Set $engine_type
let $engine_type= myisam;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/myisam_tb3.inc
--source suite/funcs_1/triggers/triggers_0102.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/myisam_triggers.test
#### suite/funcs_1/t/myisam_trig_03.test
# MyISAM tables should be used
#
# Set $engine_type
let $engine_type= myisam;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/myisam_tb3.inc
--source suite/funcs_1/triggers/triggers_03.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/myisam_triggers.test
#### suite/funcs_1/t/myisam_trig_0407.test
# MyISAM tables should be used
#
# Set $engine_type
let $engine_type= myisam;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/myisam_tb3.inc
--source suite/funcs_1/triggers/triggers_0407.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/myisam_triggers.test
#### suite/funcs_1/t/myisam_trig_08.test
# MyISAM tables should be used
#
# Set $engine_type
let $engine_type= myisam;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/myisam_tb3.inc
--source suite/funcs_1/triggers/triggers_08.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/myisam_triggers.test
#### suite/funcs_1/t/myisam_trig_09.test
# MyISAM tables should be used
#
# Set $engine_type
let $engine_type= myisam;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/myisam_tb3.inc
--source suite/funcs_1/triggers/triggers_09.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/myisam_triggers.test
#### suite/funcs_1/t/myisam_trig_1011ext.test
# MyISAM tables should be used
#
# Set $engine_type
let $engine_type= myisam;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/myisam_tb3.inc
--source suite/funcs_1/triggers/triggers_1011ext.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/ndb_triggers.test
#### suite/funcs_1/t/ndb_trig_0102.test
# ndb tables should be used
# NDB tables should be used
#
# 1. Check if ndb is available
# 1. Check if NDB is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
let $engine_type= ndbcluster;
--source suite/funcs_1/triggers/triggers_0102.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/ndb_triggers.test
# ndb tables should be used
#
# 1. Check if ndb is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
--source suite/funcs_1/triggers/triggers_0102.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/ndb_triggers.test
#### suite/funcs_1/t/ndb_trig_03.test
# NDB tables should be used
#
# 1. Check if NDB is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
let $engine_type= ndbcluster;
--source suite/funcs_1/triggers/triggers_03.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/ndb_triggers.test
# NDB tables should be used
#
# 1. Check if NDB is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
--source suite/funcs_1/triggers/triggers_03.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/ndb_triggers.test
#### suite/funcs_1/t/ndb_trig_0407.test
# ndb tables should be used
# NDB tables should be used
#
# 1. Check if ndb is available
# 1. Check if NDB is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
let $engine_type= ndbcluster;
--source suite/funcs_1/triggers/triggers_0407.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/ndb_triggers.test
# ndb tables should be used
#
# 1. Check if ndb is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
--source suite/funcs_1/triggers/triggers_0407.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/ndb_triggers.test
#### suite/funcs_1/t/ndb_trig_08.test
# ndb tables should be used
# NDB tables should be used
#
# 1. Check if ndb is available
# 1. Check if NDB is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
let $engine_type= ndbcluster;
--source suite/funcs_1/triggers/triggers_08.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/ndb_triggers.test
# ndb tables should be used
#
# 1. Check if ndb is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
--source suite/funcs_1/triggers/triggers_08.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/ndb_triggers.test
#### suite/funcs_1/t/ndb_trig_09.test
# ndb tables should be used
# NDB tables should be used
#
# 1. Check if ndb is available
# 1. Check if NDB is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
let $engine_type= ndbcluster;
--source suite/funcs_1/triggers/triggers_09.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/ndb_triggers.test
# ndb tables should be used
#
# 1. Check if ndb is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
--source suite/funcs_1/triggers/triggers_09.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/ndb_triggers.test
#### suite/funcs_1/t/ndb_trig_1011ext.test
# ndb tables should be used
# NDB tables should be used
#
# 1. Check if ndb is available
# 1. Check if NDB is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
let $engine_type= ndbcluster;
--source suite/funcs_1/triggers/triggers_1011ext.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/ndb_triggers.test
# ndb tables should be used
#
# 1. Check if ndb is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
--source suite/funcs_1/triggers/triggers_1011ext.inc
DROP TABLE test.tb3;
......@@ -4,6 +4,9 @@
# (test case numbering refer to requirement document TP v1.1)
#======================================================================
USE test;
--source suite/funcs_1/include/tb3.inc
# OBM - ToDo
############
# 1. Performace
......@@ -52,6 +55,7 @@ use test;
select @test_before, @test_after;
Insert into tb3 (f121, f122, f142, f144, f134)
values ('Test 3.5.1.1', 'First Row', @test_before, @test_after, 1);
--sorted_result
select f121, f122, f142, f144, f134 from tb3 where f121 = 'Test 3.5.1.1';
select @test_before, @test_after;
......@@ -63,6 +67,7 @@ use test;
tb3.f142 = @test_before,
tb3.f144 = @test_after
where tb3.f121 = 'Test 3.5.1.1';
--sorted_result
select f121, f122, f142, f144, f134 from tb3 where f121 = 'Test 3.5.1.1';
select @test_before, @test_after;
......@@ -71,9 +76,11 @@ use test;
values ('Test 3.5.1.1', 'Second Row', 5, 6, 2);
set @test_before = 0;
set @test_after = 0;
--sorted_result
select f121, f122, f142, f144, f134 from tb3 where f121 = 'Test 3.5.1.1';
select @test_before, @test_after;
Delete from tb3 where f121 = 'Test 3.5.1.1' and f134 = 2;
--sorted_result
select f121, f122, f142, f144, f134 from tb3 where f121 = 'Test 3.5.1.1';
select @test_before, @test_after;
......@@ -211,7 +218,8 @@ let $message= Testcase 3.5.1.7: - need to fix;
--source include/show_msg.inc
drop table if exists t1;
eval create table t1 (f1 int, f2 char(25),f3 int) engine=$engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t1 (f1 int, f2 char(25),f3 int) engine = $engine_type;
CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1
for each row set new.f3 = '14';
# In 5.0 names to long (more than 64 chars) were trimed without an error
......@@ -269,6 +277,7 @@ let $message= Testcase 3.5.1.8:;
--enable_warnings
create database trig_db;
use trig_db;
--replace_result $engine_type <engine_to_be_used>
eval create table t1 (f1 integer) engine = $engine_type;
# Can't create a trigger in a different database
......@@ -332,7 +341,9 @@ let $message= Testcase 3.5.1.?:;
drop table if exists t1;
drop table if exists t2;
--enable_warnings
--replace_result $engine_type <engine_to_be_used>
eval create table t1 (f1 char(50), f2 integer) engine = $engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t2 (f1 char(50), f2 integer) engine = $engine_type;
create trigger trig before insert on t1
......@@ -374,14 +385,17 @@ let $message= Testcase 3.5.1.11:;
create database trig_db2;
create database trig_db3;
use trig_db1;
--replace_result $engine_type <engine_to_be_used>
eval create table t1 (f1 char(50), f2 integer) engine = $engine_type;
create trigger trig before insert on t1
for each row set new.f1 ='trig1', @test_var1='trig1';
use trig_db2;
--replace_result $engine_type <engine_to_be_used>
eval create table t2 (f1 char(50), f2 integer) engine = $engine_type;
create trigger trig before insert on t2
for each row set new.f1 ='trig2', @test_var2='trig2';
use trig_db3;
--replace_result $engine_type <engine_to_be_used>
eval create table t1 (f1 char(50), f2 integer) engine = $engine_type;
create trigger trig before insert on t1
for each row set new.f1 ='trig3', @test_var3='trig3';
......@@ -433,7 +447,9 @@ let $message= Testcase 3.5.2.1/2/3:;
create database trig_db1;
create database trig_db2;
use trig_db1;
--replace_result $engine_type <engine_to_be_used>
eval create table t1 (f1 char(50), f2 integer) engine = $engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table trig_db2.t1 (f1 char(50), f2 integer) engine = $engine_type;
create trigger trig1_b before insert on t1
for each row set @test_var1='trig1_b';
......@@ -453,3 +469,4 @@ let $message= Testcase 3.5.2.1/2/3:;
--disable_warnings
drop database trig_db1;
drop database trig_db2;
DROP TABLE test.tb3;
#### suite/funcs_1/triggers/triggers_03.inc
#======================================================================
#
# Trigger Tests
......@@ -5,6 +6,9 @@
#======================================================================
# WL#4084: enable disabled parts. 2007-11-15, hhunger
USE test;
--source suite/funcs_1/include/tb3.inc
--disable_abort_on_error
###########################################
......@@ -21,6 +25,7 @@ let $message= Testcase 3.5.3:;
--enable_warnings
create database priv_db;
use priv_db;
--replace_result $engine_type <engine_to_be_used>
eval create table t1 (f1 char(20)) engine= $engine_type;
create User test_noprivs@localhost;
......@@ -570,7 +575,9 @@ let $message=Testcase: 3.5.3.x:;
drop table if exists t2;
--enable_warnings
--replace_result $engine_type <engine_to_be_used>
eval create table t1 (f1 int) engine= $engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t2 (f2 int) engine= $engine_type;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
......@@ -657,3 +664,5 @@ let $message=Testcase: 3.5.3.x:;
drop user test_noprivs;
--enable_warnings
use test;
drop table tb3;
......@@ -4,6 +4,9 @@
# (test case numbering refer to requirement document TP v1.1)
#======================================================================
USE test;
--source suite/funcs_1/include/tb3.inc
--disable_abort_on_error
# General setup for Trigger tests
......@@ -43,7 +46,8 @@ let $message= Testcase 3.5.4.1:;
connection con1_super;
create database db_drop;
Use db_drop;
eval create table t1 (f1 char(30)) engine=$engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t1 (f1 char(30)) engine = $engine_type;
grant INSERT, SELECT on db_drop.t1 to test_general;
Use db_drop;
Create trigger trg1 BEFORE INSERT on t1
......@@ -82,7 +86,8 @@ let $message= Testcase 3.5.4.2:;
--disable_warnings
drop table if exists t1_432 ;
--enable_warnings
eval create table t1_432 (f1 char (30)) engine=$engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t1_432 (f1 char (30)) engine = $engine_type;
--error ER_TRG_DOES_NOT_EXIST
Drop trigger tr_does_not_exit;
#cleanup
......@@ -104,8 +109,10 @@ let $message= Testcase 3.5.4.3:;
drop table if exists t1_433 ;
drop table if exists t1_433a ;
--enable_warnings
eval create table t1_433 (f1 char (30)) engine=$engine_type;
eval create table t1_433a (f1a char (5)) engine=$engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t1_433 (f1 char (30)) engine = $engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t1_433a (f1a char (5)) engine = $engine_type;
CREATE TRIGGER trg3 BEFORE INSERT on t1_433 for each row
set new.f1 = 'Trigger 3.5.4.3';
......@@ -141,7 +148,8 @@ let $message= Testcase 3.5.4.4:;
connection con1_super;
create database db_drop4;
Use db_drop4;
eval create table t1 (f1 char(30)) engine=$engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t1 (f1 char(30)) engine = $engine_type;
grant INSERT, SELECT on db_drop4.t1 to test_general;
Create trigger trg4 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.4';
......@@ -157,7 +165,8 @@ let $message= Testcase 3.5.4.4:;
where information_schema.triggers.trigger_name='trg4';
create database db_drop4;
Use db_drop4;
eval create table t1 (f1 char(30)) engine=$engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t1 (f1 char(30)) engine = $engine_type;
grant INSERT, SELECT on db_drop4.t1 to test_general;
connection con1_general;
Insert into t1 values ('2nd Insert 3.5.4.4');
......@@ -181,7 +190,8 @@ let $message= Testcase 3.5.4.5:;
connection con1_super;
create database db_drop5;
Use db_drop5;
eval create table t1 (f1 char(50)) engine=$engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t1 (f1 char(50)) engine = $engine_type;
grant INSERT, SELECT on t1 to test_general;
Create trigger trg5 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.5';
......@@ -195,7 +205,8 @@ let $message= Testcase 3.5.4.5:;
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers
where information_schema.triggers.trigger_name='trg5';
eval create table t1 (f1 char(50)) engine=$engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t1 (f1 char(50)) engine = $engine_type;
grant INSERT, SELECT on t1 to test_general;
connection con1_general;
Insert into t1 values ('2nd Insert 3.5.4.5');
......@@ -281,7 +292,8 @@ let $message= Testcase 3.5.5.4:;
create database dbtest_one;
create database dbtest_two;
use dbtest_two;
eval create table t2 (f1 char(15)) engine=$engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t2 (f1 char(15)) engine = $engine_type;
use dbtest_one;
--error ER_TRG_IN_WRONG_SCHEMA
create trigger trg4 before INSERT
......@@ -609,3 +621,4 @@ let $message= Testcase 3.5.7.17 (see Testcase 3.5.1.1);
drop user test_general;
drop user test_super@localhost;
DROP TABLE test.tb3;
......@@ -5,6 +5,9 @@
#======================================================================
# WL#4084: enable disabled parts, 2007-11-15 hhunger
USE test;
--source suite/funcs_1/include/tb3.inc
# General setup for Trigger tests
let $message= Testcase: 3.5:;
--source include/show_msg.inc
......@@ -57,16 +60,19 @@ let $message= Testcase 3.5.8.3/4:;
grant SELECT, INSERT, UPDATE, DELETE on db_test.* to test_general;
grant LOCK TABLES on db_test.* to test_general;
Use db_test;
--replace_result $engine_type <engine_to_be_used>
eval create table t1_i (
i120 char ascii not null DEFAULT b'101',
i136 smallint zerofill not null DEFAULT 999,
i144 int zerofill not null DEFAULT 99999,
i163 decimal (63,30)) engine=$engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t1_u (
u120 char ascii not null DEFAULT b'101',
u136 smallint zerofill not null DEFAULT 999,
u144 int zerofill not null DEFAULT 99999,
u163 decimal (63,30)) engine=$engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t1_d (
d120 char ascii not null DEFAULT b'101',
d136 smallint zerofill not null DEFAULT 999,
......@@ -550,4 +556,4 @@ let $message= Testcase 3.5.8.7;
drop user test_general;
drop user test_super@localhost;
DROP TABLE test.tb3;
......@@ -4,6 +4,13 @@
# (test case numbering refer to requirement document TP v1.1)
#======================================================================
USE test;
--source suite/funcs_1/include/tb3.inc
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
#################################
####### Section 3.5.9 ###########
......@@ -317,4 +324,4 @@ let $message= Testcase 3.5.9.13:;
let $message= Testcase 3.5.9.14: (implied in previous tests);
--source include/show_msg.inc
DROP TABLE test.tb3;
......@@ -5,6 +5,14 @@
#======================================================================
# WL#4084: enable disabled parts, 2007-11-15, hhunger
USE test;
--source suite/funcs_1/include/tb3.inc
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
--disable_abort_on_error
##############################################
......@@ -50,6 +58,7 @@ let $message= Testcase 3.5.10.1/2/3:;
Insert into vw11 (f122, f151) values ('Not in View', 3);
select f121, f122, f151, f163
from tb3 where f122 like 'Test 3.5.10.1/2/3%' order by f151;
--sorted_result
select f121, f122, f151, f163 from vw11;
select f121, f122, f151, f163
from tb3 where f122 like 'Not in View';
......@@ -58,6 +67,7 @@ let $message= Testcase 3.5.10.1/2/3:;
Update vw11 set f163=1;
select f121, f122, f151, f163 from tb3
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
--sorted_result
select f121, f122, f151, f163 from vw11;
#Section 3.5.10.3
......@@ -66,6 +76,7 @@ let $message= Testcase 3.5.10.1/2/3:;
delete from vw11 where f151=1;
select f121, f122, f151, f163 from tb3
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
--sorted_result
select f121, f122, f151, f163 from vw11;
Select @test_var as 'after delete';
......@@ -89,7 +100,8 @@ let $message= Testcase 3.5.10.1/2/3:;
let $message= Testcase 3.5.10.4:;
--source include/show_msg.inc
eval create table tb_load (f1 int, f2 char(25),f3 int) engine=$engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table tb_load (f1 int, f2 char(25),f3 int) engine = $engine_type;
Create trigger trg4 before insert on tb_load
for each row set new.f3=-(new.f1 div 5), @counter= @counter+1;
......@@ -132,7 +144,8 @@ let $message= Testcase 3.5.10.6: (implemented in trig_frkey.test);
let $message= Testcase 3.5.10.extra:;
--source include/show_msg.inc
eval create table t1_sp (var136 tinyint, var151 decimal) engine=$engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t1_sp (var136 tinyint, var151 decimal) engine = $engine_type;
create trigger trg before insert on t1_sp
for each row set @counter=@counter+1;
......@@ -204,12 +217,18 @@ let $message= Testcase y.y.y.2: Check for triggers starting triggers;
drop table if exists t3;
--enable_warnings
eval create table t1 (f1 integer) engine=$engine_type;
eval create table t2_1 (f1 integer) engine=$engine_type;
eval create table t2_2 (f1 integer) engine=$engine_type;
eval create table t2_3 (f1 integer) engine=$engine_type;
eval create table t2_4 (f1 integer) engine=$engine_type;
eval create table t3 (f1 integer) engine=$engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t1 (f1 integer) engine = $engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t2_1 (f1 integer) engine = $engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t2_2 (f1 integer) engine = $engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t2_3 (f1 integer) engine = $engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t2_4 (f1 integer) engine = $engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t3 (f1 integer) engine = $engine_type;
insert into t1 values (1);
delimiter //;
......@@ -257,9 +276,13 @@ let $message= Testcase y.y.y.3: Circular trigger reference;
drop table if exists t3;
drop table if exists t4;
--enable_warnings
--replace_result $engine_type <engine_to_be_used>
eval create table t1 (f1 integer) engine = $engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t2 (f2 integer) engine = $engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t3 (f3 integer) engine = $engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t4 (f4 integer) engine = $engine_type;
insert into t1 values (0);
......@@ -299,10 +322,11 @@ let $message= Testcase y.y.y.4: Recursive trigger/SP references;
--source include/show_msg.inc
set @sql_mode='traditional';
--replace_result $engine_type <engine_to_be_used>
eval create table t1_sp (
count integer,
var136 tinyint,
var151 decimal) engine=$engine_type;
var151 decimal) engine = $engine_type;
delimiter //;
create procedure trig_sp()
......@@ -354,7 +378,7 @@ set @sql_mode='traditional';
# Testcase: y.y.y.5:
# Checking rollback of nested trigger definitions
let $message= Testcase y.y.y.5: Roleback of nested trigger references;
let $message= Testcase y.y.y.5: Rollback of nested trigger references;
--source include/show_msg.inc
set @@sql_mode='traditional';
......@@ -365,10 +389,15 @@ let $message= Testcase y.y.y.5: Roleback of nested trigger references;
drop table if exists t3;
drop table if exists t4;
--enable_warnings
--replace_result $engine_type <engine_to_be_used>
eval create table t1 (f1 integer) engine = $engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t2 (f2 integer) engine = $engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t3 (f3 integer) engine = $engine_type;
--replace_result $engine_type <engine_to_be_used>
eval create table t4 (f4 tinyint) engine = $engine_type;
--replace_result $engine_type <engine_to_be_used>
show create table t1;
insert into t1 values (1);
create trigger tr1 after insert on t1
......@@ -378,19 +407,18 @@ let $message= Testcase y.y.y.5: Roleback of nested trigger references;
create trigger tr3 after insert on t3
for each row insert into t4 (f4) values (new.f3+1000);
#lock tables t1 write, t2 write, t3 write, t4 write;
set autocommit=0;
start transaction;
# Bug#32656 NDB: Duplicate key error aborts transaction in handler.
# Doesn't talk back to SQL
--error ER_WARN_DATA_OUT_OF_RANGE
insert into t1 values (1);
commit;
select * from t1 order by f1;
select * from t2 order by f2;
select * from t3 order by f3;
#unlock tables;
#Cleanup
--disable_warnings
drop trigger tr1;
drop trigger tr2;
drop trigger tr3;
......@@ -398,5 +426,5 @@ let $message= Testcase y.y.y.5: Roleback of nested trigger references;
drop table t2;
drop table t3;
drop table t4;
--enable_warnings
DROP TABLE test.tb3;
......@@ -187,7 +187,7 @@ SET @sleep_time_per_result_row = 1;
SET @max_acceptable_delay = 2;
# TIMEDIFF = time for query with sleep (mostly the time caused by SLEEP)
# + time for delays caused by high load on testing box
# Ensure that at least a reasonable fraction of TIMEDIFF is belongs to the SLEEP
# Ensure that at least a reasonable fraction of TIMEDIFF belongs to the SLEEP
# by appropriate setting of variables.
# Ensure that any "judging" has a base of minimum three attempts.
# (Test 2 uses all attempts except the first one.)
......@@ -251,7 +251,7 @@ while ($num)
# -> total runtime is clear more needed than for one result row needed
# = Replacement for one of the original Bug#12689 tests
--echo # Test 1: Does the query with SLEEP need a reasonable time?
eval SELECT COUNT(*) > $loops - 1 INTO @aux1 FROM t_history
eval SELECT COUNT(*) >= $loops - 1 INTO @aux1 FROM t_history
WHERE TIMEDIFF(end_ts,start_ts) - @sleep_time_per_result_row * @row_count
BETWEEN 0 AND @max_acceptable_delay;
SELECT @aux1 AS "Expect 1";
......@@ -266,7 +266,7 @@ SELECT @aux1 AS "Expect 1";
# = Replacement for one of the original Bug#12689 tests
--echo # Test 2: Does the query with SLEEP need a reasonable time even in case
--echo # of the non first execution?
eval SELECT COUNT(*) > $loops - 1 - 1 INTO @aux2 FROM t_history
eval SELECT COUNT(*) >= $loops - 1 - 1 INTO @aux2 FROM t_history
WHERE TIMEDIFF(end_ts,start_ts) - @sleep_time_per_result_row * @row_count
BETWEEN 0 AND @max_acceptable_delay
AND attempt > 1;
......
......@@ -48,3 +48,61 @@ SET @@global.query_cache_size=0;
set @@global.table_definition_cache=@save_table_definition_cache;
# 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,
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