Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.

Compile error: parse.go:248:77: undefined sqlparser.SCHEMAS #826

Closed
drauschenbach opened this issue Sep 25, 2019 · 7 comments
Closed

Compile error: parse.go:248:77: undefined sqlparser.SCHEMAS #826

drauschenbach opened this issue Sep 25, 2019 · 7 comments
Assignees
Labels
blocked Some other issue is blocking this bug Something isn't working

Comments

@drauschenbach
Copy link

Incorporating current master branch into an external main.go file:

$ go install ...myapp...
# .../vendor/github.com/src-d/go-mysql-server/sql/parse
vendor/github.com/src-d/go-mysql-server/sql/parse/parse.go:248:77: undefined: sqlparser.SCHEMAS
make: *** [compile] Error 2
@erizocosmico erizocosmico added the bug Something isn't working label Sep 26, 2019
@erizocosmico erizocosmico self-assigned this Sep 26, 2019
@erizocosmico
Copy link
Contributor

I cannot reproduce this error. Can you share the steps you went through to get this error? Are all go-mysql-server dependencies up to date in your vendor folder as well?

@erizocosmico erizocosmico added the blocked Some other issue is blocking this label Sep 27, 2019
@drauschenbach
Copy link
Author

drauschenbach commented Oct 1, 2019

@erizocosmico I created an environment to reproduce.

@erizocosmico
Copy link
Contributor

It's because dep is getting the latest vitess version, which has missing things go-mysql-server needs. go-mysql-server uses go modules to manage dependencies, so using go modules should make the problem go away.
If by any reason you can not use go modules and are stuck with dep you should pin the vitess version to v3.0.0-rc.3.0

@drauschenbach
Copy link
Author

I see. Thank you.

@bombsimon
Copy link

@erizocosmico I know this issue is closed but maybe you can help me out. I'm using go mod but I can't get this to work.

$ mkdir x && cd x

$ go mod init github.com/bombsimon/x
go: creating new go.mod: module github.com/bombsimon/x

$ go get github.com/src-d/go-mysql-server
go get: github.com/src-d/go-mysql-server@v0.5.1: parsing go.mod:
        module declares its path as: gopkg.in/src-d/go-mysql-server.v0
                but was required as: github.com/src-d/go-mysql-server

# Explicit version
$ go get github.com/src-d/go-mysql-server@v0.5.1
go: finding github.com/src-d v0.5.1
go: finding github.com v0.5.1
go get: github.com/src-d/go-mysql-server@v0.5.1: parsing go.mod:
        module declares its path as: gopkg.in/src-d/go-mysql-server.v0
                but was required as: github.com/src-d/go-mysql-server

# Or older version
go get github.com/src-d/go-mysql-server@v0.4.0
go: finding github.com/src-d v0.4.0
go: finding github.com v0.4.0
go get: github.com/src-d/go-mysql-server@v0.4.0: parsing go.mod:
        module declares its path as: gopkg.in/src-d/go-mysql-server.v0
                but was required as: github.com/src-d/go-mysql-server

Above output is with go1.13, same issue with go1.12 (but another error message).

$ go1.12.10 get github.com/src-d/go-mysql-server
go: github.com/src-d/go-mysql-server@v0.5.1: parsing go.mod: unexpected module path "gopkg.in/src-d/go-mysql-server.v0"
go: error loading module requirements

Seems to be working with other projects with go modules:

$ go get github.com/sirupsen/logrus
go: downloading golang.org/x/sys v0.0.0-20190422165155-953cdadca894
go: extracting golang.org/x/sys v0.0.0-20190422165155-953cdadca894
go: finding golang.org/x/sys v0.0.0-20190422165155-953cdadca894

$ cat go.mod
module github.com/bombsimon/x

go 1.13

require github.com/sirupsen/logrus v1.4.2 // indirect

Any advice?

@erizocosmico
Copy link
Contributor

@bombsimon oh, I see the last release is from before migrating from gopkg.in.

In this case, use:

go get github.com/src-d/go-mysql-server@ b09e8c1c8ab906a3a90cf76115c0a3fc5ee4470a

or any other commit hash to get a specific revision (that one is the master revision right now).

I just asked the maintainer for a new version so this problem goes away without resorting to pinning a specific commit.

@bombsimon
Copy link

@erizocosmico: Thank you so much! I've yet to fully understand some of those special cases regarding go mod but that seems like an easy fix. :) Again, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked Some other issue is blocking this bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants