diff --git a/benchmark/clickbench/hits/clear.sql b/benchmark/clickbench/hits/clear.sql index e70c0347a8da..81452994830f 100644 --- a/benchmark/clickbench/hits/clear.sql +++ b/benchmark/clickbench/hits/clear.sql @@ -1 +1,2 @@ -drop table hits all; +drop table hits; +VACUUM DROP TABLE retain 0 hours; diff --git a/benchmark/clickbench/tpch/clear.sql b/benchmark/clickbench/tpch/clear.sql index ded376e4a710..60b4ace1ff06 100644 --- a/benchmark/clickbench/tpch/clear.sql +++ b/benchmark/clickbench/tpch/clear.sql @@ -1,8 +1,9 @@ -drop table customer all; -drop table lineitem all; -drop table nation all; -drop table orders all; -drop table partsupp all; -drop table part all; -drop table region all; -drop table supplier all; +drop table customer; +drop table lineitem; +drop table nation; +drop table orders; +drop table partsupp; +drop table part; +drop table region; +drop table supplier; +VACUUM DROP TABLE retain 0 hours; diff --git a/benchmark/tpcds/load_data.sh b/benchmark/tpcds/load_data.sh index b2f71f834d31..ca34a816b25c 100755 --- a/benchmark/tpcds/load_data.sh +++ b/benchmark/tpcds/load_data.sh @@ -36,9 +36,11 @@ tables=( # Clear Data for t in ${tables[@]} do - echo "DROP TABLE IF EXISTS $t ALL" | $MYSQL_CLIENT_CONNECT + echo "DROP TABLE IF EXISTS $t" | $MYSQL_CLIENT_CONNECT done +echo "VACUUM DROP TABLE retain 0 hours" | $MYSQL_CLIENT_CONNECT + # Create Tables; cat "$CURDIR"/tpcds.sql | $MYSQL_CLIENT_CONNECT diff --git a/docs/doc/14-sql-commands/00-ddl/20-table/20-ddl-drop-table.md b/docs/doc/14-sql-commands/00-ddl/20-table/20-ddl-drop-table.md index 704f7253825b..0ca931eae633 100644 --- a/docs/doc/14-sql-commands/00-ddl/20-table/20-ddl-drop-table.md +++ b/docs/doc/14-sql-commands/00-ddl/20-table/20-ddl-drop-table.md @@ -18,9 +18,6 @@ DROP TABLE [IF EXISTS] [db.]name :::caution `DROP TABLE` only remove the table schema from meta service, we do not remove the underlying data from the storage. -If you want to delete the data and table all, please use: - -`DROP TABLE ALL;` ::: diff --git a/docs/doc/14-sql-commands/00-ddl/20-table/40-ddl-truncate-table.md b/docs/doc/14-sql-commands/00-ddl/20-table/40-ddl-truncate-table.md index 68592fc28c60..9f8cabac2fc2 100644 --- a/docs/doc/14-sql-commands/00-ddl/20-table/40-ddl-truncate-table.md +++ b/docs/doc/14-sql-commands/00-ddl/20-table/40-ddl-truncate-table.md @@ -2,14 +2,14 @@ title: TRUNCATE TABLE --- -Removes all data from a table while preserving the table's schema. It deletes all rows in the table, making it an empty table with the same columns and constraints. Please note that, it does not release the disk space allocated to the table. To release the disk space, include the PURGE option, which is used to release the disk space allocated to the table when the truncate operation is performed. +Removes all data from a table while preserving the table's schema. It deletes all rows in the table, making it an empty table with the same columns and constraints. Please note that, it does not release the disk space allocated to the table. See also: [DROP TABLE](20-ddl-drop-table.md) ## Syntax ```sql -TRUNCATE TABLE [db.]table_name [PURGE] +TRUNCATE TABLE [db.]table_name ``` ## Examples @@ -50,10 +50,4 @@ FROM test_truncate 0 row in 0.017 sec. Processed 0 rows, 0B (0 rows/s, 0B/s) - -root@localhost> TRUNCATE TABLE test_truncate PURGE; - -TRUNCATE TABLE test_truncate PURGE - -0 row in 0.118 sec. Processed 0 rows, 0B (0 rows/s, 0B/s) ``` \ No newline at end of file diff --git a/scripts/benchmark/query/load/hits.sh b/scripts/benchmark/query/load/hits.sh index 9754e6020532..f0c6d2a99576 100755 --- a/scripts/benchmark/query/load/hits.sh +++ b/scripts/benchmark/query/load/hits.sh @@ -7,7 +7,11 @@ select version(); SQL cat <, pub database: Option, pub table: Identifier, - pub all: bool, } impl Display for DropTableStmt { @@ -272,9 +271,6 @@ impl Display for DropTableStmt { .chain(&self.database) .chain(Some(&self.table)), )?; - if self.all { - write!(f, " ALL")?; - } Ok(()) } @@ -469,7 +465,6 @@ pub struct TruncateTableStmt { pub catalog: Option, pub database: Option, pub table: Identifier, - pub purge: bool, } impl Display for TruncateTableStmt { @@ -482,9 +477,6 @@ impl Display for TruncateTableStmt { .chain(&self.database) .chain(Some(&self.table)), )?; - if self.purge { - write!(f, " PURGE")?; - } Ok(()) } diff --git a/src/query/ast/src/parser/statement.rs b/src/query/ast/src/parser/statement.rs index e505f86ddc54..1550b916ae44 100644 --- a/src/query/ast/src/parser/statement.rs +++ b/src/query/ast/src/parser/statement.rs @@ -577,15 +577,14 @@ pub fn statement(i: Input) -> IResult { ); let drop_table = map( rule! { - DROP ~ TABLE ~ ( IF ~ ^EXISTS )? ~ #dot_separated_idents_1_to_3 ~ ALL? + DROP ~ TABLE ~ ( IF ~ ^EXISTS )? ~ #dot_separated_idents_1_to_3 }, - |(_, _, opt_if_exists, (catalog, database, table), opt_all)| { + |(_, _, opt_if_exists, (catalog, database, table))| { Statement::DropTable(DropTableStmt { if_exists: opt_if_exists.is_some(), catalog, database, table, - all: opt_all.is_some(), }) }, ); @@ -638,14 +637,13 @@ pub fn statement(i: Input) -> IResult { ); let truncate_table = map( rule! { - TRUNCATE ~ TABLE ~ #dot_separated_idents_1_to_3 ~ PURGE? + TRUNCATE ~ TABLE ~ #dot_separated_idents_1_to_3 }, - |(_, _, (catalog, database, table), opt_purge)| { + |(_, _, (catalog, database, table))| { Statement::TruncateTable(TruncateTableStmt { catalog, database, table, - purge: opt_purge.is_some(), }) }, ); @@ -1495,7 +1493,7 @@ pub fn statement(i: Input) -> IResult { | #undrop_table : "`UNDROP TABLE [.]`" | #alter_table : "`ALTER TABLE [.]
`" | #rename_table : "`RENAME TABLE [.]
TO `" - | #truncate_table : "`TRUNCATE TABLE [.]
[PURGE]`" + | #truncate_table : "`TRUNCATE TABLE [.]
`" | #optimize_table : "`OPTIMIZE TABLE [.]
(ALL | PURGE | COMPACT [SEGMENT])`" | #vacuum_table : "`VACUUM TABLE [.]
[RETAIN number HOURS] [DRY RUN]`" | #vacuum_drop_table : "`VACUUM DROP TABLE [FROM [.]] [RETAIN number HOURS] [DRY RUN]`" diff --git a/src/query/ast/tests/it/testdata/statement-error.txt b/src/query/ast/tests/it/testdata/statement-error.txt index b76a5ad67653..d3a5bfe46ea8 100644 --- a/src/query/ast/tests/it/testdata/statement-error.txt +++ b/src/query/ast/tests/it/testdata/statement-error.txt @@ -109,7 +109,7 @@ error: --> SQL:1:21 | 1 | truncate table a.b.c.d - | ^ expected `PURGE`, `FORMAT`, or `;` + | ^ expected `FORMAT` or `;` ---------- Input ---------- @@ -121,7 +121,7 @@ error: 1 | truncate a | -------- ^ expected `TABLE` | | - | while parsing `TRUNCATE TABLE [.]
[PURGE]` + | while parsing `TRUNCATE TABLE [.]
` ---------- Input ---------- diff --git a/src/query/ast/tests/it/testdata/statement.txt b/src/query/ast/tests/it/testdata/statement.txt index e76d0b1d855a..8c97eef733f5 100644 --- a/src/query/ast/tests/it/testdata/statement.txt +++ b/src/query/ast/tests/it/testdata/statement.txt @@ -1462,7 +1462,6 @@ TruncateTable( 15..16, ), }, - purge: false, }, ) @@ -1493,7 +1492,6 @@ TruncateTable( 19..20, ), }, - purge: false, }, ) @@ -1515,7 +1513,6 @@ DropTable( 11..12, ), }, - all: false, }, ) @@ -1547,7 +1544,6 @@ DropTable( 23..26, ), }, - all: false, }, ) @@ -2359,7 +2355,6 @@ TruncateTable( 15..19, ), }, - purge: false, }, ) @@ -2388,7 +2383,6 @@ TruncateTable( 23..27, ), }, - purge: false, }, ) @@ -2410,7 +2404,6 @@ DropTable( 11..17, ), }, - all: false, }, ) @@ -2432,7 +2425,6 @@ DropTable( 21..27, ), }, - all: false, }, ) diff --git a/src/query/catalog/src/table.rs b/src/query/catalog/src/table.rs index e78036bcc467..7e416d199d94 100644 --- a/src/query/catalog/src/table.rs +++ b/src/query/catalog/src/table.rs @@ -214,8 +214,8 @@ pub trait Table: Sync + Send { } #[async_backtrace::framed] - async fn truncate(&self, ctx: Arc, purge: bool) -> Result<()> { - let (_, _) = (ctx, purge); + async fn truncate(&self, ctx: Arc) -> Result<()> { + let _ = ctx; Ok(()) } diff --git a/src/query/ee/tests/it/aggregating_index/index_scan.rs b/src/query/ee/tests/it/aggregating_index/index_scan.rs index b5c955f142c4..9316863ac46e 100644 --- a/src/query/ee/tests/it/aggregating_index/index_scan.rs +++ b/src/query/ee/tests/it/aggregating_index/index_scan.rs @@ -1085,8 +1085,8 @@ async fn test_fuzz_impl(format: &str) -> Result<()> { } // Clear data - execute_sql(fixture.ctx(), "DROP TABLE rt ALL").await?; - execute_sql(fixture.ctx(), "DROP TABLE t ALL").await?; + execute_sql(fixture.ctx(), "DROP TABLE rt").await?; + execute_sql(fixture.ctx(), "DROP TABLE t").await?; } } Ok(()) diff --git a/src/query/service/src/api/rpc/packets/packet_truncate_table.rs b/src/query/service/src/api/rpc/packets/packet_truncate_table.rs index cc6ddae0c08b..75670a86214c 100644 --- a/src/query/service/src/api/rpc/packets/packet_truncate_table.rs +++ b/src/query/service/src/api/rpc/packets/packet_truncate_table.rs @@ -25,7 +25,6 @@ use crate::api::FlightAction; #[derive(serde::Serialize, serde::Deserialize, Clone, Debug)] pub struct TruncateTablePacket { - pub purge: bool, pub table_name: String, pub catalog_name: String, pub database_name: String, @@ -38,10 +37,8 @@ impl TruncateTablePacket { table_name: String, catalog_name: String, database_name: String, - purge: bool, ) -> TruncateTablePacket { TruncateTablePacket { - purge, table_name, catalog_name, database_name, diff --git a/src/query/service/src/interpreters/interpreter_table_drop.rs b/src/query/service/src/interpreters/interpreter_table_drop.rs index ba9a59b6f7ae..362695d296e3 100644 --- a/src/query/service/src/interpreters/interpreter_table_drop.rs +++ b/src/query/service/src/interpreters/interpreter_table_drop.rs @@ -14,7 +14,6 @@ use std::sync::Arc; -use common_catalog::table::TableExt; use common_exception::ErrorCode; use common_exception::Result; use common_meta_app::schema::DropTableByIdReq; @@ -78,15 +77,6 @@ impl Interpreter for DropTableInterpreter { }) .await?; - // if `plan.all`, truncate, then purge the historical data - if self.plan.all { - let purge = true; - // the above `catalog.drop_table` operation changed the table meta version, - // thus if we do not refresh the table instance, `truncate` will fail - let latest = tbl.as_ref().refresh(self.ctx.as_ref()).await?; - latest.truncate(self.ctx.clone(), purge).await? - } - if let Some((spec_vec, share_table_info)) = resp.spec_vec { save_share_spec( &self.ctx.get_tenant(), diff --git a/src/query/service/src/interpreters/interpreter_table_truncate.rs b/src/query/service/src/interpreters/interpreter_table_truncate.rs index a75f1a976b92..2b2eb0836644 100644 --- a/src/query/service/src/interpreters/interpreter_table_truncate.rs +++ b/src/query/service/src/interpreters/interpreter_table_truncate.rs @@ -27,7 +27,6 @@ use crate::sessions::TableContext; pub struct TruncateTableInterpreter { ctx: Arc, - purge: bool, table_name: String, catalog_name: String, database_name: String, @@ -39,7 +38,6 @@ impl TruncateTableInterpreter { pub fn try_create(ctx: Arc, plan: TruncateTablePlan) -> Result { Ok(TruncateTableInterpreter { ctx, - purge: plan.purge, table_name: plan.table, catalog_name: plan.catalog, database_name: plan.database, @@ -50,7 +48,6 @@ impl TruncateTableInterpreter { pub fn from_flight(ctx: Arc, packet: TruncateTablePacket) -> Result { Ok(TruncateTableInterpreter { ctx, - purge: packet.purge, table_name: packet.table_name, catalog_name: packet.catalog_name, database_name: packet.database_name, @@ -84,14 +81,13 @@ impl Interpreter for TruncateTableInterpreter { self.table_name.clone(), self.catalog_name.clone(), self.database_name.clone(), - self.purge, ); truncate_packet.commit(conf.as_ref(), timeout).await?; } } } - table.truncate(self.ctx.clone(), self.purge).await?; + table.truncate(self.ctx.clone()).await?; Ok(PipelineBuildResult::create()) } } diff --git a/src/query/service/tests/it/storages/fuse/operations/analyze.rs b/src/query/service/tests/it/storages/fuse/operations/analyze.rs index bc9498c5ca5a..46eb0cc9c44d 100644 --- a/src/query/service/tests/it/storages/fuse/operations/analyze.rs +++ b/src/query/service/tests/it/storages/fuse/operations/analyze.rs @@ -77,7 +77,7 @@ async fn test_fuse_snapshot_analyze_and_truncate() -> Result<()> { .get_table(ctx.get_tenant().as_str(), &db, &tbl) .await?; let fuse_table = FuseTable::try_from_table(table.as_ref())?; - fuse_table.truncate(ctx, false).await?; + fuse_table.truncate(ctx).await?; } // optimize after truncate table, ts file location will become None diff --git a/src/query/service/tests/it/storages/fuse/operations/gc.rs b/src/query/service/tests/it/storages/fuse/operations/gc.rs index 512436f2d875..447ddcc394c0 100644 --- a/src/query/service/tests/it/storages/fuse/operations/gc.rs +++ b/src/query/service/tests/it/storages/fuse/operations/gc.rs @@ -114,9 +114,9 @@ async fn test_fuse_purge_normal_orphan_snapshot() -> Result<()> { "do_gc: there should be 1 snapshot, 0 segment/block", expected_num_of_snapshot, 0, // 0 snapshot statistic - 1, // 0 segments - 1, // 0 blocks - 1, // 0 index + 1, // 1 segments + 1, // 1 blocks + 1, // 1 index Some(()), None, ) diff --git a/src/query/service/tests/it/storages/fuse/operations/mod.rs b/src/query/service/tests/it/storages/fuse/operations/mod.rs index 9d9d8e8a6175..7b22f3c11852 100644 --- a/src/query/service/tests/it/storages/fuse/operations/mod.rs +++ b/src/query/service/tests/it/storages/fuse/operations/mod.rs @@ -23,7 +23,6 @@ mod mutation; mod navigate; mod optimize; mod purge_drop; -mod purge_truncate; mod read_plan; mod replace_into; mod table_analyze; diff --git a/src/query/service/tests/it/storages/fuse/operations/purge_drop.rs b/src/query/service/tests/it/storages/fuse/operations/purge_drop.rs index 4c9e7762c5ca..b78191acce2f 100644 --- a/src/query/service/tests/it/storages/fuse/operations/purge_drop.rs +++ b/src/query/service/tests/it/storages/fuse/operations/purge_drop.rs @@ -15,7 +15,6 @@ use common_base::base::tokio; use common_exception::Result; use databend_query::test_kits::table_test_fixture::append_sample_data; -use databend_query::test_kits::table_test_fixture::check_data_dir; use databend_query::test_kits::table_test_fixture::execute_command; use databend_query::test_kits::table_test_fixture::TestFixture; @@ -34,32 +33,3 @@ async fn test_fuse_snapshot_truncate_in_drop_stmt() -> Result<()> { execute_command(ctx.clone(), qry.as_str()).await?; Ok(()) } - -#[tokio::test(flavor = "multi_thread")] -async fn test_fuse_snapshot_truncate_in_drop_all_stmt() -> Result<()> { - let fixture = TestFixture::new().await; - let db = fixture.default_db_name(); - let tbl = fixture.default_table_name(); - let ctx = fixture.ctx(); - fixture.create_default_table().await?; - - // ingests some test data - append_sample_data(1, &fixture).await?; - // let's Drop - let qry = format!("drop table {}.{} all", db, tbl); - execute_command(ctx.clone(), qry.as_str()).await?; - - check_data_dir( - &fixture, - "drop table: there should be 1 snapshot, 0 segment/block", - 1, // 1 snapshot - 0, // 0 snapshot statistic - 0, // 0 segments - 0, // 0 blocks - 0, // 0 index - None, - None, - ) - .await?; - Ok(()) -} diff --git a/src/query/service/tests/it/storages/fuse/operations/purge_truncate.rs b/src/query/service/tests/it/storages/fuse/operations/purge_truncate.rs deleted file mode 100644 index 86c6baf7e692..000000000000 --- a/src/query/service/tests/it/storages/fuse/operations/purge_truncate.rs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2021 Datafuse Labs. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -use common_base::base::tokio; -use common_exception::Result; -use databend_query::test_kits::table_test_fixture::append_sample_data; -use databend_query::test_kits::table_test_fixture::check_data_dir; -use databend_query::test_kits::table_test_fixture::execute_command; -use databend_query::test_kits::table_test_fixture::history_should_have_item; -use databend_query::test_kits::table_test_fixture::TestFixture; - -#[tokio::test(flavor = "multi_thread")] -async fn test_fuse_truncate_purge_stmt() -> Result<()> { - let fixture = TestFixture::new().await; - let db = fixture.default_db_name(); - let tbl = fixture.default_table_name(); - let ctx = fixture.ctx(); - fixture.create_default_table().await?; - - // ingests some 2 blocks - append_sample_data(1, &fixture).await?; - append_sample_data(1, &fixture).await?; - - let expected_index_count = 2; - // there should be some data there: 2 snapshot, 2 segment, 2 block - check_data_dir( - &fixture, - "truncate_purge", - 2, - 0, - 2, - 2, - expected_index_count, - Some(()), - None, - ) - .await?; - - // let's truncate - let qry = format!("truncate table {}.{} purge", db, tbl); - execute_command(ctx.clone(), qry.as_str()).await?; - - // one history item left there - history_should_have_item( - &fixture, - "after_truncate_there_should_be_one_history_item_left", - 1, - ) - .await?; - - // there should be only a snapshot file left there, no segments or blocks - check_data_dir( - &fixture, - "truncate_after_purge_check_file_items", - 1, - 0, - 0, - 0, - 0, - Some(()), - None, - ) - .await?; - Ok(()) -} diff --git a/src/query/service/tests/it/storages/fuse/operations/truncate.rs b/src/query/service/tests/it/storages/fuse/operations/truncate.rs index eae28a6e3538..967ae9dd6a5f 100644 --- a/src/query/service/tests/it/storages/fuse/operations/truncate.rs +++ b/src/query/service/tests/it/storages/fuse/operations/truncate.rs @@ -34,7 +34,7 @@ async fn test_fuse_table_truncate() -> common_exception::Result<()> { // 1. truncate empty table let prev_version = table.get_table_info().ident.seq; - let r = table.truncate(ctx.clone(), false).await; + let r = table.truncate(ctx.clone()).await; let table = fixture.latest_default_table().await?; // no side effects assert_eq!(prev_version, table.get_table_info().ident.seq); @@ -66,8 +66,7 @@ async fn test_fuse_table_truncate() -> common_exception::Result<()> { assert_eq!(stats.read_rows, (num_blocks * rows_per_block)); // truncate - let purge = false; - let r = table.truncate(ctx.clone(), purge).await; + let r = table.truncate(ctx.clone()).await; assert!(r.is_ok()); // get the latest tbl @@ -147,8 +146,7 @@ async fn test_fuse_table_truncate_appending_concurrently() -> common_exception:: let s2_table_to_appended = fixture.latest_default_table().await?; // 4. perform `truncate purge` operation on s1 - let purge = true; - let r = s1_table_to_be_truncated.truncate(ctx.clone(), purge).await; + let r = s1_table_to_be_truncated.truncate(ctx.clone()).await; // version mismatched, and `truncate purge` should result in error (but nothing should have been removed) assert!(r.is_err()); diff --git a/src/query/service/tests/it/storages/null.rs b/src/query/service/tests/it/storages/null.rs index 2876aceec182..fe5494af29f4 100644 --- a/src/query/service/tests/it/storages/null.rs +++ b/src/query/service/tests/it/storages/null.rs @@ -62,8 +62,7 @@ async fn test_null_table() -> Result<()> { // truncate. { - let purge = false; - table.truncate(ctx, purge).await?; + table.truncate(ctx).await?; } Ok(()) diff --git a/src/query/sql/src/planner/binder/ddl/table.rs b/src/query/sql/src/planner/binder/ddl/table.rs index df82edbccc8f..655cf3fb4785 100644 --- a/src/query/sql/src/planner/binder/ddl/table.rs +++ b/src/query/sql/src/planner/binder/ddl/table.rs @@ -666,7 +666,6 @@ impl Binder { catalog, database, table, - all, } = stmt; let tenant = self.ctx.get_tenant(); @@ -679,7 +678,6 @@ impl Binder { catalog, database, table, - all: *all, }))) } @@ -971,7 +969,6 @@ impl Binder { catalog, database, table, - purge, } = stmt; let (catalog, database, table) = @@ -981,7 +978,6 @@ impl Binder { catalog, database, table, - purge: *purge, }))) } diff --git a/src/query/sql/src/planner/plans/ddl/table.rs b/src/query/sql/src/planner/plans/ddl/table.rs index c447a07bb680..899eae287f8a 100644 --- a/src/query/sql/src/planner/plans/ddl/table.rs +++ b/src/query/sql/src/planner/plans/ddl/table.rs @@ -84,7 +84,6 @@ pub struct DropTablePlan { pub database: String, /// The table name pub table: String, - pub all: bool, } impl DropTablePlan { @@ -324,7 +323,6 @@ pub struct TruncateTablePlan { pub database: String, /// The table name pub table: String, - pub purge: bool, } impl TruncateTablePlan { diff --git a/src/query/storages/fuse/src/fuse_table.rs b/src/query/storages/fuse/src/fuse_table.rs index a0ccda0c0f87..71039e682160 100644 --- a/src/query/storages/fuse/src/fuse_table.rs +++ b/src/query/storages/fuse/src/fuse_table.rs @@ -553,8 +553,8 @@ impl Table for FuseTable { #[minitrace::trace(name = "fuse_table_truncate")] #[async_backtrace::framed] - async fn truncate(&self, ctx: Arc, purge: bool) -> Result<()> { - self.do_truncate(ctx, purge).await + async fn truncate(&self, ctx: Arc) -> Result<()> { + self.do_truncate(ctx).await } #[minitrace::trace(name = "fuse_table_optimize")] diff --git a/src/query/storages/fuse/src/io/read/block/block_reader_parquet_deserialize.rs b/src/query/storages/fuse/src/io/read/block/block_reader_parquet_deserialize.rs index 1c7a8528965b..e83767533c59 100644 --- a/src/query/storages/fuse/src/io/read/block/block_reader_parquet_deserialize.rs +++ b/src/query/storages/fuse/src/io/read/block/block_reader_parquet_deserialize.rs @@ -336,7 +336,7 @@ impl BlockReader { Suppose the name of table is T ~~~ create table tmp_t as select * from T; - drop table T all; + drop table T; alter table tmp_t rename to T; ~~~ Please note that the history of table T WILL BE LOST. diff --git a/src/query/storages/fuse/src/operations/delete.rs b/src/query/storages/fuse/src/operations/delete.rs index e08ef24f1dce..d92faa19b428 100644 --- a/src/query/storages/fuse/src/operations/delete.rs +++ b/src/query/storages/fuse/src/operations/delete.rs @@ -99,8 +99,7 @@ impl FuseTable { }; ctx.get_write_progress().incr(&progress_values); // deleting the whole table... just a truncate - let purge = false; - return self.do_truncate(ctx.clone(), purge).await.map(|_| None); + return self.do_truncate(ctx.clone()).await.map(|_| None); } Some(filters) => filters, }; @@ -122,8 +121,7 @@ impl FuseTable { ctx.get_write_progress().incr(&progress_values); // deleting the whole table... just a truncate - let purge = false; - return self.do_truncate(ctx.clone(), purge).await.map(|_| None); + return self.do_truncate(ctx.clone()).await.map(|_| None); } } Ok(Some(snapshot.clone())) diff --git a/src/query/storages/fuse/src/operations/truncate.rs b/src/query/storages/fuse/src/operations/truncate.rs index 2685d8c6093f..540b714df832 100644 --- a/src/query/storages/fuse/src/operations/truncate.rs +++ b/src/query/storages/fuse/src/operations/truncate.rs @@ -30,7 +30,7 @@ use crate::FuseTable; impl FuseTable { #[inline] #[async_backtrace::framed] - pub async fn do_truncate(&self, ctx: Arc, purge: bool) -> Result<()> { + pub async fn do_truncate(&self, ctx: Arc) -> Result<()> { if let Some(prev_snapshot) = self.read_table_snapshot().await? { // 1. prepare new snapshot let prev_id = prev_snapshot.snapshot_id; @@ -97,23 +97,6 @@ impl FuseTable { new_snapshot_loc, ) .await; - - // best effort to remove historical data. if failed, let `vacuum` to do the job. - // TODO: consider remove the `purge` option from `truncate` - // - it is not a safe operation, there is NO retention interval protection here - // - it is incompatible with time travel features - if purge { - let snapshot_files = self.list_snapshot_files().await?; - let keep_last_snapshot = false; - let ret = self - .do_purge(&ctx, snapshot_files, None, keep_last_snapshot, false) - .await; - if let Err(e) = ret { - return Err(e); - } else { - return Ok(()); - } - } } Ok(()) diff --git a/src/query/storages/hive/hive/src/hive_table.rs b/src/query/storages/hive/hive/src/hive_table.rs index 001cd227a3ce..bcb31d05f0cf 100644 --- a/src/query/storages/hive/hive/src/hive_table.rs +++ b/src/query/storages/hive/hive/src/hive_table.rs @@ -602,7 +602,7 @@ impl Table for HiveTable { } #[async_backtrace::framed] - async fn truncate(&self, _ctx: Arc, _: bool) -> Result<()> { + async fn truncate(&self, _ctx: Arc) -> Result<()> { Err(ErrorCode::Unimplemented(format!( "truncate for table {} is not implemented", self.name() diff --git a/src/query/storages/memory/src/memory_table.rs b/src/query/storages/memory/src/memory_table.rs index 43e1ef1fc7e8..8605eb97e35f 100644 --- a/src/query/storages/memory/src/memory_table.rs +++ b/src/query/storages/memory/src/memory_table.rs @@ -262,7 +262,7 @@ impl Table for MemoryTable { } #[async_backtrace::framed] - async fn truncate(&self, _ctx: Arc, _: bool) -> Result<()> { + async fn truncate(&self, _ctx: Arc) -> Result<()> { let mut blocks = self.blocks.write(); blocks.clear(); Ok(()) diff --git a/src/query/storages/stage/src/stage_table.rs b/src/query/storages/stage/src/stage_table.rs index 3885b84d4bbe..3eb8d8e4baa1 100644 --- a/src/query/storages/stage/src/stage_table.rs +++ b/src/query/storages/stage/src/stage_table.rs @@ -274,7 +274,7 @@ impl Table for StageTable { // Truncate the stage file. #[async_backtrace::framed] - async fn truncate(&self, _ctx: Arc, _: bool) -> Result<()> { + async fn truncate(&self, _ctx: Arc) -> Result<()> { Err(ErrorCode::Unimplemented( "S3 external table truncate() unimplemented yet!", )) diff --git a/src/query/storages/system/src/log_queue.rs b/src/query/storages/system/src/log_queue.rs index 748623ca3cf2..9a4dc18550c7 100644 --- a/src/query/storages/system/src/log_queue.rs +++ b/src/query/storages/system/src/log_queue.rs @@ -215,7 +215,7 @@ impl Table for SystemLogTable { } #[async_backtrace::framed] - async fn truncate(&self, _ctx: Arc, _: bool) -> Result<()> { + async fn truncate(&self, _ctx: Arc) -> Result<()> { let log_queue = SystemLogQueue::::instance()?; let mut write_guard = log_queue.data.write(); diff --git a/src/query/storages/system/src/table.rs b/src/query/storages/system/src/table.rs index 8d01a1c0f3d6..55dbfb8648e5 100644 --- a/src/query/storages/system/src/table.rs +++ b/src/query/storages/system/src/table.rs @@ -149,7 +149,7 @@ impl Table for SyncOneBlockSystemTable, _purge: bool) -> Result<()> { + async fn truncate(&self, ctx: Arc) -> Result<()> { self.inner_table.truncate(ctx) } diff --git a/src/tests/sqlsmith/src/sql_gen/ddl.rs b/src/tests/sqlsmith/src/sql_gen/ddl.rs index ef981e2b8463..c91329af1d63 100644 --- a/src/tests/sqlsmith/src/sql_gen/ddl.rs +++ b/src/tests/sqlsmith/src/sql_gen/ddl.rs @@ -66,7 +66,6 @@ impl<'a, R: Rng> SqlGenerator<'a, R> { catalog: None, database: None, table: Identifier::from_name(table_name.clone()), - all: false, }; let create_table = CreateTableStmt { if_not_exists: true, diff --git a/tests/sqllogictests/suites/base/01_system/01_0002_system_query_log b/tests/sqllogictests/suites/base/01_system/01_0002_system_query_log index 9ec8305f11df..82ce2774d1d8 100644 --- a/tests/sqllogictests/suites/base/01_system/01_0002_system_query_log +++ b/tests/sqllogictests/suites/base/01_system/01_0002_system_query_log @@ -12,7 +12,7 @@ select count(*) > 0 from system.query_log 1 statement ok -drop table if exists tbl_01_0002 all +drop table if exists tbl_01_0002 statement ok create table tbl_01_0002(a int) diff --git a/tests/sqllogictests/suites/base/01_system/01_0007_system_clustering_history b/tests/sqllogictests/suites/base/01_system/01_0007_system_clustering_history index 0294adf01e81..1072cd21c742 100644 --- a/tests/sqllogictests/suites/base/01_system/01_0007_system_clustering_history +++ b/tests/sqllogictests/suites/base/01_system/01_0007_system_clustering_history @@ -1,5 +1,5 @@ statement ok -drop table if exists tbl_01_0007 all +drop table if exists tbl_01_0007 statement ok create table tbl_01_0007(a int not null) cluster by(a) diff --git a/tests/sqllogictests/suites/base/03_common/03_0003_select_group_by b/tests/sqllogictests/suites/base/03_common/03_0003_select_group_by index 5a57592d690f..602cf6039f5d 100644 --- a/tests/sqllogictests/suites/base/03_common/03_0003_select_group_by +++ b/tests/sqllogictests/suites/base/03_common/03_0003_select_group_by @@ -75,7 +75,7 @@ statement ok DROP table t statement ok -drop table if exists t_datetime all +drop table if exists t_datetime statement ok CREATE TABLE t_datetime(created_at Date, created_time DateTime, count Int32) diff --git a/tests/sqllogictests/suites/base/03_common/03_0025_delete_from b/tests/sqllogictests/suites/base/03_common/03_0025_delete_from index 692e4f549964..ec371b908bba 100644 --- a/tests/sqllogictests/suites/base/03_common/03_0025_delete_from +++ b/tests/sqllogictests/suites/base/03_common/03_0025_delete_from @@ -54,7 +54,7 @@ select count(*) = 0 from t statement ok -drop table t all +drop table t statement ok create table t (c Int null) @@ -141,7 +141,7 @@ select count(*) = 0 from t statement ok -drop table t all +drop table t statement ok create table t(c Int) CLUSTER BY(c+1) @@ -161,7 +161,7 @@ select count(*) = 2 from t 1 statement ok -drop table t all +drop table t statement ok create table t(a Int, b Int) @@ -186,7 +186,7 @@ statement ok delete from t where t.a in (select * from numbers(10)) statement ok -drop table t all +drop table t #################################### @@ -245,7 +245,7 @@ select * from t order by c; statement ok -drop table t all +drop table t #################################### # delete pruning, whole segments # @@ -279,7 +279,7 @@ select * from t order by c; 9 statement ok -drop table t all +drop table t # test large data statement ok @@ -319,7 +319,7 @@ select count(*) from t where c >= 0 and c < 1500000; 0 statement ok -drop table t all +drop table t statement ok DROP DATABASE db1 diff --git a/tests/sqllogictests/suites/base/03_common/03_0028_copy_into_stage b/tests/sqllogictests/suites/base/03_common/03_0028_copy_into_stage index ec78cb18074a..e607cd744ed2 100644 --- a/tests/sqllogictests/suites/base/03_common/03_0028_copy_into_stage +++ b/tests/sqllogictests/suites/base/03_common/03_0028_copy_into_stage @@ -31,7 +31,7 @@ SELECT COUNT() FROM test_table 4 statement ok -drop table test_table all +drop table test_table statement ok drop stage test diff --git a/tests/sqllogictests/suites/base/03_common/03_0031_copy_into_user_stage b/tests/sqllogictests/suites/base/03_common/03_0031_copy_into_user_stage index 6dee4c9f4fdf..462da395ef8e 100644 --- a/tests/sqllogictests/suites/base/03_common/03_0031_copy_into_user_stage +++ b/tests/sqllogictests/suites/base/03_common/03_0031_copy_into_user_stage @@ -28,7 +28,7 @@ SELECT COUNT() FROM test_table 4 statement ok -drop table test_table all +drop table test_table statement ok DROP DATABASE db1 diff --git a/tests/sqllogictests/suites/base/03_common/03_0035_update b/tests/sqllogictests/suites/base/03_common/03_0035_update index 25d88b78d7d6..f347f054432a 100644 --- a/tests/sqllogictests/suites/base/03_common/03_0035_update +++ b/tests/sqllogictests/suites/base/03_common/03_0035_update @@ -89,13 +89,13 @@ select a from t3 6 statement ok -drop table t1 all +drop table t1 statement ok -drop table t2 all +drop table t2 statement ok -drop table t3 all +drop table t3 statement ok create table t1(id1 int, val1 varchar(255)); diff --git a/tests/sqllogictests/suites/base/05_ddl/05_0001_ddl_drop_table_full b/tests/sqllogictests/suites/base/05_ddl/05_0001_ddl_drop_table_full index 5be01f171242..35cf934d75ed 100644 --- a/tests/sqllogictests/suites/base/05_ddl/05_0001_ddl_drop_table_full +++ b/tests/sqllogictests/suites/base/05_ddl/05_0001_ddl_drop_table_full @@ -11,13 +11,13 @@ statement ok CREATE TABLE t(c1 int) ENGINE = Null statement ok -DROP TABLE t ALL +DROP TABLE t statement ok CREATE TABLE t(c1 int) ENGINE = Fuse statement ok -DROP TABLE t ALL +DROP TABLE t statement ok DROP database db_13_0001 diff --git a/tests/sqllogictests/suites/base/05_ddl/05_0023_exists_table b/tests/sqllogictests/suites/base/05_ddl/05_0023_exists_table index 971e21f68fbc..80bcb8cbfe49 100644 --- a/tests/sqllogictests/suites/base/05_ddl/05_0023_exists_table +++ b/tests/sqllogictests/suites/base/05_ddl/05_0023_exists_table @@ -23,7 +23,7 @@ statement ok EXISTS TABLE db_05_0023_v2.t statement ok -DROP TABLE t ALL +DROP TABLE t statement ok EXISTS TABLE db_05_0023_v2.t diff --git a/tests/sqllogictests/suites/base/09_fuse_engine/09_0006_func_fuse_history b/tests/sqllogictests/suites/base/09_fuse_engine/09_0006_func_fuse_history index 522df13c0f26..74caa07f7c9a 100644 --- a/tests/sqllogictests/suites/base/09_fuse_engine/09_0006_func_fuse_history +++ b/tests/sqllogictests/suites/base/09_fuse_engine/09_0006_func_fuse_history @@ -81,7 +81,7 @@ select count() from fuse_block('db_09_0006', 't1') 5 statement ok -truncate table t1 purge +truncate table t1 query I select block_size from fuse_block('db_09_0006', 't1') diff --git a/tests/sqllogictests/suites/base/09_fuse_engine/09_0007_func_fuse_truncate_purge b/tests/sqllogictests/suites/base/09_fuse_engine/09_0007_func_fuse_truncate similarity index 95% rename from tests/sqllogictests/suites/base/09_fuse_engine/09_0007_func_fuse_truncate_purge rename to tests/sqllogictests/suites/base/09_fuse_engine/09_0007_func_fuse_truncate index 54d0d969018c..0af63cefa0bc 100644 --- a/tests/sqllogictests/suites/base/09_fuse_engine/09_0007_func_fuse_truncate_purge +++ b/tests/sqllogictests/suites/base/09_fuse_engine/09_0007_func_fuse_truncate @@ -25,12 +25,12 @@ select count(*) from fuse_snapshot('db_09_0007', 't') 3 statement ok -truncate table `t` purge +truncate table `t` query I select count(*) from fuse_snapshot('db_09_0007', 't') ---- -1 +4 statement ok select * from t diff --git a/tests/sqllogictests/suites/base/09_fuse_engine/09_0016_remote_alter_recluster b/tests/sqllogictests/suites/base/09_fuse_engine/09_0016_remote_alter_recluster index 367af1a8242c..b65f946d7aeb 100644 --- a/tests/sqllogictests/suites/base/09_fuse_engine/09_0016_remote_alter_recluster +++ b/tests/sqllogictests/suites/base/09_fuse_engine/09_0016_remote_alter_recluster @@ -82,7 +82,7 @@ select average_overlaps, average_depth, block_depth_histogram from clustering_in # test trim string statement ok -truncate table t3 purge +truncate table t3 statement ok insert into t3 values(1,'123456780'),(2,'123456781') diff --git a/tests/sqllogictests/suites/base/09_fuse_engine/09_0017_transient_table b/tests/sqllogictests/suites/base/09_fuse_engine/09_0017_transient_table index 50a3db5b52a0..52d2b201306b 100644 --- a/tests/sqllogictests/suites/base/09_fuse_engine/09_0017_transient_table +++ b/tests/sqllogictests/suites/base/09_fuse_engine/09_0017_transient_table @@ -38,4 +38,3 @@ DROP TABLE t09_0016 statement ok DROP DATABASE db1 - diff --git a/tests/sqllogictests/suites/base/12_time_travel/12_0003_time_travel_undrop b/tests/sqllogictests/suites/base/12_time_travel/12_0003_time_travel_undrop index 0f0609ace3e8..50acc17bf61c 100644 --- a/tests/sqllogictests/suites/base/12_time_travel/12_0003_time_travel_undrop +++ b/tests/sqllogictests/suites/base/12_time_travel/12_0003_time_travel_undrop @@ -103,22 +103,5 @@ SELECT count(1) FROM t statement ok DROP TABLE t -statement ok -CREATE TABLE t(c int) - -statement ok -INSERT INTO t values(1) - -statement ok -DROP TABLE t ALL - -statement ok -UNDROP TABLE t - -query I -SELECT count(*) FROM t ----- -0 - statement ok DROP database db_12_0003 diff --git a/tests/sqllogictests/suites/base/issues/issue_10103.test b/tests/sqllogictests/suites/base/issues/issue_10103.test index f617f68c50e8..3be0dad32034 100644 --- a/tests/sqllogictests/suites/base/issues/issue_10103.test +++ b/tests/sqllogictests/suites/base/issues/issue_10103.test @@ -34,10 +34,10 @@ SELECT ts FROM test_ts_table LIMIT 1 2023-02-19 11:18:01.000000 statement ok -drop table test_table all +drop table test_table statement ok -drop table test_ts_table all +drop table test_ts_table statement ok drop stage test_10103 diff --git a/tests/sqllogictests/suites/duckdb/sql/aggregate/group/group_by_grouping_sets.test b/tests/sqllogictests/suites/duckdb/sql/aggregate/group/group_by_grouping_sets.test index e19ae1bf808e..4bfb3f29314e 100644 --- a/tests/sqllogictests/suites/duckdb/sql/aggregate/group/group_by_grouping_sets.test +++ b/tests/sqllogictests/suites/duckdb/sql/aggregate/group/group_by_grouping_sets.test @@ -245,10 +245,10 @@ a B 1 5 NULL B a A 1 5 NULL NULL statement ok -drop table t all; +drop table t; statement ok -drop table tt all; +drop table tt; statement ok drop database grouping_sets; diff --git a/tests/sqllogictests/suites/mode/cluster/04_0002_explain_v2.test b/tests/sqllogictests/suites/mode/cluster/04_0002_explain_v2.test index 3fa4bfbf8c5e..a96df63e25e0 100644 --- a/tests/sqllogictests/suites/mode/cluster/04_0002_explain_v2.test +++ b/tests/sqllogictests/suites/mode/cluster/04_0002_explain_v2.test @@ -2,10 +2,10 @@ statement ok set prefer_broadcast_join = 0 statement ok -drop table if exists t1 all; +drop table if exists t1; statement ok -drop table if exists t2 all; +drop table if exists t2; statement ok create table t1(a int not null, b int not null); diff --git a/tests/sqllogictests/suites/mode/standalone/explain/explain.test b/tests/sqllogictests/suites/mode/standalone/explain/explain.test index 40519c29096a..132b69430e93 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain/explain.test +++ b/tests/sqllogictests/suites/mode/standalone/explain/explain.test @@ -1,8 +1,8 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok -drop table if exists t2 all +drop table if exists t2 statement ok create table t1 as select number as a, number as b from numbers(1) diff --git a/tests/sqllogictests/suites/mode/standalone/explain_native/explain.test b/tests/sqllogictests/suites/mode/standalone/explain_native/explain.test index 267c0cc4489c..b9f77ca809f8 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain_native/explain.test +++ b/tests/sqllogictests/suites/mode/standalone/explain_native/explain.test @@ -1,8 +1,8 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok -drop table if exists t2 all +drop table if exists t2 statement ok create table t1 as select number as a, number as b from numbers(1) diff --git a/tests/sqllogictests/suites/query/02_function/02_0012_function_datetimes b/tests/sqllogictests/suites/query/02_function/02_0012_function_datetimes index b795556fdfe0..45ea602d715e 100644 --- a/tests/sqllogictests/suites/query/02_function/02_0012_function_datetimes +++ b/tests/sqllogictests/suites/query/02_function/02_0012_function_datetimes @@ -1,5 +1,5 @@ statement ok -drop table if exists t all +drop table if exists t statement ok set timezone = 'UTC' diff --git a/tests/sqllogictests/suites/query/02_function/02_0012_function_datetimes_tz b/tests/sqllogictests/suites/query/02_function/02_0012_function_datetimes_tz index 765c124cbf74..cd751f969ee3 100644 --- a/tests/sqllogictests/suites/query/02_function/02_0012_function_datetimes_tz +++ b/tests/sqllogictests/suites/query/02_function/02_0012_function_datetimes_tz @@ -1,5 +1,5 @@ statement ok -drop table if exists tt all +drop table if exists tt statement ok set timezone='UTC' diff --git a/tests/sqllogictests/suites/query/02_function/02_0014_function_maths b/tests/sqllogictests/suites/query/02_function/02_0014_function_maths index e88a7c4cb3f7..6325dc32dbbc 100644 --- a/tests/sqllogictests/suites/query/02_function/02_0014_function_maths +++ b/tests/sqllogictests/suites/query/02_function/02_0014_function_maths @@ -1,5 +1,5 @@ statement ok -drop table if exists math_sample_numbers all +drop table if exists math_sample_numbers statement ok CREATE TABLE math_sample_numbers (timestamp UInt32, value Int32) Engine = Fuse diff --git a/tests/sqllogictests/suites/query/02_function/02_0018_function_strings_repeat b/tests/sqllogictests/suites/query/02_function/02_0018_function_strings_repeat index a2c3ba90ad7e..7e6bcdbafe20 100644 --- a/tests/sqllogictests/suites/query/02_function/02_0018_function_strings_repeat +++ b/tests/sqllogictests/suites/query/02_function/02_0018_function_strings_repeat @@ -1,14 +1,14 @@ statement ok -drop table if exists strings_repeat_sample_u8 all +drop table if exists strings_repeat_sample_u8 statement ok -drop table if exists strings_repeat_sample_u16 all +drop table if exists strings_repeat_sample_u16 statement ok -drop table if exists strings_repeat_sample_u32 all +drop table if exists strings_repeat_sample_u32 statement ok -drop table if exists strings_repeat_sample_u64 all +drop table if exists strings_repeat_sample_u64 statement ok CREATE TABLE strings_repeat_sample_u8(s String, n Uint8) Engine = Fuse diff --git a/tests/sqllogictests/suites/query/02_function/02_0048_function_semi_structureds_object_keys b/tests/sqllogictests/suites/query/02_function/02_0048_function_semi_structureds_object_keys index d475a1a6839c..af71632ed5ce 100644 --- a/tests/sqllogictests/suites/query/02_function/02_0048_function_semi_structureds_object_keys +++ b/tests/sqllogictests/suites/query/02_function/02_0048_function_semi_structureds_object_keys @@ -1,5 +1,5 @@ statement ok -drop table if exists objects_test1 all +drop table if exists objects_test1 statement ok CREATE TABLE IF NOT EXISTS objects_test1(id TINYINT, obj VARIANT, var VARIANT) Engine = Fuse diff --git a/tests/sqllogictests/suites/query/cte.test b/tests/sqllogictests/suites/query/cte.test index 4ffcf46b2de4..9df89c397fc6 100644 --- a/tests/sqllogictests/suites/query/cte.test +++ b/tests/sqllogictests/suites/query/cte.test @@ -2,7 +2,7 @@ statement ok use default statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer, b integer, c integer, d integer, e integer) diff --git a/tests/sqllogictests/suites/query/render_result.test b/tests/sqllogictests/suites/query/render_result.test index aef7151accd1..bfb960bf447c 100644 --- a/tests/sqllogictests/suites/query/render_result.test +++ b/tests/sqllogictests/suites/query/render_result.test @@ -2,7 +2,7 @@ statement ok use default statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer, b integer, c integer, d integer, e integer) @@ -30,4 +30,4 @@ order by col1,col5,col3,col2,col4 106 1 333 1067 109 statement ok -drop table if exists t1 all +drop table if exists t1 diff --git a/tests/sqllogictests/suites/ydb/select1-1.test b/tests/sqllogictests/suites/ydb/select1-1.test index 766b45362807..0d0390458591 100644 --- a/tests/sqllogictests/suites/ydb/select1-1.test +++ b/tests/sqllogictests/suites/ydb/select1-1.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer, b integer, c integer, d integer, e integer) diff --git a/tests/sqllogictests/suites/ydb/select1-2.test b/tests/sqllogictests/suites/ydb/select1-2.test index b8eb36808143..6093d3b5d977 100644 --- a/tests/sqllogictests/suites/ydb/select1-2.test +++ b/tests/sqllogictests/suites/ydb/select1-2.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer, b integer, c integer, d integer, e integer) diff --git a/tests/sqllogictests/suites/ydb/select1-3.test b/tests/sqllogictests/suites/ydb/select1-3.test index 4d3b407c6f04..7ebd1a7dc9fa 100644 --- a/tests/sqllogictests/suites/ydb/select1-3.test +++ b/tests/sqllogictests/suites/ydb/select1-3.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer, b integer, c integer, d integer, e integer) diff --git a/tests/sqllogictests/suites/ydb/select1-4.test b/tests/sqllogictests/suites/ydb/select1-4.test index 49a214f8502e..b6906faa30d2 100644 --- a/tests/sqllogictests/suites/ydb/select1-4.test +++ b/tests/sqllogictests/suites/ydb/select1-4.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer, b integer, c integer, d integer, e integer) diff --git a/tests/sqllogictests/suites/ydb/select1-5.test b/tests/sqllogictests/suites/ydb/select1-5.test index 4be2a249bfe1..dcf4708612d2 100644 --- a/tests/sqllogictests/suites/ydb/select1-5.test +++ b/tests/sqllogictests/suites/ydb/select1-5.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer, b integer, c integer, d integer, e integer) diff --git a/tests/sqllogictests/suites/ydb/select2-1.test b/tests/sqllogictests/suites/ydb/select2-1.test index 36cf9b00c8e9..9b45f459106e 100644 --- a/tests/sqllogictests/suites/ydb/select2-1.test +++ b/tests/sqllogictests/suites/ydb/select2-1.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer null, b integer null, c integer null, d integer null, e integer null) diff --git a/tests/sqllogictests/suites/ydb/select2-2.test b/tests/sqllogictests/suites/ydb/select2-2.test index 9d5471946805..3ff660a15473 100644 --- a/tests/sqllogictests/suites/ydb/select2-2.test +++ b/tests/sqllogictests/suites/ydb/select2-2.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer null, b integer null, c integer null, d integer null, e integer null) diff --git a/tests/sqllogictests/suites/ydb/select2-3.test b/tests/sqllogictests/suites/ydb/select2-3.test index 8261386c5567..3309b5d1b6b8 100644 --- a/tests/sqllogictests/suites/ydb/select2-3.test +++ b/tests/sqllogictests/suites/ydb/select2-3.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer null, b integer null, c integer null, d integer null, e integer null) diff --git a/tests/sqllogictests/suites/ydb/select2-4.test b/tests/sqllogictests/suites/ydb/select2-4.test index 0cf264950b1f..2161ba020978 100644 --- a/tests/sqllogictests/suites/ydb/select2-4.test +++ b/tests/sqllogictests/suites/ydb/select2-4.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer null, b integer null, c integer null, d integer null, e integer null) diff --git a/tests/sqllogictests/suites/ydb/select2-5.test b/tests/sqllogictests/suites/ydb/select2-5.test index c992d31c3c2d..10b98ba17e16 100644 --- a/tests/sqllogictests/suites/ydb/select2-5.test +++ b/tests/sqllogictests/suites/ydb/select2-5.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer null, b integer null, c integer null, d integer null, e integer null) diff --git a/tests/sqllogictests/suites/ydb/select3-1.test b/tests/sqllogictests/suites/ydb/select3-1.test index 22456c0cd6c9..073074374831 100644 --- a/tests/sqllogictests/suites/ydb/select3-1.test +++ b/tests/sqllogictests/suites/ydb/select3-1.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer null, b integer null, c integer null, d integer null, e integer null) diff --git a/tests/sqllogictests/suites/ydb/select3-10.test b/tests/sqllogictests/suites/ydb/select3-10.test index 9866756f8909..c1f1216ab432 100644 --- a/tests/sqllogictests/suites/ydb/select3-10.test +++ b/tests/sqllogictests/suites/ydb/select3-10.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer null, b integer null, c integer null, d integer null, e integer null) diff --git a/tests/sqllogictests/suites/ydb/select3-11.test b/tests/sqllogictests/suites/ydb/select3-11.test index 1a446a863362..e3e6d6b63fd7 100644 --- a/tests/sqllogictests/suites/ydb/select3-11.test +++ b/tests/sqllogictests/suites/ydb/select3-11.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer null, b integer null, c integer null, d integer null, e integer null) diff --git a/tests/sqllogictests/suites/ydb/select3-12.test b/tests/sqllogictests/suites/ydb/select3-12.test index 041169ab4421..708709884737 100644 --- a/tests/sqllogictests/suites/ydb/select3-12.test +++ b/tests/sqllogictests/suites/ydb/select3-12.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer null, b integer null, c integer null, d integer null, e integer null) diff --git a/tests/sqllogictests/suites/ydb/select3-13.test b/tests/sqllogictests/suites/ydb/select3-13.test index 4f0d2d708804..ae77d1da8322 100644 --- a/tests/sqllogictests/suites/ydb/select3-13.test +++ b/tests/sqllogictests/suites/ydb/select3-13.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer null, b integer null, c integer null, d integer null, e integer null) diff --git a/tests/sqllogictests/suites/ydb/select3-14.test b/tests/sqllogictests/suites/ydb/select3-14.test index 223a247e9df1..1b62d6d12f15 100644 --- a/tests/sqllogictests/suites/ydb/select3-14.test +++ b/tests/sqllogictests/suites/ydb/select3-14.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer null, b integer null, c integer null, d integer null, e integer null) diff --git a/tests/sqllogictests/suites/ydb/select3-15.test b/tests/sqllogictests/suites/ydb/select3-15.test index 4c814cf69207..cf6c1fab47d2 100644 --- a/tests/sqllogictests/suites/ydb/select3-15.test +++ b/tests/sqllogictests/suites/ydb/select3-15.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer null, b integer null, c integer null, d integer null, e integer null) diff --git a/tests/sqllogictests/suites/ydb/select3-2.test b/tests/sqllogictests/suites/ydb/select3-2.test index e6b89c287891..f5e46aca3f4a 100644 --- a/tests/sqllogictests/suites/ydb/select3-2.test +++ b/tests/sqllogictests/suites/ydb/select3-2.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer null, b integer null, c integer null, d integer null, e integer null) diff --git a/tests/sqllogictests/suites/ydb/select3-3.test b/tests/sqllogictests/suites/ydb/select3-3.test index bd6c1fcaa9aa..feb46d3a94db 100644 --- a/tests/sqllogictests/suites/ydb/select3-3.test +++ b/tests/sqllogictests/suites/ydb/select3-3.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer null, b integer null, c integer null, d integer null, e integer null) diff --git a/tests/sqllogictests/suites/ydb/select3-4.test b/tests/sqllogictests/suites/ydb/select3-4.test index 0ff745810507..e3dd6076aa0a 100644 --- a/tests/sqllogictests/suites/ydb/select3-4.test +++ b/tests/sqllogictests/suites/ydb/select3-4.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer null, b integer null, c integer null, d integer null, e integer null) diff --git a/tests/sqllogictests/suites/ydb/select3-5.test b/tests/sqllogictests/suites/ydb/select3-5.test index 259d23e75d5b..a9913c947404 100644 --- a/tests/sqllogictests/suites/ydb/select3-5.test +++ b/tests/sqllogictests/suites/ydb/select3-5.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer null, b integer null, c integer null, d integer null, e integer null) diff --git a/tests/sqllogictests/suites/ydb/select3-6.test b/tests/sqllogictests/suites/ydb/select3-6.test index 4877d8876609..312d01a101a1 100644 --- a/tests/sqllogictests/suites/ydb/select3-6.test +++ b/tests/sqllogictests/suites/ydb/select3-6.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer null, b integer null, c integer null, d integer null, e integer null) diff --git a/tests/sqllogictests/suites/ydb/select3-7.test b/tests/sqllogictests/suites/ydb/select3-7.test index a2e5a8d5ddaa..477e9ea78503 100644 --- a/tests/sqllogictests/suites/ydb/select3-7.test +++ b/tests/sqllogictests/suites/ydb/select3-7.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer null, b integer null, c integer null, d integer null, e integer null) diff --git a/tests/sqllogictests/suites/ydb/select3-8.test b/tests/sqllogictests/suites/ydb/select3-8.test index 37e3828f498c..855703744f49 100644 --- a/tests/sqllogictests/suites/ydb/select3-8.test +++ b/tests/sqllogictests/suites/ydb/select3-8.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer null, b integer null, c integer null, d integer null, e integer null) diff --git a/tests/sqllogictests/suites/ydb/select3-9.test b/tests/sqllogictests/suites/ydb/select3-9.test index f42942c264d9..01b582ab3fa2 100644 --- a/tests/sqllogictests/suites/ydb/select3-9.test +++ b/tests/sqllogictests/suites/ydb/select3-9.test @@ -1,5 +1,5 @@ statement ok -drop table if exists t1 all +drop table if exists t1 statement ok create table t1(a integer null, b integer null, c integer null, d integer null, e integer null) diff --git a/tests/suites/0_stateless/17_altertable/17_0002_alter_table_purge_before.sh b/tests/suites/0_stateless/17_altertable/17_0002_alter_table_purge_before.sh index 85f385032306..93644ecfd07d 100755 --- a/tests/suites/0_stateless/17_altertable/17_0002_alter_table_purge_before.sh +++ b/tests/suites/0_stateless/17_altertable/17_0002_alter_table_purge_before.sh @@ -46,7 +46,7 @@ echo "checking that after purge (by snapshot id) there should be 4 rows left" echo "select count(*)=4 from t17_0002" | $MYSQL_CLIENT_CONNECT ## Drop table. -echo "drop table t17_0002 all" | $MYSQL_CLIENT_CONNECT +echo "drop table t17_0002" | $MYSQL_CLIENT_CONNECT # PURGE BEFORE TIMESTAMP @@ -90,4 +90,4 @@ echo "checking that after purge (by timestamp) there should be 5 rows left" echo "select count(*)=5 from t17_0002" | $MYSQL_CLIENT_CONNECT ## Drop table. -echo "drop table t17_0002 all" | $MYSQL_CLIENT_CONNECT +echo "drop table t17_0002" | $MYSQL_CLIENT_CONNECT diff --git a/tests/suites/0_stateless/17_altertable/17_0003_alter_table_update.sh b/tests/suites/0_stateless/17_altertable/17_0003_alter_table_update.sh index fa884b01df13..583cfb563b3a 100755 --- a/tests/suites/0_stateless/17_altertable/17_0003_alter_table_update.sh +++ b/tests/suites/0_stateless/17_altertable/17_0003_alter_table_update.sh @@ -25,7 +25,7 @@ echo "update table column" echo "update t17_0003 set c=2 where c=1" | $MYSQL_CLIENT_CONNECT ## Drop table. -echo "drop table t17_0003 all" | $MYSQL_CLIENT_CONNECT +echo "drop table t17_0003" | $MYSQL_CLIENT_CONNECT ## create two column table echo "create table t17_0003(a int not null, b int not null)" | $MYSQL_CLIENT_CONNECT @@ -50,4 +50,4 @@ echo "update table column" echo "update t17_0003 set a=3 where a=1" | $MYSQL_CLIENT_CONNECT ## Drop table. -echo "drop table t17_0003 all" | $MYSQL_CLIENT_CONNECT \ No newline at end of file +echo "drop table t17_0003" | $MYSQL_CLIENT_CONNECT diff --git a/tests/suites/0_stateless/20+_others/20_0011_purge_before.sh b/tests/suites/0_stateless/20+_others/20_0011_purge_before.sh index 4980aa0d9885..49d136e729c4 100755 --- a/tests/suites/0_stateless/20+_others/20_0011_purge_before.sh +++ b/tests/suites/0_stateless/20+_others/20_0011_purge_before.sh @@ -31,7 +31,7 @@ echo "checking that after purge (by snapshot id) there should be 4 rows left" echo "select count(*)=4 from t20_0011" | $MYSQL_CLIENT_CONNECT ## Drop table. -echo "drop table t20_0011 all" | $MYSQL_CLIENT_CONNECT +echo "drop table t20_0011" | $MYSQL_CLIENT_CONNECT # PURGE BEFORE TIMESTAMP @@ -58,4 +58,4 @@ echo "checking that after purge (by timestamp) there should be 4 rows left" echo "select count(*)=4 from t20_0011" | $MYSQL_CLIENT_CONNECT ## Drop table. -echo "drop table t20_0011 all" | $MYSQL_CLIENT_CONNECT +echo "drop table t20_0011" | $MYSQL_CLIENT_CONNECT diff --git a/tests/suites/0_stateless/20+_others/20_0012_privilege_access.sh b/tests/suites/0_stateless/20+_others/20_0012_privilege_access.sh index 134e1f1c5efd..c766b6005b5b 100755 --- a/tests/suites/0_stateless/20+_others/20_0012_privilege_access.sh +++ b/tests/suites/0_stateless/20+_others/20_0012_privilege_access.sh @@ -113,9 +113,9 @@ echo "GRANT SELECT ON system.fuse_block TO 'test-user'" | $MYSQL_CLIENT_CONNECT echo "select count(*)>=1 from fuse_block('default', 't20_0012_a')" | $TEST_USER_CONNECT ## Drop table. -echo "drop table default.t20_0012 all" | $MYSQL_CLIENT_CONNECT -echo "drop table default.t20_0012_a all" | $MYSQL_CLIENT_CONNECT -echo "drop table default.t20_0012_b all" | $MYSQL_CLIENT_CONNECT +echo "drop table default.t20_0012" | $MYSQL_CLIENT_CONNECT +echo "drop table default.t20_0012_a" | $MYSQL_CLIENT_CONNECT +echo "drop table default.t20_0012_b" | $MYSQL_CLIENT_CONNECT echo "drop view default2.v_t20_0012" | $MYSQL_CLIENT_CONNECT ## Drop database. diff --git a/tests/suites/1_stateful/04_mini_dataset/04_0000_mini_ontime.sh b/tests/suites/1_stateful/04_mini_dataset/04_0000_mini_ontime.sh index 707acc4db0d0..acf4a58613f7 100755 --- a/tests/suites/1_stateful/04_mini_dataset/04_0000_mini_ontime.sh +++ b/tests/suites/1_stateful/04_mini_dataset/04_0000_mini_ontime.sh @@ -28,4 +28,4 @@ for i in "${ontime_statements[@]}"; do done ## Clean table -echo "drop table if exists ontime_mini all;" | $MYSQL_CLIENT_CONNECT +echo "drop table if exists ontime_mini;" | $MYSQL_CLIENT_CONNECT diff --git a/tests/suites/1_stateful/04_mini_dataset/04_0001_mini_hits.sh b/tests/suites/1_stateful/04_mini_dataset/04_0001_mini_hits.sh index 291ad00c80f2..e5a7e3ffa244 100755 --- a/tests/suites/1_stateful/04_mini_dataset/04_0001_mini_hits.sh +++ b/tests/suites/1_stateful/04_mini_dataset/04_0001_mini_hits.sh @@ -105,4 +105,4 @@ for i in "${hits_statements[@]}"; do done ## Clean up -echo "drop table if exists hits all;" | $MYSQL_CLIENT_CONNECT +echo "drop table if exists hits;" | $MYSQL_CLIENT_CONNECT diff --git a/tests/suites/1_stateful/05_formats/05_01_compact/05_01_00_load_compact_copy.sh b/tests/suites/1_stateful/05_formats/05_01_compact/05_01_00_load_compact_copy.sh index bd847a61660b..be21f27434c9 100755 --- a/tests/suites/1_stateful/05_formats/05_01_compact/05_01_00_load_compact_copy.sh +++ b/tests/suites/1_stateful/05_formats/05_01_compact/05_01_00_load_compact_copy.sh @@ -10,7 +10,7 @@ for j in $(seq 1 1000);do printf "0123456789\n" >> "$DATA" done -echo "drop table if exists t1 all" | $MYSQL_CLIENT_CONNECT +echo "drop table if exists t1" | $MYSQL_CLIENT_CONNECT echo "CREATE TABLE t1 ( c0 string diff --git a/tests/suites/1_stateful/05_formats/05_01_compact/05_01_01_load_compact_streaming_load.sh b/tests/suites/1_stateful/05_formats/05_01_compact/05_01_01_load_compact_streaming_load.sh index 2b37912014b9..ef82801b4435 100755 --- a/tests/suites/1_stateful/05_formats/05_01_compact/05_01_01_load_compact_streaming_load.sh +++ b/tests/suites/1_stateful/05_formats/05_01_compact/05_01_01_load_compact_streaming_load.sh @@ -10,7 +10,7 @@ for j in $(seq 1 1000);do printf "0123456789\n" >> "$DATA" done -echo "drop table if exists t1 all" | $MYSQL_CLIENT_CONNECT +echo "drop table if exists t1" | $MYSQL_CLIENT_CONNECT echo "CREATE TABLE t1 ( c0 string diff --git a/tests/suites/1_stateful/05_formats/05_01_compact/05_01_02_load_compact_copy_max_size.sh b/tests/suites/1_stateful/05_formats/05_01_compact/05_01_02_load_compact_copy_max_size.sh index 4f9c131b9a89..2c2a0c6ebda1 100755 --- a/tests/suites/1_stateful/05_formats/05_01_compact/05_01_02_load_compact_copy_max_size.sh +++ b/tests/suites/1_stateful/05_formats/05_01_compact/05_01_02_load_compact_copy_max_size.sh @@ -11,7 +11,7 @@ for j in $(seq 1 1000);do printf "0123456789\n" >> "$DATA" done -echo "drop table if exists t1 all" | $MYSQL_CLIENT_CONNECT +echo "drop table if exists t1" | $MYSQL_CLIENT_CONNECT echo "CREATE TABLE t1 ( c0 string diff --git a/tests/suites/1_stateful/05_formats/05_01_compact/05_01_02_load_compact_copy_row_per_block.sh b/tests/suites/1_stateful/05_formats/05_01_compact/05_01_02_load_compact_copy_row_per_block.sh index 97ee66da39e7..fb9a283df0b6 100755 --- a/tests/suites/1_stateful/05_formats/05_01_compact/05_01_02_load_compact_copy_row_per_block.sh +++ b/tests/suites/1_stateful/05_formats/05_01_compact/05_01_02_load_compact_copy_row_per_block.sh @@ -11,7 +11,7 @@ for j in $(seq 1 1000);do printf "0123456789\n" >> "$DATA" done -echo "drop table if exists t1 all" | $MYSQL_CLIENT_CONNECT +echo "drop table if exists t1" | $MYSQL_CLIENT_CONNECT echo "CREATE TABLE t1 ( c0 string