Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions go/sqltypes/value.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,7 @@ func (v Value) IsBinary() bool {

// IsDateTime returns true if Value is datetime.
func (v Value) IsDateTime() bool {
dt := int(querypb.Type_DATETIME)
return int(v.typ)&dt == dt
return v.typ == querypb.Type_DATETIME
}

// IsDecimal returns true if Value is a decimal.
Expand Down
2 changes: 1 addition & 1 deletion go/vt/sqlparser/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -2475,7 +2475,7 @@ type (
// supported functions are documented in the grammar
CurTimeFuncExpr struct {
Name IdentifierCI
Fsp Expr // fractional seconds precision, integer from 0 to 6 or an Argument
Fsp int // fractional seconds precision, integer from 0 to 6 or an Argument
}

// ExtractedSubquery is a subquery that has been extracted from the original AST
Expand Down
1 change: 0 additions & 1 deletion go/vt/sqlparser/ast_clone.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions go/vt/sqlparser/ast_copy_on_rewrite.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions go/vt/sqlparser/ast_equals.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions go/vt/sqlparser/ast_format.go
Original file line number Diff line number Diff line change
Expand Up @@ -1486,8 +1486,8 @@ func (node *WeightStringFuncExpr) Format(buf *TrackedBuffer) {

// Format formats the node.
func (node *CurTimeFuncExpr) Format(buf *TrackedBuffer) {
if node.Fsp != nil {
buf.astPrintf(node, "%#s(%v)", node.Name.String(), node.Fsp)
if node.Fsp > 0 {
buf.astPrintf(node, "%#s(%d)", node.Name.String(), node.Fsp)
} else {
buf.astPrintf(node, "%#s()", node.Name.String())
}
Expand Down
4 changes: 2 additions & 2 deletions go/vt/sqlparser/ast_format_fast.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions go/vt/sqlparser/ast_rewrite.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions go/vt/sqlparser/ast_visit.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions go/vt/sqlparser/cached_size.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions go/vt/sqlparser/keywords.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ var keywords = []keyword{
{"csv", CSV},
{"current", CURRENT},
{"current_date", CURRENT_DATE},
{"curdate", CURDATE},
{"current_time", CURRENT_TIME},
{"curtime", CURTIME},
{"current_timestamp", CURRENT_TIMESTAMP},
{"current_user", CURRENT_USER},
{"cursor", UNUSED},
Expand Down Expand Up @@ -610,6 +612,7 @@ var keywords = []keyword{
{"st_polyfromtext", ST_PolygonFromText},
{"st_polygonfromtext", ST_PolygonFromText},
{"sum", SUM},
{"sysdate", SYSDATE},
{"system", UNUSED},
{"table", TABLE},
{"tables", TABLES},
Expand Down
4 changes: 2 additions & 2 deletions go/vt/sqlparser/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ var (
}, {
input: "select /* utc_timestamp as func */ utc_timestamp() from t",
}, {
input: "select /* utc_timestamp with fsp */ utc_timestamp(0) from t",
input: "select /* utc_timestamp with fsp */ utc_timestamp(1) from t",
}, {
input: "select /* utc_time */ utc_time() from t",
}, {
Expand Down Expand Up @@ -2792,7 +2792,7 @@ var (
output: "select json_array(BIN(11)) from dual",
}, {
input: `SELECT JSON_ARRAY(1, "abc", NULL, TRUE, CURTIME());`,
output: `select json_array(1, 'abc', null, true, CURTIME()) from dual`,
output: `select json_array(1, 'abc', null, true, curtime()) from dual`,
}, {
input: "SELECT JSON_OBJECT(1,2)",
output: "select json_object(1, 2) from dual",
Expand Down
Loading