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

     1  -- account level
     2  create database if not exists snapshot_read;
     3  use snapshot_read;
     4  create table test_snapshot_read (a int);
     5  insert into test_snapshot_read (a) values(1), (2), (3), (4), (5),(6), (7), (8), (9), (10), (11), (12),(13), (14), (15), (16), (17), (18), (19), (20),(21), (22), (23), (24), (25), (26), (27), (28), (29), (30),(31), (32), (33), (34), (35), (36), (37), (38), (39), (40),(41), (42), (43), (44), (45), (46), (47), (48), (49), (50),(51), (52), (53), (54), (55), (56), (57), (58), (59), (60),(61), (62), (63), (64), (65), (66), (67), (68), (69), (70),(71), (72), (73), (74), (75), (76), (77), (78), (79), (80), (81), (82), (83), (84), (85), (86), (87), (88), (89), (90),(91), (92), (93), (94), (95), (96), (97), (98), (99), (100);
     6  select count(*) from snapshot_read.test_snapshot_read;
     7  
     8  CREATE TABLE users (
     9      id INT AUTO_INCREMENT PRIMARY KEY,
    10      username VARCHAR(255) NOT NULL,
    11      email VARCHAR(255) NOT NULL UNIQUE,
    12      password VARCHAR(255) NOT NULL,
    13      created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
    14  );
    15  INSERT INTO users (username, email, password) VALUES ('john_doe', 'john@example.com', 'securepassword123');
    16  INSERT INTO users (username, email, password) VALUES ('jane_smith', 'jane.smith@example.com', 'password123'),('alice_jones', 'alice.jones@gmail.com', 'ilovecats'),('bob_brown', 'bob.brown@yahoo.com', 'mysecretpassword'),('charlie_lee', 'charlie.lee@protonmail.ch', 'secure123'),('diana_wilson', 'diana.wilson@outlook.com', 'D1anaPass');
    17  INSERT INTO users (username, email, password) VALUES ('emily_adams', 'emily.adams@icloud.com', 'Em1Ly123'), ('francis_nguyen', 'francis.nguyen@domain.com', 'fNguyenPass'), ('grace_parker', 'grace.parker@server.com', 'G1race123'), ('henry_miller', 'henry.miller@company.org', 'hMillerSecret'), ('isabella_grant', 'isabella.grant@university.edu', 'iGrantPass');
    18  
    19  select count(*) from snapshot_read.users;
    20  
    21  CREATE TABLE students (
    22      student_id INT PRIMARY KEY AUTO_INCREMENT,
    23      name VARCHAR(100) NOT NULL,
    24      age INT NOT NULL
    25  );
    26  
    27  INSERT INTO students (name, age) VALUES ('Alice', 20), ('Bob', 21), ('Charlie', 22), ('Diana', 23), ('Emily', 24);
    28  INSERT INTO students (name, age) VALUES ('Francis', 25), ('Grace', 26), ('Henry', 27), ('Isabella', 28), ('Jack', 29);
    29  INSERT INTO students (name, age) VALUES ('Katherine', 30), ('Liam', 31), ('Mia', 32), ('Noah', 33), ('Olivia', 34);
    30  INSERT INTO students (name, age) VALUES ('Penelope', 35), ('Quinn', 36), ('Ryan', 37), ('Sophia', 38), ('Thomas', 39);
    31  INSERT INTO students (name, age) VALUES ('Ursula', 40), ('Victor', 41), ('Wendy', 42), ('Xander', 43), ('Yvonne', 44);
    32  INSERT INTO students (name, age) VALUES ('Zachary', 45), ('Ava', 46), ('Benjamin', 47), ('Charlotte', 48), ('Daniel', 49);
    33  INSERT INTO students (name, age) VALUES ('Ella', 50), ('Finn', 51), ('Gabriella', 52), ('Henry', 53), ('Isabella', 54);
    34  INSERT INTO students (name, age) VALUES ('Jack', 55), ('Katherine', 56), ('Liam', 57), ('Mia', 58), ('Noah', 59);
    35  INSERT INTO students (name, age) VALUES ('Olivia', 60), ('Penelope', 61), ('Quinn', 62), ('Ryan', 63), ('Sophia', 64);
    36  INSERT INTO students (name, age) VALUES ('Thomas', 65), ('Ursula', 66), ('Victor', 67), ('Wendy', 68), ('Xander', 69);
    37  
    38  select count(*) from snapshot_read.students;
    39  
    40  create database if not exists test_snapshot_restore;
    41  use test_snapshot_restore;
    42  
    43  create table test_restore (a int);
    44  insert into test_restore (a) values(1), (2), (3), (4), (5),(6), (7), (8), (9), (10), (11), (12),(13), (14), (15), (16), (17), (18), (19), (20),(21), (22), (23), (24), (25), (26), (27), (28), (29), (30),(31), (32), (33), (34), (35), (36), (37), (38), (39), (40),(41), (42), (43), (44), (45), (46), (47), (48), (49), (50),(51), (52), (53), (54), (55), (56), (57), (58), (59), (60),(61), (62), (63), (64), (65), (66), (67), (68), (69), (70),(71), (72), (73), (74), (75), (76), (77), (78), (79), (80), (81), (82), (83), (84), (85), (86), (87), (88), (89), (90),(91), (92), (93), (94), (95), (96), (97), (98), (99), (100);
    45  select count(*) from test_snapshot_restore.test_restore;
    46  
    47  CREATE TABLE test_restore_2 (
    48      id INT PRIMARY KEY AUTO_INCREMENT,
    49      name VARCHAR(100) NOT NULL,
    50      age INT NOT NULL
    51  );
    52  insert into test_restore_2 (name, age) values('Alice', 20), ('Bob', 21), ('Charlie', 22), ('Diana', 23), ('Emily', 24);
    53  insert into test_restore_2 (name, age) values('Francis', 25), ('Grace', 26), ('Henry', 27), ('Isabella', 28), ('Jack', 29);
    54  insert into test_restore_2 (name, age) values('Katherine', 30), ('Liam', 31), ('Mia', 32), ('Noah', 33), ('Olivia', 34);
    55  insert into test_restore_2 (name, age) values('Penelope', 35), ('Quinn', 36), ('Ryan', 37), ('Sophia', 38), ('Thomas', 39);
    56  insert into test_restore_2 (name, age) values('Ursula', 40), ('Victor', 41), ('Wendy', 42), ('Xander', 43), ('Yvonne', 44);
    57  insert into test_restore_2 (name, age) values('Zachary', 45), ('Ava', 46), ('Benjamin', 47), ('Charlotte', 48), ('Daniel', 49);
    58  insert into test_restore_2 (name, age) values('Ella', 50), ('Finn', 51), ('Gabriella', 52), ('Henry', 53), ('Isabella', 54);
    59  insert into test_restore_2 (name, age) values('Jack', 55), ('Katherine', 56), ('Liam', 57), ('Mia', 58), ('Noah', 59);
    60  insert into test_restore_2 (name, age) values('Olivia', 60), ('Penelope', 61), ('Quinn', 62), ('Ryan', 63), ('Sophia', 64);
    61  insert into test_restore_2 (name, age) values('Thomas', 65), ('Ursula', 66), ('Victor', 67), ('Wendy', 68), ('Xander', 69);
    62  
    63  select count(*) from test_snapshot_restore.test_restore_2;
    64  
    65  
    66  CREATE TABLE factories (
    67      factory_name VARCHAR(255) PRIMARY KEY,
    68      address TEXT NOT NULL
    69  );
    70  
    71  INSERT INTO factories (factory_name, address) VALUES ('Factory A', '123 Main St, Springfield, IL 62701'), ('Factory B', '456 Elm St, Springfield, IL 62702');
    72  INSERT INTO factories (factory_name, address) VALUES ('Factory C', '789 Oak St, Springfield, IL 62703'), ('Factory D', '101 Pine St, Springfield, IL 62704');
    73  INSERT INTO factories (factory_name, address) VALUES ('Factory E', '112 Birch St, Springfield, IL 62705'), ('Factory F', '131 Cedar St, Springfield, IL 62706');
    74  INSERT INTO factories (factory_name, address) VALUES ('Factory G', '151 Maple St, Springfield, IL 62707'), ('Factory H', '171 Walnut St, Springfield, IL 62708');
    75  INSERT INTO factories (factory_name, address) VALUES ('Factory I', '191 Cherry St, Springfield, IL 62709'), ('Factory J', '211 Elm St, Springfield, IL 62710');
    76  INSERT INTO factories (factory_name, address) VALUES ('Factory K', '231 Oak St, Springfield, IL 62711'), ('Factory LLLLLLLLLL1', '251 Pine St, Springfield, IL 62712');
    77  INSERT INTO factories (factory_name, address) VALUES ('Factory M', '271 Birch St, Springfield, IL 62713'), ('Factory N', '291 Cedar St, Springfield, IL 62714');
    78  INSERT INTO factories (factory_name, address) VALUES ('Factory O', '311 Maple St, Springfield, IL 62715'), ('Factory P', '331 Walnut St, Springfield, IL 62716');
    79  INSERT INTO factories (factory_name, address) VALUES ('Factory Q', '351 Cherry St, Springfield, IL 62717'), ('Factory R', '371 Elm St, Springfield, IL 62718');
    80  INSERT INTO factories (factory_name, address) VALUES ('Factory S', '391 Oak St, Springfield, IL 62719'), ('Factory T', '411 Pine St, Springfield, IL 62720');
    81  INSERT INTO factories (factory_name, address) VALUES ('Factory U', '431 Birch St, Springfield, IL 62721'), ('Factory V', '451 Cedar St, Springfield, IL 62722');
    82  INSERT INTO factories (factory_name, address) VALUES ('Factory W', '471 Maple St, Springfield, IL 62723'), ('Factory X', '491 Walnut St, Springfield, IL 62724');
    83  INSERT INTO factories (factory_name, address) VALUES ('Factory Y', '511 Cherry St, Springfield, IL 62725'), ('Factory Z', '531 Elm St, Springfield, IL 62726');
    84  INSERT INTO factories (factory_name, address) VALUES ('Factory AA', '551 Oak St, Springfield, IL 62727'), ('Factory BB', '571 Pine St, Springfield, IL 62728');
    85  INSERT INTO factories (factory_name, address) VALUES ('Factory CC', '591 Birch St, Springfield, IL 62729'), ('Factory DD', '611 Cedar St, Springfield, IL 62730');
    86  INSERT INTO factories (factory_name, address) VALUES ('Factory EE', '631 Maple St, Springfield, IL 62731'), ('Factory FF', '651 Walnut St, Springfield, IL 62732');
    87  INSERT INTO factories (factory_name, address) VALUES ('Factory GG', '671 Cherry St, Springfield, IL 62733'), ('Factory HH', '691 Elm St, Springfield, IL 62734');
    88  INSERT INTO factories (factory_name, address) VALUES ('Factory II', '711 Oak St, Springfield, IL 62735'), ('Factory JJ', '731 Pine St, Springfield, IL 62736');
    89  INSERT INTO factories (factory_name, address) VALUES ('Factory KK', '751 Birch St, Springfield, IL 62737'), ('Factory LL', '771 Cedar St, Springfield, IL 62738');
    90  INSERT INTO factories (factory_name, address) VALUES ('Factory MM', '791 Maple St, Springfield, IL 62739'), ('Factory NN', '811 Walnut St, Springfield, IL 62740');
    91  INSERT INTO factories (factory_name, address) VALUES ('Factory OO', '831 Cherry St, Springfield, IL 62741'), ('Factory PP', '851 Elm St, Springfield, IL 62742');
    92  INSERT INTO factories (factory_name, address) VALUES ('Factory QQ', '871 Oak St, Springfield, IL 62743'), ('Factory RR', '891 Pine St, Springfield, IL 62744');
    93  INSERT INTO factories (factory_name, address) VALUES ('Factory SS', '911 Birch St, Springfield, IL 62745'), ('Factory TT', '931 Cedar St, Springfield, IL 62746');
    94  INSERT INTO factories (factory_name, address) VALUES ('Factory UU', '951 Maple St, Springfield, IL 62747'), ('Factory VV', '971 Walnut St, Springfield, IL 62748');
    95  INSERT INTO factories (factory_name, address) VALUES ('Factory WW', '991 Cherry St, Springfield, IL 62749'), ('Factory XX', '1011 Elm St, Springfield, IL 62750');
    96  INSERT INTO factories (factory_name, address) VALUES ('Factory YY', '1031 Oak St, Springfield, IL 62751'), ('Factory ZZ', '1051 Pine St, Springfield, IL 62752');
    97  INSERT INTO factories (factory_name, address) VALUES ('Factory AAA', '1071 Birch St, Springfield, IL 62753'), ('Factory BBB', '1091 Cedar St, Springfield, IL 62754');
    98  INSERT INTO factories (factory_name, address) VALUES ('Factory CCC', '1111 Maple St, Springfield, IL 62755'), ('Factory DDD', '1131 Walnut St, Springfield, IL 62756');
    99  INSERT INTO factories (factory_name, address) VALUES ('Factory EEE', '1151 Cherry St, Springfield, IL 62757'), ('Factory FFF', '1171 Elm St, Springfield, IL 62758');
   100  INSERT INTO factories (factory_name, address) VALUES ('Factory GGG', '1191 Oak St, Springfield, IL 62759'), ('Factory HHH', '1211 Pine St, Springfield, IL 62760');
   101  INSERT INTO factories (factory_name, address) VALUES ('Factory III', '1231 Birch St, Springfield, IL 62761'), ('Factory JJJ', '1251 Cedar St, Springfield, IL 62762');
   102  INSERT INTO factories (factory_name, address) VALUES ('Factory KKKK', '1271 Maple St, Springfield, IL 62763'), ('Factory LLLLLLLLLLLLLLL', '1291 Walnut St, Springfield, IL 62764');
   103  INSERT INTO factories (factory_name, address) VALUES ('Factory MMM', '1311 Cherry St, Springfield, IL 62765'), ('Factory NNN', '1331 Elm St, Springfield, IL 62766');
   104  INSERT INTO factories (factory_name, address) VALUES ('Factory OOO', '1351 Oak St, Springfield, IL 62767'), ('Factory PPP', '1371 Pine St, Springfield, IL 62768');
   105  INSERT INTO factories (factory_name, address) VALUES ('Factory QQQ', '1391 Birch St, Springfield, IL 62769'), ('Factory RRR', '1411 Cedar St, Springfield, IL 62770');
   106  INSERT INTO factories (factory_name, address) VALUES ('Factory SSS', '1431 Maple St, Springfield, IL 62771'), ('Factory TTT', '1451 Walnut St, Springfield, IL 62772');
   107  INSERT INTO factories (factory_name, address) VALUES ('Factory UUU', '1471 Cherry St, Springfield, IL 62773'), ('Factory VVV', '1491 Elm St, Springfield, IL 62774');
   108  INSERT INTO factories (factory_name, address) VALUES ('Factory WWW', '1511 Oak St, Springfield, IL 62775'), ('Factory XXX', '1531 Pine St, Springfield, IL 62776');
   109  INSERT INTO factories (factory_name, address) VALUES ('Factory YYY', '1551 Birch St, Springfield, IL 62777'), ('Factory ZZZ', '1571 Cedar St, Springfield, IL 62778');
   110  INSERT INTO factories (factory_name, address) VALUES ('Factory AAAA', '1591 Maple St, Springfield, IL 62779'), ('Factory BBBB', '1611 Walnut St, Springfield, IL 62780');
   111  INSERT INTO factories (factory_name, address) VALUES ('Factory CCCC', '1631 Cherry St, Springfield, IL 62781'), ('Factory DDDD', '1651 Elm St, Springfield, IL 62782');
   112  INSERT INTO factories (factory_name, address) VALUES ('Factory EEEE', '1671 Oak St, Springfield, IL 62783'), ('Factory FFFF', '1691 Pine St, Springfield, IL 62784');
   113  INSERT INTO factories (factory_name, address) VALUES ('Factory GGGG', '1711 Birch St, Springfield, IL 62785'), ('Factory HHHH', '1731 Cedar St, Springfield, IL 62786');
   114  INSERT INTO factories (factory_name, address) VALUES ('Factory IIII', '1751 Maple St, Springfield, IL 62787'), ('Factory JJJJ', '1771 Walnut St, Springfield, IL 62788');
   115  INSERT INTO factories (factory_name, address) VALUES ('Factory KKKK', '1791 Cherry St, Springfield, IL 62789'), ('Factory LLLL', '1811 Elm St, Springfield, IL 62790');
   116  INSERT INTO factories (factory_name, address) VALUES ('Factory MMMM', '1831 Oak St, Springfield, IL 62791'), ('Factory NNNN', '1851 Pine St, Springfield, IL 62792');
   117  INSERT INTO factories (factory_name, address) VALUES ('Factory OOOO', '1871 Birch St, Springfield, IL 62793'), ('Factory PPPP', '1891 Cedar St, Springfield, IL 62794');
   118  INSERT INTO factories (factory_name, address) VALUES ('Factory QQQQ', '1911 Maple St, Springfield, IL 62795'), ('Factory RRRR', '1931 Walnut St, Springfield, IL 62796');
   119  INSERT INTO factories (factory_name, address) VALUES ('Factory SSSS', '1951 Cherry St, Springfield, IL 62797'), ('Factory TTTT', '1971 Elm St, Springfield, IL 62798');
   120  INSERT INTO factories (factory_name, address) VALUES ('Factory UUUU', '1991 Oak St, Springfield, IL 62799'), ('Factory VVVV', '2011 Pine St, Springfield, IL 62800');
   121  INSERT INTO factories (factory_name, address) VALUES ('Factory WWWW', '2031 Birch St, Springfield, IL 62801'), ('Factory XXXX', '2051 Cedar St, Springfield, IL 62802');
   122  
   123  select count(*) from test_snapshot_restore.factories;
   124  
   125  create snapshot snapshot_01 for account sys;
   126  
   127  
   128  drop database test_snapshot_restore;
   129  drop database snapshot_read;
   130  
   131  restore account sys from snapshot snapshot_01;
   132  
   133  use test_snapshot_restore;
   134  select count(*) from test_snapshot_restore.test_restore;
   135  select count(*) from test_snapshot_restore.test_restore_2;
   136  select count(*) from test_snapshot_restore.factories;
   137  
   138  use snapshot_read;
   139  select count(*) from snapshot_read.test_snapshot_read;
   140  select count(*) from snapshot_read.users;
   141  select count(*) from snapshot_read.students;
   142  
   143  drop snapshot snapshot_01;
   144  drop database snapshot_read;
   145  drop database test_snapshot_restore;
   146  
   147  
   148  -- normal account
   149  create account test_account admin_name = 'test_user' identified by '111';
   150  -- @session:id=2&user=test_account:test_user&password=111
   151  create database if not exists snapshot_read;
   152  use snapshot_read;
   153  create table test_snapshot_read (a int);
   154  insert into test_snapshot_read (a) values(1), (2), (3), (4), (5),(6), (7), (8), (9), (10), (11), (12),(13), (14), (15), (16), (17), (18), (19), (20),(21), (22), (23), (24), (25), (26), (27), (28), (29), (30),(31), (32), (33), (34), (35), (36), (37), (38), (39), (40),(41), (42), (43), (44), (45), (46), (47), (48), (49), (50),(51), (52), (53), (54), (55), (56), (57), (58), (59), (60),(61), (62), (63), (64), (65), (66), (67), (68), (69), (70),(71), (72), (73), (74), (75), (76), (77), (78), (79), (80), (81), (82), (83), (84), (85), (86), (87), (88), (89), (90),(91), (92), (93), (94), (95), (96), (97), (98), (99), (100);
   155  select count(*) from snapshot_read.test_snapshot_read;
   156  
   157  CREATE TABLE users (
   158      id INT AUTO_INCREMENT PRIMARY KEY,
   159      username VARCHAR(255) NOT NULL,
   160      email VARCHAR(255) NOT NULL UNIQUE,
   161      password VARCHAR(255) NOT NULL,
   162      created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
   163  );
   164  INSERT INTO users (username, email, password) VALUES ('john_doe', 'john@example.com', 'securepassword123');
   165  INSERT INTO users (username, email, password) VALUES ('jane_smith', 'jane.smith@example.com', 'password123'),('alice_jones', 'alice.jones@gmail.com', 'ilovecats'),('bob_brown', 'bob.brown@yahoo.com', 'mysecretpassword'),('charlie_lee', 'charlie.lee@protonmail.ch', 'secure123'),('diana_wilson', 'diana.wilson@outlook.com', 'D1anaPass');
   166  INSERT INTO users (username, email, password) VALUES ('emily_adams', 'emily.adams@icloud.com', 'Em1Ly123'), ('francis_nguyen', 'francis.nguyen@domain.com', 'fNguyenPass'), ('grace_parker', 'grace.parker@server.com', 'G1race123'), ('henry_miller', 'henry.miller@company.org', 'hMillerSecret'), ('isabella_grant', 'isabella.grant@university.edu', 'iGrantPass');
   167  
   168  select count(*) from snapshot_read.users;
   169  
   170  CREATE TABLE students (
   171      student_id INT PRIMARY KEY AUTO_INCREMENT,
   172      name VARCHAR(100) NOT NULL,
   173      age INT NOT NULL
   174  );
   175  
   176  INSERT INTO students (name, age) VALUES ('Alice', 20), ('Bob', 21), ('Charlie', 22), ('Diana', 23), ('Emily', 24);
   177  INSERT INTO students (name, age) VALUES ('Francis', 25), ('Grace', 26), ('Henry', 27), ('Isabella', 28), ('Jack', 29);
   178  INSERT INTO students (name, age) VALUES ('Katherine', 30), ('Liam', 31), ('Mia', 32), ('Noah', 33), ('Olivia', 34);
   179  INSERT INTO students (name, age) VALUES ('Penelope', 35), ('Quinn', 36), ('Ryan', 37), ('Sophia', 38), ('Thomas', 39);
   180  INSERT INTO students (name, age) VALUES ('Ursula', 40), ('Victor', 41), ('Wendy', 42), ('Xander', 43), ('Yvonne', 44);
   181  INSERT INTO students (name, age) VALUES ('Zachary', 45), ('Ava', 46), ('Benjamin', 47), ('Charlotte', 48), ('Daniel', 49);
   182  INSERT INTO students (name, age) VALUES ('Ella', 50), ('Finn', 51), ('Gabriella', 52), ('Henry', 53), ('Isabella', 54);
   183  INSERT INTO students (name, age) VALUES ('Jack', 55), ('Katherine', 56), ('Liam', 57), ('Mia', 58), ('Noah', 59);
   184  INSERT INTO students (name, age) VALUES ('Olivia', 60), ('Penelope', 61), ('Quinn', 62), ('Ryan', 63), ('Sophia', 64);
   185  INSERT INTO students (name, age) VALUES ('Thomas', 65), ('Ursula', 66), ('Victor', 67), ('Wendy', 68), ('Xander', 69);
   186  
   187  select count(*) from snapshot_read.students;
   188  
   189  
   190  create database if not exists test_snapshot_restore;
   191  use test_snapshot_restore;
   192  
   193  create table test_restore (a int);
   194  insert into test_restore (a) values(1), (2), (3), (4), (5),(6), (7), (8), (9), (10), (11), (12),(13), (14), (15), (16), (17), (18), (19), (20),(21), (22), (23), (24), (25), (26), (27), (28), (29), (30),(31), (32), (33), (34), (35), (36), (37), (38), (39), (40),(41), (42), (43), (44), (45), (46), (47), (48), (49), (50),(51), (52), (53), (54), (55), (56), (57), (58), (59), (60),(61), (62), (63), (64), (65), (66), (67), (68), (69), (70),(71), (72), (73), (74), (75), (76), (77), (78), (79), (80), (81), (82), (83), (84), (85), (86), (87), (88), (89), (90),(91), (92), (93), (94), (95), (96), (97), (98), (99), (100);
   195  select count(*) from test_snapshot_restore.test_restore;
   196  
   197  CREATE TABLE test_restore_2 (
   198      id INT PRIMARY KEY AUTO_INCREMENT,
   199      name VARCHAR(100) NOT NULL,
   200      age INT NOT NULL
   201  );
   202  insert into test_restore_2 (name, age) values('Alice', 20), ('Bob', 21), ('Charlie', 22), ('Diana', 23), ('Emily', 24);
   203  insert into test_restore_2 (name, age) values('Francis', 25), ('Grace', 26), ('Henry', 27), ('Isabella', 28), ('Jack', 29);
   204  insert into test_restore_2 (name, age) values('Katherine', 30), ('Liam', 31), ('Mia', 32), ('Noah', 33), ('Olivia', 34);
   205  insert into test_restore_2 (name, age) values('Penelope', 35), ('Quinn', 36), ('Ryan', 37), ('Sophia', 38), ('Thomas', 39);
   206  insert into test_restore_2 (name, age) values('Ursula', 40), ('Victor', 41), ('Wendy', 42), ('Xander', 43), ('Yvonne', 44);
   207  insert into test_restore_2 (name, age) values('Zachary', 45), ('Ava', 46), ('Benjamin', 47), ('Charlotte', 48), ('Daniel', 49);
   208  insert into test_restore_2 (name, age) values('Ella', 50), ('Finn', 51), ('Gabriella', 52), ('Henry', 53), ('Isabella', 54);
   209  insert into test_restore_2 (name, age) values('Jack', 55), ('Katherine', 56), ('Liam', 57), ('Mia', 58), ('Noah', 59);
   210  insert into test_restore_2 (name, age) values('Olivia', 60), ('Penelope', 61), ('Quinn', 62), ('Ryan', 63), ('Sophia', 64);
   211  insert into test_restore_2 (name, age) values('Thomas', 65), ('Ursula', 66), ('Victor', 67), ('Wendy', 68), ('Xander', 69);
   212  
   213  select count(*) from test_snapshot_restore.test_restore_2;
   214  
   215  CREATE TABLE factories (
   216      factory_name VARCHAR(255) PRIMARY KEY,
   217      address TEXT NOT NULL
   218  );
   219  
   220  INSERT INTO factories (factory_name, address) VALUES ('Factory A', '123 Main St, Springfield, IL 62701'), ('Factory B', '456 Elm St, Springfield, IL 62702');
   221  INSERT INTO factories (factory_name, address) VALUES ('Factory C', '789 Oak St, Springfield, IL 62703'), ('Factory D', '101 Pine St, Springfield, IL 62704');
   222  INSERT INTO factories (factory_name, address) VALUES ('Factory E', '112 Birch St, Springfield, IL 62705'), ('Factory F', '131 Cedar St, Springfield, IL 62706');
   223  INSERT INTO factories (factory_name, address) VALUES ('Factory G', '151 Maple St, Springfield, IL 62707'), ('Factory H', '171 Walnut St, Springfield, IL 62708');
   224  INSERT INTO factories (factory_name, address) VALUES ('Factory I', '191 Cherry St, Springfield, IL 62709'), ('Factory J', '211 Elm St, Springfield, IL 62710');
   225  INSERT INTO factories (factory_name, address) VALUES ('Factory K', '231 Oak St, Springfield, IL 62711'), ('Factory LLLLLLLLL', '251 Pine St, Springfield, IL 62712');
   226  INSERT INTO factories (factory_name, address) VALUES ('Factory M', '271 Birch St, Springfield, IL 62713'), ('Factory N', '291 Cedar St, Springfield, IL 62714');
   227  INSERT INTO factories (factory_name, address) VALUES ('Factory O', '311 Maple St, Springfield, IL 62715'), ('Factory P', '331 Walnut St, Springfield, IL 62716');
   228  INSERT INTO factories (factory_name, address) VALUES ('Factory Q', '351 Cherry St, Springfield, IL 62717'), ('Factory R', '371 Elm St, Springfield, IL 62718');
   229  INSERT INTO factories (factory_name, address) VALUES ('Factory S', '391 Oak St, Springfield, IL 62719'), ('Factory T', '411 Pine St, Springfield, IL 62720');
   230  INSERT INTO factories (factory_name, address) VALUES ('Factory U', '431 Birch St, Springfield, IL 62721'), ('Factory V', '451 Cedar St, Springfield, IL 62722');
   231  INSERT INTO factories (factory_name, address) VALUES ('Factory W', '471 Maple St, Springfield, IL 62723'), ('Factory X', '491 Walnut St, Springfield, IL 62724');
   232  INSERT INTO factories (factory_name, address) VALUES ('Factory Y', '511 Cherry St, Springfield, IL 62725'), ('Factory Z', '531 Elm St, Springfield, IL 62726');
   233  INSERT INTO factories (factory_name, address) VALUES ('Factory AA', '551 Oak St, Springfield, IL 62727'), ('Factory BB', '571 Pine St, Springfield, IL 62728');
   234  INSERT INTO factories (factory_name, address) VALUES ('Factory CC', '591 Birch St, Springfield, IL 62729'), ('Factory DD', '611 Cedar St, Springfield, IL 62730');
   235  INSERT INTO factories (factory_name, address) VALUES ('Factory EE', '631 Maple St, Springfield, IL 62731'), ('Factory FF', '651 Walnut St, Springfield, IL 62732');
   236  INSERT INTO factories (factory_name, address) VALUES ('Factory GG', '671 Cherry St, Springfield, IL 62733'), ('Factory HH', '691 Elm St, Springfield, IL 62734');
   237  INSERT INTO factories (factory_name, address) VALUES ('Factory II', '711 Oak St, Springfield, IL 62735'), ('Factory JJ', '731 Pine St, Springfield, IL 62736');
   238  INSERT INTO factories (factory_name, address) VALUES ('Factory KK', '751 Birch St, Springfield, IL 62737'), ('Factory LL', '771 Cedar St, Springfield, IL 62738');
   239  INSERT INTO factories (factory_name, address) VALUES ('Factory MM', '791 Maple St, Springfield, IL 62739'), ('Factory NN', '811 Walnut St, Springfield, IL 62740');
   240  INSERT INTO factories (factory_name, address) VALUES ('Factory OO', '831 Cherry St, Springfield, IL 62741'), ('Factory PP', '851 Elm St, Springfield, IL 62742');
   241  INSERT INTO factories (factory_name, address) VALUES ('Factory QQ', '871 Oak St, Springfield, IL 62743'), ('Factory RR', '891 Pine St, Springfield, IL 62744');
   242  INSERT INTO factories (factory_name, address) VALUES ('Factory SS', '911 Birch St, Springfield, IL 62745'), ('Factory TT', '931 Cedar St, Springfield, IL 62746');
   243  INSERT INTO factories (factory_name, address) VALUES ('Factory UU', '951 Maple St, Springfield, IL 62747'), ('Factory VV', '971 Walnut St, Springfield, IL 62748');
   244  INSERT INTO factories (factory_name, address) VALUES ('Factory WW', '991 Cherry St, Springfield, IL 62749'), ('Factory XX', '1011 Elm St, Springfield, IL 62750');
   245  INSERT INTO factories (factory_name, address) VALUES ('Factory YY', '1031 Oak St, Springfield, IL 62751'), ('Factory ZZ', '1051 Pine St, Springfield, IL 62752');
   246  INSERT INTO factories (factory_name, address) VALUES ('Factory AAA', '1071 Birch St, Springfield, IL 62753'), ('Factory BBB', '1091 Cedar St, Springfield, IL 62754');
   247  INSERT INTO factories (factory_name, address) VALUES ('Factory CCC', '1111 Maple St, Springfield, IL 62755'), ('Factory DDD', '1131 Walnut St, Springfield, IL 62756');
   248  INSERT INTO factories (factory_name, address) VALUES ('Factory EEE', '1151 Cherry St, Springfield, IL 62757'), ('Factory FFF', '1171 Elm St, Springfield, IL 62758');
   249  INSERT INTO factories (factory_name, address) VALUES ('Factory GGG', '1191 Oak St, Springfield, IL 62759'), ('Factory HHH', '1211 Pine St, Springfield, IL 62760');
   250  INSERT INTO factories (factory_name, address) VALUES ('Factory III', '1231 Birch St, Springfield, IL 62761'), ('Factory JJJ', '1251 Cedar St, Springfield, IL 62762');
   251  INSERT INTO factories (factory_name, address) VALUES ('Factory KKKK', '1271 Maple St, Springfield, IL 62763'), ('Factory LLLLL', '1291 Walnut St, Springfield, IL 62764');
   252  INSERT INTO factories (factory_name, address) VALUES ('Factory MMM', '1311 Cherry St, Springfield, IL 62765'), ('Factory NNN', '1331 Elm St, Springfield, IL 62766');
   253  INSERT INTO factories (factory_name, address) VALUES ('Factory OOO', '1351 Oak St, Springfield, IL 62767'), ('Factory PPP', '1371 Pine St, Springfield, IL 62768');
   254  INSERT INTO factories (factory_name, address) VALUES ('Factory QQQ', '1391 Birch St, Springfield, IL 62769'), ('Factory RRR', '1411 Cedar St, Springfield, IL 62770');
   255  INSERT INTO factories (factory_name, address) VALUES ('Factory SSS', '1431 Maple St, Springfield, IL 62771'), ('Factory TTT', '1451 Walnut St, Springfield, IL 62772');
   256  INSERT INTO factories (factory_name, address) VALUES ('Factory UUU', '1471 Cherry St, Springfield, IL 62773'), ('Factory VVV', '1491 Elm St, Springfield, IL 62774');
   257  INSERT INTO factories (factory_name, address) VALUES ('Factory WWW', '1511 Oak St, Springfield, IL 62775'), ('Factory XXX', '1531 Pine St, Springfield, IL 62776');
   258  INSERT INTO factories (factory_name, address) VALUES ('Factory YYY', '1551 Birch St, Springfield, IL 62777'), ('Factory ZZZ', '1571 Cedar St, Springfield, IL 62778');
   259  INSERT INTO factories (factory_name, address) VALUES ('Factory AAAA', '1591 Maple St, Springfield, IL 62779'), ('Factory BBBB', '1611 Walnut St, Springfield, IL 62780');
   260  INSERT INTO factories (factory_name, address) VALUES ('Factory CCCC', '1631 Cherry St, Springfield, IL 62781'), ('Factory DDDD', '1651 Elm St, Springfield, IL 62782');
   261  INSERT INTO factories (factory_name, address) VALUES ('Factory EEEE', '1671 Oak St, Springfield, IL 62783'), ('Factory FFFF', '1691 Pine St, Springfield, IL 62784');
   262  INSERT INTO factories (factory_name, address) VALUES ('Factory GGGG', '1711 Birch St, Springfield, IL 62785'), ('Factory HHHH', '1731 Cedar St, Springfield, IL 62786');
   263  INSERT INTO factories (factory_name, address) VALUES ('Factory IIII', '1751 Maple St, Springfield, IL 62787'), ('Factory JJJJ', '1771 Walnut St, Springfield, IL 62788');
   264  INSERT INTO factories (factory_name, address) VALUES ('Factory KKKK', '1791 Cherry St, Springfield, IL 62789'), ('Factory LLLL', '1811 Elm St, Springfield, IL 62790');
   265  INSERT INTO factories (factory_name, address) VALUES ('Factory MMMM', '1831 Oak St, Springfield, IL 62791'), ('Factory NNNN', '1851 Pine St, Springfield, IL 62792');
   266  INSERT INTO factories (factory_name, address) VALUES ('Factory OOOO', '1871 Birch St, Springfield, IL 62793'), ('Factory PPPP', '1891 Cedar St, Springfield, IL 62794');
   267  INSERT INTO factories (factory_name, address) VALUES ('Factory QQQQ', '1911 Maple St, Springfield, IL 62795'), ('Factory RRRR', '1931 Walnut St, Springfield, IL 62796');
   268  INSERT INTO factories (factory_name, address) VALUES ('Factory SSSS', '1951 Cherry St, Springfield, IL 62797'), ('Factory TTTT', '1971 Elm St, Springfield, IL 62798');
   269  INSERT INTO factories (factory_name, address) VALUES ('Factory UUUU', '1991 Oak St, Springfield, IL 62799'), ('Factory VVVV', '2011 Pine St, Springfield, IL 62800');
   270  INSERT INTO factories (factory_name, address) VALUES ('Factory WWWW', '2031 Birch St, Springfield, IL 62801'), ('Factory XXXX', '2051 Cedar St, Springfield, IL 62802');
   271  
   272  select count(*) from test_snapshot_restore.factories;
   273  
   274  create snapshot snapshot_01 for account test_account;
   275  
   276  
   277  drop database test_snapshot_restore;
   278  drop database snapshot_read;
   279  
   280  restore account test_account from snapshot snapshot_01;
   281  
   282  use test_snapshot_restore;
   283  select count(*) from test_snapshot_restore.test_restore;
   284  select count(*) from test_snapshot_restore.test_restore_2;
   285  select count(*) from test_snapshot_restore.factories;
   286  
   287  use snapshot_read;
   288  select count(*) from snapshot_read.test_snapshot_read;
   289  select count(*) from snapshot_read.users;
   290  select count(*) from snapshot_read.students;
   291  
   292  drop snapshot snapshot_01;
   293  drop database snapshot_read;
   294  drop database test_snapshot_restore;
   295  -- @session
   296  drop account test_account;
   297  
   298  -- sys restore normal account
   299  create account test_account admin_name = 'test_user' identified by '111';
   300  -- @session:id=3&user=test_account:test_user&password=111
   301  create database if not exists snapshot_read;
   302  use snapshot_read;
   303  create table test_snapshot_read (a int);
   304  insert into test_snapshot_read (a) values(1), (2), (3), (4), (5),(6), (7), (8), (9), (10), (11), (12),(13), (14), (15), (16), (17), (18), (19), (20),(21), (22), (23), (24), (25), (26), (27), (28), (29), (30),(31), (32), (33), (34), (35), (36), (37), (38), (39), (40),(41), (42), (43), (44), (45), (46), (47), (48), (49), (50),(51), (52), (53), (54), (55), (56), (57), (58), (59), (60),(61), (62), (63), (64), (65), (66), (67), (68), (69), (70),(71), (72), (73), (74), (75), (76), (77), (78), (79), (80), (81), (82), (83), (84), (85), (86), (87), (88), (89), (90),(91), (92), (93), (94), (95), (96), (97), (98), (99), (100);
   305  select count(*) from snapshot_read.test_snapshot_read;
   306  
   307  CREATE TABLE users (
   308      id INT AUTO_INCREMENT PRIMARY KEY,
   309      username VARCHAR(255) NOT NULL,
   310      email VARCHAR(255) NOT NULL UNIQUE,
   311      password VARCHAR(255) NOT NULL,
   312      created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
   313  );
   314  INSERT INTO users (username, email, password) VALUES ('john_doe', 'john@example.com', 'securepassword123');
   315  INSERT INTO users (username, email, password) VALUES ('jane_smith', 'jane.smith@example.com', 'password123'),('alice_jones', 'alice.jones@gmail.com', 'ilovecats'),('bob_brown', 'bob.brown@yahoo.com', 'mysecretpassword'),('charlie_lee', 'charlie.lee@protonmail.ch', 'secure123'),('diana_wilson', 'diana.wilson@outlook.com', 'D1anaPass');
   316  INSERT INTO users (username, email, password) VALUES ('emily_adams', 'emily.adams@icloud.com', 'Em1Ly123'), ('francis_nguyen', 'francis.nguyen@domain.com', 'fNguyenPass'), ('grace_parker', 'grace.parker@server.com', 'G1race123'), ('henry_miller', 'henry.miller@company.org', 'hMillerSecret'), ('isabella_grant', 'isabella.grant@university.edu', 'iGrantPass');
   317  
   318  select count(*) from snapshot_read.users;
   319  
   320  CREATE TABLE students (
   321      student_id INT PRIMARY KEY AUTO_INCREMENT,
   322      name VARCHAR(100) NOT NULL,
   323      age INT NOT NULL
   324  );
   325  
   326  INSERT INTO students (name, age) VALUES ('Alice', 20), ('Bob', 21), ('Charlie', 22), ('Diana', 23), ('Emily', 24);
   327  INSERT INTO students (name, age) VALUES ('Francis', 25), ('Grace', 26), ('Henry', 27), ('Isabella', 28), ('Jack', 29);
   328  INSERT INTO students (name, age) VALUES ('Katherine', 30), ('Liam', 31), ('Mia', 32), ('Noah', 33), ('Olivia', 34);
   329  INSERT INTO students (name, age) VALUES ('Penelope', 35), ('Quinn', 36), ('Ryan', 37), ('Sophia', 38), ('Thomas', 39);
   330  INSERT INTO students (name, age) VALUES ('Ursula', 40), ('Victor', 41), ('Wendy', 42), ('Xander', 43), ('Yvonne', 44);
   331  INSERT INTO students (name, age) VALUES ('Zachary', 45), ('Ava', 46), ('Benjamin', 47), ('Charlotte', 48), ('Daniel', 49);
   332  INSERT INTO students (name, age) VALUES ('Ella', 50), ('Finn', 51), ('Gabriella', 52), ('Henry', 53), ('Isabella', 54);
   333  INSERT INTO students (name, age) VALUES ('Jack', 55), ('Katherine', 56), ('Liam', 57), ('Mia', 58), ('Noah', 59);
   334  INSERT INTO students (name, age) VALUES ('Olivia', 60), ('Penelope', 61), ('Quinn', 62), ('Ryan', 63), ('Sophia', 64);
   335  INSERT INTO students (name, age) VALUES ('Thomas', 65), ('Ursula', 66), ('Victor', 67), ('Wendy', 68), ('Xander', 69);
   336  
   337  select count(*) from snapshot_read.students;
   338  
   339  create database if not exists test_snapshot_restore;
   340  use test_snapshot_restore;
   341  
   342  create table test_restore (a int);
   343  insert into test_restore (a) values(1), (2), (3), (4), (5),(6), (7), (8), (9), (10), (11), (12),(13), (14), (15), (16), (17), (18), (19), (20),(21), (22), (23), (24), (25), (26), (27), (28), (29), (30),(31), (32), (33), (34), (35), (36), (37), (38), (39), (40),(41), (42), (43), (44), (45), (46), (47), (48), (49), (50),(51), (52), (53), (54), (55), (56), (57), (58), (59), (60),(61), (62), (63), (64), (65), (66), (67), (68), (69), (70),(71), (72), (73), (74), (75), (76), (77), (78), (79), (80), (81), (82), (83), (84), (85), (86), (87), (88), (89), (90),(91), (92), (93), (94), (95), (96), (97), (98), (99), (100);
   344  select count(*) from test_snapshot_restore.test_restore;
   345  
   346  CREATE TABLE test_restore_2 (
   347      id INT PRIMARY KEY AUTO_INCREMENT,
   348      name VARCHAR(100) NOT NULL,
   349      age INT NOT NULL
   350  );
   351  insert into test_restore_2 (name, age) values('Alice', 20), ('Bob', 21), ('Charlie', 22), ('Diana', 23), ('Emily', 24);
   352  insert into test_restore_2 (name, age) values('Francis', 25), ('Grace', 26), ('Henry', 27), ('Isabella', 28), ('Jack', 29);
   353  insert into test_restore_2 (name, age) values('Katherine', 30), ('Liam', 31), ('Mia', 32), ('Noah', 33), ('Olivia', 34);
   354  insert into test_restore_2 (name, age) values('Penelope', 35), ('Quinn', 36), ('Ryan', 37), ('Sophia', 38), ('Thomas', 39);
   355  insert into test_restore_2 (name, age) values('Ursula', 40), ('Victor', 41), ('Wendy', 42), ('Xander', 43), ('Yvonne', 44);
   356  insert into test_restore_2 (name, age) values('Zachary', 45), ('Ava', 46), ('Benjamin', 47), ('Charlotte', 48), ('Daniel', 49);
   357  insert into test_restore_2 (name, age) values('Ella', 50), ('Finn', 51), ('Gabriella', 52), ('Henry', 53), ('Isabella', 54);
   358  insert into test_restore_2 (name, age) values('Jack', 55), ('Katherine', 56), ('Liam', 57), ('Mia', 58), ('Noah', 59);
   359  insert into test_restore_2 (name, age) values('Olivia', 60), ('Penelope', 61), ('Quinn', 62), ('Ryan', 63), ('Sophia', 64);
   360  insert into test_restore_2 (name, age) values('Thomas', 65), ('Ursula', 66), ('Victor', 67), ('Wendy', 68), ('Xander', 69);
   361  
   362  select count(*) from test_snapshot_restore.test_restore_2;
   363  
   364  CREATE TABLE factories (
   365      factory_name VARCHAR(255) PRIMARY KEY,
   366      address TEXT NOT NULL
   367  );
   368  
   369  INSERT INTO factories (factory_name, address) VALUES ('Factory A', '123 Main St, Springfield, IL 62701'), ('Factory B', '456 Elm St, Springfield, IL 62702');
   370  INSERT INTO factories (factory_name, address) VALUES ('Factory C', '789 Oak St, Springfield, IL 62703'), ('Factory D', '101 Pine St, Springfield, IL 62704');
   371  INSERT INTO factories (factory_name, address) VALUES ('Factory E', '112 Birch St, Springfield, IL 62705'), ('Factory F', '131 Cedar St, Springfield, IL 62706');
   372  INSERT INTO factories (factory_name, address) VALUES ('Factory G', '151 Maple St, Springfield, IL 62707'), ('Factory H', '171 Walnut St, Springfield, IL 62708');
   373  INSERT INTO factories (factory_name, address) VALUES ('Factory I', '191 Cherry St, Springfield, IL 62709'), ('Factory J', '211 Elm St, Springfield, IL 62710');
   374  INSERT INTO factories (factory_name, address) VALUES ('Factory K', '231 Oak St, Springfield, IL 62711'), ('Factory L', '251 Pine St, Springfield, IL 62712');
   375  INSERT INTO factories (factory_name, address) VALUES ('Factory M', '271 Birch St, Springfield, IL 62713'), ('Factory N', '291 Cedar St, Springfield, IL 62714');
   376  INSERT INTO factories (factory_name, address) VALUES ('Factory O', '311 Maple St, Springfield, IL 62715'), ('Factory P', '331 Walnut St, Springfield, IL 62716');
   377  INSERT INTO factories (factory_name, address) VALUES ('Factory Q', '351 Cherry St, Springfield, IL 62717'), ('Factory R', '371 Elm St, Springfield, IL 62718');
   378  INSERT INTO factories (factory_name, address) VALUES ('Factory S', '391 Oak St, Springfield, IL 62719'), ('Factory T', '411 Pine St, Springfield, IL 62720');
   379  INSERT INTO factories (factory_name, address) VALUES ('Factory U', '431 Birch St, Springfield, IL 62721'), ('Factory V', '451 Cedar St, Springfield, IL 62722');
   380  INSERT INTO factories (factory_name, address) VALUES ('Factory W', '471 Maple St, Springfield, IL 62723'), ('Factory X', '491 Walnut St, Springfield, IL 62724');
   381  INSERT INTO factories (factory_name, address) VALUES ('Factory Y', '511 Cherry St, Springfield, IL 62725'), ('Factory Z', '531 Elm St, Springfield, IL 62726');
   382  INSERT INTO factories (factory_name, address) VALUES ('Factory AA', '551 Oak St, Springfield, IL 62727'), ('Factory BB', '571 Pine St, Springfield, IL 62728');
   383  INSERT INTO factories (factory_name, address) VALUES ('Factory CC', '591 Birch St, Springfield, IL 62729'), ('Factory DD', '611 Cedar St, Springfield, IL 62730');
   384  INSERT INTO factories (factory_name, address) VALUES ('Factory EE', '631 Maple St, Springfield, IL 62731'), ('Factory FF', '651 Walnut St, Springfield, IL 62732');
   385  INSERT INTO factories (factory_name, address) VALUES ('Factory GG', '671 Cherry St, Springfield, IL 62733'), ('Factory HH', '691 Elm St, Springfield, IL 62734');
   386  INSERT INTO factories (factory_name, address) VALUES ('Factory II', '711 Oak St, Springfield, IL 62735'), ('Factory JJ', '731 Pine St, Springfield, IL 62736');
   387  INSERT INTO factories (factory_name, address) VALUES ('Factory KK', '751 Birch St, Springfield, IL 62737'), ('Factory LL', '771 Cedar St, Springfield, IL 62738');
   388  INSERT INTO factories (factory_name, address) VALUES ('Factory MM', '791 Maple St, Springfield, IL 62739'), ('Factory NN', '811 Walnut St, Springfield, IL 62740');
   389  INSERT INTO factories (factory_name, address) VALUES ('Factory OO', '831 Cherry St, Springfield, IL 62741'), ('Factory PP', '851 Elm St, Springfield, IL 62742');
   390  INSERT INTO factories (factory_name, address) VALUES ('Factory QQ', '871 Oak St, Springfield, IL 62743'), ('Factory RR', '891 Pine St, Springfield, IL 62744');
   391  INSERT INTO factories (factory_name, address) VALUES ('Factory SS', '911 Birch St, Springfield, IL 62745'), ('Factory TT', '931 Cedar St, Springfield, IL 62746');
   392  INSERT INTO factories (factory_name, address) VALUES ('Factory UU', '951 Maple St, Springfield, IL 62747'), ('Factory VV', '971 Walnut St, Springfield, IL 62748');
   393  INSERT INTO factories (factory_name, address) VALUES ('Factory WW', '991 Cherry St, Springfield, IL 62749'), ('Factory XX', '1011 Elm St, Springfield, IL 62750');
   394  INSERT INTO factories (factory_name, address) VALUES ('Factory YY', '1031 Oak St, Springfield, IL 62751'), ('Factory ZZ', '1051 Pine St, Springfield, IL 62752');
   395  INSERT INTO factories (factory_name, address) VALUES ('Factory AAA', '1071 Birch St, Springfield, IL 62753'), ('Factory BBB', '1091 Cedar St, Springfield, IL 62754');
   396  INSERT INTO factories (factory_name, address) VALUES ('Factory CCC', '1111 Maple St, Springfield, IL 62755'), ('Factory DDD', '1131 Walnut St, Springfield, IL 62756');
   397  INSERT INTO factories (factory_name, address) VALUES ('Factory EEE', '1151 Cherry St, Springfield, IL 62757'), ('Factory FFF', '1171 Elm St, Springfield, IL 62758');
   398  INSERT INTO factories (factory_name, address) VALUES ('Factory GGG', '1191 Oak St, Springfield, IL 62759'), ('Factory HHH', '1211 Pine St, Springfield, IL 62760');
   399  INSERT INTO factories (factory_name, address) VALUES ('Factory III', '1231 Birch St, Springfield, IL 62761'), ('Factory JJJ', '1251 Cedar St, Springfield, IL 62762');
   400  INSERT INTO factories (factory_name, address) VALUES ('Factory KKKK', '1271 Maple St, Springfield, IL 62763'), ('Factory LLLLL', '1291 Walnut St, Springfield, IL 62764');
   401  INSERT INTO factories (factory_name, address) VALUES ('Factory MMM', '1311 Cherry St, Springfield, IL 62765'), ('Factory NNN', '1331 Elm St, Springfield, IL 62766');
   402  INSERT INTO factories (factory_name, address) VALUES ('Factory OOO', '1351 Oak St, Springfield, IL 62767'), ('Factory PPP', '1371 Pine St, Springfield, IL 62768');
   403  INSERT INTO factories (factory_name, address) VALUES ('Factory QQQ', '1391 Birch St, Springfield, IL 62769'), ('Factory RRR', '1411 Cedar St, Springfield, IL 62770');
   404  INSERT INTO factories (factory_name, address) VALUES ('Factory SSS', '1431 Maple St, Springfield, IL 62771'), ('Factory TTT', '1451 Walnut St, Springfield, IL 62772');
   405  INSERT INTO factories (factory_name, address) VALUES ('Factory UUU', '1471 Cherry St, Springfield, IL 62773'), ('Factory VVV', '1491 Elm St, Springfield, IL 62774');
   406  INSERT INTO factories (factory_name, address) VALUES ('Factory WWW', '1511 Oak St, Springfield, IL 62775'), ('Factory XXX', '1531 Pine St, Springfield, IL 62776');
   407  INSERT INTO factories (factory_name, address) VALUES ('Factory YYY', '1551 Birch St, Springfield, IL 62777'), ('Factory ZZZ', '1571 Cedar St, Springfield, IL 62778');
   408  INSERT INTO factories (factory_name, address) VALUES ('Factory AAAA', '1591 Maple St, Springfield, IL 62779'), ('Factory BBBB', '1611 Walnut St, Springfield, IL 62780');
   409  INSERT INTO factories (factory_name, address) VALUES ('Factory CCCC', '1631 Cherry St, Springfield, IL 62781'), ('Factory DDDD', '1651 Elm St, Springfield, IL 62782');
   410  INSERT INTO factories (factory_name, address) VALUES ('Factory EEEE', '1671 Oak St, Springfield, IL 62783'), ('Factory FFFF', '1691 Pine St, Springfield, IL 62784');
   411  INSERT INTO factories (factory_name, address) VALUES ('Factory GGGG', '1711 Birch St, Springfield, IL 62785'), ('Factory HHHH', '1731 Cedar St, Springfield, IL 62786');
   412  INSERT INTO factories (factory_name, address) VALUES ('Factory IIII', '1751 Maple St, Springfield, IL 62787'), ('Factory JJJJ', '1771 Walnut St, Springfield, IL 62788');
   413  INSERT INTO factories (factory_name, address) VALUES ('Factory KKKK', '1791 Cherry St, Springfield, IL 62789'), ('Factory LLLL', '1811 Elm St, Springfield, IL 62790');
   414  INSERT INTO factories (factory_name, address) VALUES ('Factory MMMM', '1831 Oak St, Springfield, IL 62791'), ('Factory NNNN', '1851 Pine St, Springfield, IL 62792');
   415  INSERT INTO factories (factory_name, address) VALUES ('Factory OOOO', '1871 Birch St, Springfield, IL 62793'), ('Factory PPPP', '1891 Cedar St, Springfield, IL 62794');
   416  INSERT INTO factories (factory_name, address) VALUES ('Factory QQQQ', '1911 Maple St, Springfield, IL 62795'), ('Factory RRRR', '1931 Walnut St, Springfield, IL 62796');
   417  INSERT INTO factories (factory_name, address) VALUES ('Factory SSSS', '1951 Cherry St, Springfield, IL 62797'), ('Factory TTTT', '1971 Elm St, Springfield, IL 62798');
   418  INSERT INTO factories (factory_name, address) VALUES ('Factory UUUU', '1991 Oak St, Springfield, IL 62799'), ('Factory VVVV', '2011 Pine St, Springfield, IL 62800');
   419  INSERT INTO factories (factory_name, address) VALUES ('Factory WWWW', '2031 Birch St, Springfield, IL 62801'), ('Factory XXXX', '2051 Cedar St, Springfield, IL 62802');
   420  
   421  select count(*) from test_snapshot_restore.factories;
   422  -- @session
   423  
   424  create snapshot snapshot_01 for account test_account;
   425  
   426  -- @session:id=4&user=test_account:test_user&password=111
   427  drop database test_snapshot_restore;
   428  drop database snapshot_read;
   429  -- @session
   430  
   431  restore account test_account from snapshot snapshot_01;
   432  
   433  -- @session:id=5&user=test_account:test_user&password=111
   434  use test_snapshot_restore;
   435  select count(*) from test_snapshot_restore.test_restore;
   436  select count(*) from test_snapshot_restore.test_restore_2;
   437  select count(*) from test_snapshot_restore.factories;
   438  
   439  use snapshot_read;
   440  select count(*) from snapshot_read.test_snapshot_read;
   441  select count(*) from snapshot_read.users;
   442  select count(*) from snapshot_read.students;
   443  -- @session
   444  
   445  
   446  drop account test_account;
   447  drop snapshot snapshot_01;
   448  
   449  
   450  -- sys account restore normal account to newAccount
   451  
   452  create account test_account admin_name = 'test_user' identified by '111';
   453  -- @session:id=6&user=test_account:test_user&password=111
   454  
   455  create database if not exists snapshot_read;
   456  use snapshot_read;
   457  create table test_snapshot_read (a int);
   458  insert into test_snapshot_read (a) values(1), (2), (3), (4), (5),(6), (7), (8), (9), (10), (11), (12),(13), (14), (15), (16), (17), (18), (19), (20),(21), (22), (23), (24), (25), (26), (27), (28), (29), (30),(31), (32), (33), (34), (35), (36), (37), (38), (39), (40),(41), (42), (43), (44), (45), (46), (47), (48), (49), (50),(51), (52), (53), (54), (55), (56), (57), (58), (59), (60),(61), (62), (63), (64), (65), (66), (67), (68), (69), (70),(71), (72), (73), (74), (75), (76), (77), (78), (79), (80), (81), (82), (83), (84), (85), (86), (87), (88), (89), (90),(91), (92), (93), (94), (95), (96), (97), (98), (99), (100);
   459  select count(*) from snapshot_read.test_snapshot_read;
   460  
   461  CREATE TABLE users (
   462      id INT AUTO_INCREMENT PRIMARY KEY,
   463      username VARCHAR(255) NOT NULL,
   464      email VARCHAR(255) NOT NULL UNIQUE,
   465      password VARCHAR(255) NOT NULL,
   466      created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
   467  );
   468  INSERT INTO users (username, email, password) VALUES ('john_doe', 'john@example.com', 'securepassword123');
   469  INSERT INTO users (username, email, password) VALUES ('jane_smith', 'jane.smith@example.com', 'password123'),('alice_jones', 'alice.jones@gmail.com', 'ilovecats'),('bob_brown', 'bob.brown@yahoo.com', 'mysecretpassword'),('charlie_lee', 'charlie.lee@protonmail.ch', 'secure123'),('diana_wilson', 'diana.wilson@outlook.com', 'D1anaPass');
   470  INSERT INTO users (username, email, password) VALUES ('emily_adams', 'emily.adams@icloud.com', 'Em1Ly123'), ('francis_nguyen', 'francis.nguyen@domain.com', 'fNguyenPass'), ('grace_parker', 'grace.parker@server.com', 'G1race123'), ('henry_miller', 'henry.miller@company.org', 'hMillerSecret'), ('isabella_grant', 'isabella.grant@university.edu', 'iGrantPass');
   471  
   472  select count(*) from snapshot_read.users;
   473  
   474  CREATE TABLE students (
   475      student_id INT PRIMARY KEY AUTO_INCREMENT,
   476      name VARCHAR(100) NOT NULL,
   477      age INT NOT NULL
   478  );
   479  
   480  INSERT INTO students (name, age) VALUES ('Alice', 20), ('Bob', 21), ('Charlie', 22), ('Diana', 23), ('Emily', 24);
   481  INSERT INTO students (name, age) VALUES ('Francis', 25), ('Grace', 26), ('Henry', 27), ('Isabella', 28), ('Jack', 29);
   482  INSERT INTO students (name, age) VALUES ('Katherine', 30), ('Liam', 31), ('Mia', 32), ('Noah', 33), ('Olivia', 34);
   483  INSERT INTO students (name, age) VALUES ('Penelope', 35), ('Quinn', 36), ('Ryan', 37), ('Sophia', 38), ('Thomas', 39);
   484  INSERT INTO students (name, age) VALUES ('Ursula', 40), ('Victor', 41), ('Wendy', 42), ('Xander', 43), ('Yvonne', 44);
   485  INSERT INTO students (name, age) VALUES ('Zachary', 45), ('Ava', 46), ('Benjamin', 47), ('Charlotte', 48), ('Daniel', 49);
   486  INSERT INTO students (name, age) VALUES ('Ella', 50), ('Finn', 51), ('Gabriella', 52), ('Henry', 53), ('Isabella', 54);
   487  INSERT INTO students (name, age) VALUES ('Jack', 55), ('Katherine', 56), ('Liam', 57), ('Mia', 58), ('Noah', 59);
   488  INSERT INTO students (name, age) VALUES ('Olivia', 60), ('Penelope', 61), ('Quinn', 62), ('Ryan', 63), ('Sophia', 64);
   489  INSERT INTO students (name, age) VALUES ('Thomas', 65), ('Ursula', 66), ('Victor', 67), ('Wendy', 68), ('Xander', 69);
   490  
   491  select count(*) from snapshot_read.students;
   492  
   493  create database if not exists test_snapshot_restore;
   494  use test_snapshot_restore;
   495  
   496  create table test_restore (a int);
   497  insert into test_restore (a) values(1), (2), (3), (4), (5),(6), (7), (8), (9), (10), (11), (12),(13), (14), (15), (16), (17), (18), (19), (20),(21), (22), (23), (24), (25), (26), (27), (28), (29), (30),(31), (32), (33), (34), (35), (36), (37), (38), (39), (40),(41), (42), (43), (44), (45), (46), (47), (48), (49), (50),(51), (52), (53), (54), (55), (56), (57), (58), (59), (60),(61), (62), (63), (64), (65), (66), (67), (68), (69), (70),(71), (72), (73), (74), (75), (76), (77), (78), (79), (80), (81), (82), (83), (84), (85), (86), (87), (88), (89), (90),(91), (92), (93), (94), (95), (96), (97), (98), (99), (100);
   498  select count(*) from test_snapshot_restore.test_restore;
   499  
   500  CREATE TABLE test_restore_2 (
   501      id INT PRIMARY KEY AUTO_INCREMENT,
   502      name VARCHAR(100) NOT NULL,
   503      age INT NOT NULL
   504  );
   505  insert into test_restore_2 (name, age) values('Alice', 20), ('Bob', 21), ('Charlie', 22), ('Diana', 23), ('Emily', 24);
   506  insert into test_restore_2 (name, age) values('Francis', 25), ('Grace', 26), ('Henry', 27), ('Isabella', 28), ('Jack', 29);
   507  insert into test_restore_2 (name, age) values('Katherine', 30), ('Liam', 31), ('Mia', 32), ('Noah', 33), ('Olivia', 34);
   508  insert into test_restore_2 (name, age) values('Penelope', 35), ('Quinn', 36), ('Ryan', 37), ('Sophia', 38), ('Thomas', 39);
   509  insert into test_restore_2 (name, age) values('Ursula', 40), ('Victor', 41), ('Wendy', 42), ('Xander', 43), ('Yvonne', 44);
   510  insert into test_restore_2 (name, age) values('Zachary', 45), ('Ava', 46), ('Benjamin', 47), ('Charlotte', 48), ('Daniel', 49);
   511  insert into test_restore_2 (name, age) values('Ella', 50), ('Finn', 51), ('Gabriella', 52), ('Henry', 53), ('Isabella', 54);
   512  insert into test_restore_2 (name, age) values('Jack', 55), ('Katherine', 56), ('Liam', 57), ('Mia', 58), ('Noah', 59);
   513  insert into test_restore_2 (name, age) values('Olivia', 60), ('Penelope', 61), ('Quinn', 62), ('Ryan', 63), ('Sophia', 64);
   514  insert into test_restore_2 (name, age) values('Thomas', 65), ('Ursula', 66), ('Victor', 67), ('Wendy', 68), ('Xander', 69);
   515  
   516  select count(*) from test_snapshot_restore.test_restore_2;
   517  
   518  CREATE TABLE factories (
   519      factory_name VARCHAR(255) PRIMARY KEY,
   520      address TEXT NOT NULL
   521  );
   522  
   523  INSERT INTO factories (factory_name, address) VALUES ('Factory A', '123 Main St, Springfield, IL 62701'), ('Factory B', '456 Elm St, Springfield, IL 62702');
   524  INSERT INTO factories (factory_name, address) VALUES ('Factory C', '789 Oak St, Springfield, IL 62703'), ('Factory D', '101 Pine St, Springfield, IL 62704');
   525  INSERT INTO factories (factory_name, address) VALUES ('Factory E', '112 Birch St, Springfield, IL 62705'), ('Factory F', '131 Cedar St, Springfield, IL 62706');
   526  INSERT INTO factories (factory_name, address) VALUES ('Factory G', '151 Maple St, Springfield, IL 62707'), ('Factory H', '171 Walnut St, Springfield, IL 62708');
   527  INSERT INTO factories (factory_name, address) VALUES ('Factory I', '191 Cherry St, Springfield, IL 62709'), ('Factory J', '211 Elm St, Springfield, IL 62710');
   528  INSERT INTO factories (factory_name, address) VALUES ('Factory K', '231 Oak St, Springfield, IL 62711'), ('Factory LLLLL2', '251 Pine St, Springfield, IL 62712');
   529  INSERT INTO factories (factory_name, address) VALUES ('Factory M', '271 Birch St, Springfield, IL 62713'), ('Factory N', '291 Cedar St, Springfield, IL 62714');
   530  INSERT INTO factories (factory_name, address) VALUES ('Factory O', '311 Maple St, Springfield, IL 62715'), ('Factory P', '331 Walnut St, Springfield, IL 62716');
   531  INSERT INTO factories (factory_name, address) VALUES ('Factory Q', '351 Cherry St, Springfield, IL 62717'), ('Factory R', '371 Elm St, Springfield, IL 62718');
   532  INSERT INTO factories (factory_name, address) VALUES ('Factory S', '391 Oak St, Springfield, IL 62719'), ('Factory T', '411 Pine St, Springfield, IL 62720');
   533  INSERT INTO factories (factory_name, address) VALUES ('Factory U', '431 Birch St, Springfield, IL 62721'), ('Factory V', '451 Cedar St, Springfield, IL 62722');
   534  INSERT INTO factories (factory_name, address) VALUES ('Factory W', '471 Maple St, Springfield, IL 62723'), ('Factory X', '491 Walnut St, Springfield, IL 62724');
   535  INSERT INTO factories (factory_name, address) VALUES ('Factory Y', '511 Cherry St, Springfield, IL 62725'), ('Factory Z', '531 Elm St, Springfield, IL 62726');
   536  INSERT INTO factories (factory_name, address) VALUES ('Factory AA', '551 Oak St, Springfield, IL 62727'), ('Factory BB', '571 Pine St, Springfield, IL 62728');
   537  INSERT INTO factories (factory_name, address) VALUES ('Factory CC', '591 Birch St, Springfield, IL 62729'), ('Factory DD', '611 Cedar St, Springfield, IL 62730');
   538  INSERT INTO factories (factory_name, address) VALUES ('Factory EE', '631 Maple St, Springfield, IL 62731'), ('Factory FF', '651 Walnut St, Springfield, IL 62732');
   539  INSERT INTO factories (factory_name, address) VALUES ('Factory GG', '671 Cherry St, Springfield, IL 62733'), ('Factory HH', '691 Elm St, Springfield, IL 62734');
   540  INSERT INTO factories (factory_name, address) VALUES ('Factory II', '711 Oak St, Springfield, IL 62735'), ('Factory JJ', '731 Pine St, Springfield, IL 62736');
   541  INSERT INTO factories (factory_name, address) VALUES ('Factory KK', '751 Birch St, Springfield, IL 62737'), ('Factory LL', '771 Cedar St, Springfield, IL 62738');
   542  INSERT INTO factories (factory_name, address) VALUES ('Factory MM', '791 Maple St, Springfield, IL 62739'), ('Factory NN', '811 Walnut St, Springfield, IL 62740');
   543  INSERT INTO factories (factory_name, address) VALUES ('Factory OO', '831 Cherry St, Springfield, IL 62741'), ('Factory PP', '851 Elm St, Springfield, IL 62742');
   544  INSERT INTO factories (factory_name, address) VALUES ('Factory QQ', '871 Oak St, Springfield, IL 62743'), ('Factory RR', '891 Pine St, Springfield, IL 62744');
   545  INSERT INTO factories (factory_name, address) VALUES ('Factory SS', '911 Birch St, Springfield, IL 62745'), ('Factory TT', '931 Cedar St, Springfield, IL 62746');
   546  INSERT INTO factories (factory_name, address) VALUES ('Factory UU', '951 Maple St, Springfield, IL 62747'), ('Factory VV', '971 Walnut St, Springfield, IL 62748');
   547  INSERT INTO factories (factory_name, address) VALUES ('Factory WW', '991 Cherry St, Springfield, IL 62749'), ('Factory XX', '1011 Elm St, Springfield, IL 62750');
   548  INSERT INTO factories (factory_name, address) VALUES ('Factory YY', '1031 Oak St, Springfield, IL 62751'), ('Factory ZZ', '1051 Pine St, Springfield, IL 62752');
   549  INSERT INTO factories (factory_name, address) VALUES ('Factory AAA', '1071 Birch St, Springfield, IL 62753'), ('Factory BBB', '1091 Cedar St, Springfield, IL 62754');
   550  INSERT INTO factories (factory_name, address) VALUES ('Factory CCC', '1111 Maple St, Springfield, IL 62755'), ('Factory DDD', '1131 Walnut St, Springfield, IL 62756');
   551  INSERT INTO factories (factory_name, address) VALUES ('Factory EEE', '1151 Cherry St, Springfield, IL 62757'), ('Factory FFF', '1171 Elm St, Springfield, IL 62758');
   552  INSERT INTO factories (factory_name, address) VALUES ('Factory GGG', '1191 Oak St, Springfield, IL 62759'), ('Factory HHH', '1211 Pine St, Springfield, IL 62760');
   553  INSERT INTO factories (factory_name, address) VALUES ('Factory III', '1231 Birch St, Springfield, IL 62761'), ('Factory JJJ', '1251 Cedar St, Springfield, IL 62762');
   554  INSERT INTO factories (factory_name, address) VALUES ('Factory KKKK', '1271 Maple St, Springfield, IL 62763'), ('Factory LLLLLL', '1291 Walnut St, Springfield, IL 62764');
   555  INSERT INTO factories (factory_name, address) VALUES ('Factory MMM', '1311 Cherry St, Springfield, IL 62765'), ('Factory NNN', '1331 Elm St, Springfield, IL 62766');
   556  INSERT INTO factories (factory_name, address) VALUES ('Factory OOO', '1351 Oak St, Springfield, IL 62767'), ('Factory PPP', '1371 Pine St, Springfield, IL 62768');
   557  INSERT INTO factories (factory_name, address) VALUES ('Factory QQQ', '1391 Birch St, Springfield, IL 62769'), ('Factory RRR', '1411 Cedar St, Springfield, IL 62770');
   558  INSERT INTO factories (factory_name, address) VALUES ('Factory SSS', '1431 Maple St, Springfield, IL 62771'), ('Factory TTT', '1451 Walnut St, Springfield, IL 62772');
   559  INSERT INTO factories (factory_name, address) VALUES ('Factory UUU', '1471 Cherry St, Springfield, IL 62773'), ('Factory VVV', '1491 Elm St, Springfield, IL 62774');
   560  INSERT INTO factories (factory_name, address) VALUES ('Factory WWW', '1511 Oak St, Springfield, IL 62775'), ('Factory XXX', '1531 Pine St, Springfield, IL 62776');
   561  INSERT INTO factories (factory_name, address) VALUES ('Factory YYY', '1551 Birch St, Springfield, IL 62777'), ('Factory ZZZ', '1571 Cedar St, Springfield, IL 62778');
   562  INSERT INTO factories (factory_name, address) VALUES ('Factory AAAA', '1591 Maple St, Springfield, IL 62779'), ('Factory BBBB', '1611 Walnut St, Springfield, IL 62780');
   563  INSERT INTO factories (factory_name, address) VALUES ('Factory CCCC', '1631 Cherry St, Springfield, IL 62781'), ('Factory DDDD', '1651 Elm St, Springfield, IL 62782');
   564  INSERT INTO factories (factory_name, address) VALUES ('Factory EEEE', '1671 Oak St, Springfield, IL 62783'), ('Factory FFFF', '1691 Pine St, Springfield, IL 62784');
   565  INSERT INTO factories (factory_name, address) VALUES ('Factory GGGG', '1711 Birch St, Springfield, IL 62785'), ('Factory HHHH', '1731 Cedar St, Springfield, IL 62786');
   566  INSERT INTO factories (factory_name, address) VALUES ('Factory IIII', '1751 Maple St, Springfield, IL 62787'), ('Factory JJJJ', '1771 Walnut St, Springfield, IL 62788');
   567  INSERT INTO factories (factory_name, address) VALUES ('Factory KKKK', '1791 Cherry St, Springfield, IL 62789'), ('Factory LLLL', '1811 Elm St, Springfield, IL 62790');
   568  INSERT INTO factories (factory_name, address) VALUES ('Factory MMMM', '1831 Oak St, Springfield, IL 62791'), ('Factory NNNN', '1851 Pine St, Springfield, IL 62792');
   569  INSERT INTO factories (factory_name, address) VALUES ('Factory OOOO', '1871 Birch St, Springfield, IL 62793'), ('Factory PPPP', '1891 Cedar St, Springfield, IL 62794');
   570  INSERT INTO factories (factory_name, address) VALUES ('Factory QQQQ', '1911 Maple St, Springfield, IL 62795'), ('Factory RRRR', '1931 Walnut St, Springfield, IL 62796');
   571  INSERT INTO factories (factory_name, address) VALUES ('Factory SSSS', '1951 Cherry St, Springfield, IL 62797'), ('Factory TTTT', '1971 Elm St, Springfield, IL 62798');
   572  INSERT INTO factories (factory_name, address) VALUES ('Factory UUUU', '1991 Oak St, Springfield, IL 62799'), ('Factory VVVV', '2011 Pine St, Springfield, IL 62800');
   573  INSERT INTO factories (factory_name, address) VALUES ('Factory WWWW', '2031 Birch St, Springfield, IL 62801'), ('Factory XXXX', '2051 Cedar St, Springfield, IL 62802');
   574  
   575  select count(*) from test_snapshot_restore.factories;
   576  
   577  -- @session
   578  
   579  create snapshot snapshot_01 for account test_account;
   580  
   581  -- @session:id=7&user=test_account:test_user&password=111
   582  drop database test_snapshot_restore;
   583  drop database snapshot_read;
   584  -- @session
   585  
   586  
   587  restore account test_account from snapshot snapshot_01;
   588  -- @session:id=8&user=test_account:test_user&password=111
   589  use test_snapshot_restore;
   590  select count(*) from test_snapshot_restore.test_restore;
   591  select count(*) from test_snapshot_restore.test_restore_2;
   592  select count(*) from test_snapshot_restore.factories;
   593  
   594  use snapshot_read;
   595  select count(*) from snapshot_read.test_snapshot_read;
   596  select count(*) from snapshot_read.users;
   597  select count(*) from snapshot_read.students;
   598  -- @session
   599  
   600  create account test_account_01 admin_name = 'test_user' identified by '111';
   601  restore account test_account from snapshot snapshot_01 to account test_account_01 ;
   602  
   603  -- @session:id=8&user=test_account_01:test_user&password=111
   604  use test_snapshot_restore;
   605  select count(*) from test_snapshot_restore.test_restore;
   606  select count(*) from test_snapshot_restore.test_restore_2;
   607  select count(*) from test_snapshot_restore.factories;
   608  
   609  use snapshot_read;
   610  select count(*) from snapshot_read.test_snapshot_read;
   611  select count(*) from snapshot_read.users;
   612  select count(*) from snapshot_read.students;
   613  -- @session
   614  
   615  drop account test_account;
   616  drop account test_account_01;
   617  drop snapshot snapshot_01;