From 6720fcd40ff90f11c2f678bb42bb288474854c19 Mon Sep 17 00:00:00 2001 From: sylzd Date: Mon, 9 Aug 2021 11:17:14 +0800 Subject: [PATCH] =?UTF-8?q?ddl:=20add=20test=20case=20of=20show=20table=20?= =?UTF-8?q?regions=20/=20split=20table=20in=20local=20temporary=20?= =?UTF-8?q?=E2=80=A6=20(#26901)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- executor/executor_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/executor/executor_test.go b/executor/executor_test.go index ffb281424ef89..6aee2ed6bbb9a 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -5234,6 +5234,23 @@ func (s *testSplitTable) TestShowTableRegion(c *C) { _, err = tk.Exec("create global temporary table temporary_table_pre_split(id int ) pre_split_regions=2 ON COMMIT DELETE ROWS;") c.Assert(err.Error(), Equals, ddl.ErrOptOnTemporaryTable.GenWithStackByArgs("pre split regions").Error()) + // Test show table regions and split table on local temporary table + tk.MustExec("drop table if exists t_regions_local_temporary_table") + tk.MustExec("set @@tidb_enable_noop_functions=1;") + tk.MustExec("create temporary table t_regions_local_temporary_table (a int key, b int, c int, index idx(b), index idx2(c));") + // Test show table regions. + _, err = tk.Exec("show table t_regions_local_temporary_table regions") + c.Assert(err.Error(), Equals, plannercore.ErrOptOnTemporaryTable.GenWithStackByArgs("show table regions").Error()) + // Test split table. + _, err = tk.Exec("split table t_regions_local_temporary_table between (-10000) and (10000) regions 4;") + c.Assert(err.Error(), Equals, plannercore.ErrOptOnTemporaryTable.GenWithStackByArgs("split table").Error()) + _, err = tk.Exec("split partition table t_regions_local_temporary_table partition (p1,p2) index idx between (0) and (20000) regions 2;") + c.Assert(err.Error(), Equals, plannercore.ErrOptOnTemporaryTable.GenWithStackByArgs("split table").Error()) + tk.MustExec("drop table if exists t_regions_local_temporary_table") + // Test pre split regions + _, err = tk.Exec("create temporary table local_temporary_table_pre_split(id int ) pre_split_regions=2;") + c.Assert(err.Error(), Equals, ddl.ErrOptOnTemporaryTable.GenWithStackByArgs("pre split regions").Error()) + rows := re.Rows() // Table t_regions should have 5 regions now. // 4 regions to store record data.