Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lossing fractional seconds for datetime(3) when applying bin log #300

Closed
jessicalu2016 opened this issue Oct 31, 2016 · 13 comments
Closed
Assignees

Comments

@jessicalu2016
Copy link

Hi Guys,

I was testing on replica (--alter="engine=innodb") and found out that columns defined as datetime(3) lost fractional seconds after migration. e.g "2016-10-31 13:25:40.834" becomes "2016-10-31 13:25:40.000". looks like gh-ost zero out the fractional seconds? Am I missing anything?

Thanks in advance!

@shlomi-noach shlomi-noach self-assigned this Oct 31, 2016
@shlomi-noach
Copy link
Contributor

@jessicalu2016 Can you please add your table schema?

@shlomi-noach
Copy link
Contributor

shlomi-noach commented Oct 31, 2016

@shlomi-noach
Copy link
Contributor

Related: go-mysql-org/go-mysql#89

@shlomi-noach
Copy link
Contributor

@jessicalu2016 are you able to build and test #301 ? Should solve your issue

@jessicalu2016
Copy link
Author

@shlomi-noach I got following error to build the source. Could you provide me instructions what I need to set up to run ./build.sh? I've got go installed and hello world test fine. thanks!

Building macOS binary
go/cmd/gh-ost/main.go:15:2: cannot find package "github.com/github/gh-ost/go/base" in any of:
    /usr/local/opt/go/libexec/src/github.com/github/gh-ost/go/base (from $GOROOT)
    /Users/jessicalu/Projects/gh-ost/go/src/github.com/github/gh-ost/go/base (from $GOPATH)
go/cmd/gh-ost/main.go:16:2: cannot find package "github.com/github/gh-ost/go/logic" in any of:
    /usr/local/opt/go/libexec/src/github.com/github/gh-ost/go/logic (from $GOROOT)
    /Users/jessicalu/Projects/gh-ost/go/src/github.com/github/gh-ost/go/logic (from $GOPATH)
go/cmd/gh-ost/main.go:17:2: cannot find package "github.com/outbrain/golib/log" in any of:
    /usr/local/opt/go/libexec/src/github.com/outbrain/golib/log (from $GOROOT)
    /Users/jessicalu/Projects/gh-ost/go/src/github.com/outbrain/golib/log (from $GOPATH)
Build failed for macOS

@shlomi-noach
Copy link
Contributor

@jessicalu2016 you probably have an older go version. Can you go version? You need to have at least go1.5

@shlomi-noach
Copy link
Contributor

or, otherwise, your GOPATH is not set properly to reflect /Users/jessicalu/Projects/. grrrrr.... this is a go nuance and a nuisance.

@jessicalu2016
Copy link
Author

@shlomi-noach go version is 1.6.2, and here's my go related setting. which dir should GOPATH pointing to? thanks!

go version go1.6.2 darwin/amd64

export GOROOT=/usr/local/opt/go/libexec
export GOPATH=/Users/jessicalu/Projects/gh-ost/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

@shlomi-noach
Copy link
Contributor

shlomi-noach commented Oct 31, 2016

so this is the nuisance about go. It expects your project to be in a place relative to your GOPATH, not in GOPATH itself. For example, you'd want to:

cd /Users/jessicalu/
mkdir -p go/src/github.com/github/
export GOPATH=/Users/jessicalu/go
mv Projects/gh-ost go/src/github.com/github/
cd go/src/github.com/github/
./build.sh

@shlomi-noach
Copy link
Contributor

Whoops, and: export GOPATH=/Users/jessicalu/go

@jessicalu2016
Copy link
Author

@shlomi-noach it works perfectly! Thanks for fast replies and the fix! appreciated!

@shlomi-noach
Copy link
Contributor

cool. Will give this more testing before merging.

@shlomi-noach
Copy link
Contributor

closed by #301

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants