feat: support table level comment (#4042)

* feat: support table level comment

* use constants

Signed-off-by: tison <wander4096@gmail.com>

---------

Signed-off-by: tison <wander4096@gmail.com>
Co-authored-by: tison <wander4096@gmail.com>
This commit is contained in:
irenjj
2024-05-27 10:28:52 +08:00
committed by GitHub
parent 3790020d78
commit 25d64255a3
4 changed files with 48 additions and 2 deletions

View File

@@ -204,3 +204,36 @@ DROP table `ExcePTuRi`;
Affected Rows: 0
CREATE TABLE if not exists monitor (
host STRING,
ts TIMESTAMP(9) DEFAULT CURRENT_TIMESTAMP() TIME INDEX,
cpu FLOAT64 DEFAULT 0,
memory FLOAT64,
PRIMARY KEY(host)) ENGINE=mito WITH(COMMENT='create by human');
Affected Rows: 0
SHOW CREATE TABLE monitor;
+---------+-----------------------------------------------------------+
| Table | Create Table |
+---------+-----------------------------------------------------------+
| monitor | CREATE TABLE IF NOT EXISTS "monitor" ( |
| | "host" STRING NULL, |
| | "ts" TIMESTAMP(9) NOT NULL DEFAULT current_timestamp(), |
| | "cpu" DOUBLE NULL DEFAULT 0, |
| | "memory" DOUBLE NULL, |
| | TIME INDEX ("ts"), |
| | PRIMARY KEY ("host") |
| | ) |
| | |
| | ENGINE=mito |
| | WITH( |
| | comment = 'create by human' |
| | ) |
+---------+-----------------------------------------------------------+
DROP TABLE monitor;
Affected Rows: 0

View File

@@ -81,3 +81,14 @@ DROP TABLE test_like_1;
DROP TABLE test_like_2;
DROP table `ExcePTuRi`;
CREATE TABLE if not exists monitor (
host STRING,
ts TIMESTAMP(9) DEFAULT CURRENT_TIMESTAMP() TIME INDEX,
cpu FLOAT64 DEFAULT 0,
memory FLOAT64,
PRIMARY KEY(host)) ENGINE=mito WITH(COMMENT='create by human');
SHOW CREATE TABLE monitor;
DROP TABLE monitor;