summaryrefslogtreecommitdiff
path: root/sql/sp_head.h
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-10-06 16:56:59 +0300
committerMichael Widenius <monty@askmonty.org>2011-10-06 16:56:59 +0300
commit9c32088322f69155d91f6033319ebb03d108f044 (patch)
tree159ff05f36694d017d5c5a62d559a0c9ef1f5b21 /sql/sp_head.h
parent5f607a2c705063ef23a9974b34151a991e80538f (diff)
downloadmariadb-git-9c32088322f69155d91f6033319ebb03d108f044.tar.gz
Fixed that when using a trigger mysql.proc is now accessed
Cleanup: Changed procedure type from a int/char to an enum for easier to manage and debug code. mysql-test/r/trigger.result: Test that mysql.proc is not used as part of creating or using a trigger. mysql-test/t/trigger.test: Test that mysql.proc is not used as part of creating or using a trigger. sql/sp.cc: The main bug fix is to not look up triggers in mysql.proc; This is done by ignoreing type == TYPE_ENUM_TRIGGER in sp_add_used_routine() Cleanup: Changed procedure type from a int/char to an enum. sql/sp.h: Cleanup: Changed procedure type from a int/char to an enum. sql/sp_head.h: Cleanup: Changed procedure type from a int/char to an enum. sql/sql_db.cc: Fix include order sql/sql_lex.cc: Fix include order sql/sql_parse.cc: Cleanup: Changed procedure type from a int/char to an enum. sql/sql_show.cc: Fix include order sql/sql_view.cc: Fix include order
Diffstat (limited to 'sql/sp_head.h')
-rw-r--r--sql/sp_head.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/sql/sp_head.h b/sql/sp_head.h
index d422adc8927..dc237163716 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -28,11 +28,16 @@
@ingroup Runtime_Environment
@{
*/
-// Values for the type enum. This reflects the order of the enum declaration
-// in the CREATE TABLE command.
-#define TYPE_ENUM_FUNCTION 1
-#define TYPE_ENUM_PROCEDURE 2
-#define TYPE_ENUM_TRIGGER 3
+/*
+ Values for the type enum. This reflects the order of the enum declaration
+ in the CREATE TABLE command.
+*/
+enum stored_procedure_type
+{
+ TYPE_ENUM_FUNCTION=1,
+ TYPE_ENUM_PROCEDURE=2,
+ TYPE_ENUM_TRIGGER=3
+};
Item_result
sp_map_result_type(enum enum_field_types type);
@@ -134,9 +139,9 @@ public:
// Init. the qualified name from the db and name.
void init_qname(THD *thd); // thd for memroot allocation
- void set_routine_type(char type)
+ void set_routine_type(stored_procedure_type type)
{
- m_sroutines_key.str[0]= type;
+ m_sroutines_key.str[0]= (char) type;
}
~sp_name()
@@ -170,8 +175,7 @@ public:
HAS_SQLCOM_FLUSH= 4096
};
- /** TYPE_ENUM_FUNCTION, TYPE_ENUM_PROCEDURE or TYPE_ENUM_TRIGGER */
- int m_type;
+ stored_procedure_type m_type;
uint m_flags; // Boolean attributes of a stored routine
Create_field m_return_field_def; /**< This is used for FUNCTIONs only. */