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

For any non-existing transaction ID, AS OF provides the current table contents without a warning

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.3(EOL)
    • 10.3.14, 10.4.4
    • Versioned Tables
    • None
    • bb-10.3-release 9b59f78d16fb000

    Description

      I couldn't find it in the current tests, so don't know if it's intentional.

      create or replace table t1 (i int, s bigint unsigned as row start, e bigint unsigned as row end, period for system_time(s,e)) with system versioning;
      insert into t1 (i) values (1),(2);
      update t1 set i = 3;
      

      MariaDB [test]> select * from t1 for system_time all;
      +------+-----+----------------------+
      | i    | s   | e                    |
      +------+-----+----------------------+
      |    3 | 229 | 18446744073709551615 |
      |    3 | 229 | 18446744073709551615 |
      |    1 | 222 |                  229 |
      |    2 | 222 |                  229 |
      +------+-----+----------------------+
      4 rows in set (0.00 sec)
      

      Existing transaction, old snapshot - OK

      MariaDB [test]> select * from t1 for system_time as of transaction 222;
      +------+-----+-----+
      | i    | s   | e   |
      +------+-----+-----+
      |    1 | 222 | 229 |
      |    2 | 222 | 229 |
      +------+-----+-----+
      2 rows in set (0.00 sec)
      

      Existing transaction, current snapshot - OK

      MariaDB [test]> select * from t1 for system_time as of transaction 229;
      +------+-----+----------------------+
      | i    | s   | e                    |
      +------+-----+----------------------+
      |    3 | 229 | 18446744073709551615 |
      |    3 | 229 | 18446744073709551615 |
      +------+-----+----------------------+
      2 rows in set (0.00 sec)
      

      Non existing transaction (greater than latest) -- questionable

      MariaDB [test]> select * from t1 for system_time as of transaction 230;
      +------+-----+----------------------+
      | i    | s   | e                    |
      +------+-----+----------------------+
      |    3 | 229 | 18446744073709551615 |
      |    3 | 229 | 18446744073709551615 |
      +------+-----+----------------------+
      2 rows in set (0.00 sec)
      

      Non existing transaction (less than minimal) -- not good

      MariaDB [test]> select * from t1 for system_time as of transaction 1;
      +------+-----+----------------------+
      | i    | s   | e                    |
      +------+-----+----------------------+
      |    3 | 229 | 18446744073709551615 |
      |    3 | 229 | 18446744073709551615 |
      +------+-----+----------------------+
      2 rows in set (0.00 sec)
      

      Non existing transaction (intermediate value) -- not good

      MariaDB [test]> select * from t1 for system_time as of transaction 227;
      +------+-----+----------------------+
      | i    | s   | e                    |
      +------+-----+----------------------+
      |    3 | 229 | 18446744073709551615 |
      |    3 | 229 | 18446744073709551615 |
      +------+-----+----------------------+
      2 rows in set (0.00 sec)
      

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova created issue -
            elenst Elena Stepanova made changes -
            Field Original Value New Value
            Description {code:sql}
            create or replace table t1 (i int, s bigint unsigned as row start, e bigint unsigned as row end, period for system_time(s,e)) with system versioning;
            insert into t1 (i) values (1),(2);
            update t1 set i = 3;
            {code}
            {code:sql}
            MariaDB [test]> select * from t1 for system_time all;
            +------+-----+----------------------+
            | i | s | e |
            +------+-----+----------------------+
            | 3 | 229 | 18446744073709551615 |
            | 3 | 229 | 18446744073709551615 |
            | 1 | 222 | 229 |
            | 2 | 222 | 229 |
            +------+-----+----------------------+
            4 rows in set (0.00 sec)
            {code}

            {code:sql|title=Existing transaction, old snapshot - OK}
            MariaDB [test]> select * from t1 for system_time as of transaction 222;
            +------+-----+-----+
            | i | s | e |
            +------+-----+-----+
            | 1 | 222 | 229 |
            | 2 | 222 | 229 |
            +------+-----+-----+
            2 rows in set (0.00 sec)
            {code}
            {code:sql|title=Existing transaction, current snapshot - OK}
            MariaDB [test]> select * from t1 for system_time as of transaction 229;
            +------+-----+----------------------+
            | i | s | e |
            +------+-----+----------------------+
            | 3 | 229 | 18446744073709551615 |
            | 3 | 229 | 18446744073709551615 |
            +------+-----+----------------------+
            2 rows in set (0.00 sec)
            {code}

            {code:sql|title=Non existing transaction (greater than latest) -- questionable}
            MariaDB [test]> select * from t1 for system_time as of transaction 230;
            +------+-----+----------------------+
            | i | s | e |
            +------+-----+----------------------+
            | 3 | 229 | 18446744073709551615 |
            | 3 | 229 | 18446744073709551615 |
            +------+-----+----------------------+
            2 rows in set (0.00 sec)
            {code}

            {code:sql|title=Non existing transaction (less than minimal) -- not good}
            MariaDB [test]> select * from t1 for system_time as of transaction 1;
            +------+-----+----------------------+
            | i | s | e |
            +------+-----+----------------------+
            | 3 | 229 | 18446744073709551615 |
            | 3 | 229 | 18446744073709551615 |
            +------+-----+----------------------+
            2 rows in set (0.00 sec)
            {code}
            I couldn't find it in the current tests, so don't know if it's intentional.

            {code:sql}
            create or replace table t1 (i int, s bigint unsigned as row start, e bigint unsigned as row end, period for system_time(s,e)) with system versioning;
            insert into t1 (i) values (1),(2);
            update t1 set i = 3;
            {code}
            {code:sql}
            MariaDB [test]> select * from t1 for system_time all;
            +------+-----+----------------------+
            | i | s | e |
            +------+-----+----------------------+
            | 3 | 229 | 18446744073709551615 |
            | 3 | 229 | 18446744073709551615 |
            | 1 | 222 | 229 |
            | 2 | 222 | 229 |
            +------+-----+----------------------+
            4 rows in set (0.00 sec)
            {code}

            {code:sql|title=Existing transaction, old snapshot - OK}
            MariaDB [test]> select * from t1 for system_time as of transaction 222;
            +------+-----+-----+
            | i | s | e |
            +------+-----+-----+
            | 1 | 222 | 229 |
            | 2 | 222 | 229 |
            +------+-----+-----+
            2 rows in set (0.00 sec)
            {code}
            {code:sql|title=Existing transaction, current snapshot - OK}
            MariaDB [test]> select * from t1 for system_time as of transaction 229;
            +------+-----+----------------------+
            | i | s | e |
            +------+-----+----------------------+
            | 3 | 229 | 18446744073709551615 |
            | 3 | 229 | 18446744073709551615 |
            +------+-----+----------------------+
            2 rows in set (0.00 sec)
            {code}

            {code:sql|title=Non existing transaction (greater than latest) -- questionable}
            MariaDB [test]> select * from t1 for system_time as of transaction 230;
            +------+-----+----------------------+
            | i | s | e |
            +------+-----+----------------------+
            | 3 | 229 | 18446744073709551615 |
            | 3 | 229 | 18446744073709551615 |
            +------+-----+----------------------+
            2 rows in set (0.00 sec)
            {code}

            {code:sql|title=Non existing transaction (less than minimal) -- not good}
            MariaDB [test]> select * from t1 for system_time as of transaction 1;
            +------+-----+----------------------+
            | i | s | e |
            +------+-----+----------------------+
            | 3 | 229 | 18446744073709551615 |
            | 3 | 229 | 18446744073709551615 |
            +------+-----+----------------------+
            2 rows in set (0.00 sec)
            {code}
            elenst Elena Stepanova made changes -
            Description I couldn't find it in the current tests, so don't know if it's intentional.

            {code:sql}
            create or replace table t1 (i int, s bigint unsigned as row start, e bigint unsigned as row end, period for system_time(s,e)) with system versioning;
            insert into t1 (i) values (1),(2);
            update t1 set i = 3;
            {code}
            {code:sql}
            MariaDB [test]> select * from t1 for system_time all;
            +------+-----+----------------------+
            | i | s | e |
            +------+-----+----------------------+
            | 3 | 229 | 18446744073709551615 |
            | 3 | 229 | 18446744073709551615 |
            | 1 | 222 | 229 |
            | 2 | 222 | 229 |
            +------+-----+----------------------+
            4 rows in set (0.00 sec)
            {code}

            {code:sql|title=Existing transaction, old snapshot - OK}
            MariaDB [test]> select * from t1 for system_time as of transaction 222;
            +------+-----+-----+
            | i | s | e |
            +------+-----+-----+
            | 1 | 222 | 229 |
            | 2 | 222 | 229 |
            +------+-----+-----+
            2 rows in set (0.00 sec)
            {code}
            {code:sql|title=Existing transaction, current snapshot - OK}
            MariaDB [test]> select * from t1 for system_time as of transaction 229;
            +------+-----+----------------------+
            | i | s | e |
            +------+-----+----------------------+
            | 3 | 229 | 18446744073709551615 |
            | 3 | 229 | 18446744073709551615 |
            +------+-----+----------------------+
            2 rows in set (0.00 sec)
            {code}

            {code:sql|title=Non existing transaction (greater than latest) -- questionable}
            MariaDB [test]> select * from t1 for system_time as of transaction 230;
            +------+-----+----------------------+
            | i | s | e |
            +------+-----+----------------------+
            | 3 | 229 | 18446744073709551615 |
            | 3 | 229 | 18446744073709551615 |
            +------+-----+----------------------+
            2 rows in set (0.00 sec)
            {code}

            {code:sql|title=Non existing transaction (less than minimal) -- not good}
            MariaDB [test]> select * from t1 for system_time as of transaction 1;
            +------+-----+----------------------+
            | i | s | e |
            +------+-----+----------------------+
            | 3 | 229 | 18446744073709551615 |
            | 3 | 229 | 18446744073709551615 |
            +------+-----+----------------------+
            2 rows in set (0.00 sec)
            {code}
            I couldn't find it in the current tests, so don't know if it's intentional.

            {code:sql}
            create or replace table t1 (i int, s bigint unsigned as row start, e bigint unsigned as row end, period for system_time(s,e)) with system versioning;
            insert into t1 (i) values (1),(2);
            update t1 set i = 3;
            {code}
            {code:sql}
            MariaDB [test]> select * from t1 for system_time all;
            +------+-----+----------------------+
            | i | s | e |
            +------+-----+----------------------+
            | 3 | 229 | 18446744073709551615 |
            | 3 | 229 | 18446744073709551615 |
            | 1 | 222 | 229 |
            | 2 | 222 | 229 |
            +------+-----+----------------------+
            4 rows in set (0.00 sec)
            {code}

            {code:sql|title=Existing transaction, old snapshot - OK}
            MariaDB [test]> select * from t1 for system_time as of transaction 222;
            +------+-----+-----+
            | i | s | e |
            +------+-----+-----+
            | 1 | 222 | 229 |
            | 2 | 222 | 229 |
            +------+-----+-----+
            2 rows in set (0.00 sec)
            {code}
            {code:sql|title=Existing transaction, current snapshot - OK}
            MariaDB [test]> select * from t1 for system_time as of transaction 229;
            +------+-----+----------------------+
            | i | s | e |
            +------+-----+----------------------+
            | 3 | 229 | 18446744073709551615 |
            | 3 | 229 | 18446744073709551615 |
            +------+-----+----------------------+
            2 rows in set (0.00 sec)
            {code}

            {code:sql|title=Non existing transaction (greater than latest) -- questionable}
            MariaDB [test]> select * from t1 for system_time as of transaction 230;
            +------+-----+----------------------+
            | i | s | e |
            +------+-----+----------------------+
            | 3 | 229 | 18446744073709551615 |
            | 3 | 229 | 18446744073709551615 |
            +------+-----+----------------------+
            2 rows in set (0.00 sec)
            {code}

            {code:sql|title=Non existing transaction (less than minimal) -- not good}
            MariaDB [test]> select * from t1 for system_time as of transaction 1;
            +------+-----+----------------------+
            | i | s | e |
            +------+-----+----------------------+
            | 3 | 229 | 18446744073709551615 |
            | 3 | 229 | 18446744073709551615 |
            +------+-----+----------------------+
            2 rows in set (0.00 sec)
            {code}

            {code:sql|title=Non existing transaction (intermediate value) -- not good}
            MariaDB [test]> select * from t1 for system_time as of transaction 227;
            +------+-----+----------------------+
            | i | s | e |
            +------+-----+----------------------+
            | 3 | 229 | 18446744073709551615 |
            | 3 | 229 | 18446744073709551615 |
            +------+-----+----------------------+
            2 rows in set (0.00 sec)
            {code}
            kevg Eugene Kosov (Inactive) made changes -
            Assignee Sergei Golubchik [ serg ] Eugene Kosov [ kevg ]
            kevg Eugene Kosov (Inactive) made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            axel Axel Schwenke made changes -
            kevg Eugene Kosov (Inactive) made changes -
            Assignee Eugene Kosov [ kevg ] Sergei Golubchik [ serg ]
            midenok Aleksey Midenkov made changes -
            Assignee Sergei Golubchik [ serg ] Aleksey Midenok [ midenok ]
            midenok Aleksey Midenkov made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            midenok Aleksey Midenkov made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            midenok Aleksey Midenkov made changes -
            Assignee Aleksey Midenok [ midenok ] Sergei Golubchik [ serg ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Aleksey Midenok [ midenok ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            midenok Aleksey Midenkov made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            midenok Aleksey Midenkov made changes -
            Assignee Aleksey Midenok [ midenok ] Sergei Golubchik [ serg ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            serg Sergei Golubchik made changes -
            Status In Review [ 10002 ] Stalled [ 10000 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.3.14 [ 23216 ]
            Fix Version/s 10.4.4 [ 23310 ]
            Fix Version/s 10.3 [ 22126 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 85743 ] MariaDB v4 [ 153863 ]

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              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.