Skip to content

FORMAT and SETTINGS parsing leads to errors #39712

@Scartiloffista

Description

@Scartiloffista

Query parsing related to FORMAT and SETTINGS clauses is inconsistent.

select 1 settings log_comment='test' Format {{format}} works as intended
(select 1) settings log_comment='test' Format {{format}} and (select 1) union (select 2) settings log_comment='test' Format {{format}} give a parsing error:

Syntax error: failed at position 50 ('Format'):

(select 1)  settings log_comment='prova valerio' Format JSONCompact

Expected end of query

Queries without the FORMAT clause work as intended.

Does it reproduce on recent release?
22.7.1.2484 is affected

How to reproduce
Connect to clickhouse-client and run the queries

Expected behavior

Same behaviour between different versions

If applicable, add screenshots to help explain your problem.

image

Metadata

Metadata

Labels

minorPriority: minorunexpected behaviourResult is unexpected, but not entirely wrong at the same time.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions