summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorunknown <cbell/Chuck@mysql_cab_desk.>2007-02-26 14:30:44 -0500
committerunknown <cbell/Chuck@mysql_cab_desk.>2007-02-26 14:30:44 -0500
commit1636d00fa7fd6ff2b8d5a0117efc44d7997860fb (patch)
tree98b999d0b64cff83861d0e19ff89a040e7969f07 /sql/item_func.cc
parentdc8b4bacc5bb76540cb33cfdcaecf916b716fa89 (diff)
parent3a8a519acb3cb44ce861375a3343b04dc812ee66 (diff)
downloadmariadb-git-1636d00fa7fd6ff2b8d5a0117efc44d7997860fb.tar.gz
Merge cbell@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into mysql_cab_desk.:C:/source/c++/mysql-5.0-rpl sql/item_func.cc: Auto merged sql/log.cc: Auto merged sql/sp_head.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 638d8903dcb..0e454ad26a1 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -4227,7 +4227,14 @@ int get_var_with_binlog(THD *thd, enum_sql_command sql_command,
user_var_entry *var_entry;
var_entry= get_variable(&thd->user_vars, name, 0);
- if (!(opt_bin_log && is_update_query(sql_command)))
+ /*
+ Any reference to user-defined variable which is done from stored
+ function or trigger affects their execution and the execution of the
+ calling statement. We must log all such variables even if they are
+ not involved in table-updating statements.
+ */
+ if (!(opt_bin_log &&
+ (is_update_query(sql_command) || thd->in_sub_stmt)))
{
*out_entry= var_entry;
return 0;