Compare commits

...

4 Commits

Author SHA1 Message Date
Arthur Passos
0274da29a6
Merge 4765fcac38 into 40c7d5fd1a 2024-11-20 21:58:44 +01:00
Arthur Passos
4765fcac38 Merge branch 'master' into demand_changes_on_alter_user 2024-11-11 09:33:33 -03:00
Arthur Passos
ffc88fd8a3 comments 2024-10-30 21:53:53 -03:00
Arthur Passos
c7318b60da demand changes on alter user 2024-10-30 19:43:38 -03:00
3 changed files with 14 additions and 0 deletions

View File

@ -549,6 +549,8 @@ bool ParserCreateUserQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expec
auto names = typeid_cast<std::shared_ptr<ASTUserNamesWithHost>>(names_ast);
auto names_ref = names->names;
auto pos_after_parsing_names = pos;
std::optional<String> new_name;
std::optional<AllowedClientHosts> hosts;
std::optional<AllowedClientHosts> add_hosts;
@ -674,6 +676,13 @@ bool ParserCreateUserQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expec
else if (alter)
names->concatParts();
bool alter_query_with_no_changes = alter && pos_after_parsing_names == pos;
if (alter_query_with_no_changes)
{
return false;
}
auto query = std::make_shared<ASTCreateUserQuery>();
node = query;

View File

@ -0,0 +1,5 @@
-- Tags: no-parallel
create user u_03254_alter_user;
alter user u_03254_alter_user; -- { clientError SYNTAX_ERROR }
drop user u_03254_alter_user;