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

Commit c0899fb

Browse files
Test parsing of integer literals
Signed-off-by: Alejandro García Montoro <[email protected]>
1 parent d436a96 commit c0899fb

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Diff for: sql/parse/parse_test.go

+18
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package parse
22

33
import (
4+
"math"
45
"testing"
56

67
"github.com/src-d/go-mysql-server/sql/expression"
@@ -1191,6 +1192,23 @@ var fixtures = map[string]sql.Node{
11911192
[]sql.Expression{},
11921193
plan.NewUnresolvedTable("foo", ""),
11931194
),
1195+
`SELECT -128, 127, 255, -32768, 32767, 65535, -2147483648, 2147483647, 4294967295, -9223372036854775808, 9223372036854775807, 18446744073709551615`: plan.NewProject(
1196+
[]sql.Expression{
1197+
expression.NewLiteral(int8(math.MinInt8), sql.Int8),
1198+
expression.NewLiteral(int8(math.MaxInt8), sql.Int8),
1199+
expression.NewLiteral(uint8(math.MaxUint8), sql.Uint8),
1200+
expression.NewLiteral(int16(math.MinInt16), sql.Int16),
1201+
expression.NewLiteral(int16(math.MaxInt16), sql.Int16),
1202+
expression.NewLiteral(uint16(math.MaxUint16), sql.Uint16),
1203+
expression.NewLiteral(int32(math.MinInt32), sql.Int32),
1204+
expression.NewLiteral(int32(math.MaxInt32), sql.Int32),
1205+
expression.NewLiteral(uint32(math.MaxUint32), sql.Uint32),
1206+
expression.NewLiteral(int64(math.MinInt64), sql.Int64),
1207+
expression.NewLiteral(int64(math.MaxInt64), sql.Int64),
1208+
expression.NewLiteral(uint64(math.MaxUint64), sql.Uint64),
1209+
},
1210+
plan.NewUnresolvedTable("dual", ""),
1211+
),
11941212
}
11951213

11961214
func TestParse(t *testing.T) {

0 commit comments

Comments
 (0)