Skip to content

Commit 42bbeca

Browse files
authored
Merge pull request #610 from kuba--/mysql-with-tableau
Upgrade mysql + integrate with auth interface.
2 parents e0b587e + ef62639 commit 42bbeca

31 files changed

+846
-273
lines changed

Gopkg.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[[constraint]]
22
name = "gopkg.in/src-d/go-mysql-server.v0"
3-
revision = "4a751c09d9fd0d59f790ad8edd28a9799fe669f8"
3+
revision = "8cb8028a413e4edf66c4b57bc3eb570950d7bcfb"
44

55
[[constraint]]
66
name = "github.com/jessevdk/go-flags"

cmd/gitbase/command/server.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func NewDatabaseEngine(
7979
squash bool,
8080
) *sqle.Engine {
8181
catalog := sql.NewCatalog()
82-
ab := analyzer.NewBuilder(catalog).WithAuth(userAuth)
82+
ab := analyzer.NewBuilder(catalog)
8383

8484
if parallelism == 0 {
8585
parallelism = runtime.NumCPU()
@@ -96,6 +96,7 @@ func NewDatabaseEngine(
9696
a := ab.Build()
9797
engine := sqle.New(catalog, a, &sqle.Config{
9898
VersionPostfix: version,
99+
Auth: userAuth,
99100
})
100101

101102
return engine
@@ -126,6 +127,7 @@ func (c *Server) Execute(args []string) error {
126127
c.userAuth = auth.NewNativeSingle(c.User, c.Password, permissions)
127128
}
128129

130+
c.userAuth = auth.NewAudit(c.userAuth, auth.NewAuditLog(logrus.New()))
129131
if err := c.buildDatabase(); err != nil {
130132
logrus.WithField("error", err).Fatal("unable to initialize database engine")
131133
return err

docs/using-gitbase/functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,4 @@ Also, if you want to retrieve values from a non common property, you can pass it
9595
9696
## Standard functions
9797

98-
You can check standard functions in [`go-mysql-server` documentation](https://github.com/src-d/go-mysql-server/tree/4a751c09d9fd0d59f790ad8edd28a9799fe669f8#custom-functions).
98+
You can check standard functions in [`go-mysql-server` documentation](https://github.com/src-d/go-mysql-server/tree/8cb8028a413e4edf66c4b57bc3eb570950d7bcfb#custom-functions).

docs/using-gitbase/indexes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ Note that you can create an index either **on one or more columns** or **on a si
1010

1111
You can find some more examples in the [examples](./examples.md#create-an-index-for-columns-on-a-table) section.
1212

13-
See [go-mysql-server](https://github.com/src-d/go-mysql-server/tree/4a751c09d9fd0d59f790ad8edd28a9799fe669f8#indexes) documentation for more details
13+
See [go-mysql-server](https://github.com/src-d/go-mysql-server/tree/8cb8028a413e4edf66c4b57bc3eb570950d7bcfb#indexes) documentation for more details
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
## Supported clients
22

3-
To see the supported MySQL clients and examples about how to use them, take a look [here](https://github.com/src-d/go-mysql-server/blob/4a751c09d9fd0d59f790ad8edd28a9799fe669f8/SUPPORTED_CLIENTS.md).
3+
To see the supported MySQL clients and examples about how to use them, take a look [here](https://github.com/src-d/go-mysql-server/blob/8cb8028a413e4edf66c4b57bc3eb570950d7bcfb/SUPPORTED_CLIENTS.md).
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
## Supported syntax
22

3-
To see the SQL subset currently supported take a look at [this list](https://github.com/src-d/go-mysql-server/blob/4a751c09d9fd0d59f790ad8edd28a9799fe669f8/SUPPORTED.md) from [src-d/go-mysql-server](https://github.com/src-d/go-mysql-server).
3+
To see the SQL subset currently supported take a look at [this list](https://github.com/src-d/go-mysql-server/blob/8cb8028a413e4edf66c4b57bc3eb570950d7bcfb/SUPPORTED.md) from [src-d/go-mysql-server](https://github.com/src-d/go-mysql-server).

session.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ func connectToBblfsh(endpoint string) (*bblfsh.Client, error) {
235235
// NewSessionBuilder creates a SessionBuilder with the given Repository Pool.
236236
func NewSessionBuilder(pool *RepositoryPool, opts ...SessionOption) server.SessionBuilder {
237237
return func(c *mysql.Conn, host string) sql.Session {
238-
opts = append(opts, WithBaseSession(sql.NewSession(host, c.User, c.ConnectionID)))
238+
opts = append(opts, WithBaseSession(sql.NewSession(host, c.RemoteAddr().String(), c.User, c.ConnectionID)))
239239
return NewSession(pool, opts...)
240240
}
241241
}

vendor/gopkg.in/src-d/go-mysql-server.v0/auth/audit.go

Lines changed: 149 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/gopkg.in/src-d/go-mysql-server.v0/auth/auth.go

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/gopkg.in/src-d/go-mysql-server.v0/auth/native.go

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/gopkg.in/src-d/go-mysql-server.v0/auth/none.go

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/gopkg.in/src-d/go-mysql-server.v0/engine.go

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/gopkg.in/src-d/go-mysql-server.v0/server/context.go

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/gopkg.in/src-d/go-mysql-server.v0/server/handler.go

Lines changed: 11 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/gopkg.in/src-d/go-mysql-server.v0/sql/analyzer/analyzer.go

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)