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

Hidden temporal period columns cannot be selected from information schema

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.5.9
    • 10.4, 10.5
    • Server
    • None

    Description

      According to the documentation there are two ways to create a versioned table: with implicit and explicit row_start and row_end columns.

      I noticed that selecting the row_end and row_start columns from the information schema is only possible when they were defined explicitly, yet if they are part of a unique index, then index columns can always be selected.

      CREATE TABLE test_1(
      	id INT NOT NULL,
      	UNIQUE INDEX(id),
      	row_start TIMESTAMP(6) GENERATED ALWAYS AS ROW START, 
      	row_end TIMESTAMP(6) GENERATED ALWAYS AS ROW END,
      	PERIOD FOR SYSTEM_TIME(row_start, row_end)
      ) WITH SYSTEM VERSIONING;
      CREATE TABLE test_2(id INT NOT NULL, UNIQUE INDEX(id)) WITH SYSTEM VERSIONING;
      

      Compare

      SELECT * FROM `COLUMNS` WHERE TABLE_NAME IN ('test_1', 'test_2');
      

      With

      SELECT * FROM `STATISTICS` WHERE TABLE_NAME IN ('test_1', 'test_2');
      

      I think this is a strange inconsistency.

      Attachments

        Activity

          People

            midenok Aleksey Midenkov
            user2180613 Remy Fox
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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