Skip to content

Remove support for the {database} macro from the client's prompt - #42508

Merged
alexey-milovidov merged 1 commit into
masterfrom
remove-database-macro-from-server-prompt
Oct 20, 2022
Merged

alexey-milovidov merged 1 commit into
masterfrom
remove-database-macro-from-server-prompt

Conversation

@alexey-milovidov

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Remove support for the {database} macro from the client's prompt. It was displayed incorrectly if the database was unspecified and it was not updated on USE statements. This closes #25891.

@robot-ch-test-poll robot-ch-test-poll added the pr-improvement Pull request with some product improvements label Oct 19, 2022
@alexey-milovidov alexey-milovidov self-assigned this Oct 20, 2022
@alexey-milovidov

Copy link
Copy Markdown
Member Author

Perfect.

@alexey-milovidov
alexey-milovidov merged commit 58f2380 into master Oct 20, 2022
@alexey-milovidov
alexey-milovidov deleted the remove-database-macro-from-server-prompt branch October 20, 2022 19:14
@azat

azat commented Oct 24, 2022

Copy link
Copy Markdown
Member

It was displayed incorrectly if the database was unspecified and it was not updated on USE statements.

Maybe it is better to fix this?

@alexey-milovidov

Copy link
Copy Markdown
Member Author

@azat Maybe it is better, but there were no tests for this feature, so removing it was easy.
And it's in question - do we really need it? Maybe not.

@azat

azat commented Oct 25, 2022

Copy link
Copy Markdown
Member

And it's in question - do we really need it?

Thinking about this a little bit more, and I guess yep, it is not that needable, and less code is better.

zhangjmruc pushed a commit to myscale/MyScaleDB that referenced this pull request Feb 5, 2025
il9ue added a commit to il9ue/ClickHouse that referenced this pull request Apr 15, 2026
The {database} macro was removed in PR ClickHouse#42508 because it read from
static config and did not update after USE statements. This re-adds
the macro by substituting it dynamically from the default_database
member variable, which is updated on USE and --database flag.

Closes ClickHouse#49118
il9ue added a commit to il9ue/ClickHouse that referenced this pull request Jul 17, 2026
The {database} macro was removed in PR ClickHouse#42508 because it read from
static config and did not update after USE statements. This re-adds
the macro by substituting it dynamically from the default_database
member variable, which is updated on USE and --database flag.

Closes ClickHouse#49118
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-improvement Pull request with some product improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

clickhouse-client shows "default" (incorrect) database name in the prompt

3 participants