Skip to content

Commit 9cd6912

Browse files
authored
Merge pull request #205 from erizocosmico/upgrade/go-mysql-server
upgrade go-mysql-server
2 parents 24b9ad0 + cbca949 commit 9cd6912

24 files changed

+211
-139
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 = "59b23db1ee89794aa6de1778e8dbb93accff5611"
3+
revision = "1e7464048d3a5f5261d26526d3500d9a560b2c08"
44

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

common_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"testing"
66

7-
opentracing "github.com/opentracing/opentracing-go"
87
"github.com/stretchr/testify/require"
98
fixtures "gopkg.in/src-d/go-git-fixtures.v3"
109
sqle "gopkg.in/src-d/go-mysql-server.v0"
@@ -32,7 +31,7 @@ func setup(t *testing.T) (ctx *sql.Context, path string, cleanup CleanupFunc) {
3231
}
3332

3433
session := NewSession(&pool)
35-
ctx = sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
34+
ctx = sql.NewContext(context.TODO(), sql.WithSession(session))
3635

3736
return ctx, path, cleanup
3837
}

integration_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66

77
"github.com/src-d/gitbase/internal/rule"
88

9-
opentracing "github.com/opentracing/opentracing-go"
109
"github.com/src-d/gitbase"
1110
"github.com/src-d/gitbase/internal/function"
1211
"github.com/stretchr/testify/require"
@@ -141,7 +140,7 @@ func TestIntegration(t *testing.T) {
141140
require := require.New(t)
142141

143142
session := gitbase.NewSession(&pool)
144-
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
143+
ctx := sql.NewContext(context.TODO(), sql.WithSession(session))
145144

146145
_, iter, err := engine.Query(ctx, tt.query)
147146
require.NoError(err)
@@ -255,7 +254,7 @@ func benchmarkQuery(b *testing.B, query string) {
255254
_, err := pool.AddGit(path)
256255
require.NoError(b, err)
257256
session := gitbase.NewSession(&pool)
258-
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
257+
ctx := sql.NewContext(context.TODO(), sql.WithSession(session))
259258

260259
run := func(b *testing.B) {
261260
for i := 0; i < b.N; i++ {

internal/function/commit_has_blob_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"testing"
66

7-
opentracing "github.com/opentracing/opentracing-go"
87
"github.com/src-d/gitbase"
98
"github.com/stretchr/testify/require"
109
fixtures "gopkg.in/src-d/go-git-fixtures.v3"
@@ -29,7 +28,7 @@ func TestCommitHasBlob(t *testing.T) {
2928
}
3029

3130
session := gitbase.NewSession(&pool)
32-
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
31+
ctx := sql.NewContext(context.TODO(), sql.WithSession(session))
3332

3433
testCases := []struct {
3534
name string
@@ -74,7 +73,7 @@ func BenchmarkCommitHasBlob(b *testing.B) {
7473
}
7574

7675
session := gitbase.NewSession(&pool)
77-
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
76+
ctx := sql.NewContext(context.TODO(), sql.WithSession(session))
7877

7978
rows := []sql.Row{
8079
// blob is not on commit

internal/function/commit_has_tree_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"testing"
66

7-
opentracing "github.com/opentracing/opentracing-go"
87
"github.com/src-d/gitbase"
98
"github.com/stretchr/testify/require"
109
fixtures "gopkg.in/src-d/go-git-fixtures.v3"
@@ -29,7 +28,7 @@ func TestCommitHasTree(t *testing.T) {
2928
}
3029

3130
session := gitbase.NewSession(&pool)
32-
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
31+
ctx := sql.NewContext(context.TODO(), sql.WithSession(session))
3332

3433
testCases := []struct {
3534
name string
@@ -75,7 +74,7 @@ func BenchmarkCommitHasTree(b *testing.B) {
7574
}
7675

7776
session := gitbase.NewSession(&pool)
78-
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
77+
ctx := sql.NewContext(context.TODO(), sql.WithSession(session))
7978

8079
rows := []sql.Row{
8180
// tree is not on commit

internal/function/history_idx_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"testing"
66

7-
opentracing "github.com/opentracing/opentracing-go"
87
"github.com/src-d/gitbase"
98
"github.com/stretchr/testify/require"
109
fixtures "gopkg.in/src-d/go-git-fixtures.v3"
@@ -29,7 +28,7 @@ func TestHistoryIdx(t *testing.T) {
2928
}
3029

3130
session := gitbase.NewSession(&pool)
32-
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
31+
ctx := sql.NewContext(context.TODO(), sql.WithSession(session))
3332

3433
testCases := []struct {
3534
name string
@@ -82,7 +81,7 @@ func BenchmarkHistoryIdx(b *testing.B) {
8281
}
8382

8483
session := gitbase.NewSession(&pool)
85-
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
84+
ctx := sql.NewContext(context.TODO(), sql.WithSession(session))
8685

8786
cases := []struct {
8887
row sql.Row

internal/function/is_remote_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"testing"
66

7-
opentracing "github.com/opentracing/opentracing-go"
87
"github.com/stretchr/testify/require"
98
"gopkg.in/src-d/go-mysql-server.v0/sql"
109
"gopkg.in/src-d/go-mysql-server.v0/sql/expression"
@@ -31,7 +30,7 @@ func TestIsRemote(t *testing.T) {
3130
require := require.New(t)
3231

3332
session := sql.NewBaseSession()
34-
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
33+
ctx := sql.NewContext(context.TODO(), sql.WithSession(session))
3534

3635
val, err := f.Eval(ctx, tt.row)
3736
if tt.err {

internal/function/is_tag_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"testing"
66

7-
opentracing "github.com/opentracing/opentracing-go"
87
"github.com/stretchr/testify/require"
98
"gopkg.in/src-d/go-mysql-server.v0/sql"
109
"gopkg.in/src-d/go-mysql-server.v0/sql/expression"
@@ -31,7 +30,7 @@ func TestIsTag(t *testing.T) {
3130
require := require.New(t)
3231

3332
session := sql.NewBaseSession()
34-
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
33+
ctx := sql.NewContext(context.TODO(), sql.WithSession(session))
3534

3635
val, err := f.Eval(ctx, tt.row)
3736
if tt.err {

internal/rule/squashjoins_test.go

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
package rule
22

33
import (
4-
"context"
54
"testing"
65

7-
opentracing "github.com/opentracing/opentracing-go"
86
"github.com/src-d/gitbase"
97
"github.com/src-d/gitbase/internal/function"
108
"github.com/stretchr/testify/require"
@@ -83,11 +81,7 @@ func TestSquashJoins(t *testing.T) {
8381
),
8482
)
8583

86-
result, err := SquashJoins(sql.NewContext(
87-
context.TODO(),
88-
sql.NewBaseSession(),
89-
opentracing.NoopTracer{},
90-
), analyzer.New(nil), node)
84+
result, err := SquashJoins(sql.NewEmptyContext(), analyzer.New(nil), node)
9185
require.NoError(err)
9286
require.Equal(expected, result)
9387
}
@@ -112,11 +106,7 @@ func TestSquashJoinsUnsquashable(t *testing.T) {
112106
),
113107
)
114108

115-
result, err := SquashJoins(sql.NewContext(
116-
context.TODO(),
117-
sql.NewBaseSession(),
118-
opentracing.NoopTracer{},
119-
), analyzer.New(nil), node)
109+
result, err := SquashJoins(sql.NewEmptyContext(), analyzer.New(nil), node)
120110
require.NoError(err)
121111
require.Equal(node, result)
122112
}
@@ -174,11 +164,7 @@ func TestSquashJoinsPartial(t *testing.T) {
174164
),
175165
)
176166

177-
result, err := SquashJoins(sql.NewContext(
178-
context.TODO(),
179-
sql.NewBaseSession(),
180-
opentracing.NoopTracer{},
181-
), analyzer.New(nil), node)
167+
result, err := SquashJoins(sql.NewEmptyContext(), analyzer.New(nil), node)
182168
require.NoError(err)
183169
require.Equal(expected, result)
184170
}
@@ -219,11 +205,7 @@ func TestSquashJoinsSchema(t *testing.T) {
219205
),
220206
)
221207

222-
result, err := SquashJoins(sql.NewContext(
223-
context.TODO(),
224-
sql.NewBaseSession(),
225-
opentracing.NoopTracer{},
226-
), analyzer.New(nil), node)
208+
result, err := SquashJoins(sql.NewEmptyContext(), analyzer.New(nil), node)
227209
require.NoError(err)
228210

229211
expected := node.Schema()

iterator_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"io"
66
"testing"
77

8-
opentracing "github.com/opentracing/opentracing-go"
98
"github.com/stretchr/testify/require"
109
fixtures "gopkg.in/src-d/go-git-fixtures.v3"
1110
git "gopkg.in/src-d/go-git.v4"
@@ -437,7 +436,7 @@ func setupIter(t *testing.T) (*sql.Context, func()) {
437436
}
438437

439438
session := NewSession(&pool)
440-
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
439+
ctx := sql.NewContext(context.TODO(), sql.WithSession(session))
441440
cleanup := func() {
442441
require.NoError(t, fixtures.Clean())
443442
}

repositories_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"testing"
66

7-
opentracing "github.com/opentracing/opentracing-go"
87
"github.com/stretchr/testify/require"
98
"gopkg.in/src-d/go-mysql-server.v0/sql"
109
"gopkg.in/src-d/go-mysql-server.v0/sql/expression"
@@ -44,7 +43,7 @@ func TestRepositoriesTable_RowIter(t *testing.T) {
4443
}
4544

4645
session := NewSession(&pool)
47-
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
46+
ctx := sql.NewContext(context.TODO(), sql.WithSession(session))
4847

4948
db := NewDatabase(RepositoriesTableName)
5049
require.NotNil(db)

repository_pool_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"sync"
1111
"testing"
1212

13-
opentracing "github.com/opentracing/opentracing-go"
1413
"github.com/stretchr/testify/require"
1514
"gopkg.in/src-d/go-git-fixtures.v3"
1615
"gopkg.in/src-d/go-git.v4"
@@ -189,7 +188,7 @@ func TestRepositoryRowIterator(t *testing.T) {
189188

190189
pool := NewRepositoryPool()
191190
session := NewSession(&pool)
192-
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
191+
ctx := sql.NewContext(context.TODO(), sql.WithSession(session))
193192
max := 64
194193

195194
for i := 0; i < max; i++ {

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

Lines changed: 1 addition & 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: 1 addition & 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: 9 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)