Skip to content

Incorrect cast date to int #1046

Closed
Closed
@overvenus

Description

  1. What version of Go are you using (go version)?

    go version go1.5.3 linux/amd64

  2. What operating system and processor architecture are you using (go env)?

    $ go env
    GOARCH="amd64"
    GOBIN=""
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="linux"
    GOOS="linux"
    GOPATH="/home/neil/repo/gopath"
    GORACE=""
    GOROOT="/usr/local/go"
    GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
    GO15VENDOREXPERIMENT=""
    CC="gcc"
    GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
    CXX="g++"
    CGO_ENABLED="1"
    
    $ tidb-server/tidb-server -h
    Welcome to the TiDB.
    Version:
    Git Commit Hash: 8aa1055ceb3db20785957056375787be7cf73709
    UTC Build Time:  2016-04-02 07:26:11
    ...
  3. What did you do?

    tidb> select current_date, current_date+1;
    +--------------+----------------+
    | current_date | current_date+1 |
    +--------------+----------------+
    | 2016-04-02   | 20160402000001 |
    +--------------+----------------+
    1 row in set (0.00 sec)
    
  4. What did you expect to see?

    mysql> select current_date, current_date+1;
    +--------------+----------------+
    | current_date | current_date+1 |
    +--------------+----------------+
    | 2016-04-02   |       20160403 |
    +--------------+----------------+
    1 row in set (0.00 sec)
    
  5. What did you see instead?

    see Q.3

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions