Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tidb panic for checkOrderPropForSubIndexScan #43178

Closed
aytrack opened this issue Apr 19, 2023 · 0 comments · Fixed by #43465
Closed

tidb panic for checkOrderPropForSubIndexScan #43178

aytrack opened this issue Apr 19, 2023 · 0 comments · Fixed by #43465
Assignees
Labels

Comments

@aytrack
Copy link
Contributor

aytrack commented Apr 19, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE `aa311c3c` (
  `57fd8d09` year(4) DEFAULT '1913',
  `afbdd7c3` char(220) DEFAULT 'gakkl6occ0yd2jmhi2qxog8szibtcqwxyxmga3hp4ktszjplmg3rjvu8v6lgn9q6hva2lekhw6napjejbut6svsr8q2j8w8rc551e5vq',
  `43b06e99` date NOT NULL DEFAULT '3403-10-08',
  `b80b3746` tinyint(4) NOT NULL DEFAULT '34',
  `6302d8ac` timestamp DEFAULT '2004-04-01 18:21:18',
  PRIMARY KEY (`43b06e99`,`b80b3746`) /*T![clustered_index] CLUSTERED */,
  KEY `3080c821` (`57fd8d09`,`43b06e99`,`b80b3746`),
  KEY `a9af33a4` (`57fd8d09`,`b80b3746`,`43b06e99`),
  KEY `464b386e` (`b80b3746`),
  KEY `19dc3c2d` (`57fd8d09`)
) ENGINE=InnoDB DEFAULT CHARSET=ascii COLLATE=ascii_bin COMMENT='320f8401';
INSERT INTO `aa311c3c` VALUES
('1975','2029-06-10 00:00:00','1982-02-15',34,'2004-04-01 18:21:18'),
('2016','2024-09-15 00:00:00','1988-08-08',-125,'2004-04-01 18:21:18'),
('2021','1976-04-17 00:00:00','2015-07-10',86,'2004-04-01 18:21:18'),
('2008','2004-04-01 18:21:18','2021-05-17',34,'2004-04-01 18:21:18'),
('1913','2004-04-01 18:21:18','3403-10-08',-91,'2004-04-01 18:21:18'),
('1913','2004-04-01 18:21:18','3403-10-08',-57,'2004-04-01 18:21:18'),
('1913','1983-03-09 00:00:00','3403-10-08',34,'2004-04-01 18:21:18'),
('1913','2004-04-01 18:21:18','3403-10-08',56,'2004-04-01 18:21:18'),
('1913','2004-04-01 18:21:18','3403-10-08',72,'2004-04-01 18:21:18'),
('1913','2004-04-01 18:21:18','3403-10-08',95,'2004-04-01 18:21:18'),
('1913','2004-04-01 18:21:18','3403-10-08',99,'2004-04-01 18:21:18');
explain select  /*+ use_index_merge( `aa311c3c` ) */   `aa311c3c`.`43b06e99` as r0 , `aa311c3c`.`6302d8ac` as r1 from `aa311c3c` where IsNull( `aa311c3c`.`b80b3746` ) or not( `aa311c3c`.`57fd8d09` >= '2008' )   order by r0,r1 limit 95 

2. What did you expect to see? (Required)

no error

3. What did you see instead (Required)

tidb panic

"github.com/pingcap/tidb/server.(*clientConn).Run.func1
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/conn.go:1042
runtime.gopanic
	/usr/local/go/src/runtime/panic.go:884
github.com/pingcap/tidb/executor.(*Compiler).Compile.func1
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/executor/compiler.go:54
runtime.gopanic
	/usr/local/go/src/runtime/panic.go:884
runtime.goPanicIndex
	/usr/local/go/src/runtime/panic.go:113
github.com/pingcap/tidb/planner/core.(*PhysicalTopN).checkOrderPropForSubIndexScan
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/task.go:1376
github.com/pingcap/tidb/planner/core.(*PhysicalTopN).checkSubScans
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/task.go:1411
github.com/pingcap/tidb/planner/core.(*PhysicalTopN).pushPartialTopNDownToCop
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/task.go:1200
github.com/pingcap/tidb/planner/core.(*PhysicalTopN).attach2Task
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/task.go:1057
github.com/pingcap/tidb/planner/core.(*baseLogicalPlan).enumeratePhysicalPlans4Task
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:252
github.com/pingcap/tidb/planner/core.(*baseLogicalPlan).findBestTask
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:452
github.com/pingcap/tidb/planner/core.(*baseLogicalPlan).enumeratePhysicalPlans4Task
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:224
github.com/pingcap/tidb/planner/core.(*baseLogicalPlan).findBestTask
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:452
github.com/pingcap/tidb/planner/core.physicalOptimize
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/optimizer.go:1140
github.com/pingcap/tidb/planner/core.DoOptimize
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/optimizer.go:305
github.com/pingcap/tidb/planner.optimize
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/optimize.go:469
github.com/pingcap/tidb/planner.Optimize
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/optimize.go:297
github.com/pingcap/tidb/executor.(*Compiler).Compile
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/executor/compiler.go:98
github.com/pingcap/tidb/session.(*session).ExecuteStmt
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/session/session.go:2154
github.com/pingcap/tidb/server.(*TiDBContext).ExecuteStmt
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/driver_tidb.go:252
github.com/pingcap/tidb/server.(*clientConn).handleStmt
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/conn.go:2061
github.com/pingcap/tidb/server.(*clientConn).handleQuery
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/conn.go:1852
github.com/pingcap/tidb/server.(*clientConn).dispatch
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/conn.go:1339
github.com/pingcap/tidb/server.(*clientConn).Run
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/conn.go:1120
github.com/pingcap/tidb/server.(*Server).onConn
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/server.go:677"]

4. What is your TiDB version? (Required)

+-----------------------------------------------------------+
| tidb_version()                                            |
+-----------------------------------------------------------+
| Release Version: v7.1.0-alpha                             |
| Edition: Community                                        |
| Git Commit Hash: 171b0e9a4b910c6010c6195df0a0047d3ab89538 |
| Git Branch: heads/refs/tags/v7.1.0-alpha                  |
| UTC Build Time: 2023-04-18 11:42:39                       |
| GoVersion: go1.20.3                                       |
| Race Enabled: false                                       |
| TiKV Min Version: 6.2.0-alpha                             |
| Check Table Before Drop: false                            |
| Store: tikv                                               |
+-----------------------------------------------------------+
@aytrack aytrack added type/bug The issue is confirmed as a bug. sig/planner SIG: Planner severity/major labels Apr 19, 2023
@ti-chi-bot ti-chi-bot added may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 labels Apr 19, 2023
@winoros winoros removed may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 labels Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants