You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: two commits created in one transaction fail the monotonic-commit trigger #413
I have verified that I am running the latest version of the SysML2.NET
I have searched open and closed issues to ensure it has not already been reported
Description
commit.created defaults to now() (schema.generated.sql:297), which returns the transaction start time. Two commits created in one transaction get identical timestamps, and trg_commit_parent_monotonic (:354-379) rejects the parent edge between them as not strictly newer.
SysML2.NET.CodeGenerator.Tests/Sql/schema.concurrency.setup.sql:20 already stamps commits with clock_timestamp() for this reason; the schema default contradicts it, and any insert that omits created hits the problem.
Expected: a parent and child commit created in one transaction get distinct, increasing timestamps.
Fix:
Change the default to clock_timestamp(), or drop the default so the service must supply created.
Add the case to schema.smoke.sql.
Steps to Reproduce
BEGIN;
INSERT INTOsysml2.commit (id, project_id, model_version_id) VALUES (:c1, :p, 1), (:c2, :p, 1);
INSERT INTOsysml2.commit_parent (commit_id, parent_commit_id, ordinal) VALUES (:c2, :c1, 0);
-- ERROR: commit … is not strictly newer than its parent …
Activity