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

*: add test for issue #54254 and it has been fixed by pr #54183 (#54301) #55036

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #54301

What problem does this PR solve?

Issue Number: close #54254 #48457

Problem Summary: add test for issue #54254 and it has been fixed by pr #54183

What changed and how does it work?

PR #54183 also fix the issue #54254, and I've verified and add a test TestIssue54254 for it.

Without the fix in PR #54183, the test TestIssue54254 will failed and has the same panic stack, such as following:

[2024/06/28 14:06:22.604 +08:00] [ERROR] [conn.go:1024] ["connection running loop panic"] [conn=2097158] [session_alias=] [lastSQL="UPDATE stock SET c = ? WHERE a= ? AND b = 'a' [arguments: (101, 1)]"] [err="runtime error: index out of range [4] with length 4"] [stack="github.com/pingcap/tidb/pkg/server.(*clientConn).Run.func1
	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/server/conn.go:1027
runtime.gopanic
	/usr/local/go/src/runtime/panic.go:914
github.com/pingcap/tidb/pkg/executor.(*Compiler).Compile.func1
	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/executor/compiler.go:57
runtime.gopanic
	/usr/local/go/src/runtime/panic.go:914
runtime.goPanicIndex
	/usr/local/go/src/runtime/panic.go:114
github.com/pingcap/tidb/pkg/planner/core.GetUpdateColumnsInfo
	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/planner/core/logical_plan_builder.go:5855
github.com/pingcap/tidb/pkg/planner/core.(*Update).buildTbl2UpdateColumns
	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/planner/core/foreign_key.go:336
github.com/pingcap/tidb/pkg/planner/core.(*Update).buildOnUpdateFKTriggers
	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/planner/core/foreign_key.go:224
github.com/pingcap/tidb/pkg/planner/core.buildPointUpdatePlan
	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/planner/core/point_get_plan.go:1970
github.com/pingcap/tidb/pkg/planner/core.tryUpdatePointPlan
	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/planner/core/point_get_plan.go:1910
github.com/pingcap/tidb/pkg/planner/core.TryFastPlan
	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/planner/core/point_get_plan.go:923
github.com/pingcap/tidb/pkg/planner.Optimize
	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/planner/optimize.go:224
github.com/pingcap/tidb/pkg/planner/core.generateNewPlan
	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/planner/core/plan_cache.go:316
github.com/pingcap/tidb/pkg/planner/core.GetPlanFromPlanCache
	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/planner/core/plan_cache.go:265
github.com/pingcap/tidb/pkg/planner.OptimizeExecStmt
	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/planner/optimize.go:541
github.com/pingcap/tidb/pkg/planner.Optimize
	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/planner/optimize.go:163
github.com/pingcap/tidb/pkg/executor.(*Compiler).Compile
	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/executor/compiler.go:99
github.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt
	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/session/session.go:2098
github.com/pingcap/tidb/pkg/server.(*TiDBContext).ExecuteStmt
	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/server/driver_tidb.go:294
github.com/pingcap/tidb/pkg/server.(*clientConn).executePreparedStmtAndWriteResult
	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/server/conn_stmt.go:306
github.com/pingcap/tidb/pkg/server.(*clientConn).executePlanCacheStmt
	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/server/conn_stmt.go:234
github.com/pingcap/tidb/pkg/server.(*clientConn).handleStmtExecute
	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/server/conn_stmt.go:225
github.com/pingcap/tidb/pkg/server.(*clientConn).dispatch
	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/server/conn.go:1386
github.com/pingcap/tidb/pkg/server.(*clientConn).Run
	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/server/conn.go:1125
github.com/pingcap/tidb/pkg/server.(*Server).onConn
	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/server/server.go:739"] 
...
...
...
--- FAIL: TestIssue54254 (0.54s)
    server_client.go:2966: 
        	Error Trace:	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/server/internal/testserverclient/server_client.go:2966
        	            				/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/ddl/util/callback/callback.go:124
        	            				/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/ddl/job_table.go:634
        	            				/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/ddl/job_table.go:538
        	            				/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/util/wait_group_wrapper.go:171
        	            				/usr/local/go/src/runtime/asm_arm64.s:1197
        	Error:      	Received unexpected error:
        	            	Error 1105 (HY000): runtime error: index out of range [4] with length 4
        	Test:       	TestIssue54254
    server_client.go:865: 
        	Error Trace:	/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/server/internal/testserverclient/server_client.go:865
        	            				/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/server/internal/testserverclient/server_client.go:2991
        	            				/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/server/internal/testserverclient/server_client.go:2890
        	            				/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/server/internal/testserverclient/server_client.go:134
        	            				/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/server/internal/testserverclient/server_client.go:2862
        	            				/Users/cs/code/goread/src/github.com/pingcap/tidb/pkg/server/tests/commontest/tidb_test.go:3099
        	Error:      	Not equal: 
        	            	expected: "1 a 101 x <nil>\n2 b 102 z <nil>"
        	            	actual  : "1 a 11 x <nil>\n2 b 22 y <nil>"

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

Signed-off-by: crazycs520 <crazycs520@gmail.com>
@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-8.1 This PR is cherry-picked to release-8.1 from a source PR. labels Jul 30, 2024
@ti-chi-bot ti-chi-bot added the cherry-pick-approved Cherry pick PR approved by release team. label Jul 30, 2024
Copy link

codecov bot commented Jul 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (release-8.1@b5de417). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff                @@
##             release-8.1     #55036   +/-   ##
================================================
  Coverage               ?   72.4246%           
================================================
  Files                  ?       1465           
  Lines                  ?     433583           
  Branches               ?          0           
================================================
  Hits                   ?     314021           
  Misses                 ?      99073           
  Partials               ?      20489           
Flag Coverage Δ
unit 72.4246% <100.0000%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 57.8032% <0.0000%> (?)
parser ∅ <0.0000%> (?)
br 41.3111% <0.0000%> (?)

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 5, 2024
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 5, 2024
Copy link

ti-chi-bot bot commented Aug 5, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-08-05 06:07:02.045630262 +0000 UTC m=+245751.912729351: ☑️ agreed by crazycs520.
  • 2024-08-05 06:08:12.115573644 +0000 UTC m=+245821.982672731: ☑️ agreed by tangenta.

@crazycs520
Copy link
Contributor

/merge

Copy link

ti-chi-bot bot commented Aug 5, 2024

@crazycs520: We have migrated to builtin LGTM and approve plugins for reviewing.

👉 Please use /approve when you want approve this pull request.

The changes announcement: LGTM plugin changes

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@crazycs520
Copy link
Contributor

/approve

@ti-chi-bot ti-chi-bot removed the cherry-pick-approved Cherry pick PR approved by release team. label Aug 5, 2024
@ti-chi-bot ti-chi-bot closed this Aug 5, 2024
@crazycs520 crazycs520 reopened this Aug 5, 2024
@ti-chi-bot ti-chi-bot added the cherry-pick-approved Cherry pick PR approved by release team. label Aug 5, 2024
@crazycs520
Copy link
Contributor

/approve

Copy link

ti-chi-bot bot commented Aug 5, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: crazycs520, lcwangchao, tangenta

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [crazycs520,lcwangchao,tangenta]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot merged commit 8f9bc9a into pingcap:release-8.1 Aug 5, 2024
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved cherry-pick-approved Cherry pick PR approved by release team. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-8.1 This PR is cherry-picked to release-8.1 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants