code: func (v *typeInferrer) convertValueToColumnTypeIfNeeded(x *ast.PatternInExpr) {
  	if cn, ok := x.Expr.(*ast.ColumnNameExpr); ok && cn.Refer != nil {
  		ft := cn.Refer.Column.FieldType
  		for _, expr := range x.List {
  			if valueExpr, ok := expr.(*ast.ValueExpr); ok {
  				newDatum, err := valueExpr.Datum.ConvertTo(v.sc, &ft)
  				if err != nil {
  					v.err = errors.Trace(err)
  				}
  				cmp, err := newDatum.CompareDatum(v.sc, valueExpr.Datum)
  				if err != nil {
  					v.err = errors.Trace(err)
  				}
  				if cmp != 0 {
  					// The value will never match the column, do not set newDatum.
  					continue
  				}
  				valueExpr.SetDatum(newDatum)
  			}
  		}
  		if v.err != nil {
  			// TODO: Errors should be handled differently according to query context.
  			log.Printf("inferor type for pattern in error %v", v.err)
  			v.err = nil
  		}
  	}
  }
docs: // ConvertValueToColumnTypeIfNeeded checks if the expr in PatternInExpr is column name,
  // and casts function to the items in the list.