From 4719999e18b2d02d77dd8ca213c7783341df5f7e Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 27 Apr 2026 00:33:03 +0000 Subject: [PATCH] Inline parser driver into ast package The parser_driver indirection (function-variable injection points and a side-effect import of test_driver) only made sense when pingcap/parser supported both TiDB's full types and a lightweight stub. Marino has a single driver, so the indirection was pure ceremony: a runtime panic in parser.New, a required blank import for users, and *test_driver.X type assertions in callers. Move the driver code into ast/, rename the concrete types that collided with their interfaces (ValueExpr -> ValueExprBase, ParamMarkerExpr -> ParamMarkerExprBase, BinaryLiteral []byte -> BinaryLit), turn ast.New* function-vars into plain functions, and drop the driver-missing panic. --- BUILD.bazel | 1 - ast/BUILD.bazel | 5 +- ast/base.go | 3 - .../test_driver_datum.go => ast/datum.go | 50 +++++------ .../datum_helper.go | 6 +- ast/expressions.go | 6 -- ast/functions_test.go | 5 +- ast/misc.go | 11 +-- .../mydecimal.go | 2 +- ast/util_test.go | 3 +- .../test_driver.go => ast/value_expr.go | 85 ++++++++----------- docs/quickstart.md | 4 - parser/parser_test.go | 17 ++-- parser/yy_parser.go | 7 -- test_driver/BUILD.bazel | 21 ----- types/BUILD.bazel | 1 - types/field_type_test.go | 3 - 17 files changed, 83 insertions(+), 147 deletions(-) rename test_driver/test_driver_datum.go => ast/datum.go (91%) rename test_driver/test_driver_helper.go => ast/datum_helper.go (94%) rename test_driver/test_driver_mydecimal.go => ast/mydecimal.go (99%) rename test_driver/test_driver.go => ast/value_expr.go (70%) delete mode 100644 test_driver/BUILD.bazel diff --git a/BUILD.bazel b/BUILD.bazel index dae3edc..ac7124a 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -60,7 +60,6 @@ go_test( "//pkg/parser/mysql", "//pkg/parser/opcode", "//pkg/parser/terror", - "//pkg/parser/test_driver", "@com_github_pingcap_errors//:errors", "@com_github_stretchr_testify//require", "@org_uber_go_goleak//:goleak", diff --git a/ast/BUILD.bazel b/ast/BUILD.bazel index dd43f00..4f7d34b 100644 --- a/ast/BUILD.bazel +++ b/ast/BUILD.bazel @@ -5,6 +5,8 @@ go_library( srcs = [ "ast.go", "base.go", + "datum.go", + "datum_helper.go", "ddl.go", "dml.go", "expressions.go", @@ -12,10 +14,12 @@ go_library( "functions.go", "misc.go", "model.go", + "mydecimal.go", "procedure.go", "sem.go", "stats.go", "util.go", + "value_expr.go", ], importpath = "github.com/sqlc-dev/marino/ast", visibility = ["//visibility:public"], @@ -60,7 +64,6 @@ go_test( "//pkg/parser/charset", "//pkg/parser/format", "//pkg/parser/mysql", - "//pkg/parser/test_driver", "@com_github_stretchr_testify//require", ], ) diff --git a/ast/base.go b/ast/base.go index c6c1877..5636ddb 100644 --- a/ast/base.go +++ b/ast/base.go @@ -410,9 +410,6 @@ type exprNode struct { flag uint64 } -// TexprNode is exported for parser driver. -type TexprNode = exprNode - // SetType implements ExprNode interface. func (en *exprNode) SetType(tp *types.FieldType) { en.Type = *tp diff --git a/test_driver/test_driver_datum.go b/ast/datum.go similarity index 91% rename from test_driver/test_driver_datum.go rename to ast/datum.go index 57e3ab8..d31ee33 100644 --- a/test_driver/test_driver_datum.go +++ b/ast/datum.go @@ -13,7 +13,7 @@ //go:build !codes -package test_driver +package ast import ( "bytes" @@ -155,12 +155,12 @@ func (d *Datum) SetNull() { } // GetBinaryLiteral gets Bit value -func (d *Datum) GetBinaryLiteral() BinaryLiteral { +func (d *Datum) GetBinaryLiteral() BinaryLit { return d.b } // SetBinaryLiteral sets Bit value -func (d *Datum) SetBinaryLiteral(b BinaryLiteral) { +func (d *Datum) SetBinaryLiteral(b BinaryLit) { d.k = KindBinaryLiteral d.b = b } @@ -227,12 +227,12 @@ func (d *Datum) SetValue(val any) { d.SetBytes(x) case *MyDecimal: d.SetMysqlDecimal(x) - case BinaryLiteral: + case BinaryLit: d.SetBinaryLiteral(x) - case BitLiteral: // Store as BinaryLiteral for Bit and Hex literals - d.SetBinaryLiteral(BinaryLiteral(x)) + case BitLiteral: // Store as BinaryLit for Bit and Hex literals + d.SetBinaryLiteral(BinaryLit(x)) case HexLiteral: - d.SetBinaryLiteral(BinaryLiteral(x)) + d.SetBinaryLiteral(BinaryLit(x)) default: d.SetInterface(x) } @@ -270,20 +270,20 @@ func MakeDatums(args ...any) []Datum { return datums } -// BinaryLiteral is the internal type for storing bit / hex literal type. -type BinaryLiteral []byte +// BinaryLit is the internal type for storing bit / hex literal type. +type BinaryLit []byte // BitLiteral is the bit literal type. -type BitLiteral BinaryLiteral +type BitLiteral BinaryLit // HexLiteral is the hex literal type. -type HexLiteral BinaryLiteral +type HexLiteral BinaryLit -// ZeroBinaryLiteral is a BinaryLiteral literal with zero value. -var ZeroBinaryLiteral = BinaryLiteral{} +// ZeroBinaryLit is a BinaryLit literal with zero value. +var ZeroBinaryLit = BinaryLit{} // String implements fmt.Stringer interface. -func (b BinaryLiteral) String() string { +func (b BinaryLit) String() string { if len(b) == 0 { return "" } @@ -291,12 +291,12 @@ func (b BinaryLiteral) String() string { } // ToString returns the string representation for the literal. -func (b BinaryLiteral) ToString() string { +func (b BinaryLit) ToString() string { return string(b) } // ToBitLiteralString returns the bit literal representation for the literal. -func (b BinaryLiteral) ToBitLiteralString(trimLeadingZero bool) string { +func (b BinaryLit) ToBitLiteralString(trimLeadingZero bool) string { if len(b) == 0 { return "b''" } @@ -317,7 +317,7 @@ func (b BinaryLiteral) ToBitLiteralString(trimLeadingZero bool) string { // ParseBitStr parses bit string. // The string format can be b'val', B'val' or 0bval, val must be 0 or 1. // See https://dev.mysql.com/doc/refman/5.7/en/bit-value-literals.html -func ParseBitStr(s string) (BinaryLiteral, error) { +func ParseBitStr(s string) (BinaryLit, error) { if len(s) == 0 { return nil, fmt.Errorf("invalid empty string for parsing bit type") } @@ -333,7 +333,7 @@ func ParseBitStr(s string) (BinaryLiteral, error) { } if len(s) == 0 { - return ZeroBinaryLiteral, nil + return ZeroBinaryLit, nil } alignedLength := (len(s) + 7) &^ 7 @@ -362,14 +362,14 @@ func NewBitLiteral(s string) (BitLiteral, error) { return BitLiteral(b), nil } -// ToString implement ast.BinaryLiteral interface +// ToString implement BinaryLiteral interface func (b BitLiteral) ToString() string { - return BinaryLiteral(b).ToString() + return BinaryLit(b).ToString() } // ParseHexStr parses hexadecimal string literal. // See https://dev.mysql.com/doc/refman/5.7/en/hexadecimal-literals.html -func ParseHexStr(s string) (BinaryLiteral, error) { +func ParseHexStr(s string) (BinaryLit, error) { if len(s) == 0 { return nil, fmt.Errorf("invalid empty string for parsing hexadecimal literal") } @@ -388,7 +388,7 @@ func ParseHexStr(s string) (BinaryLiteral, error) { } if len(s) == 0 { - return ZeroBinaryLiteral, nil + return ZeroBinaryLit, nil } if len(s)%2 != 0 { @@ -410,9 +410,9 @@ func NewHexLiteral(s string) (HexLiteral, error) { return HexLiteral(h), nil } -// ToString implement ast.BinaryLiteral interface +// ToString implement BinaryLiteral interface func (b HexLiteral) ToString() string { - return BinaryLiteral(b).ToString() + return BinaryLit(b).ToString() } // SetBinChsClnFlag sets charset, collation as 'binary' and adds binaryFlag to FieldType. @@ -491,7 +491,7 @@ func DefaultTypeForValue(value any, tp *types.FieldType, charset string, collate tp.SetDecimal(0) tp.AddFlag(mysql.UnsignedFlag) SetBinChsClnFlag(tp) - case BinaryLiteral: + case BinaryLit: tp.SetType(mysql.TypeBit) tp.SetFlen(len(x) * 8) tp.SetDecimal(0) diff --git a/test_driver/test_driver_helper.go b/ast/datum_helper.go similarity index 94% rename from test_driver/test_driver_helper.go rename to ast/datum_helper.go index 129266c..4de7167 100644 --- a/test_driver/test_driver_helper.go +++ b/ast/datum_helper.go @@ -13,7 +13,7 @@ //go:build !codes -package test_driver +package ast import ( "math" @@ -38,7 +38,7 @@ func pow10(x int) int32 { return int32(math.Pow10(x)) } -func Abs(n int64) int64 { +func absInt64(n int64) int64 { y := n >> 63 return (n ^ y) - y } @@ -68,5 +68,5 @@ func StrLenOfInt64Fast(x int64) int { if x < 0 { size = 1 // add "-" sign on the length count } - return size + StrLenOfUint64Fast(uint64(Abs(x))) + return size + StrLenOfUint64Fast(uint64(absInt64(x))) } diff --git a/ast/expressions.go b/ast/expressions.go index 219ab58..6df2643 100644 --- a/ast/expressions.go +++ b/ast/expressions.go @@ -64,12 +64,6 @@ type ValueExpr interface { SetProjectionOffset(offset int) } -// NewValueExpr creates a ValueExpr with value, and sets default field type. -var NewValueExpr func(value any, charset string, collate string) ValueExpr - -// NewParamMarkerExpr creates a ParamMarkerExpr. -var NewParamMarkerExpr func(offset int) ParamMarkerExpr - // BetweenExpr is for "between and" or "not between and" expression. type BetweenExpr struct { exprNode diff --git a/ast/functions_test.go b/ast/functions_test.go index 19737cb..22e2e4c 100644 --- a/ast/functions_test.go +++ b/ast/functions_test.go @@ -21,7 +21,6 @@ import ( "github.com/sqlc-dev/marino/format" "github.com/sqlc-dev/marino/mysql" "github.com/sqlc-dev/marino/parser" - "github.com/sqlc-dev/marino/test_driver" "reflect" ) @@ -182,7 +181,7 @@ func TestConvert(t *testing.T) { st := stmt.(*SelectStmt) expr := st.Fields.Fields[0].Expr.(*FuncCallExpr) - charsetArg := expr.Args[1].(*test_driver.ValueExpr) + charsetArg := expr.Args[1].(*ValueExprBase) if !reflect.DeepEqual(testCase.CharsetName, charsetArg.GetString()) { t.Fatalf("got %v, want %v", charsetArg.GetString(), testCase.CharsetName) } @@ -217,7 +216,7 @@ func TestChar(t *testing.T) { st := stmt.(*SelectStmt) expr := st.Fields.Fields[0].Expr.(*FuncCallExpr) - charsetArg := expr.Args[1].(*test_driver.ValueExpr) + charsetArg := expr.Args[1].(*ValueExprBase) if !reflect.DeepEqual(testCase.CharsetName, charsetArg.GetString()) { t.Fatalf("got %v, want %v", charsetArg.GetString(), testCase.CharsetName) } diff --git a/ast/misc.go b/ast/misc.go index fa81fc7..8d338b7 100644 --- a/ast/misc.go +++ b/ast/misc.go @@ -4226,19 +4226,12 @@ type TextString struct { IsBinaryLiteral bool } +// BinaryLiteral abstracts over the concrete bit/hex literal types so the +// parser can stringify any of them without a type switch. type BinaryLiteral interface { ToString() string } -// NewDecimal creates a types.Decimal value, it's provided by parser driver. -var NewDecimal func(string) (any, error) - -// NewHexLiteral creates a types.HexLiteral value, it's provided by parser driver. -var NewHexLiteral func(string) (any, error) - -// NewBitLiteral creates a types.BitLiteral value, it's provided by parser driver. -var NewBitLiteral func(string) (any, error) - // SetResourceGroupStmt is a statement to set the resource group name for current session. type SetResourceGroupStmt struct { stmtNode diff --git a/test_driver/test_driver_mydecimal.go b/ast/mydecimal.go similarity index 99% rename from test_driver/test_driver_mydecimal.go rename to ast/mydecimal.go index 33bb06e..95aff47 100644 --- a/test_driver/test_driver_mydecimal.go +++ b/ast/mydecimal.go @@ -13,7 +13,7 @@ //go:build !codes -package test_driver +package ast const panicInfo = "This branch is not implemented. " + "This is because you are trying to test something specific to TiDB's MyDecimal implementation. " + diff --git a/ast/util_test.go b/ast/util_test.go index 7b902e3..8ed1e8f 100644 --- a/ast/util_test.go +++ b/ast/util_test.go @@ -22,7 +22,6 @@ import ( . "github.com/sqlc-dev/marino/format" "github.com/sqlc-dev/marino/mysql" "github.com/sqlc-dev/marino/parser" - "github.com/sqlc-dev/marino/test_driver" "reflect" ) @@ -194,7 +193,7 @@ func (checker *nodeTextCleaner) Enter(in Node) (out Node, skipChildren bool) { node.FnName.O = strings.ToLower(node.FnName.O) switch node.FnName.L { case "convert": - node.Args[1].(*test_driver.ValueExpr).Datum.SetBytes(nil) + node.Args[1].(*ValueExprBase).Datum.SetBytes(nil) } case *AggregateFuncExpr: node.F = strings.ToLower(node.F) diff --git a/test_driver/test_driver.go b/ast/value_expr.go similarity index 70% rename from test_driver/test_driver.go rename to ast/value_expr.go index 7ef7319..3af79a8 100644 --- a/test_driver/test_driver.go +++ b/ast/value_expr.go @@ -13,51 +13,32 @@ //go:build !codes -package test_driver +package ast import ( "fmt" "io" "strconv" - "github.com/sqlc-dev/marino/ast" "github.com/sqlc-dev/marino/charset" "github.com/sqlc-dev/marino/format" "github.com/sqlc-dev/marino/mysql" ) -func init() { - ast.NewValueExpr = newValueExpr - ast.NewParamMarkerExpr = newParamMarkerExpr - ast.NewDecimal = func(str string) (any, error) { - dec := new(MyDecimal) - err := dec.FromString([]byte(str)) - return dec, err - } - ast.NewHexLiteral = func(str string) (any, error) { - h, err := NewHexLiteral(str) - return h, err - } - ast.NewBitLiteral = func(str string) (any, error) { - b, err := NewBitLiteral(str) - return b, err - } -} - var ( - _ ast.ParamMarkerExpr = &ParamMarkerExpr{} - _ ast.ValueExpr = &ValueExpr{} + _ ParamMarkerExpr = &ParamMarkerExprBase{} + _ ValueExpr = &ValueExprBase{} ) -// ValueExpr is the simple value expression. -type ValueExpr struct { - ast.TexprNode +// ValueExprBase is the simple value expression. +type ValueExprBase struct { + exprNode Datum projectionOffset int } // Restore implements Node interface. -func (n *ValueExpr) Restore(ctx *format.RestoreCtx) error { +func (n *ValueExprBase) Restore(ctx *format.RestoreCtx) error { switch n.Kind() { case KindNull: ctx.WriteKeyWord("NULL") @@ -114,12 +95,12 @@ func (n *ValueExpr) Restore(ctx *format.RestoreCtx) error { } // GetDatumString implements the ValueExpr interface. -func (n *ValueExpr) GetDatumString() string { +func (n *ValueExprBase) GetDatumString() string { return n.GetString() } // Format the ExprNode into a Writer. -func (n *ValueExpr) Format(w io.Writer) { +func (n *ValueExprBase) Format(w io.Writer) { var s string switch n.Kind() { case KindNull: @@ -156,75 +137,83 @@ func (n *ValueExpr) Format(w io.Writer) { _, _ = fmt.Fprint(w, s) } -// newValueExpr creates a ValueExpr with value, and sets default field type. -func newValueExpr(value any, charset string, collate string) ast.ValueExpr { - if ve, ok := value.(*ValueExpr); ok { +// NewValueExpr creates a ValueExpr with value, and sets default field type. +func NewValueExpr(value any, charset string, collate string) ValueExpr { + if ve, ok := value.(*ValueExprBase); ok { return ve } - ve := &ValueExpr{} + ve := &ValueExprBase{} ve.SetValue(value) DefaultTypeForValue(value, &ve.Type, charset, collate) ve.projectionOffset = -1 return ve } -// SetProjectionOffset sets ValueExpr.projectionOffset for logical plan builder. -func (n *ValueExpr) SetProjectionOffset(offset int) { +// SetProjectionOffset sets ValueExprBase.projectionOffset for logical plan builder. +func (n *ValueExprBase) SetProjectionOffset(offset int) { n.projectionOffset = offset } -// GetProjectionOffset returns ValueExpr.projectionOffset. -func (n *ValueExpr) GetProjectionOffset() int { +// GetProjectionOffset returns ValueExprBase.projectionOffset. +func (n *ValueExprBase) GetProjectionOffset() int { return n.projectionOffset } // Accept implements Node interface. -func (n *ValueExpr) Accept(v ast.Visitor) (ast.Node, bool) { +func (n *ValueExprBase) Accept(v Visitor) (Node, bool) { newNode, skipChildren := v.Enter(n) if skipChildren { return v.Leave(newNode) } - n = newNode.(*ValueExpr) + n = newNode.(*ValueExprBase) return v.Leave(n) } -// ParamMarkerExpr expression holds a place for another expression. +// ParamMarkerExprBase expression holds a place for another expression. // Used in parsing prepare statement. -type ParamMarkerExpr struct { - ValueExpr +type ParamMarkerExprBase struct { + ValueExprBase Offset int Order int InExecute bool } // Restore implements Node interface. -func (n *ParamMarkerExpr) Restore(ctx *format.RestoreCtx) error { +func (n *ParamMarkerExprBase) Restore(ctx *format.RestoreCtx) error { ctx.WritePlain("?") return nil } -func newParamMarkerExpr(offset int) ast.ParamMarkerExpr { - return &ParamMarkerExpr{ +// NewParamMarkerExpr creates a ParamMarkerExpr. +func NewParamMarkerExpr(offset int) ParamMarkerExpr { + return &ParamMarkerExprBase{ Offset: offset, } } // Format the ExprNode into a Writer. -func (n *ParamMarkerExpr) Format(w io.Writer) { +func (n *ParamMarkerExprBase) Format(w io.Writer) { panic("Not implemented") } // Accept implements Node Accept interface. -func (n *ParamMarkerExpr) Accept(v ast.Visitor) (ast.Node, bool) { +func (n *ParamMarkerExprBase) Accept(v Visitor) (Node, bool) { newNode, skipChildren := v.Enter(n) if skipChildren { return v.Leave(newNode) } - n = newNode.(*ParamMarkerExpr) + n = newNode.(*ParamMarkerExprBase) return v.Leave(n) } // SetOrder implements the ParamMarkerExpr interface. -func (n *ParamMarkerExpr) SetOrder(order int) { +func (n *ParamMarkerExprBase) SetOrder(order int) { n.Order = order } + +// NewDecimal creates a *MyDecimal value. +func NewDecimal(s string) (*MyDecimal, error) { + dec := new(MyDecimal) + err := dec.FromString([]byte(s)) + return dec, err +} diff --git a/docs/quickstart.md b/docs/quickstart.md index d3a1398..f1f4315 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -49,7 +49,6 @@ import ( "github.com/sqlc-dev/marino/parser" "github.com/sqlc-dev/marino/ast" - _ "github.com/sqlc-dev/marino/test_driver" ) func parse(sql string) (*ast.StmtNode, error) { @@ -88,9 +87,6 @@ If the parser runs properly, you should get a result like this: > **NOTE** > > Here are a few things you might want to know: -> - To use a parser, a `parser_driver` is required. It decides how to parse the basic data types in SQL. -> -> You can use [`github.com/sqlc-dev/marino/test_driver`](https://pkg.go.dev/github.com/sqlc-dev/marino/test_driver) as the `parser_driver`. > - The instantiated parser object is not goroutine safe and not lightweight. It is better to keep it in a single goroutine, and reuse it if possible. > - Warning: the `parser.result` object is being reused without being properly reset or copied. This can cause unexpected behavior or errors if the object is used for multiple parsing operations or concurrently in multiple goroutines. To avoid these issues, make a copy of `parser.result` object before calling `parser.Parse()` again or before using it in another goroutine, or create a new `parser` object altogether for each new parsing operation. diff --git a/parser/parser_test.go b/parser/parser_test.go index 0cf0298..75a5d35 100644 --- a/parser/parser_test.go +++ b/parser/parser_test.go @@ -31,7 +31,6 @@ import ( "github.com/sqlc-dev/marino/opcode" "github.com/sqlc-dev/marino/parser" "github.com/sqlc-dev/marino/terror" - "github.com/sqlc-dev/marino/test_driver" ) func TestSimple(t *testing.T) { @@ -330,9 +329,9 @@ func TestSimple(t *testing.T) { t.Fatal("expected true") } expr := sel.Fields.Fields[0] - vExpr := expr.Expr.(*test_driver.ValueExpr) - if !reflect.DeepEqual(test_driver.KindInt64, vExpr.Kind()) { - t.Fatalf("got %v, want %v", vExpr.Kind(), test_driver.KindInt64) + vExpr := expr.Expr.(*ast.ValueExprBase) + if !reflect.DeepEqual(ast.KindInt64, vExpr.Kind()) { + t.Fatalf("got %v, want %v", vExpr.Kind(), ast.KindInt64) } src = "SELECT 9223372036854775808;" st, err = p.ParseOneStmt(src, "", "") @@ -344,9 +343,9 @@ func TestSimple(t *testing.T) { t.Fatal("expected true") } expr = sel.Fields.Fields[0] - vExpr = expr.Expr.(*test_driver.ValueExpr) - if !reflect.DeepEqual(test_driver.KindUint64, vExpr.Kind()) { - t.Fatalf("got %v, want %v", vExpr.Kind(), test_driver.KindUint64) + vExpr = expr.Expr.(*ast.ValueExprBase) + if !reflect.DeepEqual(ast.KindUint64, vExpr.Kind()) { + t.Fatalf("got %v, want %v", vExpr.Kind(), ast.KindUint64) } src = `select 99e+r10 from t1;` @@ -8611,8 +8610,8 @@ func (checker *nodeTextCleaner) Enter(in ast.Node) (out ast.Node, skipChildren b node.F = strings.ToLower(node.F) case *ast.SelectField: node.Offset = 0 - case *test_driver.ValueExpr: - if node.Kind() == test_driver.KindMysqlDecimal { + case *ast.ValueExprBase: + if node.Kind() == ast.KindMysqlDecimal { _ = node.GetMysqlDecimal().FromString(node.GetMysqlDecimal().ToString()) } case *ast.GrantStmt: diff --git a/parser/yy_parser.go b/parser/yy_parser.go index b41df0e..ce64b90 100644 --- a/parser/yy_parser.go +++ b/parser/yy_parser.go @@ -129,13 +129,6 @@ type stmtTexter interface { // New returns a Parser object with default SQL mode. func New() *Parser { - if ast.NewValueExpr == nil || - ast.NewParamMarkerExpr == nil || - ast.NewHexLiteral == nil || - ast.NewBitLiteral == nil { - panic("no parser driver (forgotten import?) https://github.com/pingcap/parser/issues/43") - } - p := &Parser{ cache: make([]yySymType, 200), } diff --git a/test_driver/BUILD.bazel b/test_driver/BUILD.bazel deleted file mode 100644 index e8965bf..0000000 --- a/test_driver/BUILD.bazel +++ /dev/null @@ -1,21 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "test_driver", - srcs = [ - "test_driver.go", - "test_driver_datum.go", - "test_driver_helper.go", - "test_driver_mydecimal.go", - ], - importpath = "github.com/sqlc-dev/marino/test_driver", - visibility = ["//visibility:public"], - deps = [ - "//pkg/parser/ast", - "//pkg/parser/charset", - "//pkg/parser/format", - "//pkg/parser/mysql", - "//pkg/parser/types", - "@com_github_pingcap_errors//:errors", - ], -) diff --git a/types/BUILD.bazel b/types/BUILD.bazel index 89f5434..4c873a9 100644 --- a/types/BUILD.bazel +++ b/types/BUILD.bazel @@ -33,7 +33,6 @@ go_test( "//pkg/parser/ast", "//pkg/parser/charset", "//pkg/parser/mysql", - "//pkg/parser/test_driver", "@com_github_stretchr_testify//require", ], ) diff --git a/types/field_type_test.go b/types/field_type_test.go index f5dd819..b29cb91 100644 --- a/types/field_type_test.go +++ b/types/field_type_test.go @@ -21,9 +21,6 @@ import ( "github.com/sqlc-dev/marino/charset" "github.com/sqlc-dev/marino/mysql" "github.com/sqlc-dev/marino/parser" - - // import parser_driver - _ "github.com/sqlc-dev/marino/test_driver" . "github.com/sqlc-dev/marino/types" "reflect"