Skip to content

Commit

Permalink
Merge pull request #349 from dolthub/zachmu/timestamp
Browse files Browse the repository at this point in the history
Fixed timestamp bindvar formatting to match MySQL string expectation
  • Loading branch information
zachmu authored May 29, 2024
2 parents 4c419c3 + e1ffffa commit 05c840d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go/sqltypes/bind_variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func BuildBindVariable(v interface{}) (*querypb.BindVariable, error) {
case time.Time:
return &querypb.BindVariable{
Type: querypb.Type_TIMESTAMP,
Value: []byte(v.String()),
Value: []byte(v.Format("2006-01-02 15:04:05.000000")),
}, nil
// TODO: somehow support types.Timespan
case nil:
Expand Down
2 changes: 1 addition & 1 deletion go/sqltypes/bind_variables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func TestBuildBindVariable(t *testing.T) {
in: time.Time{},
out: &querypb.BindVariable{
Type: querypb.Type_TIMESTAMP,
Value: []byte("0001-01-01 00:00:00 +0000 UTC"),
Value: []byte("0001-01-01 00:00:00.000000"),
},
},
{
Expand Down

0 comments on commit 05c840d

Please sign in to comment.