Commit 63e732fe authored by Marc Alff's avatar Marc Alff

Bug#33637 SHOW PROCEDURE CODE/SHOW FUNCTION CODE sp_name gives a syntax error.

Backport for 5.5

In non debug builds, the statements:
- SHOW PROCEDURE CODE
- SHOW FUNCTION CODE
used to fail with a "syntax error", which is misleading.

These statements have been changed to return the following error for non
debug builds:
ERROR HY000: The 'SHOW PROCEDURE|FUNCTION CODE' feature is disabled; you
need MySQL built with '--with-debug' to have it working

For debug builds (./configure --with-debug), nothing is changed.
parent afc87e52
-- require r/have_nodebug.require
disable_query_log;
select (version() like '%debug%') as debug;
enable_query_log;
show procedure code foo;
ERROR HY000: The 'SHOW PROCEDURE|FUNCTION CODE' feature is disabled; you need MySQL built with '--with-debug' to have it working
show function code foo;
ERROR HY000: The 'SHOW PROCEDURE|FUNCTION CODE' feature is disabled; you need MySQL built with '--with-debug' to have it working
#
# Test the debugging feature "show procedure/function code <name>"
#
-- source include/have_nodebug.inc
--error ER_FEATURE_DISABLED
show procedure code foo;
--error ER_FEATURE_DISABLED
show function code foo;
......@@ -4658,10 +4658,10 @@ create_sp_error:
}
break;
}
#ifndef DBUG_OFF
case SQLCOM_SHOW_PROC_CODE:
case SQLCOM_SHOW_FUNC_CODE:
{
#ifndef DBUG_OFF
sp_head *sp;
if (lex->sql_command == SQLCOM_SHOW_PROC_CODE)
......@@ -4678,8 +4678,12 @@ create_sp_error:
goto error;
}
break;
}
#else
my_error(ER_FEATURE_DISABLED, MYF(0),
"SHOW PROCEDURE|FUNCTION CODE", "--with-debug");
goto error;
#endif // ifndef DBUG_OFF
}
case SQLCOM_SHOW_CREATE_TRIGGER:
{
if (lex->spname->m_name.length > NAME_LEN)
......
......@@ -10469,23 +10469,13 @@ show_param:
}
| PROCEDURE CODE_SYM sp_name
{
#ifdef DBUG_OFF
my_parse_error(ER(ER_SYNTAX_ERROR));
MYSQL_YYABORT;
#else
Lex->sql_command= SQLCOM_SHOW_PROC_CODE;
Lex->spname= $3;
#endif
}
| FUNCTION_SYM CODE_SYM sp_name
{
#ifdef DBUG_OFF
my_parse_error(ER(ER_SYNTAX_ERROR));
MYSQL_YYABORT;
#else
Lex->sql_command= SQLCOM_SHOW_FUNC_CODE;
Lex->spname= $3;
#endif
}
| CREATE EVENT_SYM sp_name
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment