• unknown's avatar
    Bug#29223 declare cursor c for SHOW ..... · 03e74b8c
    unknown authored
    "DECLARE CURSOR FOR SHOW ..." is a syntax that currently appears to work,
    but is untested for some SHOW commands and does not work for other SHOW
    commands.
    
    Since this is an un-intended feature that leaked as a result of a coding bug
    (in the parser grammar), the correct fix is to fix the grammar to not accept
    this construct.
    
    In other words, "DECLARE CURSOR FOR SHOW <other commands that don't work>"
    is not considered a bug, and we will not implement other features to make all
    the SHOW commands usable inside a cursor just because someone exploited a bug.
    
    
    mysql-test/r/sp-error.result:
      Only allow declaring cursors for SELECT statements to avoid
      possible further confusion/problems.
    mysql-test/t/information_schema.test:
      Only SELECT statements are allowed in cursors.
    mysql-test/t/sp-error.test:
      Add test case for Bug#29223. Non-SELECT statements in cursors now
      yields a parser error.
    sql/sql_yacc.yy:
      Rework DECLARE CURSOR statement to not allow non-SELECT statements.
    03e74b8c
sp-error.test 50.1 KB