From df3a48ea43b93ad91546d71c49963665f13179db Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 19:17:15 +0200 Subject: Bug #27354 stored function in where condition was always treated as const Possible problems: function call could be eliminated from where class and only be evaluated once; function can be evaluated during table and item setup phase which could cause side effects not to be registered in binlog. Fixed with introducing func_item_sp::used_tables() returning the correct table_map constant. mysql-test/r/sp.result: results changed mysql-test/t/sp.test: regression test demonstrating that function's returns match where condition of the top-level query table. sql/item_func.h: private used_tables() method returning the correct table_bit with meaning the item is not a constant --- sql/item_func.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sql/item_func.h') diff --git a/sql/item_func.h b/sql/item_func.h index 68591f9c6f5..24f30994b22 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1411,7 +1411,7 @@ private: bool execute(Field **flp); bool execute_impl(THD *thd, Field *return_value_fld); Field *sp_result_field(void) const; - + public: Item_func_sp(Name_resolution_context *context_arg, sp_name *name); @@ -1422,6 +1422,8 @@ public: virtual ~Item_func_sp() {} + table_map used_tables() const { return RAND_TABLE_BIT; } + void cleanup(); const char *func_name() const; -- cgit v1.2.1