Merge branch 'master' into enable-output_format_pretty_row_numbers

This commit is contained in:
Alexey Milovidov 2024-03-24 00:58:12 +01:00
commit df8a6b8d0c
5 changed files with 13 additions and 7 deletions

View File

@ -405,7 +405,7 @@ Returns the name of the current user. In case of a distributed query, the name o
SELECT currentUser(); SELECT currentUser();
``` ```
Alias: `user()`, `USER()`. Aliases: `user()`, `USER()`, `current_user()`. Aliases are case insensitive.
**Returned values** **Returned values**

View File

@ -55,6 +55,7 @@ REGISTER_FUNCTION(CurrentUser)
{ {
factory.registerFunction<FunctionCurrentUser>(); factory.registerFunction<FunctionCurrentUser>();
factory.registerAlias("user", FunctionCurrentUser::name, FunctionFactory::CaseInsensitive); factory.registerAlias("user", FunctionCurrentUser::name, FunctionFactory::CaseInsensitive);
factory.registerAlias("current_user", FunctionCurrentUser::name, FunctionFactory::CaseInsensitive);
} }
} }

View File

@ -216,11 +216,14 @@ def gen_tags(version: ClickHouseVersion, release_type: str) -> List[str]:
return tags return tags
def buildx_args(urls: Dict[str, str], arch: str, direct_urls: List[str]) -> List[str]: def buildx_args(
urls: Dict[str, str], arch: str, direct_urls: List[str], version: str
) -> List[str]:
args = [ args = [
f"--platform=linux/{arch}", f"--platform=linux/{arch}",
f"--label=build-url={GITHUB_RUN_URL}", f"--label=build-url={GITHUB_RUN_URL}",
f"--label=com.clickhouse.build.githash={git.sha}", f"--label=com.clickhouse.build.githash={git.sha}",
f"--label=com.clickhouse.build.version={version}",
] ]
if direct_urls: if direct_urls:
args.append(f"--build-arg=DIRECT_DOWNLOAD_URLS='{' '.join(direct_urls)}'") args.append(f"--build-arg=DIRECT_DOWNLOAD_URLS='{' '.join(direct_urls)}'")
@ -267,7 +270,9 @@ def build_and_push_image(
urls = [url for url in direct_urls[arch] if ".deb" in url] urls = [url for url in direct_urls[arch] if ".deb" in url]
else: else:
urls = [url for url in direct_urls[arch] if ".tgz" in url] urls = [url for url in direct_urls[arch] if ".tgz" in url]
cmd_args.extend(buildx_args(repo_urls, arch, direct_urls=urls)) cmd_args.extend(
buildx_args(repo_urls, arch, direct_urls=urls, version=version.describe)
)
if not push: if not push:
cmd_args.append(f"--tag={image.repo}:{arch_tag}") cmd_args.append(f"--tag={image.repo}:{arch_tag}")
cmd_args.extend( cmd_args.extend(

View File

@ -1,4 +1,4 @@
1 1
1 1
1 1 1 1 1
1 1

View File

@ -1,5 +1,5 @@
-- since actual user name is unknown, have to perform just smoke tests -- Since the actual user name is unknown, have to perform just smoke tests
select currentUser() IS NOT NULL; select currentUser() IS NOT NULL;
select length(currentUser()) > 0; select length(currentUser()) > 0;
select currentUser() = user(), currentUser() = USER(); select currentUser() = user(), currentUser() = USER(), current_user() = currentUser();
select currentUser() = initial_user from system.processes where query like '%$!@#%'; select currentUser() = initial_user from system.processes where query like '%$!@#%' AND current_database = currentDatabase();