From 290de0a8105b60ab33c7a9a28fa79da37cba1fbf Mon Sep 17 00:00:00 2001 From: "9611008+johnnymatthews@users.noreply.github.com" Date: Fri, 23 Feb 2024 12:26:29 -0400 Subject: [PATCH 1/2] Adds docs for version(). --- .../functions/other-functions.md | 43 ++++++++++++++++++- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/docs/en/sql-reference/functions/other-functions.md b/docs/en/sql-reference/functions/other-functions.md index d05e7bbfe51..4dd52aae694 100644 --- a/docs/en/sql-reference/functions/other-functions.md +++ b/docs/en/sql-reference/functions/other-functions.md @@ -780,8 +780,47 @@ If executed in the context of a distributed table, this function generates a nor ## version() -Returns the server version as a string. -If executed in the context of a distributed table, this function generates a normal column with values relevant to each shard. Otherwise it produces a constant value. +Returns the current version of ClickHouse as a string in the form of: + +```plaintext +major version`.minor version.patch version.the number of commits since the previous stable release +``` + +If executed in the context of a distributed table, this function generates a normal column with values relevant to each shard. Otherwise, it produces a constant value. + +**Syntax** + +```sql +version() +``` + +**Arguments** + +None. + +**Returned value** + +Type: [String](../data-types/string) + +**Implementation details** + +None. + +**Example** + +Query: + +```sql +SELECT version() +``` + +**Result**: + +```response +┌─version()─┐ +│ 24.2.1.1 │ +└───────────┘ +``` ## buildId() From 5bd8f4356c73e970721cdda13a7280df4dfa9a10 Mon Sep 17 00:00:00 2001 From: Johnny <9611008+johnnymatthews@users.noreply.github.com> Date: Mon, 26 Feb 2024 12:41:44 -0400 Subject: [PATCH 2/2] Cleans up version() example. --- docs/en/sql-reference/functions/other-functions.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/en/sql-reference/functions/other-functions.md b/docs/en/sql-reference/functions/other-functions.md index 4dd52aae694..739b688a0d2 100644 --- a/docs/en/sql-reference/functions/other-functions.md +++ b/docs/en/sql-reference/functions/other-functions.md @@ -782,8 +782,13 @@ If executed in the context of a distributed table, this function generates a nor Returns the current version of ClickHouse as a string in the form of: +- Major version +- Minor version +- Patch version +- Number of commits since the previous stable release. + ```plaintext -major version`.minor version.patch version.the number of commits since the previous stable release +major_version.minor_version.patch_version.number_of_commits_since_the_previous_stable_release ``` If executed in the context of a distributed table, this function generates a normal column with values relevant to each shard. Otherwise, it produces a constant value.