Debian Codegraph @

mysql-test/suite/encryption/r/rename_table.result

raw
1 #
2 # WL#12261 Control (enforce and disable) table encryption
3 #
4 # Pre-define user u1, which is used in different tests below.
5 CREATE USER u1@localhost;
6 GRANT ALL ON db1.* TO u1@localhost;
7 GRANT ALL ON db2.* TO u1@localhost;
8 GRANT ALL ON sch1.* TO u1@localhost;
9 GRANT ALL ON sch2.* TO u1@localhost;
10 GRANT CREATE TABLESPACE, PROCESS, SYSTEM_VARIABLES_ADMIN ON *.* TO u1@localhost;
11 SET GLOBAL debug= '+d,skip_table_encryption_admin_check_for_set';
12 # The test cases run RENAME TABLE to move tables from one database
13 # to another, with tables using file-per-table or general
14 # tablespace. And these operations are run in below configuration,
15 #
16 # - Setting table_encryption_privilege_check to true/false.
17 # - Setting per database default encryption to 'y' and 'n'
18 # - Setting table's encryption mode to 'y' and 'n'.
19 # - With and without user holding TABLE_ENCRYPTION_ADMIN privilege.
20 # -
21 # - Check for warnings generated.
22 #
23 `````````````````````````````````````````````````````````
24 # Test using innodb_file_per_table tablespace.
25 `````````````````````````````````````````````````````````
26 # table_encryption_privilege_check=false
27 # [ALTER TABLE ... RENAME ...] Case 1 )
28 `````````````````````````````````````````````````````````
29 CREATE DATABASE db1 DEFAULT ENCRYPTION='y';
30 CREATE DATABASE db2 DEFAULT ENCRYPTION='n';
31 CREATE DATABASE sch1 DEFAULT ENCRYPTION='y';
32 CREATE DATABASE sch2 DEFAULT ENCRYPTION='n';
33 CREATE TABLE db1.fpt1 (f1 int) ENCRYPTION='n';
34 Warnings:
35 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
36 CREATE TABLE db1.fpt2 (f1 int) ENCRYPTION='n';
37 Warnings:
38 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
39 CREATE TABLE db1.ts1 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='n';
40 Warnings:
41 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
42 CREATE TABLE db1.ts2 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='n';
43 Warnings:
44 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
45 CREATE TABLE db2.fpt1 (f1 int) ENCRYPTION='n';
46 CREATE TABLE db2.fpt2 (f1 int) ENCRYPTION='n';
47 CREATE TABLE db2.ts1 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='n';
48 CREATE TABLE db2.ts2 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='n';
49 CREATE TABLE sch1.fpt (f1 int) ENCRYPTION='n';
50 Warnings:
51 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
52 CREATE TABLE sch1.ts (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='n';
53 Warnings:
54 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
55 CREATE TABLE sch2.fpt (f1 int) ENCRYPTION='n';
56 CREATE TABLE sch2.ts (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='n';
57 SET GLOBAL table_encryption_privilege_check=false;
58 # 1.1.
59 # Rename table using file-per-table tablespace from db encryption='y'
60 # to db with encryption='n' and viceversa
61 RENAME TABLE db1.fpt1 TO db2.fpt1_renamed;
62 RENAME TABLE db2.fpt1 TO db1.fpt1_renamed;
63 Warnings:
64 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
65 # 1.2.
66 # Rename table using general tablespace from db encryption='y'
67 # to db with encryption='n' and viceversa
68 RENAME TABLE db1.ts1 TO db2.ts1_rename;
69 RENAME TABLE db2.ts1 TO db1.ts1_rename;
70 Warnings:
71 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
72 # 1.3.
73 # Rename table (using file-per-table/general tablespace)
74 # within the database never fails.
75 RENAME TABLE sch1.fpt TO sch1.fpt_renamed;
76 RENAME TABLE sch1.ts TO sch1.ts_renamed;
77 RENAME TABLE sch2.fpt TO sch2.fpt_renamed;
78 RENAME TABLE sch2.ts TO sch2.ts_renamed;
79 SET GLOBAL table_encryption_privilege_check=false;
80 SHOW TABLES IN db1;
81 Tables_in_db1
82 fpt1_renamed
83 fpt2
84 ts1_rename
85 ts2
86 SHOW TABLES IN db2;
87 Tables_in_db2
88 fpt1_renamed
89 fpt2
90 ts1_rename
91 ts2
92 SHOW TABLES IN sch1;
93 Tables_in_sch1
94 fpt_renamed
95 ts_renamed
96 SHOW TABLES IN sch2;
97 Tables_in_sch2
98 fpt_renamed
99 ts_renamed
100 DROP DATABASE db1;
101 DROP DATABASE db2;
102 DROP DATABASE sch1;
103 DROP DATABASE sch2;
104 # [ALTER TABLE ... RENAME ...] Case 2 )
105 `````````````````````````````````````````````````````````
106 CREATE DATABASE db1 DEFAULT ENCRYPTION='y';
107 CREATE DATABASE db2 DEFAULT ENCRYPTION='n';
108 CREATE DATABASE sch1 DEFAULT ENCRYPTION='y';
109 CREATE DATABASE sch2 DEFAULT ENCRYPTION='n';
110 CREATE TABLE db1.fpt1 (f1 int) ENCRYPTION='y';
111 CREATE TABLE db1.fpt2 (f1 int) ENCRYPTION='y';
112 CREATE TABLE db1.ts1 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='y';
113 CREATE TABLE db1.ts2 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='y';
114 CREATE TABLE db2.fpt1 (f1 int) ENCRYPTION='y';
115 CREATE TABLE db2.fpt2 (f1 int) ENCRYPTION='y';
116 CREATE TABLE db2.ts1 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='y';
117 CREATE TABLE db2.ts2 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='y';
118 CREATE TABLE sch1.fpt (f1 int) ENCRYPTION='y';
119 CREATE TABLE sch1.ts (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='y';
120 CREATE TABLE sch2.fpt (f1 int) ENCRYPTION='y';
121 CREATE TABLE sch2.ts (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='y';
122 SET GLOBAL table_encryption_privilege_check=false;
123 # 2.1.
124 # Rename table using file-per-table tablespace from db encryption='y'
125 # to db with encryption='n' and viceversa
126 RENAME TABLE db1.fpt1 TO db2.fpt1_renamed;
127 RENAME TABLE db2.fpt1 TO db1.fpt1_renamed;
128 # 2.2.
129 # Rename table using general tablespace from db encryption='y'
130 # to db with encryption='n' and viceversa
131 RENAME TABLE db1.ts1 TO db2.ts1_rename;
132 RENAME TABLE db2.ts1 TO db1.ts1_rename;
133 # 2.3.
134 # Rename table (using file-per-table/general tablespace)
135 # within the database never fails.
136 RENAME TABLE sch1.fpt TO sch1.fpt_renamed;
137 RENAME TABLE sch1.ts TO sch1.ts_renamed;
138 RENAME TABLE sch2.fpt TO sch2.fpt_renamed;
139 RENAME TABLE sch2.ts TO sch2.ts_renamed;
140 SET GLOBAL table_encryption_privilege_check=false;
141 SHOW TABLES IN db1;
142 Tables_in_db1
143 fpt1_renamed
144 fpt2
145 ts1_rename
146 ts2
147 SHOW TABLES IN db2;
148 Tables_in_db2
149 fpt1_renamed
150 fpt2
151 ts1_rename
152 ts2
153 SHOW TABLES IN sch1;
154 Tables_in_sch1
155 fpt_renamed
156 ts_renamed
157 SHOW TABLES IN sch2;
158 Tables_in_sch2
159 fpt_renamed
160 ts_renamed
161 DROP DATABASE db1;
162 DROP DATABASE db2;
163 DROP DATABASE sch1;
164 DROP DATABASE sch2;
165 `````````````````````````````````````````````````````````
166 # table_encryption_privilege_check=true
167 `````````````````````````````````````````````````````````
168 # We expect failure when the table encryption does not match
169 # with default database encryption.
170 # [ALTER TABLE ... RENAME ...] Case 3 )
171 `````````````````````````````````````````````````````````
172 CREATE DATABASE db1 DEFAULT ENCRYPTION='y';
173 CREATE DATABASE db2 DEFAULT ENCRYPTION='n';
174 CREATE DATABASE sch1 DEFAULT ENCRYPTION='y';
175 CREATE DATABASE sch2 DEFAULT ENCRYPTION='n';
176 CREATE TABLE db1.fpt1 (f1 int) ENCRYPTION='n';
177 Warnings:
178 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
179 CREATE TABLE db1.fpt2 (f1 int) ENCRYPTION='n';
180 Warnings:
181 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
182 CREATE TABLE db1.ts1 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='n';
183 Warnings:
184 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
185 CREATE TABLE db1.ts2 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='n';
186 Warnings:
187 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
188 CREATE TABLE db2.fpt1 (f1 int) ENCRYPTION='n';
189 CREATE TABLE db2.fpt2 (f1 int) ENCRYPTION='n';
190 CREATE TABLE db2.ts1 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='n';
191 CREATE TABLE db2.ts2 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='n';
192 CREATE TABLE sch1.fpt (f1 int) ENCRYPTION='n';
193 Warnings:
194 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
195 CREATE TABLE sch1.ts (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='n';
196 Warnings:
197 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
198 CREATE TABLE sch2.fpt (f1 int) ENCRYPTION='n';
199 CREATE TABLE sch2.ts (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='n';
200 SET GLOBAL table_encryption_privilege_check=true;
201 # 3.1.
202 # Rename table using file-per-table tablespace from db encryption='y'
203 # to db with encryption='n' and viceversa
204 RENAME TABLE db1.fpt1 TO db2.fpt1_renamed;
205 RENAME TABLE db2.fpt1 TO db1.fpt1_renamed;
206 ERROR HY000: Table encryption differ from its database default encryption, and user doesn't have enough privilege.
207 # 3.2.
208 # Rename table using general tablespace from db encryption='y'
209 # to db with encryption='n' and viceversa
210 RENAME TABLE db1.ts1 TO db2.ts1_rename;
211 RENAME TABLE db2.ts1 TO db1.ts1_rename;
212 ERROR HY000: Table encryption differ from its database default encryption, and user doesn't have enough privilege.
213 # 3.3.
214 # Rename table (using file-per-table/general tablespace)
215 # within the database never fails.
216 RENAME TABLE sch1.fpt TO sch1.fpt_renamed;
217 RENAME TABLE sch1.ts TO sch1.ts_renamed;
218 RENAME TABLE sch2.fpt TO sch2.fpt_renamed;
219 RENAME TABLE sch2.ts TO sch2.ts_renamed;
220 SET GLOBAL table_encryption_privilege_check=false;
221 SHOW TABLES IN db1;
222 Tables_in_db1
223 fpt2
224 ts2
225 SHOW TABLES IN db2;
226 Tables_in_db2
227 fpt1
228 fpt1_renamed
229 fpt2
230 ts1
231 ts1_rename
232 ts2
233 SHOW TABLES IN sch1;
234 Tables_in_sch1
235 fpt_renamed
236 ts_renamed
237 SHOW TABLES IN sch2;
238 Tables_in_sch2
239 fpt_renamed
240 ts_renamed
241 DROP DATABASE db1;
242 DROP DATABASE db2;
243 DROP DATABASE sch1;
244 DROP DATABASE sch2;
245 # [ALTER TABLE ... RENAME ...] Case 4 )
246 `````````````````````````````````````````````````````````
247 CREATE DATABASE db1 DEFAULT ENCRYPTION='y';
248 CREATE DATABASE db2 DEFAULT ENCRYPTION='n';
249 CREATE DATABASE sch1 DEFAULT ENCRYPTION='y';
250 CREATE DATABASE sch2 DEFAULT ENCRYPTION='n';
251 CREATE TABLE db1.fpt1 (f1 int) ENCRYPTION='n';
252 Warnings:
253 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
254 CREATE TABLE db1.fpt2 (f1 int) ENCRYPTION='n';
255 Warnings:
256 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
257 CREATE TABLE db1.ts1 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='n';
258 Warnings:
259 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
260 CREATE TABLE db1.ts2 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='n';
261 Warnings:
262 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
263 CREATE TABLE db2.fpt1 (f1 int) ENCRYPTION='n';
264 CREATE TABLE db2.fpt2 (f1 int) ENCRYPTION='n';
265 CREATE TABLE db2.ts1 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='n';
266 CREATE TABLE db2.ts2 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='n';
267 CREATE TABLE sch1.fpt (f1 int) ENCRYPTION='n';
268 Warnings:
269 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
270 CREATE TABLE sch1.ts (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='n';
271 Warnings:
272 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
273 CREATE TABLE sch2.fpt (f1 int) ENCRYPTION='n';
274 CREATE TABLE sch2.ts (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='n';
275 SET GLOBAL table_encryption_privilege_check=true;
276 # Grant user with TABLE_ENCRYPTION_ADMIN
277 GRANT TABLE_ENCRYPTION_ADMIN ON *.* TO u1@localhost;
278 # 4.1.
279 # Rename table using file-per-table tablespace from db encryption='y'
280 # to db with encryption='n' and viceversa
281 ALTER TABLE db1.fpt1 RENAME db2.fpt1_renamed ;
282 ALTER TABLE db2.fpt1 RENAME db1.fpt1_renamed ;
283 # 4.2.
284 # Rename table using general tablespace from db encryption='y'
285 # to db with encryption='n' and viceversa
286 ALTER TABLE db1.ts1 RENAME db2.ts1_rename ;
287 ALTER TABLE db2.ts1 RENAME db1.ts1_rename ;
288 # 4.3.
289 # Rename table (using file-per-table/general tablespace)
290 # within the database never fails.
291 ALTER TABLE sch1.fpt RENAME sch1.fpt_renamed ;
292 ALTER TABLE sch1.ts RENAME sch1.ts_renamed ;
293 ALTER TABLE sch2.fpt RENAME sch2.fpt_renamed ;
294 ALTER TABLE sch2.ts RENAME sch2.ts_renamed ;
295 SET GLOBAL table_encryption_privilege_check=false;
296 SHOW TABLES IN db1;
297 Tables_in_db1
298 fpt1_renamed
299 fpt2
300 ts1_rename
301 ts2
302 SHOW TABLES IN db2;
303 Tables_in_db2
304 fpt1_renamed
305 fpt2
306 ts1_rename
307 ts2
308 SHOW TABLES IN sch1;
309 Tables_in_sch1
310 fpt_renamed
311 ts_renamed
312 SHOW TABLES IN sch2;
313 Tables_in_sch2
314 fpt_renamed
315 ts_renamed
316 # Revoke TABLE_ENCRYPTION_ADMIN from user.
317 REVOKE TABLE_ENCRYPTION_ADMIN ON *.* FROM u1@localhost;
318 DROP DATABASE db1;
319 DROP DATABASE db2;
320 DROP DATABASE sch1;
321 DROP DATABASE sch2;
322 `````````````````````````````````````````````````````````
323 # We expect failure when the table encryption does not match
324 # with default database encryption.
325 # [ALTER TABLE ... RENAME ...] Case 5 )
326 `````````````````````````````````````````````````````````
327 CREATE DATABASE db1 DEFAULT ENCRYPTION='y';
328 CREATE DATABASE db2 DEFAULT ENCRYPTION='n';
329 CREATE DATABASE sch1 DEFAULT ENCRYPTION='y';
330 CREATE DATABASE sch2 DEFAULT ENCRYPTION='n';
331 CREATE TABLE db1.fpt1 (f1 int) ENCRYPTION='y';
332 CREATE TABLE db1.fpt2 (f1 int) ENCRYPTION='y';
333 CREATE TABLE db1.ts1 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='y';
334 CREATE TABLE db1.ts2 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='y';
335 CREATE TABLE db2.fpt1 (f1 int) ENCRYPTION='y';
336 CREATE TABLE db2.fpt2 (f1 int) ENCRYPTION='y';
337 CREATE TABLE db2.ts1 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='y';
338 CREATE TABLE db2.ts2 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='y';
339 CREATE TABLE sch1.fpt (f1 int) ENCRYPTION='y';
340 CREATE TABLE sch1.ts (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='y';
341 CREATE TABLE sch2.fpt (f1 int) ENCRYPTION='y';
342 CREATE TABLE sch2.ts (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='y';
343 SET GLOBAL table_encryption_privilege_check=true;
344 # 5.1.
345 # Rename table using file-per-table tablespace from db encryption='y'
346 # to db with encryption='n' and viceversa
347 RENAME TABLE db1.fpt1 TO db2.fpt1_renamed;
348 ERROR HY000: Table encryption differ from its database default encryption, and user doesn't have enough privilege.
349 RENAME TABLE db2.fpt1 TO db1.fpt1_renamed;
350 # 5.2.
351 # Rename table using general tablespace from db encryption='y'
352 # to db with encryption='n' and viceversa
353 RENAME TABLE db1.ts1 TO db2.ts1_rename;
354 ERROR HY000: Table encryption differ from its database default encryption, and user doesn't have enough privilege.
355 RENAME TABLE db2.ts1 TO db1.ts1_rename;
356 # 5.3.
357 # Rename table (using file-per-table/general tablespace)
358 # within the database never fails.
359 RENAME TABLE sch1.fpt TO sch1.fpt_renamed;
360 RENAME TABLE sch1.ts TO sch1.ts_renamed;
361 RENAME TABLE sch2.fpt TO sch2.fpt_renamed;
362 RENAME TABLE sch2.ts TO sch2.ts_renamed;
363 SET GLOBAL table_encryption_privilege_check=false;
364 SHOW TABLES IN db1;
365 Tables_in_db1
366 fpt1
367 fpt1_renamed
368 fpt2
369 ts1
370 ts1_rename
371 ts2
372 SHOW TABLES IN db2;
373 Tables_in_db2
374 fpt2
375 ts2
376 SHOW TABLES IN sch1;
377 Tables_in_sch1
378 fpt_renamed
379 ts_renamed
380 SHOW TABLES IN sch2;
381 Tables_in_sch2
382 fpt_renamed
383 ts_renamed
384 DROP DATABASE db1;
385 DROP DATABASE db2;
386 DROP DATABASE sch1;
387 DROP DATABASE sch2;
388 # [ALTER TABLE ... RENAME ...] Case 6 )
389 `````````````````````````````````````````````````````````
390 CREATE DATABASE db1 DEFAULT ENCRYPTION='y';
391 CREATE DATABASE db2 DEFAULT ENCRYPTION='n';
392 CREATE DATABASE sch1 DEFAULT ENCRYPTION='y';
393 CREATE DATABASE sch2 DEFAULT ENCRYPTION='n';
394 CREATE TABLE db1.fpt1 (f1 int) ENCRYPTION='y';
395 CREATE TABLE db1.fpt2 (f1 int) ENCRYPTION='y';
396 CREATE TABLE db1.ts1 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='y';
397 CREATE TABLE db1.ts2 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='y';
398 CREATE TABLE db2.fpt1 (f1 int) ENCRYPTION='y';
399 CREATE TABLE db2.fpt2 (f1 int) ENCRYPTION='y';
400 CREATE TABLE db2.ts1 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='y';
401 CREATE TABLE db2.ts2 (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='y';
402 CREATE TABLE sch1.fpt (f1 int) ENCRYPTION='y';
403 CREATE TABLE sch1.ts (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='y';
404 CREATE TABLE sch2.fpt (f1 int) ENCRYPTION='y';
405 CREATE TABLE sch2.ts (f1 int) TABLESPACE=innodb_file_per_table ENCRYPTION='y';
406 SET GLOBAL table_encryption_privilege_check=true;
407 # Grant user with TABLE_ENCRYPTION_ADMIN
408 GRANT TABLE_ENCRYPTION_ADMIN ON *.* TO u1@localhost;
409 # 6.1.
410 # Rename table using file-per-table tablespace from db encryption='y'
411 # to db with encryption='n' and viceversa
412 ALTER TABLE db1.fpt1 RENAME db2.fpt1_renamed ;
413 ALTER TABLE db2.fpt1 RENAME db1.fpt1_renamed ;
414 # 6.2.
415 # Rename table using general tablespace from db encryption='y'
416 # to db with encryption='n' and viceversa
417 ALTER TABLE db1.ts1 RENAME db2.ts1_rename ;
418 ALTER TABLE db2.ts1 RENAME db1.ts1_rename ;
419 # 6.3.
420 # Rename table (using file-per-table/general tablespace)
421 # within the database never fails.
422 ALTER TABLE sch1.fpt RENAME sch1.fpt_renamed ;
423 ALTER TABLE sch1.ts RENAME sch1.ts_renamed ;
424 ALTER TABLE sch2.fpt RENAME sch2.fpt_renamed ;
425 ALTER TABLE sch2.ts RENAME sch2.ts_renamed ;
426 SET GLOBAL table_encryption_privilege_check=false;
427 SHOW TABLES IN db1;
428 Tables_in_db1
429 fpt1_renamed
430 fpt2
431 ts1_rename
432 ts2
433 SHOW TABLES IN db2;
434 Tables_in_db2
435 fpt1_renamed
436 fpt2
437 ts1_rename
438 ts2
439 SHOW TABLES IN sch1;
440 Tables_in_sch1
441 fpt_renamed
442 ts_renamed
443 SHOW TABLES IN sch2;
444 Tables_in_sch2
445 fpt_renamed
446 ts_renamed
447 # Revoke TABLE_ENCRYPTION_ADMIN from user.
448 REVOKE TABLE_ENCRYPTION_ADMIN ON *.* FROM u1@localhost;
449 DROP DATABASE db1;
450 DROP DATABASE db2;
451 DROP DATABASE sch1;
452 DROP DATABASE sch2;
453 `````````````````````````````````````````````````````````
454 # Test using general tablespace.
455 `````````````````````````````````````````````````````````
456 # table_encryption_privilege_check=false
457 # [ALTER TABLE ... RENAME ...] Case 7 )
458 `````````````````````````````````````````````````````````
459 CREATE DATABASE db1 DEFAULT ENCRYPTION='y';
460 CREATE DATABASE db2 DEFAULT ENCRYPTION='n';
461 CREATE DATABASE sch1 DEFAULT ENCRYPTION='y';
462 CREATE DATABASE sch2 DEFAULT ENCRYPTION='n';
463 CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.ibd' ENCRYPTION='n';
464 CREATE TABLE db1.fpt1 (f1 int) ENCRYPTION='n';
465 Warnings:
466 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
467 CREATE TABLE db1.fpt2 (f1 int) ENCRYPTION='n';
468 Warnings:
469 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
470 CREATE TABLE db1.ts1 (f1 int) TABLESPACE=ts1 ENCRYPTION='n';
471 Warnings:
472 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
473 CREATE TABLE db1.ts2 (f1 int) TABLESPACE=ts1 ENCRYPTION='n';
474 Warnings:
475 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
476 CREATE TABLE db2.fpt1 (f1 int) ENCRYPTION='n';
477 CREATE TABLE db2.fpt2 (f1 int) ENCRYPTION='n';
478 CREATE TABLE db2.ts1 (f1 int) TABLESPACE=ts1 ENCRYPTION='n';
479 CREATE TABLE db2.ts2 (f1 int) TABLESPACE=ts1 ENCRYPTION='n';
480 CREATE TABLE sch1.fpt (f1 int) ENCRYPTION='n';
481 Warnings:
482 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
483 CREATE TABLE sch1.ts (f1 int) TABLESPACE=ts1 ENCRYPTION='n';
484 Warnings:
485 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
486 CREATE TABLE sch2.fpt (f1 int) ENCRYPTION='n';
487 CREATE TABLE sch2.ts (f1 int) TABLESPACE=ts1 ENCRYPTION='n';
488 SET GLOBAL table_encryption_privilege_check=false;
489 # 7.1.
490 # Rename table using file-per-table tablespace from db encryption='y'
491 # to db with encryption='n' and viceversa
492 RENAME TABLE db1.fpt1 TO db2.fpt1_renamed;
493 RENAME TABLE db2.fpt1 TO db1.fpt1_renamed;
494 Warnings:
495 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
496 # 7.2.
497 # Rename table using general tablespace from db encryption='y'
498 # to db with encryption='n' and viceversa
499 RENAME TABLE db1.ts1 TO db2.ts1_rename;
500 RENAME TABLE db2.ts1 TO db1.ts1_rename;
501 Warnings:
502 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
503 # 7.3.
504 # Rename table (using file-per-table/general tablespace)
505 # within the database never fails.
506 RENAME TABLE sch1.fpt TO sch1.fpt_renamed;
507 RENAME TABLE sch1.ts TO sch1.ts_renamed;
508 RENAME TABLE sch2.fpt TO sch2.fpt_renamed;
509 RENAME TABLE sch2.ts TO sch2.ts_renamed;
510 SET GLOBAL table_encryption_privilege_check=false;
511 SHOW TABLES IN db1;
512 Tables_in_db1
513 fpt1_renamed
514 fpt2
515 ts1_rename
516 ts2
517 SHOW TABLES IN db2;
518 Tables_in_db2
519 fpt1_renamed
520 fpt2
521 ts1_rename
522 ts2
523 SHOW TABLES IN sch1;
524 Tables_in_sch1
525 fpt_renamed
526 ts_renamed
527 SHOW TABLES IN sch2;
528 Tables_in_sch2
529 fpt_renamed
530 ts_renamed
531 DROP DATABASE db1;
532 DROP DATABASE db2;
533 DROP DATABASE sch1;
534 DROP DATABASE sch2;
535 DROP TABLESPACE ts1;
536 # [ALTER TABLE ... RENAME ...] Case 8 )
537 `````````````````````````````````````````````````````````
538 CREATE DATABASE db1 DEFAULT ENCRYPTION='y';
539 CREATE DATABASE db2 DEFAULT ENCRYPTION='n';
540 CREATE DATABASE sch1 DEFAULT ENCRYPTION='y';
541 CREATE DATABASE sch2 DEFAULT ENCRYPTION='n';
542 CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.ibd' ENCRYPTION='y';
543 CREATE TABLE db1.fpt1 (f1 int) ENCRYPTION='y';
544 CREATE TABLE db1.fpt2 (f1 int) ENCRYPTION='y';
545 CREATE TABLE db1.ts1 (f1 int) TABLESPACE=ts1 ENCRYPTION='y';
546 CREATE TABLE db1.ts2 (f1 int) TABLESPACE=ts1 ENCRYPTION='y';
547 CREATE TABLE db2.fpt1 (f1 int) ENCRYPTION='y';
548 CREATE TABLE db2.fpt2 (f1 int) ENCRYPTION='y';
549 CREATE TABLE db2.ts1 (f1 int) TABLESPACE=ts1 ENCRYPTION='y';
550 CREATE TABLE db2.ts2 (f1 int) TABLESPACE=ts1 ENCRYPTION='y';
551 CREATE TABLE sch1.fpt (f1 int) ENCRYPTION='y';
552 CREATE TABLE sch1.ts (f1 int) TABLESPACE=ts1 ENCRYPTION='y';
553 CREATE TABLE sch2.fpt (f1 int) ENCRYPTION='y';
554 CREATE TABLE sch2.ts (f1 int) TABLESPACE=ts1 ENCRYPTION='y';
555 SET GLOBAL table_encryption_privilege_check=false;
556 # 8.1.
557 # Rename table using file-per-table tablespace from db encryption='y'
558 # to db with encryption='n' and viceversa
559 RENAME TABLE db1.fpt1 TO db2.fpt1_renamed;
560 RENAME TABLE db2.fpt1 TO db1.fpt1_renamed;
561 # 8.2.
562 # Rename table using general tablespace from db encryption='y'
563 # to db with encryption='n' and viceversa
564 RENAME TABLE db1.ts1 TO db2.ts1_rename;
565 RENAME TABLE db2.ts1 TO db1.ts1_rename;
566 # 8.3.
567 # Rename table (using file-per-table/general tablespace)
568 # within the database never fails.
569 RENAME TABLE sch1.fpt TO sch1.fpt_renamed;
570 RENAME TABLE sch1.ts TO sch1.ts_renamed;
571 RENAME TABLE sch2.fpt TO sch2.fpt_renamed;
572 RENAME TABLE sch2.ts TO sch2.ts_renamed;
573 SET GLOBAL table_encryption_privilege_check=false;
574 SHOW TABLES IN db1;
575 Tables_in_db1
576 fpt1_renamed
577 fpt2
578 ts1_rename
579 ts2
580 SHOW TABLES IN db2;
581 Tables_in_db2
582 fpt1_renamed
583 fpt2
584 ts1_rename
585 ts2
586 SHOW TABLES IN sch1;
587 Tables_in_sch1
588 fpt_renamed
589 ts_renamed
590 SHOW TABLES IN sch2;
591 Tables_in_sch2
592 fpt_renamed
593 ts_renamed
594 DROP DATABASE db1;
595 DROP DATABASE db2;
596 DROP DATABASE sch1;
597 DROP DATABASE sch2;
598 DROP TABLESPACE ts1;
599 `````````````````````````````````````````````````````````
600 # table_encryption_privilege_check=true
601 `````````````````````````````````````````````````````````
602 # We expect failure when the table encryption does not match
603 # with default database encryption.
604 # [ALTER TABLE ... RENAME ...] Case 9 )
605 `````````````````````````````````````````````````````````
606 CREATE DATABASE db1 DEFAULT ENCRYPTION='y';
607 CREATE DATABASE db2 DEFAULT ENCRYPTION='n';
608 CREATE DATABASE sch1 DEFAULT ENCRYPTION='y';
609 CREATE DATABASE sch2 DEFAULT ENCRYPTION='n';
610 CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.ibd' ENCRYPTION='n';
611 CREATE TABLE db1.fpt1 (f1 int) ENCRYPTION='n';
612 Warnings:
613 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
614 CREATE TABLE db1.fpt2 (f1 int) ENCRYPTION='n';
615 Warnings:
616 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
617 CREATE TABLE db1.ts1 (f1 int) TABLESPACE=ts1 ENCRYPTION='n';
618 Warnings:
619 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
620 CREATE TABLE db1.ts2 (f1 int) TABLESPACE=ts1 ENCRYPTION='n';
621 Warnings:
622 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
623 CREATE TABLE db2.fpt1 (f1 int) ENCRYPTION='n';
624 CREATE TABLE db2.fpt2 (f1 int) ENCRYPTION='n';
625 CREATE TABLE db2.ts1 (f1 int) TABLESPACE=ts1 ENCRYPTION='n';
626 CREATE TABLE db2.ts2 (f1 int) TABLESPACE=ts1 ENCRYPTION='n';
627 CREATE TABLE sch1.fpt (f1 int) ENCRYPTION='n';
628 Warnings:
629 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
630 CREATE TABLE sch1.ts (f1 int) TABLESPACE=ts1 ENCRYPTION='n';
631 Warnings:
632 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
633 CREATE TABLE sch2.fpt (f1 int) ENCRYPTION='n';
634 CREATE TABLE sch2.ts (f1 int) TABLESPACE=ts1 ENCRYPTION='n';
635 SET GLOBAL table_encryption_privilege_check=true;
636 # 9.1.
637 # Rename table using file-per-table tablespace from db encryption='y'
638 # to db with encryption='n' and viceversa
639 RENAME TABLE db1.fpt1 TO db2.fpt1_renamed;
640 RENAME TABLE db2.fpt1 TO db1.fpt1_renamed;
641 ERROR HY000: Table encryption differ from its database default encryption, and user doesn't have enough privilege.
642 # 9.2.
643 # Rename table using general tablespace from db encryption='y'
644 # to db with encryption='n' and viceversa
645 RENAME TABLE db1.ts1 TO db2.ts1_rename;
646 RENAME TABLE db2.ts1 TO db1.ts1_rename;
647 ERROR HY000: Table encryption differ from its database default encryption, and user doesn't have enough privilege.
648 # 9.3.
649 # Rename table (using file-per-table/general tablespace)
650 # within the database never fails.
651 RENAME TABLE sch1.fpt TO sch1.fpt_renamed;
652 RENAME TABLE sch1.ts TO sch1.ts_renamed;
653 RENAME TABLE sch2.fpt TO sch2.fpt_renamed;
654 RENAME TABLE sch2.ts TO sch2.ts_renamed;
655 SET GLOBAL table_encryption_privilege_check=false;
656 SHOW TABLES IN db1;
657 Tables_in_db1
658 fpt2
659 ts2
660 SHOW TABLES IN db2;
661 Tables_in_db2
662 fpt1
663 fpt1_renamed
664 fpt2
665 ts1
666 ts1_rename
667 ts2
668 SHOW TABLES IN sch1;
669 Tables_in_sch1
670 fpt_renamed
671 ts_renamed
672 SHOW TABLES IN sch2;
673 Tables_in_sch2
674 fpt_renamed
675 ts_renamed
676 DROP DATABASE db1;
677 DROP DATABASE db2;
678 DROP DATABASE sch1;
679 DROP DATABASE sch2;
680 DROP TABLESPACE ts1;
681 # [ALTER TABLE ... RENAME ...] Case 10 )
682 `````````````````````````````````````````````````````````
683 CREATE DATABASE db1 DEFAULT ENCRYPTION='y';
684 CREATE DATABASE db2 DEFAULT ENCRYPTION='n';
685 CREATE DATABASE sch1 DEFAULT ENCRYPTION='y';
686 CREATE DATABASE sch2 DEFAULT ENCRYPTION='n';
687 CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.ibd' ENCRYPTION='n';
688 CREATE TABLE db1.fpt1 (f1 int) ENCRYPTION='n';
689 Warnings:
690 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
691 CREATE TABLE db1.fpt2 (f1 int) ENCRYPTION='n';
692 Warnings:
693 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
694 CREATE TABLE db1.ts1 (f1 int) TABLESPACE=ts1 ENCRYPTION='n';
695 Warnings:
696 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
697 CREATE TABLE db1.ts2 (f1 int) TABLESPACE=ts1 ENCRYPTION='n';
698 Warnings:
699 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
700 CREATE TABLE db2.fpt1 (f1 int) ENCRYPTION='n';
701 CREATE TABLE db2.fpt2 (f1 int) ENCRYPTION='n';
702 CREATE TABLE db2.ts1 (f1 int) TABLESPACE=ts1 ENCRYPTION='n';
703 CREATE TABLE db2.ts2 (f1 int) TABLESPACE=ts1 ENCRYPTION='n';
704 CREATE TABLE sch1.fpt (f1 int) ENCRYPTION='n';
705 Warnings:
706 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
707 CREATE TABLE sch1.ts (f1 int) TABLESPACE=ts1 ENCRYPTION='n';
708 Warnings:
709 Warning 3824 Creating an unencrypted table in a database with default encryption enabled.
710 CREATE TABLE sch2.fpt (f1 int) ENCRYPTION='n';
711 CREATE TABLE sch2.ts (f1 int) TABLESPACE=ts1 ENCRYPTION='n';
712 SET GLOBAL table_encryption_privilege_check=true;
713 # Grant user with TABLE_ENCRYPTION_ADMIN
714 GRANT TABLE_ENCRYPTION_ADMIN ON *.* TO u1@localhost;
715 # 10.1.
716 # Rename table using file-per-table tablespace from db encryption='y'
717 # to db with encryption='n' and viceversa
718 ALTER TABLE db1.fpt1 RENAME db2.fpt1_renamed ;
719 ALTER TABLE db2.fpt1 RENAME db1.fpt1_renamed ;
720 # 10.2.
721 # Rename table using general tablespace from db encryption='y'
722 # to db with encryption='n' and viceversa
723 ALTER TABLE db1.ts1 RENAME db2.ts1_rename ;
724 ALTER TABLE db2.ts1 RENAME db1.ts1_rename ;
725 # 10.3.
726 # Rename table (using file-per-table/general tablespace)
727 # within the database never fails.
728 ALTER TABLE sch1.fpt RENAME sch1.fpt_renamed ;
729 ALTER TABLE sch1.ts RENAME sch1.ts_renamed ;
730 ALTER TABLE sch2.fpt RENAME sch2.fpt_renamed ;
731 ALTER TABLE sch2.ts RENAME sch2.ts_renamed ;
732 SET GLOBAL table_encryption_privilege_check=false;
733 SHOW TABLES IN db1;
734 Tables_in_db1
735 fpt1_renamed
736 fpt2
737 ts1_rename
738 ts2
739 SHOW TABLES IN db2;
740 Tables_in_db2
741 fpt1_renamed
742 fpt2
743 ts1_rename
744 ts2
745 SHOW TABLES IN sch1;
746 Tables_in_sch1
747 fpt_renamed
748 ts_renamed
749 SHOW TABLES IN sch2;
750 Tables_in_sch2
751 fpt_renamed
752 ts_renamed
753 # Revoke TABLE_ENCRYPTION_ADMIN from user.
754 REVOKE TABLE_ENCRYPTION_ADMIN ON *.* FROM u1@localhost;
755 DROP DATABASE db1;
756 DROP DATABASE db2;
757 DROP DATABASE sch1;
758 DROP DATABASE sch2;
759 DROP TABLESPACE ts1;
760 `````````````````````````````````````````````````````````
761 # We expect failure when the table encryption does not match
762 # with default database encryption.
763 # [ALTER TABLE ... RENAME ...] Case 11 )
764 `````````````````````````````````````````````````````````
765 CREATE DATABASE db1 DEFAULT ENCRYPTION='y';
766 CREATE DATABASE db2 DEFAULT ENCRYPTION='n';
767 CREATE DATABASE sch1 DEFAULT ENCRYPTION='y';
768 CREATE DATABASE sch2 DEFAULT ENCRYPTION='n';
769 CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.ibd' ENCRYPTION='y';
770 CREATE TABLE db1.fpt1 (f1 int) ENCRYPTION='y';
771 CREATE TABLE db1.fpt2 (f1 int) ENCRYPTION='y';
772 CREATE TABLE db1.ts1 (f1 int) TABLESPACE=ts1 ENCRYPTION='y';
773 CREATE TABLE db1.ts2 (f1 int) TABLESPACE=ts1 ENCRYPTION='y';
774 CREATE TABLE db2.fpt1 (f1 int) ENCRYPTION='y';
775 CREATE TABLE db2.fpt2 (f1 int) ENCRYPTION='y';
776 CREATE TABLE db2.ts1 (f1 int) TABLESPACE=ts1 ENCRYPTION='y';
777 CREATE TABLE db2.ts2 (f1 int) TABLESPACE=ts1 ENCRYPTION='y';
778 CREATE TABLE sch1.fpt (f1 int) ENCRYPTION='y';
779 CREATE TABLE sch1.ts (f1 int) TABLESPACE=ts1 ENCRYPTION='y';
780 CREATE TABLE sch2.fpt (f1 int) ENCRYPTION='y';
781 CREATE TABLE sch2.ts (f1 int) TABLESPACE=ts1 ENCRYPTION='y';
782 SET GLOBAL table_encryption_privilege_check=true;
783 # 11.1.
784 # Rename table using file-per-table tablespace from db encryption='y'
785 # to db with encryption='n' and viceversa
786 RENAME TABLE db1.fpt1 TO db2.fpt1_renamed;
787 ERROR HY000: Table encryption differ from its database default encryption, and user doesn't have enough privilege.
788 RENAME TABLE db2.fpt1 TO db1.fpt1_renamed;
789 # 11.2.
790 # Rename table using general tablespace from db encryption='y'
791 # to db with encryption='n' and viceversa
792 RENAME TABLE db1.ts1 TO db2.ts1_rename;
793 ERROR HY000: Table encryption differ from its database default encryption, and user doesn't have enough privilege.
794 RENAME TABLE db2.ts1 TO db1.ts1_rename;
795 # 11.3.
796 # Rename table (using file-per-table/general tablespace)
797 # within the database never fails.
798 RENAME TABLE sch1.fpt TO sch1.fpt_renamed;
799 RENAME TABLE sch1.ts TO sch1.ts_renamed;
800 RENAME TABLE sch2.fpt TO sch2.fpt_renamed;
801 RENAME TABLE sch2.ts TO sch2.ts_renamed;
802 SET GLOBAL table_encryption_privilege_check=false;
803 SHOW TABLES IN db1;
804 Tables_in_db1
805 fpt1
806 fpt1_renamed
807 fpt2
808 ts1
809 ts1_rename
810 ts2
811 SHOW TABLES IN db2;
812 Tables_in_db2
813 fpt2
814 ts2
815 SHOW TABLES IN sch1;
816 Tables_in_sch1
817 fpt_renamed
818 ts_renamed
819 SHOW TABLES IN sch2;
820 Tables_in_sch2
821 fpt_renamed
822 ts_renamed
823 DROP DATABASE db1;
824 DROP DATABASE db2;
825 DROP DATABASE sch1;
826 DROP DATABASE sch2;
827 DROP TABLESPACE ts1;
828 # [ALTER TABLE ... RENAME ...] Case 12 )
829 `````````````````````````````````````````````````````````
830 CREATE DATABASE db1 DEFAULT ENCRYPTION='y';
831 CREATE DATABASE db2 DEFAULT ENCRYPTION='n';
832 CREATE DATABASE sch1 DEFAULT ENCRYPTION='y';
833 CREATE DATABASE sch2 DEFAULT ENCRYPTION='n';
834 CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.ibd' ENCRYPTION='y';
835 CREATE TABLE db1.fpt1 (f1 int) ENCRYPTION='y';
836 CREATE TABLE db1.fpt2 (f1 int) ENCRYPTION='y';
837 CREATE TABLE db1.ts1 (f1 int) TABLESPACE=ts1 ENCRYPTION='y';
838 CREATE TABLE db1.ts2 (f1 int) TABLESPACE=ts1 ENCRYPTION='y';
839 CREATE TABLE db2.fpt1 (f1 int) ENCRYPTION='y';
840 CREATE TABLE db2.fpt2 (f1 int) ENCRYPTION='y';
841 CREATE TABLE db2.ts1 (f1 int) TABLESPACE=ts1 ENCRYPTION='y';
842 CREATE TABLE db2.ts2 (f1 int) TABLESPACE=ts1 ENCRYPTION='y';
843 CREATE TABLE sch1.fpt (f1 int) ENCRYPTION='y';
844 CREATE TABLE sch1.ts (f1 int) TABLESPACE=ts1 ENCRYPTION='y';
845 CREATE TABLE sch2.fpt (f1 int) ENCRYPTION='y';
846 CREATE TABLE sch2.ts (f1 int) TABLESPACE=ts1 ENCRYPTION='y';
847 SET GLOBAL table_encryption_privilege_check=true;
848 # Grant user with TABLE_ENCRYPTION_ADMIN
849 GRANT TABLE_ENCRYPTION_ADMIN ON *.* TO u1@localhost;
850 # 12.1.
851 # Rename table using file-per-table tablespace from db encryption='y'
852 # to db with encryption='n' and viceversa
853 ALTER TABLE db1.fpt1 RENAME db2.fpt1_renamed ;
854 ALTER TABLE db2.fpt1 RENAME db1.fpt1_renamed ;
855 # 12.2.
856 # Rename table using general tablespace from db encryption='y'
857 # to db with encryption='n' and viceversa
858 ALTER TABLE db1.ts1 RENAME db2.ts1_rename ;
859 ALTER TABLE db2.ts1 RENAME db1.ts1_rename ;
860 # 12.3.
861 # Rename table (using file-per-table/general tablespace)
862 # within the database never fails.
863 ALTER TABLE sch1.fpt RENAME sch1.fpt_renamed ;
864 ALTER TABLE sch1.ts RENAME sch1.ts_renamed ;
865 ALTER TABLE sch2.fpt RENAME sch2.fpt_renamed ;
866 ALTER TABLE sch2.ts RENAME sch2.ts_renamed ;
867 SET GLOBAL table_encryption_privilege_check=false;
868 SHOW TABLES IN db1;
869 Tables_in_db1
870 fpt1_renamed
871 fpt2
872 ts1_rename
873 ts2
874 SHOW TABLES IN db2;
875 Tables_in_db2
876 fpt1_renamed
877 fpt2
878 ts1_rename
879 ts2
880 SHOW TABLES IN sch1;
881 Tables_in_sch1
882 fpt_renamed
883 ts_renamed
884 SHOW TABLES IN sch2;
885 Tables_in_sch2
886 fpt_renamed
887 ts_renamed
888 # Revoke TABLE_ENCRYPTION_ADMIN from user.
889 REVOKE TABLE_ENCRYPTION_ADMIN ON *.* FROM u1@localhost;
890 DROP DATABASE db1;
891 DROP DATABASE db2;
892 DROP DATABASE sch1;
893 DROP DATABASE sch2;
894 DROP TABLESPACE ts1;
895 # Cleanup
896 DROP USER u1@localhost;
897 SET GLOBAL debug= '-d,skip_table_encryption_admin_check_for_set';