Trigger Internals for Tables

Registered by Brian Aker

We need to have Triggers on a variety of things:

1) Tables INSERT/UPDATE
2) Engine DDL
3) Commit

Today we essentially have #1 via the replication hooks. We need a way to expose these as a "service". Current idea is that when we create a TableShare we should add a vector of functions that should be run pre/post write_row()/update_row(). If a table is to be replicated its triggers would be pushed into the vector (extrapolate and you can see that a table can be skipped by just not adding triggers to it).

For any sort of CREATE TRIGGER, the TRIGGER would be stored with the definition of the table (aka... DFE). Upon creation of the share any triggers, which are of a type function, would be pushed into the function vector to the table.

Open Question: DEFINER would be stored with DFE, how to assume credentials are safe (or do we just trust the engine?... gotta trust someone).

Open Question: Order. Does the order matter for the trigger? AKA should replication go before... or after?

Open Question: This system relies on the server side scripting, which means that our Trigger definition will require that a "language engine" be specified.

Open Question: API will need to be flexible enough to handle replication having access and other languages having access.

Open Question: Should Triggers require a specific form of function, or be more general in nature (aka... S^3 language will be for cal() but should it also provide for Triggers, or should we keep them different?)

Blueprint information

Status:
Not started
Approver:
None
Priority:
Low
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
Discussion
Series goal:
Accepted for trunk
Implementation:
Unknown
Milestone target:
milestone icon future

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.