Hi!
>>>>> "barries" == barries <barries@stripped> writes:
barries> On Thu, Mar 29, 2001 at 02:42:45PM -0500, barries wrote:
>>
>> Unless somebody steps forward with an existing implementation or shoots
>> down the approach/suggests a better one, I'll probably start on the
>> trigger classes early next week.
barries> I lied, here's a patch against a FreeBSD ports collection version of
barries> 3.23.34a that implements an update trigger without passing in before &
barries> after row values:
barries> http://slaysys.com/src/diff.txt
barries> It's creating the triggers based on a table in trigger.cc like:
barries> static struct st_trigger_def {
barries> const char *db_name;
barries> const char *table_name;
barries> Trigger *(*factory )( TABLE *table );
barries> } sql_triggers[] = {
barries> // For now, triggers fire in in reverse declaration order.
barries> { "t%st", "f%o", t::NewTrigger },
barries> { "bar", "foo", t::NewTrigger },
barries> };
Shouldn't you also have a list of columns that you want to test?
<cut>
barries> Any clues as to how to take a table and get it's record[0] and record[1]
barries> out into List<Item>? I suspect that I only need to do the "before"
barries> values this way, as the "after" values should be present in the fields
barries> passed in.
See my previous email
barries> I'd also appreciate any other feedback about the patch you can muster.
I will comment on these after you have consider the changes my
proposal would require.
barries> I think I've missed at least one of the places table is closed; when I
barries> interrupt mysqld from the shell (^C in my environment), it seems to not
barries> delete the triggers. Where are tables closed when SIGINT happens? I
barries> know, I know, break out gdb :-). But if I find that one, I'll not be
barries> confident I haven't missed other spots, so if somebody can enlighten
barries> me...?
When MySQL gets a sigint it should call the following functions:
- unireg_end() -> clean_up() -> table_cache_free() -> close_cached_tables()...
-> mi_close()
Regards,
Monty