Commit db40f4a5 authored by unknown's avatar unknown
Browse files

Fixed BUG#7185: Stored procedure crash if identifier is AVG


mysql-test/r/sp.result:
  Added test case for BUG#7185.
mysql-test/t/sp.test:
  Added test case for BUG#7185.
sql/sql_yacc.yy:
  Allow non-reserved words as stored procedure names.
parent 99b986d0
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2844,4 +2844,10 @@ drop procedure bug6900|
drop procedure bug9074|
drop procedure bug6900_9074|
drop table t3|
drop procedure if exists avg|
create procedure avg ()
begin
end|
call avg ()|
drop procedure avg|
drop table t1,t2;
+14 −0
Original line number Diff line number Diff line
@@ -3481,6 +3481,20 @@ drop procedure bug6900_9074|
drop table t3|


#
# BUG#7185: Stored procedure crash if identifier is AVG
#
--disable_warnings
drop procedure if exists avg|
--enable_warnings
create procedure avg ()
begin
end|

call avg ()|
drop procedure avg|


#
# BUG#NNNN: New bug synopsis
#
+2 −2
Original line number Diff line number Diff line
@@ -1328,12 +1328,12 @@ clear_privileges:
        ;

sp_name:
	  IDENT_sys '.' IDENT_sys
	  ident '.' ident
	  {
	    $$= new sp_name($1, $3);
	    $$->init_qname(YYTHD);
	  }
	| IDENT_sys
	| ident
	  {
	    $$= sp_name_current_db_new(YYTHD, $1);
	  }