v.23.10Improvement

Database Behavior Consistency in ClickHouse with Queries After Drop

If you dropped the current database, you will still be able to run some queries in clickhouse-local and switch to another database. This makes the behavior consistent with clickhouse-client. This closes #55834. #55853 (Alexey Milovidov).
Make clickhouse-local able to run queries and switch databases after dropping the current database, aligning its behavior with clickhouse-client.

Why it matters

Previously, dropping the current database in clickhouse-local could leave the user unable to execute further queries or switch to another database. This feature resolves that inconsistency by allowing continued query execution and database switching after dropping the current database, improving usability and consistency across ClickHouse client tools.

How to use it

When using clickhouse-local, after dropping the active database with DROP DATABASE <db_name>, users can continue to run queries and switch to other databases using standard SQL commands such as USE <other_database>.