*: add foreign key cascade delete when execute delete statement#38377
*: add foreign key cascade delete when execute delete statement#38377ti-chi-bot merged 35 commits intopingcap:masterfrom
Conversation
Signed-off-by: crazycs520 <crazycs520@gmail.com>
|
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. DetailsReviewer can indicate their review by submitting an approval review. |
|
/run-all-tests |
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
|
/run-mysql-test |
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
56fe5e0 to
75f7d46
Compare
|
/run-all-tests |
Signed-off-by: crazycs520 <crazycs520@gmail.com>
|
/run-build |
Signed-off-by: crazycs520 <crazycs520@gmail.com>
| e, err := fkc.buildExecutor(ctx) | ||
| if err != nil || e == nil { | ||
| return err | ||
| } | ||
| if err := e.Open(ctx); err != nil { | ||
| terror.Call(e.Close) | ||
| return err | ||
| } | ||
| _, _, e, err = a.handleNoDelay(ctx, e, isPessimistic) | ||
| if err != nil { | ||
| return err | ||
| } |
There was a problem hiding this comment.
I'm not quite clear about the previous state assumptions, maybe it's better to add some descriptions to explain the safety, which states of a statement execution may change or may not change.
For example, should the executions refresh the for_update_ts or they should always use the same one?
There was a problem hiding this comment.
Great, maybe I shouldn't reuse handleNoDelay here, write an handleFKExecutor method to handle it maybe better.
There was a problem hiding this comment.
I have refactored the logic here, PTAL
executor/foreign_key.go
Outdated
| if err != nil { | ||
| return nil, err | ||
| } | ||
| err = ResetContextOfStmt(sctx, stmtNode) |
There was a problem hiding this comment.
The ResetContextOfStmt is called by the execution framework. The function uildFKCascadePlan does something the same as the framework does, maybe it's better to reuse the existing functions by making necessary changes to them.
There was a problem hiding this comment.
It really doesn't quite fit here, so it has been deleted.
There was a problem hiding this comment.
I have refactored the logic here, PTAL
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
…into fk-cascade-delete
Signed-off-by: crazycs520 <crazycs520@gmail.com>
It's fixed now. |
|
/run-all-tests |
Signed-off-by: crazycs520 <crazycs520@gmail.com>
|
/merge |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: a5ca023 |
|
/build |
|
/run-build |
TiDB MergeCI notify🔴 Bad News! New failing [1] after this pr merged.
|
Signed-off-by: crazycs520 crazycs520@gmail.com
What problem does this PR solve?
Issue Number: close #38376
Problem Summary: add foreign key cascade delete when execute delete statement
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.