Commit 66b71ca3 authored by unknown's avatar unknown
Browse files

Fixed BUG#6600: Stored procedure crash after repeated calls with check table.

  Sedond attempt: Simply disallow CHECK in SPs, since it can't work.


mysql-test/r/sp-error.result:
  New test cast for BUG#6600
mysql-test/r/sp.result:
  Removed old test case for BUG#6600
mysql-test/t/sp-error.test:
  New test cast for BUG#6600
mysql-test/t/sp.test:
  Removed old test case for BUG#6600
sql/share/errmsg.txt:
  Made the SP bad statement error message more general.
sql/sp_head.cc:
  CHECK is not possible in stored procedures.
sql/sql_parse.cc:
  Undid attempt to fix CHECK in stored procedures, it didn't work.
sql/sql_yacc.yy:
  CHECK is not possible in stored procedures.
  (And updated error messages for LOCK/UNLOCK.)
parent 3a44dcd1
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -494,4 +494,13 @@ declare continue handler for sqlstate '42x00' begin end;
begin end;
end|
ERROR 42000: Bad SQLSTATE: '42x00'
create procedure bug6600()
check table t1|
ERROR 0A000: CHECK is not allowed in stored procedures
create procedure bug6600()
lock table t1 read|
ERROR 0A000: LOCK is not allowed in stored procedures
create procedure bug6600()
unlock table t1|
ERROR 0A000: UNLOCK is not allowed in stored procedures
drop table t1|
+0 −19
Original line number Diff line number Diff line
@@ -2779,23 +2779,4 @@ a
3.2000
drop procedure bug8937|
delete from t1|
drop procedure if exists bug6600|
drop table if exists t3|
drop view if exists v1|
create table t3 (s1 decimal(31,30))|
create view v1 as select * from t3|
create procedure bug6600()
check table v1|
call bug6600()|
Table	Op	Msg_type	Msg_text
test.v1	check	status	OK
call bug6600()|
Table	Op	Msg_type	Msg_text
test.v1	check	status	OK
call bug6600()|
Table	Op	Msg_type	Msg_text
test.v1	check	status	OK
drop procedure bug6600|
drop view v1|
drop table t3|
drop table t1,t2;
+17 −0
Original line number Diff line number Diff line
@@ -680,6 +680,23 @@ begin
end|


#
# BUG#6600: Stored procedure crash after repeated calls with check table
#
--error ER_SP_BADSTATEMENT
create procedure bug6600()
  check table t1|

# Check these two as well, while we're at it. (Although it isn't really
# related to the bug report, but to the fix.)
--error ER_SP_BADSTATEMENT
create procedure bug6600()
  lock table t1 read|
--error ER_SP_BADSTATEMENT
create procedure bug6600()
  unlock table t1|


#
# BUG#NNNN: New bug synopsis
#
+0 −22
Original line number Diff line number Diff line
@@ -3398,28 +3398,6 @@ drop procedure bug8937|
delete from t1|


#
# BUG#6600: Stored procedure crash after repeated calls with check table
#
--disable_warnings
drop procedure if exists bug6600|
drop table if exists t3|
drop view if exists v1|
--enable_warnings
create table t3 (s1 decimal(31,30))|
create view v1 as select * from t3|

create procedure bug6600()
  check table v1|

call bug6600()|
call bug6600()|
call bug6600()|
drop procedure bug6600|
drop view v1|
drop table t3|


#
# BUG#NNNN: New bug synopsis
#
+1 −1
Original line number Diff line number Diff line
@@ -5094,7 +5094,7 @@ ER_SP_BADSELECT 0A000
ER_SP_BADRETURN 42000 
	eng "RETURN is only allowed in a FUNCTION"
ER_SP_BADSTATEMENT 0A000 
	eng "LOCK and UNLOCK tables are not allowed in stored procedures"
	eng "%s is not allowed in stored procedures"
ER_UPDATE_LOG_DEPRECATED_IGNORED 42000 
	eng "The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored"
ER_UPDATE_LOG_DEPRECATED_TRANSLATED 42000 
Loading