[MDEV-16983] Application-time periods: foreign key Created: 2018-08-15 Updated: 2023-12-22 |
|
| Status: | In Review |
| Project: | MariaDB Server |
| Component/s: | Versioned Tables |
| Fix Version/s: | 11.5 |
| Type: | New Feature | Priority: | Major |
| Reporter: | Nikita Malyavin | Assignee: | Sergei Golubchik |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
The syntax as follows: <referencing period specification> ::= PERIOD <application time period name> |
| Comments |
| Comment by Nikita Malyavin [ 2018-09-09 ] | ||||||
|
Some notes from sql standard: — MATCH PARTIAL: if all referencing columns are null, then the row of the referencing table passes the constraint check. If at least one referencing column is not null and the referenced table is not a system-versioned table, then a row R of the referencing table passes the constraint check if and only if there is a non-empty set S of rows of the referenced table such that every row in S matches all the non-null referencing columns of R and the CATPN period value of R is a subset of the union of the PATPN period values of the rows in S. If at least one referencing columns is not null and the referenced table is a system-versioned table, then a row R of the referencing table passes the constraint check if and only if there is a non-empty set S of current system rows of the referenced table such that every row in S matches all the non-null referencing columns of R and the CATPN period value of R is a subset of the union of the PATPN period values of the rows in S. — MATCH FULL: if all referencing columns are null, then the row of the referencing table passes the constraint check. If all referencing columns are not null and the referenced table is not a system-versioned table, then a row R of the referencing table passes the constraint check if and only if there is a non-empty set S of rows of the referenced table such that every row in S matches all the referencing columns of R and the CATPN period value of R is a subset of the union of the PATPN period values of the rows in S. If all referencing columns are not null and the referenced table is a system-versioned table, then a row R of the referencing table passes the constraint check if and only if there is a non-empty set S of current system rows of the referenced table such that every row in S matches all the referencing columns of R and the CATPN period value of R is a subset of the union of the PATPN period values of the rows in S. If some referencing column is null and another referencing column is non-null, then the row of the referencing table violates the constraint check.
[If] <referencing period specification> is specified, then the unique constraint that defines the unique columns of the referenced table shall specify <without overlap specification>. If <referencing period specification> is specified, then: | ||||||
| Comment by Nikita Malyavin [ 2020-02-26 ] | ||||||
|
Hello, serg!
|