Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

Override the CURRENT_TIMESTAMP and store in checkpoint #171

Closed
kennytm opened this issue Apr 25, 2019 · 0 comments · Fixed by #235
Closed

Override the CURRENT_TIMESTAMP and store in checkpoint #171

kennytm opened this issue Apr 25, 2019 · 0 comments · Fixed by #235
Labels
feature-request This issue is a feature request

Comments

@kennytm
Copy link
Collaborator

kennytm commented Apr 25, 2019

After #170, Lightning can recognize the DEFAULT CURRENT_TIMESTAMP option, which is always initialized to time.Now(). This means restoring from checkpoint is going to be non-deterministic when the timestamp column is indexed.

CREATE TABLE t (
    x DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    KEY(x)
);
INSERT INTO t VALUES (), (), (), ();

We need to override the session system variable timestamp, and also store it into the checkpoint to ensure the value before and after are equivalent.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request This issue is a feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant