Below is the list of changes that have just been committed into a local
5.0 repository of dlenev. When dlenev does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1912 05/05/27 14:15:17 dlenev@stripped +3 -0
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/sql_yacc.yy
1.381 05/05/27 14:15:12 dlenev@stripped +8 -5
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.h
1.53 05/05/27 14:15:12 dlenev@stripped +3 -4
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.cc
1.138 05/05/27 14:15:12 dlenev@stripped +3 -3
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()).
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: dlenev
# Host: brandersnatch.localdomain
# Root: /home/dlenev/src/mysql-5.0-ttdf
--- 1.380/sql/sql_yacc.yy Fri May 20 19:47:01 2005
+++ 1.381/sql/sql_yacc.yy Fri May 27 14:15:12 2005
@@ -7565,6 +7565,7 @@
{
/* We are in trigger and assigning value to field of new row */
Item *it;
+ Item_trigger_field *trg_fld;
sp_instr_set_trigger_field *i;
if ($1)
{
@@ -7585,17 +7586,19 @@
it= new Item_null();
}
- if (!(i= new sp_instr_set_trigger_field(
- lex->sphead->instructions(), lex->spcont,
- $2.base_name, it)))
+ if (!(trg_fld= new Item_trigger_field(Item_trigger_field::NEW_ROW,
+ $2.base_name.str)) ||
+ !(i= new sp_instr_set_trigger_field(
+ lex->sphead->instructions(), lex->spcont,
+ trg_fld, it)))
YYABORT;
/*
Let us add this item to list of all Item_trigger_field
objects in trigger.
*/
- lex->trg_table_fields.link_in_list((byte *)&i->trigger_field,
- (byte **)&i->trigger_field.next_trg_field);
+ lex->trg_table_fields.link_in_list((byte *)trg_fld,
+ (byte **)&trg_fld->next_trg_field);
lex->sphead->add_instr(i);
}
--- 1.137/sql/sp_head.cc Tue May 24 01:43:37 2005
+++ 1.138/sql/sp_head.cc Fri May 27 14:15:12 2005
@@ -1499,8 +1499,8 @@
DBUG_ENTER("sp_instr_set_trigger_field::execute");
/* QQ: Still unsure what should we return in case of error 1 or -1 ? */
if (!value->fixed && value->fix_fields(thd, 0, &value) ||
- trigger_field.fix_fields(thd, 0, 0) ||
- (value->save_in_field(trigger_field.field, 0) < 0))
+ trigger_field->fix_fields(thd, 0, 0) ||
+ (value->save_in_field(trigger_field->field, 0) < 0))
res= -1;
*nextp= m_ip + 1;
DBUG_RETURN(res);
@@ -1510,7 +1510,7 @@
sp_instr_set_trigger_field::print(String *str)
{
str->append("set ", 4);
- trigger_field.print(str);
+ trigger_field->print(str);
str->append(":=", 2);
value->print(str);
}
--- 1.52/sql/sp_head.h Tue Mar 8 21:53:00 2005
+++ 1.53/sql/sp_head.h Fri May 27 14:15:12 2005
@@ -467,9 +467,9 @@
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 @@
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
| Thread |
|---|
| • bk commit into 5.0 tree (dlenev:1.1912) | dlenev | 27 May |