| 1 |
-- source include/not_embedded.inc |
| 2 |
-- source ../include/ps_truncate_all_tables.inc |
| 3 |
# Tests for sys schema |
| 4 |
# Verify the sys.schema_redundant_indexes / x$schema_flattened_keys views |
| 5 |
|
| 6 |
# Ensure structure changes don't slip in |
| 7 |
DESC sys.schema_redundant_indexes; |
| 8 |
|
| 9 |
# Make sure view select does not error, but ignore results |
| 10 |
--disable_result_log |
| 11 |
SELECT * FROM sys.schema_redundant_indexes; |
| 12 |
--enable_result_log |
| 13 |
|
| 14 |
|
| 15 |
# Ensure structure changes don't slip in |
| 16 |
DESC sys.x$schema_flattened_keys; |
| 17 |
|
| 18 |
# Make sure view select does not error, but ignore results |
| 19 |
--disable_result_log |
| 20 |
SELECT * FROM sys.x$schema_flattened_keys; |
| 21 |
--enable_result_log |
| 22 |
|
| 23 |
# Test correctly identifies keys |
| 24 |
|
| 25 |
CREATE DATABASE rkey; |
| 26 |
|
| 27 |
CREATE TABLE rkey.rkey ( |
| 28 |
i INT, |
| 29 |
j INT, |
| 30 |
k INT, |
| 31 |
PRIMARY KEY (i), |
| 32 |
KEY (j), |
| 33 |
KEY (j, k), |
| 34 |
KEY (i, j, k) |
| 35 |
); |
| 36 |
|
| 37 |
--sorted_result |
| 38 |
SELECT * FROM sys.schema_redundant_indexes; |
| 39 |
|
| 40 |
DROP DATABASE rkey; |