Files
greptimedb/tests/cases/standalone/common/create/create_database_opts.result
JohnsonLee a8477e4142 fix: table resolving logic related to pg_catalog (#4580)
* fix: table resolving logic related to pg_catalog

refer to
https://github.com/GreptimeTeam/greptimedb/issues/3560#issuecomment-2287794348
and #4543

* refactor: remove CatalogProtocol type

* fix: sqlness

* fix: forbid create database pg_catalog with mysql client

* refactor: use QueryContext as arguments rather than Channel

* refactor: pass None as default behaviour in information_schema

* test: fix test
2024-09-09 00:47:59 +00:00

82 lines
2.0 KiB
Plaintext

CREATE DATABASE mydb WITH (ttl = '1h');
Affected Rows: 1
SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| greptime_private |
| information_schema |
| mydb |
| public |
+--------------------+
SHOW FULL DATABASES;
+--------------------+----------+
| Database | Options |
+--------------------+----------+
| greptime_private | |
| information_schema | |
| mydb | ttl='1h' |
| public | |
+--------------------+----------+
SHOW CREATE DATABASE mydb;
+----------+------------------------------------+
| Database | Create Database |
+----------+------------------------------------+
| mydb | CREATE DATABASE IF NOT EXISTS mydb |
| | WITH( |
| | ttl = '1h' |
| | ) |
+----------+------------------------------------+
USE mydb;
Affected Rows: 0
CREATE TABLE test(host STRING, cpu DOUBLE, ts TIMESTAMP TIME INDEX);
Affected Rows: 0
SHOW CREATE TABLE test;
+-------+-------------------------------------+
| Table | Create Table |
+-------+-------------------------------------+
| test | CREATE TABLE IF NOT EXISTS "test" ( |
| | "host" STRING NULL, |
| | "cpu" DOUBLE NULL, |
| | "ts" TIMESTAMP(3) NOT NULL, |
| | TIME INDEX ("ts") |
| | ) |
| | |
| | ENGINE=mito |
| | WITH( |
| | ttl = '1h' |
| | ) |
+-------+-------------------------------------+
USE public;
Affected Rows: 0
DROP DATABASE mydb;
Affected Rows: 0
SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| greptime_private |
| information_schema |
| public |
+--------------------+