@ -377,9 +377,6 @@ func (b *executorBuilder) buildAggregate(v *plan.Aggregate) Executor {
|
||||
return nil
|
||||
}
|
||||
client := txn.GetClient()
|
||||
if !client.SupportRequestType(kv.ReqTypeSelect, kv.ReqSubTypeAgg) {
|
||||
return e
|
||||
}
|
||||
if len(v.GroupByItems) > 0 && !client.SupportRequestType(kv.ReqTypeSelect, kv.ReqSubTypeGroupBy) {
|
||||
return e
|
||||
}
|
||||
|
||||
3
kv/kv.go
3
kv/kv.go
@ -111,8 +111,7 @@ const (
|
||||
|
||||
ReqSubTypeBasic = 0
|
||||
ReqSubTypeDesc = 10000
|
||||
ReqSubTypeAgg = 10001
|
||||
ReqSubTypeGroupBy = 10002
|
||||
ReqSubTypeGroupBy = 10001
|
||||
)
|
||||
|
||||
// KeyRange represents a range where StartKey <= key < EndKey.
|
||||
|
||||
@ -39,7 +39,7 @@ func (c *dbClient) SupportRequestType(reqType, subType int64) bool {
|
||||
switch reqType {
|
||||
case kv.ReqTypeSelect:
|
||||
switch subType {
|
||||
case kv.ReqSubTypeAgg:
|
||||
case kv.ReqSubTypeGroupBy:
|
||||
return true
|
||||
default:
|
||||
return supportExpr(tipb.ExprType(subType))
|
||||
|
||||
@ -37,7 +37,12 @@ type CopClient struct {
|
||||
func (c *CopClient) SupportRequestType(reqType, subType int64) bool {
|
||||
switch reqType {
|
||||
case kv.ReqTypeSelect:
|
||||
return supportExpr(tipb.ExprType(subType))
|
||||
switch subType {
|
||||
case kv.ReqSubTypeGroupBy:
|
||||
return true
|
||||
default:
|
||||
return supportExpr(tipb.ExprType(subType))
|
||||
}
|
||||
case kv.ReqTypeIndex:
|
||||
switch subType {
|
||||
case kv.ReqSubTypeDesc, kv.ReqSubTypeBasic:
|
||||
@ -58,6 +63,8 @@ func supportExpr(exprType tipb.ExprType) bool {
|
||||
tipb.ExprType_In, tipb.ExprType_ValueList,
|
||||
tipb.ExprType_Like, tipb.ExprType_Not:
|
||||
return true
|
||||
case tipb.ExprType_Count:
|
||||
return true
|
||||
case kv.ReqSubTypeDesc:
|
||||
return true
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user