summaryrefslogtreecommitdiff
path: root/sql/sp_head.h
diff options
context:
space:
mode:
authorunknown <dlenev@brandersnatch.localdomain>2005-05-27 14:15:17 +0400
committerunknown <dlenev@brandersnatch.localdomain>2005-05-27 14:15:17 +0400
commitd51a5baecb83341e65931b2430f86d9982367a04 (patch)
treebc44b47861c533818a659e4b74e092f6869fdfe4 /sql/sp_head.h
parentf0f9b5959eecb87b369fc45c981d926b79de0c61 (diff)
downloadmariadb-git-d51a5baecb83341e65931b2430f86d9982367a04.tar.gz
Fix for trigger.test failure in --debug mode.
We can't have Item_trigger_field as aggregated object inside of sp_instr_set_trigger_field class since in this case its destructor will be called twice. So instead let us create this Item separately and store pointer to it in instruction object. sql/sp_head.cc: sp_instr_set_trigger_field: We can't have Item_trigger_field as aggregated object since in this case its destructor will be called twice, so let us store pointer to this Item (Another way to avoid this is to exclude this Item from free_list but this can't be done in elegant way in 5.0 and will also cause additional problems with Item::cleanup()). sql/sp_head.h: sp_instr_set_trigger_field: We can't have Item_trigger_field as aggregated object since in this case its destructor will be called twice, so let us store pointer to this Item (Another way to avoid this is to exclude this Item from free_list but this can't be done in elegant way in 5.0 and will also cause additional problems with Item::cleanup()). sql/sql_yacc.yy: We can't have Item_trigger_field as aggregated object inside of sp_instr_set_trigger_field class since in this case its destructor will be called twice. So instead let us create this Item separately and store pointer to it in instruction object.
Diffstat (limited to 'sql/sp_head.h')
-rw-r--r--sql/sp_head.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/sql/sp_head.h b/sql/sp_head.h
index ee41b1efc83..4e940c427bb 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -467,9 +467,9 @@ class sp_instr_set_trigger_field : public sp_instr
public:
sp_instr_set_trigger_field(uint ip, sp_pcontext *ctx,
- LEX_STRING field_name, Item *val)
+ Item_trigger_field *trg_fld, Item *val)
: sp_instr(ip, ctx),
- trigger_field(Item_trigger_field::NEW_ROW, field_name.str),
+ trigger_field(trg_fld),
value(val)
{}
@@ -480,9 +480,8 @@ public:
virtual void print(String *str);
- Item_trigger_field trigger_field;
-
private:
+ Item_trigger_field *trigger_field;
Item *value;
}; // class sp_instr_trigger_field : public sp_instr