mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-07 22:02:56 +00:00
* 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
82 lines
2.0 KiB
Plaintext
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 |
|
|
+--------------------+
|
|
|