forked from go-mysql-org/go-mysql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexpr.go
49 lines (42 loc) · 1.58 KB
/
expr.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package canal
import (
"io"
"github.com/pingcap/tidb/parser/ast"
"github.com/pingcap/tidb/parser/charset"
"github.com/pingcap/tidb/parser/format"
)
func init() {
ast.NewValueExpr = newValueExpr
ast.NewParamMarkerExpr = newParamExpr
ast.NewDecimal = func(_ string) (interface{}, error) {
return nil, nil
}
ast.NewHexLiteral = func(_ string) (interface{}, error) {
return nil, nil
}
ast.NewBitLiteral = func(_ string) (interface{}, error) {
return nil, nil
}
}
type paramExpr struct {
valueExpr
}
func newParamExpr(_ int) ast.ParamMarkerExpr {
return ¶mExpr{}
}
func (pe *paramExpr) SetOrder(o int) {}
type valueExpr struct {
ast.TexprNode
}
func newValueExpr(_ interface{}, _ string, _ string) ast.ValueExpr { return &valueExpr{} }
func (ve *valueExpr) SetValue(val interface{}) {}
func (ve *valueExpr) GetValue() interface{} { return nil }
func (ve *valueExpr) GetDatumString() string { return "" }
func (ve *valueExpr) GetString() string { return "" }
func (ve *valueExpr) GetProjectionOffset() int { return 0 }
func (ve *valueExpr) SetProjectionOffset(offset int) {}
func (ve *valueExpr) Restore(ctx *format.RestoreCtx) error { return nil }
func (ve *valueExpr) Accept(v ast.Visitor) (node ast.Node, ok bool) { return }
func (ve *valueExpr) Text() string { return "" }
func (ve *valueExpr) SetText(enc charset.Encoding, text string) {}
func (ve *valueExpr) Format(w io.Writer) {}