Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Commit fb0e801

Browse files
authored
Merge pull request #840 from agarciamontoro/fix.parsing
Fix integer literals parsing
2 parents b5a2318 + c0899fb commit fb0e801

File tree

13 files changed

+443
-140
lines changed

13 files changed

+443
-140
lines changed

Diff for: engine_pilosa_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -207,4 +207,3 @@ func TestCreateIndex(t *testing.T) {
207207
require.NoError(os.RemoveAll(tmpDir))
208208
}()
209209
}
210-

Diff for: engine_test.go

+26-26
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ var queries = []struct {
582582
{
583583
`SELECT COALESCE(NULL, NULL, NULL, COALESCE(NULL, 1234567890))`,
584584
[]sql.Row{
585-
{int64(1234567890)},
585+
{int32(1234567890)},
586586
},
587587
},
588588
{
@@ -981,7 +981,7 @@ var queries = []struct {
981981
},
982982
{
983983
`SELECT -1`,
984-
[]sql.Row{{int64(-1)}},
984+
[]sql.Row{{int8(-1)}},
985985
},
986986
{
987987
`
@@ -1043,13 +1043,13 @@ var queries = []struct {
10431043
{
10441044
`SELECT nullif(123, 321)`,
10451045
[]sql.Row{
1046-
{int64(123)},
1046+
{int8(123)},
10471047
},
10481048
},
10491049
{
10501050
`SELECT ifnull(123, NULL)`,
10511051
[]sql.Row{
1052-
{int64(123)},
1052+
{int8(123)},
10531053
},
10541054
},
10551055
{
@@ -1061,19 +1061,19 @@ var queries = []struct {
10611061
{
10621062
`SELECT ifnull(NULL, 123)`,
10631063
[]sql.Row{
1064-
{int64(123)},
1064+
{int8(123)},
10651065
},
10661066
},
10671067
{
10681068
`SELECT ifnull(123, 123)`,
10691069
[]sql.Row{
1070-
{int64(123)},
1070+
{int8(123)},
10711071
},
10721072
},
10731073
{
10741074
`SELECT ifnull(123, 321)`,
10751075
[]sql.Row{
1076-
{int64(123)},
1076+
{int8(123)},
10771077
},
10781078
},
10791079
{
@@ -1085,7 +1085,7 @@ var queries = []struct {
10851085
{
10861086
`SELECT round(15, 1)`,
10871087
[]sql.Row{
1088-
{int64(15)},
1088+
{int8(15)},
10891089
},
10901090
},
10911091
{
@@ -1452,7 +1452,7 @@ var queries = []struct {
14521452
},
14531453
{
14541454
`SELECT 1 FROM mytable GROUP BY i HAVING i > 1`,
1455-
[]sql.Row{{int64(1)}, {int64(1)}},
1455+
[]sql.Row{{int8(1)}, {int8(1)}},
14561456
},
14571457
{
14581458
`SELECT avg(i) FROM mytable GROUP BY i HAVING avg(i) > 1`,
@@ -1887,8 +1887,8 @@ func TestInsertInto(t *testing.T) {
18871887
[]sql.Row{{int64(1)}},
18881888
"SELECT * FROM typestable WHERE id = 999;",
18891889
[]sql.Row{{
1890-
int64(999), int64(math.MaxInt8), int64(math.MaxInt16), int64(math.MaxInt32), int64(math.MaxInt64),
1891-
int64(math.MaxUint8), int64(math.MaxUint16), int64(math.MaxUint32), uint64(math.MaxUint64),
1890+
int64(999), int8(math.MaxInt8), int16(math.MaxInt16), int32(math.MaxInt32), int64(math.MaxInt64),
1891+
uint8(math.MaxUint8), uint16(math.MaxUint16), uint32(math.MaxUint32), uint64(math.MaxUint64),
18921892
float64(math.MaxFloat32), float64(math.MaxFloat64),
18931893
timeParse(sql.TimestampLayout, "2132-04-05 12:51:36"), timeParse(sql.DateLayout, "2231-11-07"),
18941894
"random text", true, `{"key":"value"}`, "blobdata",
@@ -1905,8 +1905,8 @@ func TestInsertInto(t *testing.T) {
19051905
[]sql.Row{{int64(1)}},
19061906
"SELECT * FROM typestable WHERE id = 999;",
19071907
[]sql.Row{{
1908-
int64(999), int64(math.MaxInt8), int64(math.MaxInt16), int64(math.MaxInt32), int64(math.MaxInt64),
1909-
int64(math.MaxUint8), int64(math.MaxUint16), int64(math.MaxUint32), uint64(math.MaxUint64),
1908+
int64(999), int8(math.MaxInt8), int16(math.MaxInt16), int32(math.MaxInt32), int64(math.MaxInt64),
1909+
uint8(math.MaxUint8), uint16(math.MaxUint16), uint32(math.MaxUint32), uint64(math.MaxUint64),
19101910
float64(math.MaxFloat32), float64(math.MaxFloat64),
19111911
timeParse(sql.TimestampLayout, "2132-04-05 12:51:36"), timeParse(sql.DateLayout, "2231-11-07"),
19121912
"random text", true, `{"key":"value"}`, "blobdata",
@@ -1923,8 +1923,8 @@ func TestInsertInto(t *testing.T) {
19231923
[]sql.Row{{int64(1)}},
19241924
"SELECT * FROM typestable WHERE id = 999;",
19251925
[]sql.Row{{
1926-
int64(999), int64(-math.MaxInt8 - 1), int64(-math.MaxInt16 - 1), int64(-math.MaxInt32 - 1), int64(-math.MaxInt64 - 1),
1927-
int64(0), int64(0), int64(0), int64(0),
1926+
int64(999), int8(-math.MaxInt8 - 1), int16(-math.MaxInt16 - 1), int32(-math.MaxInt32 - 1), int64(-math.MaxInt64 - 1),
1927+
uint8(0), uint16(0), uint32(0), uint64(0),
19281928
float64(math.SmallestNonzeroFloat32), float64(math.SmallestNonzeroFloat64),
19291929
timeParse(sql.TimestampLayout, "0010-04-05 12:51:36"), timeParse(sql.DateLayout, "0101-11-07"),
19301930
"", false, ``, "",
@@ -1941,8 +1941,8 @@ func TestInsertInto(t *testing.T) {
19411941
[]sql.Row{{int64(1)}},
19421942
"SELECT * FROM typestable WHERE id = 999;",
19431943
[]sql.Row{{
1944-
int64(999), int64(-math.MaxInt8 - 1), int64(-math.MaxInt16 - 1), int64(-math.MaxInt32 - 1), int64(-math.MaxInt64 - 1),
1945-
int64(0), int64(0), int64(0), int64(0),
1944+
int64(999), int8(-math.MaxInt8 - 1), int16(-math.MaxInt16 - 1), int32(-math.MaxInt32 - 1), int64(-math.MaxInt64 - 1),
1945+
uint8(0), uint16(0), uint32(0), uint64(0),
19461946
float64(math.SmallestNonzeroFloat32), float64(math.SmallestNonzeroFloat64),
19471947
timeParse(sql.TimestampLayout, "0010-04-05 12:51:36"), timeParse(sql.DateLayout, "0101-11-07"),
19481948
"", false, ``, "",
@@ -2087,8 +2087,8 @@ func TestReplaceInto(t *testing.T) {
20872087
[]sql.Row{{int64(1)}},
20882088
"SELECT * FROM typestable WHERE id = 999;",
20892089
[]sql.Row{{
2090-
int64(999), int64(math.MaxInt8), int64(math.MaxInt16), int64(math.MaxInt32), int64(math.MaxInt64),
2091-
int64(math.MaxUint8), int64(math.MaxUint16), int64(math.MaxUint32), uint64(math.MaxUint64),
2090+
int64(999), int8(math.MaxInt8), int16(math.MaxInt16), int32(math.MaxInt32), int64(math.MaxInt64),
2091+
uint8(math.MaxUint8), uint16(math.MaxUint16), uint32(math.MaxUint32), uint64(math.MaxUint64),
20922092
float64(math.MaxFloat32), float64(math.MaxFloat64),
20932093
timeParse(sql.TimestampLayout, "2132-04-05 12:51:36"), timeParse(sql.DateLayout, "2231-11-07"),
20942094
"random text", true, `{"key":"value"}`, "blobdata",
@@ -2105,8 +2105,8 @@ func TestReplaceInto(t *testing.T) {
21052105
[]sql.Row{{int64(1)}},
21062106
"SELECT * FROM typestable WHERE id = 999;",
21072107
[]sql.Row{{
2108-
int64(999), int64(math.MaxInt8), int64(math.MaxInt16), int64(math.MaxInt32), int64(math.MaxInt64),
2109-
int64(math.MaxUint8), int64(math.MaxUint16), int64(math.MaxUint32), uint64(math.MaxUint64),
2108+
int64(999), int8(math.MaxInt8), int16(math.MaxInt16), int32(math.MaxInt32), int64(math.MaxInt64),
2109+
uint8(math.MaxUint8), uint16(math.MaxUint16), uint32(math.MaxUint32), uint64(math.MaxUint64),
21102110
float64(math.MaxFloat32), float64(math.MaxFloat64),
21112111
timeParse(sql.TimestampLayout, "2132-04-05 12:51:36"), timeParse(sql.DateLayout, "2231-11-07"),
21122112
"random text", true, `{"key":"value"}`, "blobdata",
@@ -2123,8 +2123,8 @@ func TestReplaceInto(t *testing.T) {
21232123
[]sql.Row{{int64(1)}},
21242124
"SELECT * FROM typestable WHERE id = 999;",
21252125
[]sql.Row{{
2126-
int64(999), int64(-math.MaxInt8 - 1), int64(-math.MaxInt16 - 1), int64(-math.MaxInt32 - 1), int64(-math.MaxInt64 - 1),
2127-
int64(0), int64(0), int64(0), int64(0),
2126+
int64(999), int8(-math.MaxInt8 - 1), int16(-math.MaxInt16 - 1), int32(-math.MaxInt32 - 1), int64(-math.MaxInt64 - 1),
2127+
uint8(0), uint16(0), uint32(0), uint64(0),
21282128
float64(math.SmallestNonzeroFloat32), float64(math.SmallestNonzeroFloat64),
21292129
timeParse(sql.TimestampLayout, "0010-04-05 12:51:36"), timeParse(sql.DateLayout, "0101-11-07"),
21302130
"", false, ``, "",
@@ -2141,8 +2141,8 @@ func TestReplaceInto(t *testing.T) {
21412141
[]sql.Row{{int64(1)}},
21422142
"SELECT * FROM typestable WHERE id = 999;",
21432143
[]sql.Row{{
2144-
int64(999), int64(-math.MaxInt8 - 1), int64(-math.MaxInt16 - 1), int64(-math.MaxInt32 - 1), int64(-math.MaxInt64 - 1),
2145-
int64(0), int64(0), int64(0), int64(0),
2144+
int64(999), int8(-math.MaxInt8 - 1), int16(-math.MaxInt16 - 1), int32(-math.MaxInt32 - 1), int64(-math.MaxInt64 - 1),
2145+
uint8(0), uint16(0), uint32(0), uint64(0),
21462146
float64(math.SmallestNonzeroFloat32), float64(math.SmallestNonzeroFloat64),
21472147
timeParse(sql.TimestampLayout, "0010-04-05 12:51:36"), timeParse(sql.DateLayout, "0101-11-07"),
21482148
"", false, ``, "",
@@ -2947,7 +2947,7 @@ func TestSessionVariables(t *testing.T) {
29472947
rows, err := sql.RowIterToRows(iter)
29482948
require.NoError(err)
29492949

2950-
require.Equal([]sql.Row{{int64(1), ",STRICT_TRANS_TABLES"}}, rows)
2950+
require.Equal([]sql.Row{{int8(1), ",STRICT_TRANS_TABLES"}}, rows)
29512951
}
29522952

29532953
func TestSessionVariablesONOFF(t *testing.T) {

Diff for: internal/sockstate/netstat_linux.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ import (
2222
const (
2323
pathTCP4Tab = "/proc/net/tcp"
2424
pathTCP6Tab = "/proc/net/tcp6"
25-
ipv4StrLen = 8
26-
ipv6StrLen = 32
25+
ipv4StrLen = 8
26+
ipv6StrLen = 32
2727
)
2828

2929
type procFd struct {

Diff for: sql/expression/function/ceil_round_floor.go

+24
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,18 @@ func (r *Round) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) {
203203
dVal = float64(dNum)
204204
case int32:
205205
dVal = float64(dNum)
206+
case int16:
207+
dVal = float64(dNum)
208+
case int8:
209+
dVal = float64(dNum)
210+
case uint64:
211+
dVal = float64(dNum)
212+
case uint32:
213+
dVal = float64(dNum)
214+
case uint16:
215+
dVal = float64(dNum)
216+
case uint8:
217+
dVal = float64(dNum)
206218
case int:
207219
dVal = float64(dNum)
208220
default:
@@ -233,6 +245,18 @@ func (r *Round) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) {
233245
return int64(math.Round(float64(xNum)*math.Pow(10.0, dVal)) / math.Pow(10.0, dVal)), nil
234246
case int32:
235247
return int32(math.Round(float64(xNum)*math.Pow(10.0, dVal)) / math.Pow(10.0, dVal)), nil
248+
case int16:
249+
return int16(math.Round(float64(xNum)*math.Pow(10.0, dVal)) / math.Pow(10.0, dVal)), nil
250+
case int8:
251+
return int8(math.Round(float64(xNum)*math.Pow(10.0, dVal)) / math.Pow(10.0, dVal)), nil
252+
case uint64:
253+
return uint64(math.Round(float64(xNum)*math.Pow(10.0, dVal)) / math.Pow(10.0, dVal)), nil
254+
case uint32:
255+
return uint32(math.Round(float64(xNum)*math.Pow(10.0, dVal)) / math.Pow(10.0, dVal)), nil
256+
case uint16:
257+
return uint16(math.Round(float64(xNum)*math.Pow(10.0, dVal)) / math.Pow(10.0, dVal)), nil
258+
case uint8:
259+
return uint8(math.Round(float64(xNum)*math.Pow(10.0, dVal)) / math.Pow(10.0, dVal)), nil
236260
case int:
237261
return int(math.Round(float64(xNum)*math.Pow(10.0, dVal)) / math.Pow(10.0, dVal)), nil
238262
default:

Diff for: sql/expression/function/ceil_round_floor_test.go

+44
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,50 @@ func TestRound(t *testing.T) {
156156
{"int32 with float d", sql.Int32, sql.Float64, sql.NewRow(int32(5), float32(2.123)), int32(5), nil},
157157
{"int32 with float negative d", sql.Int32, sql.Float64, sql.NewRow(int32(52), float32(-1)), int32(50), nil},
158158
{"int32 with blob d", sql.Int32, sql.Blob, sql.NewRow(int32(5), []byte{1, 2, 3}), int32(5), nil},
159+
{"int16 is nil", sql.Int16, sql.Int16, sql.NewRow(nil, nil), nil, nil},
160+
{"int16 without d", sql.Int16, sql.Int16, sql.NewRow(int16(5), nil), int16(5), nil},
161+
{"int16 with d", sql.Int16, sql.Int16, sql.NewRow(int16(5), 2), int16(5), nil},
162+
{"int16 with negative d", sql.Int16, sql.Int16, sql.NewRow(int16(52), -1), int16(50), nil},
163+
{"int16 with float d", sql.Int16, sql.Float64, sql.NewRow(int16(5), float32(2.123)), int16(5), nil},
164+
{"int16 with float negative d", sql.Int16, sql.Float64, sql.NewRow(int16(52), float32(-1)), int16(50), nil},
165+
{"int16 with blob d", sql.Int16, sql.Blob, sql.NewRow(int16(5), []byte{1, 2, 3}), int16(5), nil},
166+
{"int8 is nil", sql.Int8, sql.Int8, sql.NewRow(nil, nil), nil, nil},
167+
{"int8 without d", sql.Int8, sql.Int8, sql.NewRow(int8(5), nil), int8(5), nil},
168+
{"int8 with d", sql.Int8, sql.Int8, sql.NewRow(int8(5), 2), int8(5), nil},
169+
{"int8 with negative d", sql.Int8, sql.Int8, sql.NewRow(int8(52), -1), int8(50), nil},
170+
{"int8 with float d", sql.Int8, sql.Float64, sql.NewRow(int8(5), float32(2.123)), int8(5), nil},
171+
{"int8 with float negative d", sql.Int8, sql.Float64, sql.NewRow(int8(52), float32(-1)), int8(50), nil},
172+
{"int8 with blob d", sql.Int8, sql.Blob, sql.NewRow(int8(5), []byte{1, 2, 3}), int8(5), nil},
173+
{"uint64 is nil", sql.Uint64, sql.Int32, sql.NewRow(nil, nil), nil, nil},
174+
{"uint64 without d", sql.Uint64, sql.Int32, sql.NewRow(uint64(5), nil), uint64(5), nil},
175+
{"uint64 with d", sql.Uint64, sql.Int32, sql.NewRow(uint64(5), 2), uint64(5), nil},
176+
{"uint64 with negative d", sql.Uint64, sql.Int32, sql.NewRow(uint64(52), -1), uint64(50), nil},
177+
{"uint64 with float d", sql.Uint64, sql.Float64, sql.NewRow(uint64(5), float32(2.123)), uint64(5), nil},
178+
{"uint64 with float negative d", sql.Uint64, sql.Float64, sql.NewRow(uint64(52), float32(-1)), uint64(50), nil},
179+
{"uint32 with blob d", sql.Uint32, sql.Blob, sql.NewRow(uint32(5), []byte{1, 2, 3}), uint32(5), nil},
180+
{"uint32 is nil", sql.Uint32, sql.Int32, sql.NewRow(nil, nil), nil, nil},
181+
{"uint32 without d", sql.Uint32, sql.Int32, sql.NewRow(uint32(5), nil), uint32(5), nil},
182+
{"uint32 with d", sql.Uint32, sql.Int32, sql.NewRow(uint32(5), 2), uint32(5), nil},
183+
{"uint32 with negative d", sql.Uint32, sql.Int32, sql.NewRow(uint32(52), -1), uint32(50), nil},
184+
{"uint32 with float d", sql.Uint32, sql.Float64, sql.NewRow(uint32(5), float32(2.123)), uint32(5), nil},
185+
{"uint32 with float negative d", sql.Uint32, sql.Float64, sql.NewRow(uint32(52), float32(-1)), uint32(50), nil},
186+
{"uint32 with blob d", sql.Uint32, sql.Blob, sql.NewRow(uint32(5), []byte{1, 2, 3}), uint32(5), nil},
187+
{"uint16 with blob d", sql.Uint16, sql.Blob, sql.NewRow(uint16(5), []byte{1, 2, 3}), uint16(5), nil},
188+
{"uint16 is nil", sql.Uint16, sql.Int16, sql.NewRow(nil, nil), nil, nil},
189+
{"uint16 without d", sql.Uint16, sql.Int16, sql.NewRow(uint16(5), nil), uint16(5), nil},
190+
{"uint16 with d", sql.Uint16, sql.Int16, sql.NewRow(uint16(5), 2), uint16(5), nil},
191+
{"uint16 with negative d", sql.Uint16, sql.Int16, sql.NewRow(uint16(52), -1), uint16(50), nil},
192+
{"uint16 with float d", sql.Uint16, sql.Float64, sql.NewRow(uint16(5), float32(2.123)), uint16(5), nil},
193+
{"uint16 with float negative d", sql.Uint16, sql.Float64, sql.NewRow(uint16(52), float32(-1)), uint16(50), nil},
194+
{"uint16 with blob d", sql.Uint16, sql.Blob, sql.NewRow(uint16(5), []byte{1, 2, 3}), uint16(5), nil},
195+
{"uint8 with blob d", sql.Uint8, sql.Blob, sql.NewRow(uint8(5), []byte{1, 2, 3}), uint8(5), nil},
196+
{"uint8 is nil", sql.Uint8, sql.Int8, sql.NewRow(nil, nil), nil, nil},
197+
{"uint8 without d", sql.Uint8, sql.Int8, sql.NewRow(uint8(5), nil), uint8(5), nil},
198+
{"uint8 with d", sql.Uint8, sql.Int8, sql.NewRow(uint8(5), 2), uint8(5), nil},
199+
{"uint8 with negative d", sql.Uint8, sql.Int8, sql.NewRow(uint8(52), -1), uint8(50), nil},
200+
{"uint8 with float d", sql.Uint8, sql.Float64, sql.NewRow(uint8(5), float32(2.123)), uint8(5), nil},
201+
{"uint8 with float negative d", sql.Uint8, sql.Float64, sql.NewRow(uint8(52), float32(-1)), uint8(50), nil},
202+
{"uint8 with blob d", sql.Uint8, sql.Blob, sql.NewRow(uint8(5), []byte{1, 2, 3}), uint8(5), nil},
159203
{"blob is nil", sql.Blob, sql.Int32, sql.NewRow(nil, nil), nil, nil},
160204
{"blob is ok", sql.Blob, sql.Int32, sql.NewRow([]byte{1, 2, 3}, nil), int32(0), nil},
161205
{"text int without d", sql.Text, sql.Int32, sql.NewRow("5", nil), int32(5), nil},

Diff for: sql/expression/function/time.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,10 @@ func (d *YearWeek) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) {
363363
return nil, err
364364
}
365365
if val != nil {
366-
if mode, ok = val.(int64); ok {
367-
mode %= 8 // mode in [0, 7]
366+
if i64, err := sql.Int64.Convert(val); err == nil {
367+
if mode, ok = i64.(int64); ok {
368+
mode %= 8 // mode in [0, 7]
369+
}
368370
}
369371
}
370372
yyyy, week := calcWeek(yyyy, mm, dd, weekMode(mode)|weekBehaviourYear)

Diff for: sql/index/pilosa/lookup.go

+76
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,14 @@ func decodeGob(k []byte, value interface{}) (interface{}, error) {
621621
var v string
622622
err := decoder.Decode(&v)
623623
return v, err
624+
case int8:
625+
var v int8
626+
err := decoder.Decode(&v)
627+
return v, err
628+
case int16:
629+
var v int16
630+
err := decoder.Decode(&v)
631+
return v, err
624632
case int32:
625633
var v int32
626634
err := decoder.Decode(&v)
@@ -629,6 +637,14 @@ func decodeGob(k []byte, value interface{}) (interface{}, error) {
629637
var v int64
630638
err := decoder.Decode(&v)
631639
return v, err
640+
case uint8:
641+
var v uint8
642+
err := decoder.Decode(&v)
643+
return v, err
644+
case uint16:
645+
var v uint16
646+
err := decoder.Decode(&v)
647+
return v, err
632648
case uint32:
633649
var v uint32
634650
err := decoder.Decode(&v)
@@ -688,6 +704,36 @@ func compare(a, b interface{}) (int, error) {
688704
}
689705

690706
return strings.Compare(a, v), nil
707+
case int8:
708+
v, ok := b.(int8)
709+
if !ok {
710+
return 0, errTypeMismatch.New(a, b)
711+
}
712+
713+
if a == v {
714+
return 0, nil
715+
}
716+
717+
if a < v {
718+
return -1, nil
719+
}
720+
721+
return 1, nil
722+
case int16:
723+
v, ok := b.(int16)
724+
if !ok {
725+
return 0, errTypeMismatch.New(a, b)
726+
}
727+
728+
if a == v {
729+
return 0, nil
730+
}
731+
732+
if a < v {
733+
return -1, nil
734+
}
735+
736+
return 1, nil
691737
case int32:
692738
v, ok := b.(int32)
693739
if !ok {
@@ -717,6 +763,36 @@ func compare(a, b interface{}) (int, error) {
717763
return -1, nil
718764
}
719765

766+
return 1, nil
767+
case uint8:
768+
v, ok := b.(uint8)
769+
if !ok {
770+
return 0, errTypeMismatch.New(a, b)
771+
}
772+
773+
if a == v {
774+
return 0, nil
775+
}
776+
777+
if a < v {
778+
return -1, nil
779+
}
780+
781+
return 1, nil
782+
case uint16:
783+
v, ok := b.(uint16)
784+
if !ok {
785+
return 0, errTypeMismatch.New(a, b)
786+
}
787+
788+
if a == v {
789+
return 0, nil
790+
}
791+
792+
if a < v {
793+
return -1, nil
794+
}
795+
720796
return 1, nil
721797
case uint32:
722798
v, ok := b.(uint32)

0 commit comments

Comments
 (0)