github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/snapshot/snapshot_restore_view.result (about)

     1  create account acc1 ADMIN_NAME 'admin1' IDENTIFIED BY 'test123';
     2  create database if not exists db1;
     3  create table db1.t1 (a int);
     4  insert into db1.t1 values (1), (2), (3);
     5  create snapshot sn1 for account acc1;
     6  show snapshots;
     7  SNAPSHOT_NAME    TIMESTAMP    SNAPSHOT_LEVEL    ACCOUNT_NAME    DATABASE_NAME    TABLE_NAME
     8  sn1    2024-05-13 13:38:02.617258    account    acc1        
     9  drop database db1;
    10  create database view_test1;
    11  create table view_test1.t1 (a int);
    12  insert into view_test1.t1 values (1), (2), (4);
    13  create view view_test1.v1 as select * from view_test1.t1;
    14  create view view_test1.v2 as select * from db1.t1 {snapshot = 'sn1'};
    15  create database view_test2;
    16  create view view_test2.v3 as select view_test1.v1.a as v1a, view_test1.v2.a as v2a from view_test1.v1 join view_test1.v2 on view_test1.v1.a = view_test1.v2.a;
    17  create view view_test2.v4 as select * from view_test2.v3;
    18  create database view_test3;
    19  create view view_test3.v5 as select * from view_test2.v4;
    20  create view view_test3.v6 as select * from view_test2.v4;
    21  select * from view_test1.t1;
    22  a
    23  1
    24  2
    25  4
    26  select * from view_test1.v1;
    27  a
    28  1
    29  2
    30  4
    31  select * from view_test1.v2;
    32  a
    33  1
    34  2
    35  3
    36  select * from view_test2.v3;
    37  v1a    v2a
    38  1    1
    39  2    2
    40  select * from view_test2.v4;
    41  v1a    v2a
    42  1    1
    43  2    2
    44  select * from view_test3.v5;
    45  v1a    v2a
    46  1    1
    47  2    2
    48  select * from view_test3.v6;
    49  v1a    v2a
    50  1    1
    51  2    2
    52  create snapshot syssn1 for account acc1;
    53  show databases {snapshot = 'syssn1'};
    54  Database
    55  information_schema
    56  mo_catalog
    57  mysql
    58  system
    59  system_metrics
    60  view_test1
    61  view_test2
    62  view_test3
    63  show full tables from view_test1 {snapshot = 'syssn1'};
    64  Tables_in_view_test1    Table_type
    65  t1    BASE TABLE
    66  v1    VIEW
    67  v2    VIEW
    68  show full tables from view_test2 {snapshot = 'syssn1'};
    69  Tables_in_view_test2    Table_type
    70  v3    VIEW
    71  v4    VIEW
    72  show full tables from view_test3 {snapshot = 'syssn1'};
    73  Tables_in_view_test3    Table_type
    74  v5    VIEW
    75  v6    VIEW
    76  select * from view_test1.t1 {snapshot = 'syssn1'};
    77  a
    78  1
    79  2
    80  4
    81  select * from view_test1.v1 {snapshot = 'syssn1'};
    82  a
    83  1
    84  2
    85  4
    86  select * from view_test1.v2 {snapshot = 'syssn1'};
    87  a
    88  1
    89  2
    90  3
    91  select * from view_test2.v3 {snapshot = 'syssn1'};
    92  v1a    v2a
    93  1    1
    94  2    2
    95  select * from view_test2.v4 {snapshot = 'syssn1'};
    96  v1a    v2a
    97  1    1
    98  2    2
    99  select * from view_test3.v5 {snapshot = 'syssn1'};
   100  v1a    v2a
   101  1    1
   102  2    2
   103  select * from view_test3.v6 {snapshot = 'syssn1'};
   104  v1a    v2a
   105  1    1
   106  2    2
   107  drop database view_test1;
   108  drop database view_test2;
   109  drop database view_test3;
   110  restore account acc1 from snapshot syssn1 to account acc1;
   111  show databases;
   112  Database
   113  information_schema
   114  mo_catalog
   115  mysql
   116  system
   117  system_metrics
   118  view_test1
   119  view_test2
   120  view_test3
   121  select * from view_test1.t1;
   122  a
   123  1
   124  2
   125  4
   126  select * from view_test1.v2;
   127  a
   128  1
   129  2
   130  3
   131  select * from view_test2.v3;
   132  v1a    v2a
   133  1    1
   134  2    2
   135  select * from view_test2.v4;
   136  v1a    v2a
   137  1    1
   138  2    2
   139  select * from view_test3.v5;
   140  v1a    v2a
   141  1    1
   142  2    2
   143  select * from view_test3.v6;
   144  v1a    v2a
   145  1    1
   146  2    2
   147  drop database view_test1;
   148  drop database view_test2;
   149  drop database view_test3;
   150  drop snapshot sn1;
   151  drop snapshot syssn1;
   152  drop account acc1;