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

types: clip to zero when convert negative decimal to uint (#41791) #41815

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #41791

What problem does this PR solve?

Issue Number: close #41736

Problem Summary:

see #41736 (comment)

What is changed and how it works?

Check List

Tests

  • Unit test
  • Integration test

Release note

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

Fix a compare incorrect issue cause by fault convert 

@ti-chi-bot
Copy link
Member Author

ti-chi-bot commented Mar 1, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • LittleFall
  • windtalker

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added do-not-merge/cherry-pick-not-approved release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. type/cherry-pick-for-release-6.5 This PR is cherry-picked to release-6.5 from a source PR. labels Mar 1, 2023
@VelocityLight VelocityLight added cherry-pick-approved Cherry pick PR approved by release team. and removed do-not-merge/cherry-pick-not-approved labels Mar 1, 2023
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 1, 2023
Copy link
Contributor

@windtalker windtalker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 1, 2023
@windtalker
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member Author

This pull request has been accepted and is ready to merge.

Commit hash: 74dc563

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 1, 2023
@LittleFall
Copy link
Contributor

/test unit-test

@LittleFall
Copy link
Contributor

/build

@hawkingrei
Copy link
Member

/test

@ti-chi-bot
Copy link
Member Author

@hawkingrei: The /test command needs one or more targets.
The following commands are available to trigger required jobs:

  • /test build
  • /test check-dev
  • /test check-dev2
  • /test mysql-test
  • /test unit-test

Use /test all to run all jobs.

In response to this:

/test

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 kubernetes/test-infra repository.

@hawkingrei
Copy link
Member

/test build

@LittleFall
Copy link
Contributor

/test unit-test

@LittleFall
Copy link
Contributor

testing.go:1319: race detected during execution of test

--- FAIL: TestCursorReadHoldTS (3.21s)

@LittleFall
Copy link
Contributor

/test unit-test

1 similar comment
@LittleFall
Copy link
Contributor

/test unit-test

@LittleFall
Copy link
Contributor

/test unit-test

@LittleFall
Copy link
Contributor

LittleFall commented Mar 1, 2023

==================
WARNING: DATA RACE
Write at 0x00c005d6e328 by goroutine 293:
github.com/pingcap/tidb/sessionctx/variable.(*SessionVars).InitStatementContext()
sessionctx/variable/session.go:1414 +0xd7
github.com/pingcap/tidb/executor.ResetContextOfStmt()
executor/executor.go:1945 +0x184
github.com/pingcap/tidb/session.(*session).ExecuteStmt()
session/session.go:2138 +0x408
github.com/pingcap/tidb/server.(*TiDBContext).ExecuteStmt()
server/driver_tidb.go:247 +0x12d
github.com/pingcap/tidb/server.(*clientConn).executePreparedStmtAndWriteResult()
server/conn_stmt.go:272 +0x4ac
github.com/pingcap/tidb/server.(*clientConn).executePlanCacheStmt()
server/conn_stmt.go:221 +0x1c4
github.com/pingcap/tidb/server.(*clientConn).handleStmtExecute()
server/conn_stmt.go:213 +0xa1a
github.com/pingcap/tidb/server.(*clientConn).dispatch()
server/conn.go:1430 +0x1a5a
github.com/pingcap/tidb/server.(*mockConn).Dispatch()
server/mock_conn.go:66 +0x8a
github.com/pingcap/tidb/server.TestCursorReadHoldTS()
server/conn_stmt_test.go:326 +0x148e
github.com/pingcap/tidb/domain.(*Domain).rebuildSysVarCache()
domain/sysvar_cache.go:146 +0x73c
github.com/pingcap/tidb/domain.(*Domain).LoadSysVarCacheLoop()
domain/domain.go:1370 +0xb9
github.com/pingcap/tidb/session.BootstrapSession()
session/session.go:3316 +0x78c
github.com/pingcap/tidb/domain.(*Domain).GetSessionCache()
domain/sysvar_cache.go:62 +0x6a
github.com/pingcap/tidb/session.(*session).loadCommonGlobalVariablesIfNeeded()
session/session.go:3582 +0x11e
github.com/pingcap/tidb/session.(*session).ExecuteStmt()
session/session.go:2130 +0x2fb
github.com/pingcap/tidb/session.(*session).ExecuteInternal()
session/session.go:1676 +0x4eb
github.com/pingcap/tidb/domain.(*Domain).LoadPrivilegeLoop()
domain/domain.go:1312 +0x143
github.com/pingcap/tidb/session.BootstrapSession()
session/session.go:3309 +0x72c
github.com/pingcap/tidb/testkit.bootstrap()
testkit/mockstore.go:84 +0x84
github.com/pingcap/tidb/testkit.CreateMockStoreAndDomain()
testkit/mockstore.go:69 +0xd0
github.com/pingcap/tidb/server.TestCursorReadHoldTS()
server/conn_stmt_test.go:259 +0x58
testing.tRunner()
GOROOT/src/testing/testing.go:1446 +0x216
testing.(*T).Run.func1()
GOROOT/src/testing/testing.go:1493 +0x47
Previous read at 0x00c005d6e328 by goroutine 857:
sync/atomic.LoadInt64()
src/runtime/race_amd64.s:208 +0xb
sync/atomic.LoadPointer()
:1 +0x16
github.com/pingcap/tidb/util/memory.(*Tracker).Consume()
util/memory/tracker.go:409 +0x1ba
github.com/pingcap/tidb/store/copr.(*copIteratorWorker).sendToRespCh()
store/copr/coprocessor.go:818 +0x2b4
github.com/pingcap/tidb/store/copr.(*copIteratorWorker).handleCopResponse()
store/copr/coprocessor.go:1265 +0x2e47
github.com/pingcap/tidb/store/copr.(*copIteratorWorker).handleCopPagingResult()
store/copr/coprocessor.go:1121 +0xfd
github.com/pingcap/tidb/store/copr.(*copIteratorWorker).handleTaskOnce()
store/copr/coprocessor.go:1060 +0x1c97
github.com/pingcap/tidb/store/copr.(*copIteratorWorker).handleTask()
store/copr/coprocessor.go:941 +0x224
github.com/pingcap/tidb/store/copr.(*copIteratorWorker).run()
store/copr/coprocessor.go:651 +0x1e4
github.com/pingcap/tidb/store/copr.(*copIterator).open.func1()
store/copr/coprocessor.go:691 +0x58
Goroutine 293 (running) created at:
testing.(*T).Run()
GOROOT/src/testing/testing.go:1493 +0x75d
testing.runTests.func1()
GOROOT/src/testing/testing.go:1846 +0x99
testing.tRunner()
GOROOT/src/testing/testing.go:1446 +0x216
testing.runTests()
GOROOT/src/testing/testing.go:1844 +0x7ec
testing.(*M).Run()
GOROOT/src/testing/testing.go:1726 +0xa84
go.uber.org/goleak.VerifyTestMain()
external/org_uber_go_goleak/testmain.go:53 +0x70
github.com/pingcap/tidb/server.TestMain()
server/main_test.go:74 +0xe8f
main.main()
bazel-out/k8-fastbuild/bin/server/server_test_/testmain.go:284 +0x7c9
Goroutine 857 (running) created at:
github.com/pingcap/tidb/store/copr.(*copIterator).open()
store/copr/coprocessor.go:691 +0x11d
github.com/pingcap/tidb/store/copr.(*CopClient).Send()
store/copr/coprocessor.go:103 +0x36e
[2023/03/01 17:43:56.090 +08:00] [INFO] [server.go:509] ["setting tidb-server to report unhealthy (shutting-down)"]
github.com/pingcap/tidb/distsql.Select()
distsql/distsql.go:102 +0x9f4
github.com/pingcap/tidb/distsql.SelectWithRuntimeStats()
distsql/distsql.go:143 +0xcc
github.com/pingcap/tidb/executor.selectResultHook.SelectResult()
executor/table_reader.go:58 +0x204
github.com/pingcap/tidb/executor.(*TableReaderExecutor).buildResp()
executor/table_reader.go:326 +0x7eb
github.com/pingcap/tidb/executor.(*TableReaderExecutor).Open()
executor/table_reader.go:223 +0x1433
github.com/pingcap/tidb/executor.(*ExecStmt).openExecutor()
executor/adapter.go:1135 +0x109
github.com/pingcap/tidb/executor.(*ExecStmt).Exec()
executor/adapter.go:508 +0xbc4
github.com/pingcap/tidb/session.runStmt()
session/session.go:2351 +0x85c
github.com/pingcap/tidb/session.(*session).ExecuteStmt()
session/session.go:2215 +0x1266
github.com/pingcap/tidb/server.(*TiDBContext).ExecuteStmt()
server/driver_tidb.go:247 +0x12d
github.com/pingcap/tidb/server.(*clientConn).executePreparedStmtAndWriteResult()
server/conn_stmt.go:272 +0x4ac
github.com/pingcap/tidb/server.(*clientConn).executePlanCacheStmt()
server/conn_stmt.go:221 +0x1c4
github.com/pingcap/tidb/server.(*clientConn).handleStmtExecute()
server/conn_stmt.go:213 +0xa1a
github.com/pingcap/tidb/server.(*clientConn).dispatch()
server/conn.go:1430 +0x1a5a
github.com/pingcap/tidb/server.(*mockConn).Dispatch()
server/mock_conn.go:66 +0x8a
github.com/pingcap/tidb/server.TestCursorReadHoldTS()
server/conn_stmt_test.go:318 +0x123c
github.com/pingcap/tidb/domain.(*Domain).rebuildSysVarCache()
domain/sysvar_cache.go:146 +0x73c
github.com/pingcap/tidb/domain.(*Domain).LoadSysVarCacheLoop()
domain/domain.go:1370 +0xb9
github.com/pingcap/tidb/session.BootstrapSession()
session/session.go:3316 +0x78c
github.com/pingcap/tidb/domain.(*Domain).GetSessionCache()
domain/sysvar_cache.go:62 +0x6a
github.com/pingcap/tidb/session.(*session).loadCommonGlobalVariablesIfNeeded()
session/session.go:3582 +0x11e
github.com/pingcap/tidb/session.(*session).ExecuteStmt()
session/session.go:2130 +0x2fb
github.com/pingcap/tidb/session.(*session).ExecuteInternal()
session/session.go:1676 +0x4eb
github.com/pingcap/tidb/domain.(*Domain).LoadPrivilegeLoop()
domain/domain.go:1312 +0x143
github.com/pingcap/tidb/session.BootstrapSession()
session/session.go:3309 +0x72c
github.com/pingcap/tidb/testkit.bootstrap()
testkit/mockstore.go:84 +0x84
github.com/pingcap/tidb/testkit.CreateMockStoreAndDomain()
testkit/mockstore.go:69 +0xd0
github.com/pingcap/tidb/server.TestCursorReadHoldTS()
server/conn_stmt_test.go:259 +0x58
testing.tRunner()
GOROOT/src/testing/testing.go:1446 +0x216
testing.(*T).Run.func1()
GOROOT/src/testing/testing.go:1493 +0x47

==================

@LittleFall
Copy link
Contributor

/test unit-test

3 similar comments
@LittleFall
Copy link
Contributor

/test unit-test

@LittleFall
Copy link
Contributor

/test unit-test

@LittleFall
Copy link
Contributor

/test unit-test

@ti-chi-bot ti-chi-bot merged commit 584c22a into pingcap:release-6.5 Mar 2, 2023
@VelocityLight VelocityLight added do-not-merge/cherry-pick-not-approved cherry-pick-approved Cherry pick PR approved by release team. and removed cherry-pick-approved Cherry pick PR approved by release team. do-not-merge/cherry-pick-not-approved labels Mar 13, 2023
@ti-chi-bot ti-chi-bot removed the cherry-pick-approved Cherry pick PR approved by release team. label May 28, 2024
@ti-chi-bot ti-chi-bot added the cherry-pick-approved Cherry pick PR approved by release team. label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Cherry pick PR approved by release team. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/cherry-pick-for-release-6.5 This PR is cherry-picked to release-6.5 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants