summaryrefslogtreecommitdiff
path: root/sql/sql_trigger.cc
diff options
context:
space:
mode:
authordlenev@mysql.com <>2005-07-09 22:04:18 +0400
committerdlenev@mysql.com <>2005-07-09 22:04:18 +0400
commit75b8d4fa08966baa22bf2e1126c1df8cb6618a80 (patch)
treea5f776a966cf0d153d69ffe3d90f3c7513a727c3 /sql/sql_trigger.cc
parent94310faa2e549a480bba595fd6941b4b37f76bca (diff)
parent923fe817e0d7d4ae6ba8fa16d6c5381bd58ac4b9 (diff)
downloadmariadb-git-75b8d4fa08966baa22bf2e1126c1df8cb6618a80.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/dlenev/src/mysql-5.0-bg8406
Diffstat (limited to 'sql/sql_trigger.cc')
-rw-r--r--sql/sql_trigger.cc29
1 files changed, 29 insertions, 0 deletions
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index 1272d38f729..f058c306d42 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -1,3 +1,20 @@
+/* Copyright (C) 2004-2005 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+
#include "mysql_priv.h"
#include "sp_head.h"
#include "sql_trigger.h"
@@ -418,6 +435,18 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
table->triggers= triggers;
/*
+ Construct key that will represent triggers for this table in the set
+ of routines used by statement.
+ */
+ triggers->sroutines_key.length= 1+strlen(db)+1+strlen(table_name)+1;
+ if (!(triggers->sroutines_key.str=
+ alloc_root(&table->mem_root, triggers->sroutines_key.length)))
+ DBUG_RETURN(1);
+ triggers->sroutines_key.str[0]= TYPE_ENUM_TRIGGER;
+ strmov(strmov(strmov(triggers->sroutines_key.str+1, db), "."),
+ table_name);
+
+ /*
TODO: This could be avoided if there is no triggers
for UPDATE and DELETE.
*/