mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 17:41:59 +00:00
Merge pull request #63193 from ClickHouse/backport/24.3/63136
Backport #63136 to 24.3: Format SQL security option only in `CREATE VIEW` queries.
This commit is contained in:
commit
7e7f3bdd9b
@ -1076,7 +1076,7 @@ BlockIO InterpreterCreateQuery::createTable(ASTCreateQuery & create)
|
||||
String current_database = getContext()->getCurrentDatabase();
|
||||
auto database_name = create.database ? create.getDatabase() : current_database;
|
||||
|
||||
if (!create.sql_security && !getContext()->getServerSettings().ignore_empty_sql_security_in_create_view_query)
|
||||
if (!create.sql_security && create.supportSQLSecurity() && !getContext()->getServerSettings().ignore_empty_sql_security_in_create_view_query)
|
||||
create.sql_security = std::make_shared<ASTSQLSecurity>();
|
||||
|
||||
if (create.sql_security)
|
||||
|
@ -485,7 +485,7 @@ void ASTCreateQuery::formatQueryImpl(const FormatSettings & settings, FormatStat
|
||||
else if (is_create_empty)
|
||||
settings.ostr << (settings.hilite ? hilite_keyword : "") << " EMPTY" << (settings.hilite ? hilite_none : "");
|
||||
|
||||
if (sql_security && sql_security->as<ASTSQLSecurity &>().type.has_value())
|
||||
if (sql_security && supportSQLSecurity() && sql_security->as<ASTSQLSecurity &>().type.has_value())
|
||||
{
|
||||
settings.ostr << settings.nl_or_ws;
|
||||
sql_security->formatImpl(settings, state, frame);
|
||||
|
@ -149,6 +149,8 @@ public:
|
||||
|
||||
bool isParameterizedView() const;
|
||||
|
||||
bool supportSQLSecurity() const { return is_ordinary_view || is_materialized_view; }
|
||||
|
||||
QueryKind getQueryKind() const override { return QueryKind::Create; }
|
||||
|
||||
struct UUIDs
|
||||
|
Loading…
Reference in New Issue
Block a user