@@ -38,9 +38,9 @@ func TestIntegration(t *testing.T) {
38
38
}{
39
39
{
40
40
`SELECT COUNT(c.commit_hash), c.commit_hash
41
- FROM refs r
41
+ FROM ref_commits r
42
42
INNER JOIN commits c
43
- ON r.ref_name = 'HEAD' AND history_idx( r.commit_hash, c.commit_hash) >= 0
43
+ ON r.ref_name = 'HEAD' AND r.commit_hash = c.commit_hash
44
44
INNER JOIN blobs b
45
45
ON commit_has_blob(c.commit_hash, b.blob_hash)
46
46
GROUP BY c.commit_hash` ,
@@ -66,10 +66,10 @@ func TestIntegration(t *testing.T) {
66
66
},
67
67
{
68
68
`SELECT c.commit_hash
69
- FROM refs
69
+ FROM ref_commits r
70
70
INNER JOIN commits c
71
- ON refs .ref_name = 'HEAD'
72
- AND history_idx(refs .commit_hash, c.commit_hash) >= 0 ` ,
71
+ ON r .ref_name = 'HEAD'
72
+ AND r .commit_hash = c.commit_hash` ,
73
73
[]sql.Row {
74
74
{"6ecf0ef2c2dffb796033e5a02219af86ec6584e5" },
75
75
{"918c48b83bd081e863dbe1b80f8998f058cd8294" },
@@ -86,10 +86,10 @@ func TestIntegration(t *testing.T) {
86
86
FROM (
87
87
SELECT YEAR(c.commit_author_when) AS first_commit_year
88
88
FROM repositories r
89
- INNER JOIN refs
90
- ON r.repository_id = refs .repository_id
89
+ INNER JOIN ref_commits rc
90
+ ON r.repository_id = rc .repository_id
91
91
INNER JOIN commits c
92
- ON history_idx(refs .commit_hash, c.commit_hash) >= 0
92
+ ON rc .commit_hash = c.commit_hash
93
93
ORDER BY c.commit_author_when
94
94
LIMIT 1
95
95
) repo_years
@@ -104,9 +104,9 @@ func TestIntegration(t *testing.T) {
104
104
r.repository_id as repo_id,
105
105
committer_email
106
106
FROM repositories r
107
- INNER JOIN refs ON refs .repository_id = r.repository_id
108
- AND refs .ref_name = 'refs/heads/master'
109
- INNER JOIN commits c ON history_idx(refs .commit_hash, c.commit_hash) >= 0
107
+ INNER JOIN ref_commits rc ON rc .repository_id = r.repository_id
108
+ AND rc .ref_name = 'refs/heads/master'
109
+ INNER JOIN commits c ON rc .commit_hash = c.commit_hash
110
110
WHERE YEAR(committer_when) = 2015
111
111
) as t
112
112
GROUP BY committer_email, month, repo_id` ,
@@ -119,9 +119,9 @@ func TestIntegration(t *testing.T) {
119
119
{
120
120
`SELECT * FROM (
121
121
SELECT COUNT(c.commit_hash) AS num, c.commit_hash
122
- FROM refs r
122
+ FROM ref_commits r
123
123
INNER JOIN commits c
124
- ON history_idx( r.commit_hash, c.commit_hash) >= 0
124
+ ON r.commit_hash = c.commit_hash
125
125
GROUP BY c.commit_hash
126
126
) t WHERE num > 1` ,
127
127
[]sql.Row {
@@ -224,7 +224,7 @@ func TestSquashCorrectness(t *testing.T) {
224
224
`SELECT * FROM repositories r INNER JOIN remotes ON r.repository_id = remotes.repository_id` ,
225
225
`SELECT * FROM refs r INNER JOIN remotes re ON r.repository_id = re.repository_id` ,
226
226
`SELECT * FROM refs r INNER JOIN commits c ON r.commit_hash = c.commit_hash` ,
227
- `SELECT * FROM refs r INNER JOIN commits c ON history_idx( r.commit_hash, c.commit_hash) >= 0 ` ,
227
+ `SELECT * FROM ref_commits r INNER JOIN commits c ON r.commit_hash = c.commit_hash` ,
228
228
`SELECT * FROM refs r INNER JOIN tree_entries te ON commit_has_tree(r.commit_hash, te.tree_hash)` ,
229
229
`SELECT * FROM refs r INNER JOIN blobs b ON commit_has_blob(r.commit_hash, b.blob_hash)` ,
230
230
`SELECT * FROM commits c INNER JOIN tree_entries te ON commit_has_tree(c.commit_hash, te.tree_hash)` ,
0 commit comments