Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-16978

Application period tables: WITHOUT OVERLAPS

Details

    Description

      From sql standard:

      <unique constraint definition> ::=
        <unique specification> <left paren> <unique column list> 
        [ <comma> <without overlap specification> ] <right paren>
        | UNIQUE ( VALUE )
      <without overlap specification> ::= <application time period name> WITHOUT OVERLAPS
      

      The simplest observed implementation is:
      1. Add period start/end to the index at the very end (even after SYSTEM_TIME row_end)
      2. On each insert/update, check if there's such a key, with period overlapping the inserting/updating one. `ha_index_*` functions fit this purpose. It is sufficient to fetch a row with `ha_index_read_map` with `HA_READ_KEY_OR_PREV` flag, and fetch another one with `ha_index_next`

      Although this check can be done totally on the `sql/` side, the constraint should always be satisfied, so it should be close to engine. It is supposed to be done as `handler::check_overlaps` function called from `ha_write_row` and `ha_update_row`

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Nikita Malyavin made transition -
            Open In Progress
            42d 19h 44m 1
            Nikita Malyavin made transition -
            Stalled In Progress
            3d 1h 41m 2
            Nikita Malyavin made transition -
            In Progress In Review
            70d 9h 4m 3
            Nikita Malyavin made transition -
            Stalled In Review
            27d 18h 31m 1
            Sergei Golubchik made transition -
            In Review Stalled
            438d 18h 19m 4
            Sergei Golubchik made transition -
            Stalled Closed
            13d 3h 40m 1

            People

              nikitamalyavin Nikita Malyavin
              nikitamalyavin Nikita Malyavin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.