dolthub / dolthub/dolt

Fail Gracefully when DB schema can be loaded

Open
#5,517 0 comments 0 reactions 0 assignees View on GitHub
bad error message
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 5h
Merged PRs (30d)
108

Description

In issue: https://github.com/dolthub/dolt/issues/5411, we discovered that databases with unparsable data were loaded, we provided a very poor error message. In the original reproduction steps, simply running `dolt sql` resulted in this:

```
lcl:~/Documents/data_dir_1/db2$ dolt sql
# Welcome to the DoltSQL shell.
# Statements must be terminated with ';'.
# "exit" or "quit" (or Ctrl-D) to exit.
syntax error at position 19 near 'test'
lcl:~/Documents/data_dir_1/db2$ echo $?
1
lcl:~/Documents/data_dir_1/db2$
```

Reproducing this became more difficult with the following change: https://github.com/dolthub/go-mysql-server/pull/1639. The following provides DB created before the fix with the data breakage. Not how to test for this on an ongoing basis, but at a minimum we need to print a better error message for errors like this.

[corrupt_db.zip](https://github.com/dolthub/dolt/files/10922896/corrupt_db.zip)

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.