ClickHouse/tests/queries/0_stateless/02263_format_insert_settings.reference
Azat Khuzhin c5ffbc688e Do not allow SETTINGS after FORMAT for INSERT queries
Parsing SETTINGS after FORMAT, that has been introduced in [1], can
interpret SETTING as some values, which is misleading.

  [1]: https://github.com/ClickHouse/ClickHouse/pull/4174/files#diff-ba7bd0657630b1cd94cf6ed364bd857338096f49f66dc82918438d6745753775R106

Note, that we are touching only INSERT queries, not SELECT, since this
is a backward incompatible change, and in case of modifying SELECT it
can break too much.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
Fixes: #35100
Fixes: #20343
2022-04-07 16:29:36 +03:00

59 lines
2.1 KiB
Plaintext

insert into foo settings max_threads=1
Syntax error (query): failed at position 40 (end of query):
insert into foo format tsv settings max_threads=1
Can't format ASTInsertQuery with data, since data will be lost.
[multi] insert into foo values
INSERT INTO foo FORMAT Values
[oneline] insert into foo values
INSERT INTO foo FORMAT Values
[multi] insert into foo select 1
INSERT INTO foo SELECT 1
[oneline] insert into foo select 1
INSERT INTO foo SELECT 1
[multi] insert into foo watch bar
INSERT INTO foo WATCH bar
[oneline] insert into foo watch bar
INSERT INTO foo WATCH bar
[multi] insert into foo format tsv
INSERT INTO foo FORMAT tsv
[oneline] insert into foo format tsv
INSERT INTO foo FORMAT tsv
[multi] insert into foo settings max_threads=1 values
INSERT INTO foo
SETTINGS max_threads = 1
FORMAT Values
[oneline] insert into foo settings max_threads=1 values
INSERT INTO foo SETTINGS max_threads = 1 FORMAT Values
[multi] insert into foo settings max_threads=1 select 1
INSERT INTO foo
SETTINGS max_threads = 1
SELECT 1
[oneline] insert into foo settings max_threads=1 select 1
INSERT INTO foo SETTINGS max_threads = 1 SELECT 1
[multi] insert into foo settings max_threads=1 watch bar
INSERT INTO foo
SETTINGS max_threads = 1
WATCH bar
[oneline] insert into foo settings max_threads=1 watch bar
INSERT INTO foo SETTINGS max_threads = 1 WATCH bar
[multi] insert into foo settings max_threads=1 format tsv
INSERT INTO foo
SETTINGS max_threads = 1
FORMAT tsv
[oneline] insert into foo settings max_threads=1 format tsv
INSERT INTO foo SETTINGS max_threads = 1 FORMAT tsv
[multi] insert into foo select 1 settings max_threads=1
INSERT INTO foo
SETTINGS max_threads = 1
SELECT 1
SETTINGS max_threads = 1
[oneline] insert into foo select 1 settings max_threads=1
INSERT INTO foo SETTINGS max_threads = 1 SELECT 1 SETTINGS max_threads = 1
[multi] insert into foo settings max_threads=1 select 1 settings max_threads=1
INSERT INTO foo
SETTINGS max_threads = 1
SELECT 1
SETTINGS max_threads = 1
[oneline] insert into foo settings max_threads=1 select 1 settings max_threads=1
INSERT INTO foo SETTINGS max_threads = 1 SELECT 1 SETTINGS max_threads = 1