ClickHouse/tests/queries/0_stateless/01564_test_hint_woes.reference
2024-05-31 09:53:53 +00:00

34 lines
1.4 KiB
Plaintext

-- { echo }
create table values_01564(
a int,
constraint c1 check a < 10) engine Memory;
-- client error hint after broken insert values
insert into values_01564 values ('f'); -- { clientError CANNOT_PARSE_TEXT }
insert into values_01564 values ('f'); -- { clientError CANNOT_PARSE_TEXT }
select 1;
1
insert into values_01564 values ('f'); -- { clientError CANNOT_PARSE_TEXT }
select nonexistent column; -- { serverError UNKNOWN_IDENTIFIER }
select 1;
1
select nonexistent column; -- { serverError UNKNOWN_IDENTIFIER }
-- server error hint after broken insert values (violated constraint)
insert into values_01564 values (11); -- { serverError VIOLATED_CONSTRAINT }
insert into values_01564 values (11); -- { serverError VIOLATED_CONSTRAINT }
select 1;
1
insert into values_01564 values (11); -- { serverError VIOLATED_CONSTRAINT }
select nonexistent column; -- { serverError UNKNOWN_IDENTIFIER }
-- query after values on the same line
insert into values_01564 values (1); select 1;
select 1;
1
-- a failing insert and then a normal insert (#https://github.com/ClickHouse/ClickHouse/issues/19353)
CREATE TABLE t0 (c0 String, c1 Int32) ENGINE = Memory() ;
INSERT INTO t0(c0, c1) VALUES ("1",1) ; -- { clientError UNKNOWN_IDENTIFIER }
INSERT INTO t0(c0, c1) VALUES ('1', 1) ;
-- the return code must be zero after the final query has failed with expected error
insert into values_01564 values (11); -- { serverError VIOLATED_CONSTRAINT }
drop table t0;
drop table values_01564;