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

SQLError[4122]: View is not system versioned

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.3.4
    • Fix Version/s: 10.3.5
    • Component/s: Versioned Tables, Views
    • Labels:
      None
    • Environment:
      Windows 10 x64
      Ubuntu 17.10 x64

      Description

      According to the System-Versioned Table documentation you are supposed to be able to create a view from a system versioned table and work with it just like with the versioned table itself. However in the below test case I am encountering SQLError[4122] "Table 'v1' is not system versioned" when running the query.

      Testcase:

      DROP DATABASE IF EXISTS test;
      CREATE DATABASE test;
      USE test;
       
      CREATE TABLE User
      (
      	Id			INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
      	Name		VARCHAR(20) NOT NULL
      );
       
      CREATE TABLE Product
      (
      	Id			INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
      	Name		VARCHAR(20) NOT NULL,
      	Price		DECIMAL UNSIGNED NOT NULL,
      	UserId	INT UNSIGNED NOT NULL,
      	FOREIGN KEY(UserId) REFERENCES User(Id)
      ) WITH SYSTEM VERSIONING;
       
      INSERT INTO User(Name) VALUES ("admin");
       
      INSERT INTO Product(Name, Price, UserId) VALUES ("bottle", 1.0, 1);
      UPDATE Product SET Price = 2.0 WHERE Id = 1;
       
      SELECT * FROM Product;
      SELECT Name, Price, row_start, row_end FROM Product FOR SYSTEM_TIME ALL;
       
      CREATE VIEW v1 AS SELECT * FROM Product;
      SELECT * FROM v1 FOR SYSTEM_TIME ALL; #Error here
      

        Attachments

          Activity

            People

            • Assignee:
              serg Sergei Golubchik
              Reporter:
              bbartels Benjamin Bartels
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: