Files
greptimedb/tests/cases/standalone/common/information_schema/table_constraints.result
dennis zhuang 75d85f9915 feat: impl table_constraints table for information_schema (#3698)
* feat: impl table_constraints table for information_schema

* test: update information_schema sqlness test

* test: adds table_constraints sqlness test
2024-04-15 03:59:16 +00:00

59 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 |
+--------------------+-------------------+-----------------+--------------+------------+-----------------+----------+
CREATE TABLE test(i double, j string, ts timestamp time index, primary key(j));
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 | information_schema | PRIMARY | information_schema | test | PRIMARY KEY | YES |
| def | information_schema | TIME INDEX | information_schema | 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 | information_schema | PRIMARY | information_schema | test | PRIMARY KEY | YES |
| def | information_schema | TIME INDEX | information_schema | test | TIME INDEX | YES |
+--------------------+--------------------+-----------------+--------------------+------------+-----------------+----------+
DROP TABLE test;
Affected Rows: 0
USE public;
Affected Rows: 0