Skip to content

Commit

Permalink
skip when foreign check enabled
Browse files Browse the repository at this point in the history
Signed-off-by: you06 <you1474600@gmail.com>
  • Loading branch information
you06 committed Mar 11, 2024
1 parent 68cda48 commit 37b39a7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -4308,12 +4308,14 @@ func (s *session) isPipelinedDML() bool {
return false
}
{
//stmtCtx.OriginalSQL
if s.sessionVars.ForeignKeyChecks {
return false
}
var target *ast.TableRefsClause
stmts, err := s.Parse(context.Background(), stmtCtx.OriginalSQL)
if err != nil || len(stmts) == 0 {
return false
}
var target *ast.TableRefsClause
stmt := stmts[0]
switch v := stmt.(type) {
case *ast.InsertStmt:
Expand Down

0 comments on commit 37b39a7

Please sign in to comment.