Skip to content

Commit

Permalink
forbids json_contains from pushing down (pingcap#203)
Browse files Browse the repository at this point in the history
* forbids json_contains from pushing down

Signed-off-by: David <[email protected]>

* fix typo

Signed-off-by: David <[email protected]>

---------

Signed-off-by: David <[email protected]>
  • Loading branch information
AmoebaProtozoa authored Jan 28, 2023
1 parent d065c72 commit f8516a2
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions session/bootstrap_serverless.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,20 @@ import (

const (
serverlessVersionVar = "serverless_version"
// serverlessVersion2 added support for Disaggregated TiFlash, as a result, we can no safely enable mpp
// serverlessVersion2 added support for Disaggregated TiFlash, as a result, we can now safely enable mpp
// and two previously forbidden executor push-down.
serverlessVersion2 = 2
// serverlessVersion3 adds json contains to tikv push-down-blacklist.
serverlessVersion3 = 3
)

// currentServerlessVersion is defined as a variable, so we can modify its value for testing.
// please make sure this is the largest version
var currentServerlessVersion int64 = serverlessVersion2
var currentServerlessVersion int64 = serverlessVersion3

var bootstrapServerlessVersion = []func(Session, int64){
upgradeToServerlessVer2,
upgradeToServerlessVer3,
}

// updateServerlessVersion updates serverless version variable in mysql.TiDB table.
Expand Down Expand Up @@ -129,3 +132,12 @@ func upgradeToServerlessVer2(s Session, ver int64) {
mustExecute(s, "DELETE FROM mysql.expr_pushdown_blacklist where name in "+
"(\"Lead\", \"Lag\") and store_type = \"tiflash\"")
}

func upgradeToServerlessVer3(s Session, ver int64) {
if ver >= serverlessVersion3 {
return
}

mustExecute(s, "INSERT HIGH_PRIORITY INTO mysql.expr_pushdown_blacklist VALUES"+
"('json_contains','tikv', 'Compatibility with tikv 6.1')")
}

0 comments on commit f8516a2

Please sign in to comment.