1128
1128
create function bug11555_1() returns int return (select max(i) from t1);
1129
1129
create function bug11555_2() returns int return bug11555_1();
1130
1130
create view v1 as select bug11555_1();
1131
ERROR 42S02: Table 'test.t1' doesn't exist
1132
1132
create view v2 as select bug11555_2();
1133
ERROR 42S02: Table 'test.t1' doesn't exist
1134
1134
create table t1 (i int);
1135
1135
create view v1 as select bug11555_1();
1136
1136
create view v2 as select bug11555_2();
1153
1152
create view v1 as select * from t1;
1155
1154
insert into v1 values (1);
1156
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
1155
ERROR HY000: Table 't2' was not locked with LOCK TABLES
1157
1156
drop trigger t1_ai;
1158
1157
create function bug11555_1() returns int return (select max(i) from t2);
1159
1158
create trigger t1_ai after insert on t1 for each row set @a:=bug11555_1();
1160
1159
insert into v1 values (2);
1161
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
1160
ERROR HY000: Table 't2' was not locked with LOCK TABLES
1162
1161
drop function bug11555_1;
1269
1268
ERROR 42S22: Unknown column 'y.value' in 'field list'
1270
1269
drop procedure bug24491;
1271
1270
drop tables t1;
1271
DROP FUNCTION IF EXISTS bug18914_f1;
1272
DROP FUNCTION IF EXISTS bug18914_f2;
1273
DROP PROCEDURE IF EXISTS bug18914_p1;
1274
DROP PROCEDURE IF EXISTS bug18914_p2;
1275
DROP TABLE IF EXISTS t1, t2;
1276
CREATE TABLE t1 (i INT);
1277
CREATE PROCEDURE bug18914_p1() CREATE TABLE t2 (i INT);
1278
CREATE PROCEDURE bug18914_p2() DROP TABLE IF EXISTS no_such_table;
1279
CREATE FUNCTION bug18914_f1() RETURNS INT
1284
CREATE FUNCTION bug18914_f2() RETURNS INT
1289
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
1291
INSERT INTO t1 VALUES (1);
1292
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
1293
SELECT bug18914_f1();
1294
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
1295
SELECT bug18914_f2();
1296
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
1298
ERROR 42S02: Table 'test.t2' doesn't exist
1299
DROP FUNCTION bug18914_f1;
1300
DROP FUNCTION bug18914_f2;
1301
DROP PROCEDURE bug18914_p1;
1302
DROP PROCEDURE bug18914_p2;
1304
drop table if exists bogus_table_20713;
1305
drop function if exists func_20713_a;
1306
drop function if exists func_20713_b;
1307
create table bogus_table_20713( id int(10) not null primary key);
1308
insert into bogus_table_20713 values (1), (2), (3);
1309
create function func_20713_a() returns int(11)
1312
declare continue handler for sqlexception set id=null;
1314
set id = (select id from bogus_table_20713 where id = 3);
1318
create function func_20713_b() returns int(11)
1321
declare continue handler for sqlstate value '42S02' set id=null;
1323
set id = (select id from bogus_table_20713 where id = 3);
1328
select func_20713_a();
1335
select func_20713_b();
1341
drop table bogus_table_20713;
1343
select func_20713_a();
1350
select func_20713_b();
1356
drop function if exists func_20713_a;
1357
drop function if exists func_20713_b;
1358
drop table if exists table_25345_a;
1359
drop table if exists table_25345_b;
1360
drop procedure if exists proc_25345;
1361
drop function if exists func_25345;
1362
drop function if exists func_25345_b;
1363
create table table_25345_a (a int);
1364
create table table_25345_b (b int);
1365
create procedure proc_25345()
1367
declare c1 cursor for select a from table_25345_a;
1368
declare c2 cursor for select b from table_25345_b;
1371
create function func_25345() returns int(11)
1376
create function func_25345_b() returns int(11)
1378
declare c1 cursor for select a from table_25345_a;
1379
declare c2 cursor for select b from table_25345_b;
1385
select func_25345();
1386
ERROR 0A000: Not allowed to return a result set from a function
1387
select func_25345_b();
1390
drop table table_25345_a;
1394
select func_25345();
1395
ERROR 0A000: Not allowed to return a result set from a function
1396
select func_25345_b();
1399
drop table table_25345_b;
1400
drop procedure proc_25345;
1401
drop function func_25345;
1402
drop function func_25345_b;