Skip to content

Commit f25bd52

Browse files
committed
update go-mysql-server and fix tests
Signed-off-by: Miguel Molina <[email protected]>
1 parent a4f3735 commit f25bd52

File tree

2,428 files changed

+5028
-421301
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,428 files changed

+5028
-421301
lines changed

Gopkg.lock

Lines changed: 2 additions & 47 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 = "a25d2500494956cf33f5ccb182ac809848100eaf"
3+
revision = "0b8a5d0ec0b45efc062f6e6a4f386b7a68915111"
44

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

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@ $(MAKEFILE):
1313

1414
-include $(MAKEFILE)
1515

16-
dependencies:
16+
bblfsh-client:
1717
cd vendor/gopkg.in/bblfsh/client-go.v2 && make dependencies
18+
19+
dependencies: bblfsh-client

files.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ func (filesTable) WithProjectAndFilters(
6363
) (sql.RowIter, error) {
6464
span, ctx := ctx.Span("gitbase.FilesTable")
6565
iter, err := rowIterWithSelectors(
66-
ctx, FilesSchema, FilesTableName, filters,
66+
ctx, FilesSchema, FilesTableName, filters, columns,
6767
[]string{"repository_id", "blob_hash", "file_path", "tree_hash"},
68-
func(selectors selectors) (RowRepoIter, error) {
68+
func(ctx *sql.Context, selectors selectors, exprs []sql.Expression) (RowRepoIter, error) {
6969
repos, err := selectors.textValues("repository_id")
7070
if err != nil {
7171
return nil, err
@@ -124,6 +124,15 @@ type filesIter struct {
124124
treeHashes []plumbing.Hash
125125
}
126126

127+
// TODO: remove this once the interface is changed, it's just a placeholder for now
128+
func (*filesIter) LastObject() string {
129+
return ""
130+
}
131+
132+
func (i *filesIter) Repository() string {
133+
return i.repo.ID
134+
}
135+
127136
func (i *filesIter) NewIterator(repo *Repository) (RowRepoIter, error) {
128137
var iter object.CommitIter
129138
if len(i.repos) == 0 || stringContains(i.repos, repo.ID) {

index_test.go

Lines changed: 48 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -153,23 +153,19 @@ func TestIndexableTable(t *testing.T) {
153153
idxValue: &indexValue{paths[0], "a8d315b2b1c615d43042c3a62402b8a54288cf5c"},
154154
},
155155
{
156-
key: []interface{}{"go/example.go", "880cd14280f4b9b6ed3986d6671f907d7cc2a198"},
156+
key: []interface{}{"go", "a39771a7651f97faf5c72e08224d857fc35133db"},
157157
idxValue: &indexValue{paths[0], "a8d315b2b1c615d43042c3a62402b8a54288cf5c"},
158158
},
159159
{
160-
key: []interface{}{"json/long.json", "49c6bb89b17060d7b4deacb7b338fcc6ea2352a9"},
160+
key: []interface{}{"json", "5a877e6a906a2743ad6e45d99c1793642aaf8eda"},
161161
idxValue: &indexValue{paths[0], "a8d315b2b1c615d43042c3a62402b8a54288cf5c"},
162162
},
163163
{
164-
key: []interface{}{"json/short.json", "c8f1d8c61f9da76f4cb49fd86322b6e685dba956"},
164+
key: []interface{}{"php", "586af567d0bb5e771e49bdd9434f5e0fb76d25fa"},
165165
idxValue: &indexValue{paths[0], "a8d315b2b1c615d43042c3a62402b8a54288cf5c"},
166166
},
167167
{
168-
key: []interface{}{"php/crappy.php", "9a48f23120e880dfbe41f7c9b7b708e9ee62a492"},
169-
idxValue: &indexValue{paths[0], "a8d315b2b1c615d43042c3a62402b8a54288cf5c"},
170-
},
171-
{
172-
key: []interface{}{"vendor/foo.go", "9dea2395f5403188298c1dabe8bdafe562c491e3"},
168+
key: []interface{}{"vendor", "cf4aa3b38974fb7d81f367c0830f7d78d65ab86b"},
173169
idxValue: &indexValue{paths[0], "a8d315b2b1c615d43042c3a62402b8a54288cf5c"},
174170
},
175171
{
@@ -189,19 +185,15 @@ func TestIndexableTable(t *testing.T) {
189185
idxValue: &indexValue{paths[0], "fb72698cab7617ac416264415f13224dfd7a165e"},
190186
},
191187
{
192-
key: []interface{}{"go/example.go", "880cd14280f4b9b6ed3986d6671f907d7cc2a198"},
188+
key: []interface{}{"go", "a39771a7651f97faf5c72e08224d857fc35133db"},
193189
idxValue: &indexValue{paths[0], "fb72698cab7617ac416264415f13224dfd7a165e"},
194190
},
195191
{
196-
key: []interface{}{"json/long.json", "49c6bb89b17060d7b4deacb7b338fcc6ea2352a9"},
192+
key: []interface{}{"json", "5a877e6a906a2743ad6e45d99c1793642aaf8eda"},
197193
idxValue: &indexValue{paths[0], "fb72698cab7617ac416264415f13224dfd7a165e"},
198194
},
199195
{
200-
key: []interface{}{"json/short.json", "c8f1d8c61f9da76f4cb49fd86322b6e685dba956"},
201-
idxValue: &indexValue{paths[0], "fb72698cab7617ac416264415f13224dfd7a165e"},
202-
},
203-
{
204-
key: []interface{}{"php/crappy.php", "9a48f23120e880dfbe41f7c9b7b708e9ee62a492"},
196+
key: []interface{}{"php", "586af567d0bb5e771e49bdd9434f5e0fb76d25fa"},
205197
idxValue: &indexValue{paths[0], "fb72698cab7617ac416264415f13224dfd7a165e"},
206198
},
207199
{
@@ -225,19 +217,15 @@ func TestIndexableTable(t *testing.T) {
225217
idxValue: &indexValue{paths[0], "dbd3641b371024f44d0e469a9c8f5457b0660de1"},
226218
},
227219
{
228-
key: []interface{}{"go/example.go", "880cd14280f4b9b6ed3986d6671f907d7cc2a198"},
229-
idxValue: &indexValue{paths[0], "dbd3641b371024f44d0e469a9c8f5457b0660de1"},
230-
},
231-
{
232-
key: []interface{}{"json/long.json", "49c6bb89b17060d7b4deacb7b338fcc6ea2352a9"},
220+
key: []interface{}{"go", "a39771a7651f97faf5c72e08224d857fc35133db"},
233221
idxValue: &indexValue{paths[0], "dbd3641b371024f44d0e469a9c8f5457b0660de1"},
234222
},
235223
{
236-
key: []interface{}{"json/short.json", "c8f1d8c61f9da76f4cb49fd86322b6e685dba956"},
224+
key: []interface{}{"json", "5a877e6a906a2743ad6e45d99c1793642aaf8eda"},
237225
idxValue: &indexValue{paths[0], "dbd3641b371024f44d0e469a9c8f5457b0660de1"},
238226
},
239227
{
240-
key: []interface{}{"php/crappy.php", "9a48f23120e880dfbe41f7c9b7b708e9ee62a492"},
228+
key: []interface{}{"php", "586af567d0bb5e771e49bdd9434f5e0fb76d25fa"},
241229
idxValue: &indexValue{paths[0], "dbd3641b371024f44d0e469a9c8f5457b0660de1"},
242230
},
243231
{
@@ -257,11 +245,7 @@ func TestIndexableTable(t *testing.T) {
257245
idxValue: &indexValue{paths[0], "4d081c50e250fa32ea8b1313cf8bb7c2ad7627fd"},
258246
},
259247
{
260-
key: []interface{}{"json/long.json", "49c6bb89b17060d7b4deacb7b338fcc6ea2352a9"},
261-
idxValue: &indexValue{paths[0], "4d081c50e250fa32ea8b1313cf8bb7c2ad7627fd"},
262-
},
263-
{
264-
key: []interface{}{"json/short.json", "c8f1d8c61f9da76f4cb49fd86322b6e685dba956"},
248+
key: []interface{}{"json", "5a877e6a906a2743ad6e45d99c1793642aaf8eda"},
265249
idxValue: &indexValue{paths[0], "4d081c50e250fa32ea8b1313cf8bb7c2ad7627fd"},
266250
},
267251
{
@@ -320,38 +304,66 @@ func TestIndexableTable(t *testing.T) {
320304
key: []interface{}{"README.md", "b4f017e8c030d24aef161569b9ade3e55931ba01"},
321305
idxValue: &indexValue{paths[1], "3bf5d30ad4f23cf517676fee232e3bcb8537c1d0"},
322306
},
307+
{
308+
key: []interface{}{"basic", "6ecf0ef2c2dffb796033e5a02219af86ec6584e5"},
309+
idxValue: &indexValue{paths[1], "3bf5d30ad4f23cf517676fee232e3bcb8537c1d0"},
310+
},
311+
{
312+
key: []interface{}{"itself", "47770b26e71b0f69c0ecd494b1066f8d1da4fc03"},
313+
idxValue: &indexValue{paths[1], "3bf5d30ad4f23cf517676fee232e3bcb8537c1d0"},
314+
},
323315
{
324316
key: []interface{}{".gitmodules", "278871477afb195f908155a65b5c651f1cfd02d3"},
325317
idxValue: &indexValue{paths[1], "8ac3015df16d47179e903d0379b52267359c1499"},
326318
},
319+
{
320+
key: []interface{}{"basic", "6ecf0ef2c2dffb796033e5a02219af86ec6584e5"},
321+
idxValue: &indexValue{paths[1], "8ac3015df16d47179e903d0379b52267359c1499"},
322+
},
323+
{
324+
key: []interface{}{"itself", "c7431b5bc9d45fb64a87d4a895ce3d1073c898d2"},
325+
idxValue: &indexValue{paths[1], "8ac3015df16d47179e903d0379b52267359c1499"},
326+
},
327327
{
328328
key: []interface{}{".gitmodules", "278871477afb195f908155a65b5c651f1cfd02d3"},
329329
idxValue: &indexValue{paths[1], "c4db5d7fc75aa3bef9004122d0cf2a2679935ef8"},
330330
},
331+
{
332+
key: []interface{}{"basic", "6ecf0ef2c2dffb796033e5a02219af86ec6584e5"},
333+
idxValue: &indexValue{paths[1], "c4db5d7fc75aa3bef9004122d0cf2a2679935ef8"},
334+
},
335+
{
336+
key: []interface{}{"itself", "47770b26e71b0f69c0ecd494b1066f8d1da4fc03"},
337+
idxValue: &indexValue{paths[1], "c4db5d7fc75aa3bef9004122d0cf2a2679935ef8"},
338+
},
331339
{
332340
key: []interface{}{".gitmodules", "97b013ecd2cc7f572960509f659d8068798d59ca"},
333341
idxValue: &indexValue{paths[1], "efe525d0f1372593df812e3f6faa4e05bb91f498"},
334342
},
343+
{
344+
key: []interface{}{"basic", "6ecf0ef2c2dffb796033e5a02219af86ec6584e5"},
345+
idxValue: &indexValue{paths[1], "efe525d0f1372593df812e3f6faa4e05bb91f498"},
346+
},
335347
},
336348
columns: []sql.Expression{
337349
expression.NewGetFieldWithTable(1, sql.Text, TreeEntriesTableName, "tree_hash", false),
338350
expression.NewGetFieldWithTable(2, sql.Text, TreeEntriesTableName, "blob_hash", false),
339351
},
340352
filters: []sql.Expression{
341353
expression.NewEquals(
342-
expression.NewGetFieldWithTable(4, sql.Text, TreeEntriesTableName, "tree_entry_name", false),
354+
expression.NewGetFieldWithTable(1, sql.Text, TreeEntriesTableName, "tree_entry_name", false),
343355
expression.NewLiteral("LICENSE", sql.Text),
344356
),
345357
},
346358
expectedRows: []sql.Row{
347-
sql.NewRow(paths[0], "a8d315b2b1c615d43042c3a62402b8a54288cf5c", "c192bd6a24ea1ab01d78686e417c8bdc7c3d197f", "100644", "LICENSE"),
348-
sql.NewRow(paths[0], "fb72698cab7617ac416264415f13224dfd7a165e", "c192bd6a24ea1ab01d78686e417c8bdc7c3d197f", "100644", "LICENSE"),
349-
sql.NewRow(paths[0], "dbd3641b371024f44d0e469a9c8f5457b0660de1", "c192bd6a24ea1ab01d78686e417c8bdc7c3d197f", "100644", "LICENSE"),
350-
sql.NewRow(paths[0], "4d081c50e250fa32ea8b1313cf8bb7c2ad7627fd", "c192bd6a24ea1ab01d78686e417c8bdc7c3d197f", "100644", "LICENSE"),
351-
sql.NewRow(paths[0], "eba74343e2f15d62adedfd8c883ee0262b5c8021", "c192bd6a24ea1ab01d78686e417c8bdc7c3d197f", "100644", "LICENSE"),
352-
sql.NewRow(paths[0], "c2d30fa8ef288618f65f6eed6e168e0d514886f4", "c192bd6a24ea1ab01d78686e417c8bdc7c3d197f", "100644", "LICENSE"),
353-
sql.NewRow(paths[0], "8dcef98b1d52143e1e2dbc458ffe38f925786bf2", "c192bd6a24ea1ab01d78686e417c8bdc7c3d197f", "100644", "LICENSE"),
354-
sql.NewRow(paths[0], "aa9b383c260e1d05fbbf6b30a02914555e20c725", "c192bd6a24ea1ab01d78686e417c8bdc7c3d197f", "100644", "LICENSE"),
359+
sql.NewRow(paths[0], "LICENSE", "c192bd6a24ea1ab01d78686e417c8bdc7c3d197f", "a8d315b2b1c615d43042c3a62402b8a54288cf5c", "100644"),
360+
sql.NewRow(paths[0], "LICENSE", "c192bd6a24ea1ab01d78686e417c8bdc7c3d197f", "fb72698cab7617ac416264415f13224dfd7a165e", "100644"),
361+
sql.NewRow(paths[0], "LICENSE", "c192bd6a24ea1ab01d78686e417c8bdc7c3d197f", "dbd3641b371024f44d0e469a9c8f5457b0660de1", "100644"),
362+
sql.NewRow(paths[0], "LICENSE", "c192bd6a24ea1ab01d78686e417c8bdc7c3d197f", "4d081c50e250fa32ea8b1313cf8bb7c2ad7627fd", "100644"),
363+
sql.NewRow(paths[0], "LICENSE", "c192bd6a24ea1ab01d78686e417c8bdc7c3d197f", "eba74343e2f15d62adedfd8c883ee0262b5c8021", "100644"),
364+
sql.NewRow(paths[0], "LICENSE", "c192bd6a24ea1ab01d78686e417c8bdc7c3d197f", "c2d30fa8ef288618f65f6eed6e168e0d514886f4", "100644"),
365+
sql.NewRow(paths[0], "LICENSE", "c192bd6a24ea1ab01d78686e417c8bdc7c3d197f", "8dcef98b1d52143e1e2dbc458ffe38f925786bf2", "100644"),
366+
sql.NewRow(paths[0], "LICENSE", "c192bd6a24ea1ab01d78686e417c8bdc7c3d197f", "aa9b383c260e1d05fbbf6b30a02914555e20c725", "100644"),
355367
},
356368
},
357369
{

vendor/github.com/apache/thrift/.clang-format

Lines changed: 0 additions & 56 deletions
This file was deleted.

vendor/github.com/apache/thrift/.dockerignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)