MCPcopy
hub / github.com/go-sql-driver/mysql / TestInterpolateParamsUint64

Function TestInterpolateParamsUint64

connection_test.go:83–99  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

81}
82
83func TestInterpolateParamsUint64(t *testing.T) {
84 mc := &mysqlConn{
85 buf: newBuffer(),
86 maxAllowedPacket: maxPacketSize,
87 cfg: &Config{
88 InterpolateParams: true,
89 },
90 }
91
92 q, err := mc.interpolateParams("SELECT ?", []driver.Value{uint64(42)})
93 if err != nil {
94 t.Errorf("Expected err=nil, got err=%#v, q=%#v", err, q)
95 }
96 if q != "SELECT 42" {
97 t.Errorf("Expected uint64 interpolation to work, got q=%#v", q)
98 }
99}
100
101func TestCheckNamedValue(t *testing.T) {
102 value := driver.NamedValue{Value: ^uint64(0)}

Callers

nothing calls this directly

Calls 2

interpolateParamsMethod · 0.95
newBufferFunction · 0.85

Tested by

no test coverage detected