code: func getCmpTp4MinMax(args []Expression) (argTp types.EvalType) {
  	datetimeFound, isAllStr := false, true
  	cmpEvalType, isStr, isTemporalWithDate := temporalWithDateAsNumEvalType(args[0].GetType())
  	if !isStr {
  		isAllStr = false
  	}
  	if isTemporalWithDate {
  		datetimeFound = true
  	}
  	lft := args[0].GetType()
  	for i := range args {
  		rft := args[i].GetType()
  		var tp types.EvalType
  		tp, isStr, isTemporalWithDate = temporalWithDateAsNumEvalType(rft)
  		if isTemporalWithDate {
  			datetimeFound = true
  		}
  		if !isStr {
  			isAllStr = false
  		}
  		cmpEvalType = getBaseCmpType(cmpEvalType, tp, lft, rft)
  		lft = rft
  	}
  	argTp = cmpEvalType
  	if cmpEvalType.IsStringKind() {
  		argTp = types.ETString
  	}
  	if isAllStr && datetimeFound {
  		argTp = types.ETDatetime
  	}
  	return argTp
  }
docs: // getCmpTp4MinMax gets compare type for GREATEST and LEAST.