Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
wshwsh12 committed Jul 26, 2019
1 parent 1017f24 commit 3291f08
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,9 @@ func (s *testParserSuite) TestBuiltin(c *C) {
// for cast as signed int, fix issue #3691.
{"select cast(1 as signed int);", true, "SELECT CAST(1 AS SIGNED)"},

// for cast as double
{"select cast(1 as double);", true, "SELECT CAST(1 AS DOUBLE)"},

// for last_insert_id
{"SELECT last_insert_id();", true, "SELECT LAST_INSERT_ID()"},
{"SELECT last_insert_id(1);", true, "SELECT LAST_INSERT_ID(1)"},
Expand Down
2 changes: 2 additions & 0 deletions types/field_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ func (ft *FieldType) RestoreAsCastType(ctx *format.RestoreCtx) {
}
case mysql.TypeJSON:
ctx.WriteKeyWord("JSON")
case mysql.TypeDouble:
ctx.WriteKeyWord("DOUBLE")
}
}

Expand Down

0 comments on commit 3291f08

Please sign in to comment.