mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
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.
This commit is contained in:
4
mysql-test/include/have_nodebug.inc
Normal file
4
mysql-test/include/have_nodebug.inc
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
-- require r/have_nodebug.require
|
||||||
|
disable_query_log;
|
||||||
|
select (version() like '%debug%') as debug;
|
||||||
|
enable_query_log;
|
2
mysql-test/r/have_nodebug.require
Normal file
2
mysql-test/r/have_nodebug.require
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
debug
|
||||||
|
0
|
4
mysql-test/r/sp-no-code.result
Normal file
4
mysql-test/r/sp-no-code.result
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
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
|
12
mysql-test/t/sp-no-code.test
Normal file
12
mysql-test/t/sp-no-code.test
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#
|
||||||
|
# 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;
|
break;
|
||||||
}
|
}
|
||||||
#ifndef DBUG_OFF
|
|
||||||
case SQLCOM_SHOW_PROC_CODE:
|
case SQLCOM_SHOW_PROC_CODE:
|
||||||
case SQLCOM_SHOW_FUNC_CODE:
|
case SQLCOM_SHOW_FUNC_CODE:
|
||||||
{
|
{
|
||||||
|
#ifndef DBUG_OFF
|
||||||
sp_head *sp;
|
sp_head *sp;
|
||||||
|
|
||||||
if (lex->sql_command == SQLCOM_SHOW_PROC_CODE)
|
if (lex->sql_command == SQLCOM_SHOW_PROC_CODE)
|
||||||
@ -4678,8 +4678,12 @@ create_sp_error:
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
#else
|
||||||
|
my_error(ER_FEATURE_DISABLED, MYF(0),
|
||||||
|
"SHOW PROCEDURE|FUNCTION CODE", "--with-debug");
|
||||||
|
goto error;
|
||||||
#endif // ifndef DBUG_OFF
|
#endif // ifndef DBUG_OFF
|
||||||
|
}
|
||||||
case SQLCOM_SHOW_CREATE_TRIGGER:
|
case SQLCOM_SHOW_CREATE_TRIGGER:
|
||||||
{
|
{
|
||||||
if (lex->spname->m_name.length > NAME_LEN)
|
if (lex->spname->m_name.length > NAME_LEN)
|
||||||
|
@ -10469,23 +10469,13 @@ show_param:
|
|||||||
}
|
}
|
||||||
| PROCEDURE CODE_SYM sp_name
|
| 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->sql_command= SQLCOM_SHOW_PROC_CODE;
|
||||||
Lex->spname= $3;
|
Lex->spname= $3;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
| FUNCTION_SYM CODE_SYM sp_name
|
| 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->sql_command= SQLCOM_SHOW_FUNC_CODE;
|
||||||
Lex->spname= $3;
|
Lex->spname= $3;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
| CREATE EVENT_SYM sp_name
|
| CREATE EVENT_SYM sp_name
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user