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

ERROR 1105 (HY000): Can't find column Column#2 in schema Column: [test.t3.c0] Unique key: [] #37971

Closed
Reminiscent opened this issue Sep 20, 2022 · 1 comment · Fixed by #38802
Assignees
Labels
severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@Reminiscent
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists t3;
CREATE TABLE t3(c0 INT, primary key(c0));
SELECT v2.c0 FROM (select 1 as c0 from t3) v2 WHERE (v2.c0)like(True);

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

Execute success without error.

3. What did you see instead (Required)

ERROR 1105 (HY000): Can't find column Column#2 in schema Column: [test.t3.c0] Unique key: []

4. What is your TiDB version? (Required)

latest master

@Reminiscent Reminiscent added type/bug The issue is confirmed as a bug. sig/planner SIG: Planner labels Sep 20, 2022
@Reminiscent Reminiscent self-assigned this Sep 20, 2022
@Reminiscent
Copy link
Contributor Author

[err="Can't find column Column#2 in schema Column: [test.t3.c0] Unique key: []
github.com/pingcap/tidb/expression.(*Column).resolveIndices
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/expression/column.go:530
github.com/pingcap/tidb/expression.(*ScalarFunction).resolveIndices
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/expression/scalar_function.go:466
github.com/pingcap/tidb/expression.(*ScalarFunction).resolveIndices
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/expression/scalar_function.go:466
github.com/pingcap/tidb/expression.(*ScalarFunction).ResolveIndices
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/expression/scalar_function.go:460
github.com/pingcap/tidb/planner/core.(*PhysicalSelection).ResolveIndices
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/planner/core/resolve_indices.go:356
github.com/pingcap/tidb/planner/core.(*PhysicalTableReader).ResolveIndices
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/planner/core/resolve_indices.go:268
github.com/pingcap/tidb/planner/core.(*basePhysicalPlan).ResolveIndices
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/planner/core/resolve_indices.go:675
github.com/pingcap/tidb/planner/core.(*physicalSchemaProducer).ResolveIndices
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/planner/core/resolve_indices.go:664
github.com/pingcap/tidb/planner/core.(*PhysicalProjection).ResolveIndices
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/planner/core/resolve_indices.go:26
github.com/pingcap/tidb/planner/core.(*basePhysicalPlan).ResolveIndices
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/planner/core/resolve_indices.go:675
github.com/pingcap/tidb/planner/core.(*physicalSchemaProducer).ResolveIndices
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/planner/core/resolve_indices.go:664
github.com/pingcap/tidb/planner/core.(*PhysicalProjection).ResolveIndices
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/planner/core/resolve_indices.go:26
github.com/pingcap/tidb/planner/core.physicalOptimize
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/planner/core/optimizer.go:659
github.com/pingcap/tidb/planner/core.DoOptimize
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/planner/core/optimizer.go:294
github.com/pingcap/tidb/planner.optimize
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/planner/optimize.go:397
github.com/pingcap/tidb/planner.Optimize
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/planner/optimize.go:245
github.com/pingcap/tidb/executor.(*Compiler).Compile
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/executor/compiler.go:98
github.com/pingcap/tidb/session.(*session).ExecuteStmt
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/session/session.go:2026
github.com/pingcap/tidb/server.(*TiDBContext).ExecuteStmt
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/server/driver_tidb.go:231
github.com/pingcap/tidb/server.(*clientConn).handleStmt
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/server/conn.go:2049
github.com/pingcap/tidb/server.(*clientConn).handleQuery
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/server/conn.go:1904
github.com/pingcap/tidb/server.(*clientConn).dispatch
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/server/conn.go:1359
github.com/pingcap/tidb/server.(*clientConn).Run
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/server/conn.go:1104
github.com/pingcap/tidb/server.(*Server).onConn
	/Users/yanchengpeng/go/src/github.com/pingcap/tidb/server/server.go:563
runtime.goexit
	/usr/local/opt/go/libexec/src/runtime/asm_amd64.s:1594"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants