Files
greptimedb/tests/cases/standalone/common/information_schema/table_constraints.result
Yohan Wal c4db9e8aa7 fix!: forbid to change information_schema (#4233)
* fix: forbid to change tables in information_schema

* refactor: use unified read-only check function

* test: add more sqlness tests for information_schema

* refactor: move is_readonly_schema to common_catalog
2024-07-03 03:09:23 +00:00

67 lines
3.4 KiB
Plaintext

--- test information_schema.table_constraints ----
USE INFORMATION_SCHEMA;
Affected Rows: 0
DESC TABLE TABLE_CONSTRAINTS;
+--------------------+--------+-----+------+---------+---------------+
| Column | Type | Key | Null | Default | Semantic Type |
+--------------------+--------+-----+------+---------+---------------+
| constraint_catalog | String | | NO | | FIELD |
| constraint_schema | String | | NO | | FIELD |
| constraint_name | String | | NO | | FIELD |
| table_schema | String | | NO | | FIELD |
| table_name | String | | NO | | FIELD |
| constraint_type | String | | NO | | FIELD |
| enforced | String | | NO | | FIELD |
+--------------------+--------+-----+------+---------+---------------+
SELECT * FROM TABLE_CONSTRAINTS ORDER BY TABLE_NAME, CONSTRAINT_NAME;
+--------------------+-------------------+-----------------+--------------+------------+-----------------+----------+
| constraint_catalog | constraint_schema | constraint_name | table_schema | table_name | constraint_type | enforced |
+--------------------+-------------------+-----------------+--------------+------------+-----------------+----------+
| def | public | PRIMARY | public | numbers | PRIMARY KEY | YES |
+--------------------+-------------------+-----------------+--------------+------------+-----------------+----------+
use public;
Affected Rows: 0
CREATE TABLE test(i double, j string, ts timestamp time index, primary key(j));
Affected Rows: 0
use INFORMATION_SCHEMA;
Affected Rows: 0
SELECT * FROM TABLE_CONSTRAINTS ORDER BY TABLE_NAME, CONSTRAINT_NAME;
+--------------------+-------------------+-----------------+--------------+------------+-----------------+----------+
| constraint_catalog | constraint_schema | constraint_name | table_schema | table_name | constraint_type | enforced |
+--------------------+-------------------+-----------------+--------------+------------+-----------------+----------+
| def | public | PRIMARY | public | numbers | PRIMARY KEY | YES |
| def | public | PRIMARY | public | test | PRIMARY KEY | YES |
| def | public | TIME INDEX | public | test | TIME INDEX | YES |
+--------------------+-------------------+-----------------+--------------+------------+-----------------+----------+
SELECT * FROM TABLE_CONSTRAINTS WHERE TABLE_NAME = 'test' ORDER BY TABLE_NAME, CONSTRAINT_NAME;
+--------------------+-------------------+-----------------+--------------+------------+-----------------+----------+
| constraint_catalog | constraint_schema | constraint_name | table_schema | table_name | constraint_type | enforced |
+--------------------+-------------------+-----------------+--------------+------------+-----------------+----------+
| def | public | PRIMARY | public | test | PRIMARY KEY | YES |
| def | public | TIME INDEX | public | test | TIME INDEX | YES |
+--------------------+-------------------+-----------------+--------------+------------+-----------------+----------+
use public;
Affected Rows: 0
DROP TABLE test;
Affected Rows: 0