
Not yet complete.

The revision engine is a proxy on top of an underlying storage engine.

It provides an automatic versioning of data: when data is updated or deleted, it keeps the previous version of the data.

Two flavors of the engine exist:
- single table: versioned data are stored along current data in the same table
- two tables: versioned data are stored in a second table.

This storage engine can be specified with the comment field of the create table
statement e.g.:

CREATE TABLE t1 (a int) ENGINE=REVISION COMMENT='MyISAM';

If the comment field is missing, the default storage engine will be used.

To create the two-table flavor of the engine, the comment field needs an
additional flags:

CREATE TABLE t1 (a int) ENGINE=REVISION COMMENT='MyISAM:DOUBLE';

It adds a new field 'revision_id' to the table definition and to the keys as
well. The field is initialized to 1, and is incremented each time the row is
updated. A timestamp is added as well, and it records the date & time when
a row is inserted/deleted/updated.

Data retrieval:

A session variable is available to ease the way rows are retrieved. This
variable is named 'revision_select_mode' and can have the following values:

- current: The head revision is to be retrieved.
- deleted: Deleted revision are to be retrieved.
- history: All revisions are to be retrieved.
- a timestamp (e.g. '2006-03-26 14:50:45'): The state of data at this date and
  time is to be retrieved.

E.g.:

set revision_select_mode=current; SELECT ...

Remarks:
- Default variable value is current.
- If a row is deleted, it will not be retrieved when the variable is set to
current.
