summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <igor@olga.mysql.com>2007-01-12 13:43:25 -0800
committerunknown <igor@olga.mysql.com>2007-01-12 13:43:25 -0800
commitc7c6e78e603cac267adab475ba9c80f0aac61e3c (patch)
tree5881e473ef67266d5a7ce068255ea2fec126bd6e /sql
parent86e771b204b96c154d70f0dde5a2c21858c79402 (diff)
downloadmariadb-git-c7c6e78e603cac267adab475ba9c80f0aac61e3c.tar.gz
Fixed bug #25398: crash in a trigger when using trigger fields
in a select list. The objects of the Item_trigger_field class inherited the implementations of the methods copy_or_same, get_tmp_table_item and get_tmp_table_field from the class Item_field while they rather should have used the default implementations defined for the base class Item. It could cause catastrophic problems for triggers that used SELECTs with select list containing trigger fields such as NEW.<table column> under DISTINCT. mysql-test/r/trigger.result: Added a test case for bug #25398. mysql-test/t/trigger.test: Added a test case for bug #25398.
Diffstat (limited to 'sql')
-rw-r--r--sql/item.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/item.h b/sql/item.h
index 6065e385a6c..62d6127f10b 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -2269,6 +2269,9 @@ public:
bool fix_fields(THD *, Item **);
void print(String *str);
table_map used_tables() const { return (table_map)0L; }
+ Field *get_tmp_table_field() { return 0; }
+ Item *copy_or_same(THD *thd) { return this; }
+ Item *get_tmp_table_item(THD *thd) { return copy_or_same(thd); }
void cleanup();
private: