a view referencing non-existing table causes restarted server to be not connectable by MySQL client
- Dominant language
- Go
- Stars
- 24.4k
- Forks
- 873
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 108
Description
MySQL client does [`automatic rehashing`](https://dev.mysql.com/doc/refman/8.0/en/mysql-command-options.html#option_mysql_auto-rehash) by default, which sends `SELECT * FROM LIMIT 0` over the wire for for every table on the database. If there is a view that references non-existing table, it crashes the client with `ERROR 2008 (HY000): MySQL client ran out of memory` error message.
Repro:
```
create table t (pk int primary key);
create view v as select * from t;
rename table t to tt;
```
then restart the server. After restarting the server, run `SELECT 1` or any query.
Note:
`show create view v` should still work with a warning, but currently in Dolt it throws an error, which causes the client not be able to connect to the restarted server.
**Workaround** is to use mysql client with `-A` flag option, which disables automatic rehashing.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.