fix: quote ident on rendered SQL (#2248)

* fix: quote ident on rendered SQL

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* read quote style from query context

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* update sqlness result

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
Ruihang Xia
2023-08-25 02:25:21 -05:00
committed by GitHub
parent de1daec680
commit 8d446ed741
10 changed files with 154 additions and 113 deletions

View File

@@ -19,29 +19,29 @@ Affected Rows: 0
SHOW CREATE TABLE system_metrics;
+----------------+----------------------------------------------------------+
| Table | Create Table |
+----------------+----------------------------------------------------------+
| system_metrics | CREATE TABLE IF NOT EXISTS system_metrics ( |
| | id INT UNSIGNED NULL, |
| | host STRING NULL, |
| | cpu DOUBLE NULL, |
| | disk FLOAT NULL, |
| | n INT NULL, |
| | ts TIMESTAMP(3) NOT NULL DEFAULT current_timestamp(), |
| | TIME INDEX (ts), |
| | PRIMARY KEY (id, host) |
| | ) |
| | PARTITION BY RANGE COLUMNS (n) ( |
| | PARTITION r0 VALUES LESS THAN (5), |
| | PARTITION r1 VALUES LESS THAN (9), |
| | PARTITION r2 VALUES LESS THAN (MAXVALUE) |
| | ) |
| | ENGINE=mito |
| | WITH( |
| | regions = 3 |
| | ) |
+----------------+----------------------------------------------------------+
+----------------+-----------------------------------------------------------+
| Table | Create Table |
+----------------+-----------------------------------------------------------+
| system_metrics | CREATE TABLE IF NOT EXISTS "system_metrics" ( |
| | "id" INT UNSIGNED NULL, |
| | "host" STRING NULL, |
| | "cpu" DOUBLE NULL, |
| | "disk" FLOAT NULL, |
| | "n" INT NULL, |
| | "ts" TIMESTAMP(3) NOT NULL DEFAULT current_timestamp(), |
| | TIME INDEX ("ts"), |
| | PRIMARY KEY ("id", "host") |
| | ) |
| | PARTITION BY RANGE COLUMNS ("n") ( |
| | PARTITION r0 VALUES LESS THAN (5), |
| | PARTITION r1 VALUES LESS THAN (9), |
| | PARTITION r2 VALUES LESS THAN (MAXVALUE) |
| | ) |
| | ENGINE=mito |
| | WITH( |
| | regions = 3 |
| | ) |
+----------------+-----------------------------------------------------------+
DROP TABLE system_metrics;
@@ -55,19 +55,19 @@ Affected Rows: 0
show create table table_without_partition;
+-------------------------+---------------------------------------------------------+
| Table | Create Table |
+-------------------------+---------------------------------------------------------+
| table_without_partition | CREATE TABLE IF NOT EXISTS table_without_partition ( |
| | ts TIMESTAMP(3) NOT NULL DEFAULT current_timestamp(), |
| | TIME INDEX (ts) |
| | ) |
| | |
| | ENGINE=mito |
| | WITH( |
| | regions = 1 |
| | ) |
+-------------------------+---------------------------------------------------------+
+-------------------------+-----------------------------------------------------------+
| Table | Create Table |
+-------------------------+-----------------------------------------------------------+
| table_without_partition | CREATE TABLE IF NOT EXISTS "table_without_partition" ( |
| | "ts" TIMESTAMP(3) NOT NULL DEFAULT current_timestamp(), |
| | TIME INDEX ("ts") |
| | ) |
| | |
| | ENGINE=mito |
| | WITH( |
| | regions = 1 |
| | ) |
+-------------------------+-----------------------------------------------------------+
drop table table_without_partition;