dolthub / dolthub/dolthub-issues

DoltHub Release/Branch Query Error and Name Conflict

Open
#584 0 comments 0 reactions 1 assignee Claimed by @tbantle22 View on GitHub
bug
Dominant language
No language data
Stars
5
Forks
0
PR merge metrics
No merged PRs in 30d

Description

If I make a release, the data in the tables is properly saved when I go to download it as CSV files. However, if I try running a query (e.g., a view) from the release on the web or the API, it says the query can’t be executed as the branch can’t be found, as the release URL uses the tag name and not the branch name. If I make a release that shares the name of an existing branch (such as “main”), I can run queries normally. However, the URL in the release redirects to the branch itself, which may not be in the same state at the time of release.

For [example](https://www.dolthub.com/repositories/shantanut01/test-database/releases), I made a release called main (same name as the primary branch). Then I added an entry to the main branch (after the release). When I click on the release, it takes me to the main branch and shows the new entry, which is not in the release. However, I can run queries normally, but any queries executed run on the branch itself, not the release.

SQL API Result on release with no corresponding branch:

```json
{
"query_execution_status": "Error",
"query_execution_message": "query error: branch not found",
"repository_owner": "shantanut01",
"repository_name": "test-database",
"commit_ref": "v2",
"sql_query": "SELECT * FROM `first_view`",
"schema": [],
"rows": []
}
```
When a release and a branch share the same name:

CSVs downloaded from the release called "main":

Image

When going to the "main" release [URL](https://www.dolthub.com/repositories/shantanut01/test-database/data/main), the results show:

Image

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.