github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/snapshot/snapshot_restore_table_level.sql (about) 1 -- table level noraml 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 create snapshot snapshot_01 for account sys; 8 delete from test_snapshot_read where a <= 50; 9 select count(*) from snapshot_read.test_snapshot_read; 10 select count(*) from snapshot_read.test_snapshot_read {snapshot = 'snapshot_01'}; 11 create snapshot snapshot_02 for account sys; 12 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); 13 select count(*) from snapshot_read.test_snapshot_read; 14 select count(*) from snapshot_read.test_snapshot_read{snapshot = 'snapshot_02'}; 15 restore account sys database snapshot_read table test_snapshot_read from snapshot snapshot_01; 16 select count(*) from snapshot_read.test_snapshot_read; 17 restore account sys database snapshot_read table test_snapshot_read from snapshot snapshot_02; 18 select count(*) from snapshot_read.test_snapshot_read; 19 drop database snapshot_read; 20 drop snapshot snapshot_01; 21 drop snapshot snapshot_02; 22 23 24 -- table level pk col 25 create database if not exists snapshot_read; 26 use snapshot_read; 27 CREATE TABLE users ( 28 id INT AUTO_INCREMENT PRIMARY KEY, 29 username VARCHAR(255) NOT NULL, 30 email VARCHAR(255) NOT NULL UNIQUE, 31 password VARCHAR(255) NOT NULL, 32 created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP 33 ); 34 INSERT INTO users (username, email, password) VALUES ('john_doe', 'john@example.com', 'securepassword123'); 35 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'); 36 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'); 37 38 select id, username, email from snapshot_read.users where email = 'john@example.com'; 39 select id, username, email from snapshot_read.users where email = 'alice.jones@gmail.com'; 40 41 create snapshot sp_01 for account sys; 42 43 DELETE FROM users where email = 'john@example.com'; 44 UPDATE users SET password = 'newsecurepassword123' WHERE email = 'alice.jones@gmail.com'; 45 46 select id, username, email from snapshot_read.users where email = 'john@example.com'; 47 select id, username, email from snapshot_read.users where email = 'alice.jones@gmail.com'; 48 49 restore account sys database snapshot_read table users from snapshot sp_01; 50 select id, username, email from snapshot_read.users where email = 'john@example.com'; 51 select id, username, email from snapshot_read.users where email = 'alice.jones@gmail.com'; 52 53 54 CREATE TABLE new_users ( 55 id INT AUTO_INCREMENT PRIMARY KEY, 56 username VARCHAR(255) NOT NULL, 57 email VARCHAR(255) NOT NULL UNIQUE, 58 password VARCHAR(255) NOT NULL, 59 created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP 60 ); 61 62 insert into new_users select * from snapshot_read.users where email = 'john@example.com'; 63 insert into new_users select * from snapshot_read.users where email = 'alice.jones@gmail.com'; 64 65 select id, username, email from snapshot_read.new_users; 66 67 drop snapshot sp_01; 68 drop database if exists snapshot_read; 69 70 -- table level drop table 71 create database if not exists snapshot_read; 72 use snapshot_read; 73 CREATE TABLE users ( 74 id INT AUTO_INCREMENT PRIMARY KEY, 75 username VARCHAR(255) NOT NULL, 76 email VARCHAR(255) NOT NULL UNIQUE, 77 password VARCHAR(255) NOT NULL, 78 created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP 79 ); 80 INSERT INTO users (username, email, password) VALUES ('john_doe', 'john@example.com', 'securepassword123'); 81 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'); 82 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'); 83 84 select count(*) from snapshot_read.users; 85 create snapshot sp_01 for account sys; 86 drop table users; 87 select count(*) from snapshot_read.users; 88 restore account sys database snapshot_read table users from snapshot sp_01; 89 select count(*) from snapshot_read.users; 90 drop snapshot sp_01; 91 drop database if exists snapshot_read; 92 93 -- table level drop database 94 create database if not exists snapshot_read; 95 use snapshot_read; 96 CREATE TABLE users ( 97 id INT AUTO_INCREMENT PRIMARY KEY, 98 username VARCHAR(255) NOT NULL, 99 email VARCHAR(255) NOT NULL UNIQUE, 100 password VARCHAR(255) NOT NULL, 101 created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP 102 ); 103 INSERT INTO users (username, email, password) VALUES ('john_doe', 'john@example.com', 'securepassword123'); 104 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'); 105 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'); 106 107 select count(*) from snapshot_read.users; 108 create snapshot sp_01 for account sys; 109 drop database snapshot_read; 110 select count(*) from snapshot_read.users; 111 restore account sys database snapshot_read table users from snapshot sp_01; 112 select count(*) from snapshot_read.users; 113 drop snapshot sp_01; 114 drop database if exists snapshot_read; 115 116 117 -- normal account 118 create account test_account admin_name = 'test_user' identified by '111'; 119 -- @session:id=2&user=test_account:test_user&password=111 120 -- table level noraml 121 create database if not exists snapshot_read; 122 use snapshot_read; 123 create table test_snapshot_read (a int); 124 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); 125 select count(*) from snapshot_read.test_snapshot_read; 126 create snapshot snapshot_01 for account test_account; 127 delete from test_snapshot_read where a <= 50; 128 select count(*) from snapshot_read.test_snapshot_read; 129 select count(*) from snapshot_read.test_snapshot_read {snapshot = 'snapshot_01'}; 130 create snapshot snapshot_02 for account test_account; 131 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); 132 select count(*) from snapshot_read.test_snapshot_read; 133 select count(*) from snapshot_read.test_snapshot_read{snapshot = 'snapshot_02'}; 134 restore account test_account database snapshot_read table test_snapshot_read from snapshot snapshot_01; 135 select count(*) from snapshot_read.test_snapshot_read; 136 restore account test_account database snapshot_read table test_snapshot_read from snapshot snapshot_02; 137 select count(*) from snapshot_read.test_snapshot_read; 138 drop database snapshot_read; 139 drop snapshot snapshot_01; 140 drop snapshot snapshot_02; 141 142 143 -- table level pk col 144 create database if not exists snapshot_read; 145 use snapshot_read; 146 CREATE TABLE users ( 147 id INT AUTO_INCREMENT PRIMARY KEY, 148 username VARCHAR(255) NOT NULL, 149 email VARCHAR(255) NOT NULL UNIQUE, 150 password VARCHAR(255) NOT NULL, 151 created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP 152 ); 153 INSERT INTO users (username, email, password) VALUES ('john_doe', 'john@example.com', 'securepassword123'); 154 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'); 155 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'); 156 157 select id, username, email from snapshot_read.users where email = 'john@example.com'; 158 select id, username, email from snapshot_read.users where email = 'alice.jones@gmail.com'; 159 160 create snapshot sp_01 for account test_account; 161 162 DELETE FROM users where email = 'john@example.com'; 163 UPDATE users SET password = 'newsecurepassword123' WHERE email = 'alice.jones@gmail.com'; 164 165 select id, username, email from snapshot_read.users where email = 'john@example.com'; 166 select id, username, email from snapshot_read.users where email = 'alice.jones@gmail.com'; 167 168 restore account test_account database snapshot_read table users from snapshot sp_01; 169 select id, username, email from snapshot_read.users where email = 'john@example.com'; 170 select id, username, email from snapshot_read.users where email = 'alice.jones@gmail.com'; 171 172 173 CREATE TABLE new_users ( 174 id INT AUTO_INCREMENT PRIMARY KEY, 175 username VARCHAR(255) NOT NULL, 176 email VARCHAR(255) NOT NULL UNIQUE, 177 password VARCHAR(255) NOT NULL, 178 created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP 179 ); 180 181 insert into new_users select * from snapshot_read.users where email = 'john@example.com'; 182 insert into new_users select * from snapshot_read.users where email = 'alice.jones@gmail.com'; 183 184 select id, username, email from snapshot_read.new_users; 185 186 drop snapshot sp_01; 187 drop database if exists snapshot_read; 188 189 -- table level drop table 190 create database if not exists snapshot_read; 191 use snapshot_read; 192 CREATE TABLE users ( 193 id INT AUTO_INCREMENT PRIMARY KEY, 194 username VARCHAR(255) NOT NULL, 195 email VARCHAR(255) NOT NULL UNIQUE, 196 password VARCHAR(255) NOT NULL, 197 created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP 198 ); 199 INSERT INTO users (username, email, password) VALUES ('john_doe', 'john@example.com', 'securepassword123'); 200 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'); 201 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'); 202 203 select count(*) from snapshot_read.users; 204 create snapshot sp_01 for account test_account; 205 drop table users; 206 select count(*) from snapshot_read.users; 207 restore account test_account database snapshot_read table users from snapshot sp_01; 208 select count(*) from snapshot_read.users; 209 drop snapshot sp_01; 210 drop database if exists snapshot_read; 211 212 -- table level drop database 213 create database if not exists snapshot_read; 214 use snapshot_read; 215 CREATE TABLE users ( 216 id INT AUTO_INCREMENT PRIMARY KEY, 217 username VARCHAR(255) NOT NULL, 218 email VARCHAR(255) NOT NULL UNIQUE, 219 password VARCHAR(255) NOT NULL, 220 created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP 221 ); 222 INSERT INTO users (username, email, password) VALUES ('john_doe', 'john@example.com', 'securepassword123'); 223 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'); 224 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'); 225 226 select count(*) from snapshot_read.users; 227 create snapshot sp_01 for account test_account; 228 drop database snapshot_read; 229 select count(*) from snapshot_read.users; 230 restore account test_account database snapshot_read table users from snapshot sp_01; 231 select count(*) from snapshot_read.users; 232 drop snapshot sp_01; 233 drop database if exists snapshot_read; 234 235 236 -- sys account restore normal account 237 create account test_account admin_name = 'test_user' identified by '111'; 238 -- @session:id=3&user=test_account:test_user&password=111 239 create database if not exists snapshot_read; 240 use snapshot_read; 241 create table test_snapshot_read (a int); 242 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); 243 select count(*) from snapshot_read.test_snapshot_read; 244 245 CREATE TABLE users ( 246 id INT AUTO_INCREMENT PRIMARY KEY, 247 username VARCHAR(255) NOT NULL, 248 email VARCHAR(255) NOT NULL UNIQUE, 249 password VARCHAR(255) NOT NULL, 250 created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP 251 ); 252 INSERT INTO users (username, email, password) VALUES ('john_doe', 'john@example.com', 'securepassword123'); 253 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'); 254 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'); 255 256 select count(*) from snapshot_read.users; 257 -- @session 258 259 create snapshot sp_01 for account test_account; 260 261 -- @session:id=4&user=test_account:test_user&password=111 262 DELETE FROM snapshot_read.users; 263 select count(*) from snapshot_read.users; 264 -- @session 265 266 restore account test_account database snapshot_read table users from snapshot sp_01; 267 268 -- @session:id=5&user=test_account:test_user&password=111 269 select count(*) from snapshot_read.users; 270 -- @session 271 272 drop snapshot sp_01; 273 drop account test_account; 274 275 276 create database if not exists snapshot_read; 277 use snapshot_read; 278 create table test_snapshot_read (a int); 279 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); 280 select count(*) from snapshot_read.test_snapshot_read; 281 CREATE TABLE users ( 282 id INT AUTO_INCREMENT PRIMARY KEY, 283 username VARCHAR(255) NOT NULL, 284 email VARCHAR(255) NOT NULL UNIQUE, 285 password VARCHAR(255) NOT NULL, 286 created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP 287 ); 288 INSERT INTO users (username, email, password) VALUES ('john_doe', 'john@example.com', 'securepassword123'); 289 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'); 290 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'); 291 292 293 select count(*) from snapshot_read.users; 294 create snapshot sp_01 for account sys; 295 delete from test_snapshot_read where a <= 50; 296 select count(*) from snapshot_read.test_snapshot_read; 297 298 restore account sys database snapshot_read table test_snapshot_read from snapshot sp_01; 299 select count(*) from snapshot_read.test_snapshot_read; 300 301 drop database snapshot_read; 302 drop snapshot sp_01; 303 304 305 -- sys account restore normal account 306 create account test_account admin_name = 'test_user' identified by '111'; 307 -- @session:id=6&user=test_account:test_user&password=111 308 create database if not exists snapshot_read; 309 use snapshot_read; 310 create table test_snapshot_read (a int); 311 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); 312 select count(*) from snapshot_read.test_snapshot_read; 313 314 CREATE TABLE users ( 315 id INT AUTO_INCREMENT PRIMARY KEY, 316 username VARCHAR(255) NOT NULL, 317 email VARCHAR(255) NOT NULL UNIQUE, 318 password VARCHAR(255) NOT NULL, 319 created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP 320 ); 321 INSERT INTO users (username, email, password) VALUES ('john_doe', 'john@example.com', 'securepassword123'); 322 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'); 323 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'); 324 325 select count(*) from snapshot_read.users; 326 -- @session 327 328 create snapshot sp_01 for account test_account; 329 330 -- @session:id=7&user=test_account:test_user&password=111 331 DELETE FROM snapshot_read.users; 332 select count(*) from snapshot_read.users; 333 -- @session 334 335 create account test_account_2 admin_name = 'test_user' identified by '111'; 336 restore account test_account database snapshot_read table users from snapshot sp_01 to account test_account_2; 337 338 -- @session:id=8&user=test_account_2:test_user&password=111 339 select count(*) from snapshot_read.users; 340 -- @session 341 342 drop snapshot sp_01; 343 drop account test_account; 344 drop account test_account_2;