feat: implement drop multiple tables (#4085)

* feat: implement drop multiple tables

* fix: pass fmt and clippy checks

* add: drop multiple sqlness test

* update: accept review suggestions

* update: accept reviem suggestion

Co-authored-by: Weny Xu <wenymedia@gmail.com>

* fix: pass clippy check

---------

Co-authored-by: Weny Xu <wenymedia@gmail.com>
This commit is contained in:
sarailQAQ
2024-06-04 21:11:41 +08:00
committed by GitHub
parent c0aed1d267
commit 98c19ed0fa
7 changed files with 207 additions and 54 deletions

View File

@@ -20,3 +20,58 @@ DROP TABLE IF EXISTS foo;
Affected Rows: 0
DROP TABLE IF EXISTS foo, bar;
Affected Rows: 0
create table foo (
host string,
ts timestamp DEFAULT '2024-06-01 00:00:00+00:00',
cpu double default 0,
TIME INDEX (ts),
PRIMARY KEY(host)
) engine=mito;
Affected Rows: 0
DROP TABLE foo, bar;
Error: 4001(TableNotFound), Table not found: greptime.public.bar
SHOW TABLES;
+---------+
| Tables |
+---------+
| foo |
| numbers |
+---------+
DROP TABLE IF EXISTS foo, bar;
Affected Rows: 0
create table foo (
host string,
ts timestamp DEFAULT '2024-06-01 00:00:00+00:00',
cpu double default 0,
TIME INDEX (ts),
PRIMARY KEY(host)
) engine=mito;
Affected Rows: 0
create table bar (
host string,
ts timestamp DEFAULT '2024-06-01 00:00:00+00:00',
cpu double default 0,
TIME INDEX (ts),
PRIMARY KEY(host)
) engine=mito;
Affected Rows: 0
DROP TABLE foo, bar;
Affected Rows: 0

View File

@@ -11,3 +11,38 @@ create table foo (
DROP TABLE IF EXISTS foo;
DROP TABLE IF EXISTS foo;
DROP TABLE IF EXISTS foo, bar;
create table foo (
host string,
ts timestamp DEFAULT '2024-06-01 00:00:00+00:00',
cpu double default 0,
TIME INDEX (ts),
PRIMARY KEY(host)
) engine=mito;
DROP TABLE foo, bar;
SHOW TABLES;
DROP TABLE IF EXISTS foo, bar;
create table foo (
host string,
ts timestamp DEFAULT '2024-06-01 00:00:00+00:00',
cpu double default 0,
TIME INDEX (ts),
PRIMARY KEY(host)
) engine=mito;
create table bar (
host string,
ts timestamp DEFAULT '2024-06-01 00:00:00+00:00',
cpu double default 0,
TIME INDEX (ts),
PRIMARY KEY(host)
) engine=mito;
DROP TABLE foo, bar;