From c39c21b53792e7830baae28a36ebb6c1171298fe Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Jan 2005 19:53:54 +0100 Subject: [PATCH] Fix 'SHOW CREATE FUNCTION' to say 'FUNCTION' in its error message. (Bug #6338) sql/sql_parse.cc: Fix SP_COM_STRING() macro for 'SHOW CREATE FUNCTION' case mysql-test/r/sp-error.result: results for SHOW CREATE FUNCTION test mysql-test/t/sp-error.test: test SHOW CREATE FUNCTION --- mysql-test/r/sp-error.result | 2 ++ mysql-test/t/sp-error.test | 2 ++ sql/sql_parse.cc | 1 + 3 files changed, 5 insertions(+) diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 642f1aedd78..57126162e3f 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -47,6 +47,8 @@ Warnings: Note 1305 PROCEDURE foo does not exist show create procedure foo| ERROR 42000: PROCEDURE foo does not exist +show create function foo| +ERROR 42000: FUNCTION foo does not exist create procedure foo() foo: loop leave bar; diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test index c24f9df16be..b0d7ca60f27 100644 --- a/mysql-test/t/sp-error.test +++ b/mysql-test/t/sp-error.test @@ -81,6 +81,8 @@ call foo()| drop procedure if exists foo| --error 1305 show create procedure foo| +--error 1305 +show create function foo| # LEAVE/ITERATE/GOTO with no match --error 1308 diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 1e03af7626c..80cb45c7005 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -52,6 +52,7 @@ #define SP_COM_STRING(LP) \ ((LP)->sql_command == SQLCOM_CREATE_SPFUNCTION || \ (LP)->sql_command == SQLCOM_ALTER_FUNCTION || \ + (LP)->sql_command == SQLCOM_SHOW_CREATE_FUNC || \ (LP)->sql_command == SQLCOM_DROP_FUNCTION ? \ "FUNCTION" : "PROCEDURE")