Commit c3612b41 authored by unknown's avatar unknown
Browse files

Added test case for BUG#14270: Stored procedures: crash if load index

  which was fixed by earlier changesets; LOAD INDEX is not allowed in functions.
  Also testing CACHE INDEX, while OPTIMIZE and CHECK were covered by existing tests already.


mysql-test/r/sp-error.result:
  Updated result for new test case (BUG#14270).
mysql-test/t/sp-error.test:
  New test case for BUG#14270.
parent 5dda41a7
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -1147,3 +1147,19 @@ show procedure status;
Db	Name	Type	Definer	Modified	Created	Security_type	Comment
test	 bug15658	PROCEDURE	root@localhost	0000-00-00 00:00:00	0000-00-00 00:00:00	DEFINER	
drop procedure ` bug15658`;
drop function if exists bug14270;
drop table if exists t1;
create table t1 (s1 int primary key);
create function bug14270() returns int
begin
load index into cache t1;
return 1;
end|
ERROR 0A000: Not allowed to return a result set from a function
create function bug14270() returns int
begin
cache index t1 key (`primary`) in keycache1;
return 1;
end|
ERROR 0A000: Not allowed to return a result set from a function
drop table t1;
+29 −0
Original line number Diff line number Diff line
@@ -1643,6 +1643,35 @@ show procedure status;
drop procedure ` bug15658`;


#
# BUG#14270: Stored procedures: crash if load index
#
--disable_warnings
drop function if exists bug14270;
drop table if exists t1;
--enable_warnings

create table t1 (s1 int primary key);

delimiter |;
--error ER_SP_NO_RETSET
create function bug14270() returns int
begin
  load index into cache t1;
  return 1;
end|

--error ER_SP_NO_RETSET
create function bug14270() returns int
begin
  cache index t1 key (`primary`) in keycache1;
  return 1;
end|
delimiter ;|

drop table t1;


#
# BUG#NNNN: New bug synopsis
#