Skip to content

Problem with distinct and order by #976

Closed
@alexpdp7

Description

@alexpdp7

I think there might be a problem with the interaction between ORDER BY and DISTINCT:

MySQL [gitbase]> select distinct repository_id from blobs where blob_hash in ('93ec5b4525363844ddb1981adf1586ebddbc21c1', 'aad34590345310fe813fd1d9eff868afc4cea10c', 'ed82eb69daf806e521840f4320ea80d4fe0af435') order by blob_hash, repository_id;
+-------------------------------------+
| repository_id                       |
+-------------------------------------+
| github.com/src-d/gitbase            |
| github.com/src-d/go-mysql-server    |
| github.com/bblfsh/javascript-driver |
| github.com/bblfsh/python-driver     |
| github.com/bblfsh/ruby-driver       |
| github.com/src-d/enry               |
| github.com/src-d/gitbase            |
| github.com/src-d/go-mysql-server    |
+-------------------------------------+
8 rows in set (0.14 sec)

MySQL [gitbase]> select distinct repository_id from blobs where blob_hash in ('93ec5b4525363844ddb1981adf1586ebddbc21c1', 'aad34590345310fe813fd1d9eff868afc4cea10c', 'ed82eb69daf806e521840f4320ea80d4fe0af435') order by repository_id;
+-------------------------------------+
| repository_id                       |
+-------------------------------------+
| github.com/bblfsh/javascript-driver |
| github.com/bblfsh/python-driver     |
| github.com/bblfsh/ruby-driver       |
| github.com/src-d/enry               |
| github.com/src-d/gitbase            |
| github.com/src-d/go-mysql-server    |
+-------------------------------------+
6 rows in set (0.42 sec)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions