mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Make function return initial user
This commit is contained in:
parent
bc4177f64c
commit
d9234a64c4
@ -15,7 +15,7 @@ public:
|
||||
static constexpr auto name = "currentUser";
|
||||
static FunctionPtr create(const Context & context)
|
||||
{
|
||||
return std::make_shared<FunctionCurrentUser>(context.getClientInfo().current_user);
|
||||
return std::make_shared<FunctionCurrentUser>(context.getClientInfo().initial_user);
|
||||
}
|
||||
|
||||
explicit FunctionCurrentUser(const String & user_name_) : user_name{user_name_}
|
||||
|
@ -1,3 +1,4 @@
|
||||
1
|
||||
1
|
||||
1 1
|
||||
1
|
||||
|
@ -1,4 +1,5 @@
|
||||
-- since actual user name is unknown, have to perform just smoke tests
|
||||
select currentUser() IS NOT NULL;
|
||||
select length(currentUser()) > 0;
|
||||
select currentUser() = user();
|
||||
select currentUser() = user(), currentUser() = USER();
|
||||
select currentUser() = initial_user from system.processes where query like '%$!@#%';
|
@ -103,7 +103,7 @@ Returns the name of the current database.
|
||||
You can use this function in table engine parameters in a CREATE TABLE query where you need to specify the database.
|
||||
|
||||
## currentUser()
|
||||
Returns the login of authorized user.
|
||||
Returns the login of authorized user (initiator of query execution).
|
||||
|
||||
## isFinite(x)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user