Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SQLLogicTest] Expected error message is no longer optional for statement error #9962

Merged
merged 12 commits into from Dec 12, 2023
  •  
  •  
  •  
11 changes: 11 additions & 0 deletions test/common/test_cast_hugeint.test
Expand Up @@ -36,6 +36,7 @@ loop i 0 2

statement error
SELECT f::HUGEINT FROM (SELECT f FROM broken_floats ORDER BY f LIMIT 1 OFFSET ${i}) t1
----

endloop

Expand Down Expand Up @@ -71,6 +72,7 @@ loop i 0 4

statement error
SELECT f::HUGEINT FROM (SELECT f FROM broken_doubles ORDER BY f LIMIT 1 OFFSET ${i}) t1
----

endloop

Expand Down Expand Up @@ -107,6 +109,7 @@ loop i 0 14

statement error
SELECT f::HUGEINT FROM (SELECT f FROM broken_strings ORDER BY f LIMIT 1 OFFSET ${i}) t1
----

endloop

Expand Down Expand Up @@ -327,9 +330,11 @@ select '255'::HUGEINT::UINT8

statement error
select '-1'::hugeint::uint8
----

statement error
select '256'::hugeint::uint8
----

# uint16
query I
Expand All @@ -339,9 +344,11 @@ select '65535'::HUGEINT::UINT16

statement error
select '-1'::hugeint::uint16
----

statement error
select '65536'::hugeint::uint16
----

# uint32
query I
Expand All @@ -351,9 +358,11 @@ select '4294967295'::HUGEINT::UINT32

statement error
select '-1'::hugeint::uint32
----

statement error
select '4294967296'::hugeint::uint32
----

# UINT64
query I
Expand All @@ -363,9 +372,11 @@ select '18446744073709551615'::HUGEINT::UINT64

statement error
select '-1'::hugeint::UINT64
----

statement error
select '18446744073709551616'::hugeint::UINT64
----

# uint -> hugeint
query I
Expand Down
2 changes: 1 addition & 1 deletion test/extension/autoloading_copy_function.test
Expand Up @@ -38,4 +38,4 @@ copy (select 1337 as edgy_hacker_number) TO '__TEST_DIR__/test1337.parquet'
query I
select * from '__TEST_DIR__/test1337.parquet';
----
1337
1337
2 changes: 1 addition & 1 deletion test/extension/autoloading_filesystems.test
Expand Up @@ -46,4 +46,4 @@ IO Error: Connection error for HTTP HEAD to 'https://some-bucket.false_endpoint/
statement error
SELECT * FROM 'azure://some-bucket/a-file.csv'
----
IO Error: No files found that match the pattern "azure://some-bucket/a-file.csv"
IO Error: No files found that match the pattern "azure://some-bucket/a-file.csv"
2 changes: 1 addition & 1 deletion test/extension/autoloading_types.test
Expand Up @@ -35,4 +35,4 @@ set autoinstall_extension_repository='${LOCAL_EXTENSION_REPO}';
query I
SELECT '{}'::JSON;
----
{}
{}
5 changes: 5 additions & 0 deletions test/extension/install_extension.test_slow
Expand Up @@ -14,9 +14,11 @@ load __TEST_DIR__/dummy_database_for_extension_installation.db

statement error
INSTALL 'asdf';
----

statement error
INSTALL 'asdf/asdf.duckdb_extension';
----

statement ok
INSTALL '__BUILD_DIRECTORY__/test/extension/loadable_extension_demo.duckdb_extension';
Expand All @@ -39,6 +41,7 @@ SET extension_directory='__TEST_DIR__/extension_directory'

statement error
LOAD 'loadable_extension_demo';
----

# can install after setting directory, even if the extension directory does not yet exist
statement ok
Expand Down Expand Up @@ -69,10 +72,12 @@ SET home_directory='__TEST_DIR__/home_directory'

statement error
LOAD 'loadable_extension_demo';
----

# we can't install because we will not create a non-existing home directory
statement error
INSTALL '__BUILD_DIRECTORY__/test/extension/loadable_extension_demo.duckdb_extension';
----

# but this one should exist
statement ok
Expand Down
5 changes: 5 additions & 0 deletions test/extension/load_extension.test
Expand Up @@ -11,12 +11,15 @@ PRAGMA enable_verification

statement error
LOAD 'asdf';
----

statement error
LOAD 'Makefile';
----

statement error
LOAD NULL;
----

statement ok
LOAD '__BUILD_DIRECTORY__/test/extension/loadable_extension_demo.duckdb_extension';
Expand All @@ -41,9 +44,11 @@ QUACK

statement error
QUAC
----

statement error
QUACK NOT QUACK
----

query I
SELECT contains(loaded_extensions(), 'loadable_extension_demo')
Expand Down
2 changes: 2 additions & 0 deletions test/extension/test_alias_point.test
Expand Up @@ -39,9 +39,11 @@ SELECT sub_point(({'x': 2, 'y': 3})::POINT, ({'x': 3, 'y': 4})::POINT)

statement error
SELECT add_point(pt, pt) from points;
----

statement error
SELECT sub_point(pt, pt) from points;
----

query I
SELECT add_point(point, point) from points;
Expand Down
2 changes: 1 addition & 1 deletion test/extension/test_loadable_optimizer.test
Expand Up @@ -16,4 +16,4 @@ statement ok
LOAD '__BUILD_DIRECTORY__/test/extension/loadable_extension_optimizer_demo.duckdb_extension';

statement ok
select 42
select 42
1 change: 1 addition & 0 deletions test/fuzzer/afl/alter_if_exists.test
Expand Up @@ -7,3 +7,4 @@ ALTER TABLE IF EXISTS t0 ADD COLUMN c1 INT;

statement error
ALTER TABLE t0 ADD COLUMN c1 INT;
----
1 change: 1 addition & 0 deletions test/fuzzer/afl/invalid_foreign_key.test
Expand Up @@ -7,3 +7,4 @@ PRAGMA enable_verification

statement error
create table y(y int, foreign key (y) references y(y));
----
3 changes: 3 additions & 0 deletions test/fuzzer/afl/limit_out_of_range.test
Expand Up @@ -7,9 +7,12 @@ PRAGMA enable_verification

statement error
SELECT 1 LIMIT 3493690519702624888078795276804013381392711238711408854154521934990547605008475834286773858253643735619391784938186674922945640543537290894084514784093972720748475288610394187481276081350259062592878908961890372712236217855377408.000000%;
----

statement error
SELECT 1 LIMIT 3493690519702624888078795276804013381392711238711408854154521934990547605008475834286773858253643735619391784938186674922945640543537290894084514784093972720748475288610394187481276081350259062592878908961890372712236217855377408.000000;
----

statement error
SELECT 1 LIMIT CAST('NaN' AS REAL)%;
----
1 change: 1 addition & 0 deletions test/fuzzer/afl/window_function_binder_error.test
Expand Up @@ -12,3 +12,4 @@ SELECT count(x) OVER () FROM (SELECT 1) x(x);

statement error
SELECT count(x) OVER () FROM (SELECT 1) x(x) GROUP BY ALL;
----
2 changes: 1 addition & 1 deletion test/fuzzer/duckfuzz/array_slice_underflow.test
Expand Up @@ -13,4 +13,4 @@ SELECT ([1, 2, 3])[0:-9223372036854775808];
query I
SELECT ([1, 2, 3])[-9223372036854775808:0];
----
[]
[]
1 change: 1 addition & 0 deletions test/fuzzer/duckfuzz/arrow_scan_subquery_nullptr.test
Expand Up @@ -5,3 +5,4 @@
statement error
SELECT * FROM (SELECT * FROM arrow_scan(NULL, NULL, NULL));
Binder Error: arrow_scan: pointers cannot be null
----
1 change: 1 addition & 0 deletions test/fuzzer/duckfuzz/pivot_aggregate_mismatch.test
Expand Up @@ -7,3 +7,4 @@ PRAGMA enable_verification

statement error
FROM (VALUES (42)) t(i) PIVOT (current_date() FOR (i) IN (41))
----
2 changes: 1 addition & 1 deletion test/fuzzer/duckfuzz/strptime_const_arg.test
Expand Up @@ -8,4 +8,4 @@ create table all_types as select * exclude(small_enum, medium_enum, large_enum)
statement error
SELECT COLUMNS(list_filter(*, (c43 -> try_strptime(c29, c24)))) FROM all_types AS t42(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41)
----
Binder Error: Star expression
Binder Error: Star expression
2 changes: 1 addition & 1 deletion test/fuzzer/duckfuzz/union_dict_tag.test
Expand Up @@ -6,4 +6,4 @@ statement ok
create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types();

statement ok
SELECT encode("union"), "double" FROM all_types where "double";
SELECT encode("union"), "double" FROM all_types where "double";
2 changes: 1 addition & 1 deletion test/fuzzer/pedro/C_C++_API_query_verification.test
Expand Up @@ -22,4 +22,4 @@ SELECT c0 FROM t0;
-2

statement ok
SELECT CAST((((1!) << CASE WHEN 1 THEN 1 WHEN 1 THEN 1 END) IS NULL) AS USMALLINT)
SELECT CAST((((1!) << CASE WHEN 1 THEN 1 WHEN 1 THEN 1 END) IS NULL) AS USMALLINT)
3 changes: 3 additions & 0 deletions test/fuzzer/pedro/alter_column_generated.test
Expand Up @@ -16,9 +16,11 @@ ALTER TABLE t0 ALTER c1 SET NOT NULL;

statement error
ALTER TABLE t0 ALTER c0 SET NOT NULL;
----

statement error
INSERT INTO t0 VALUES (NULL);
----

statement ok
DROP TABLE t0;
Expand All @@ -31,4 +33,5 @@ INSERT INTO t0 VALUES (NULL);

statement error
ALTER TABLE t0 ALTER c1 SET NOT NULL;
----

2 changes: 1 addition & 1 deletion test/fuzzer/pedro/alter_dependencies.test
Expand Up @@ -22,5 +22,5 @@ COMMIT;

statement error
ALTER TABLE t1 ALTER c2 SET NOT NULL;
---
----
Cannot alter
1 change: 1 addition & 0 deletions test/fuzzer/pedro/alter_dependency_conflict.test
Expand Up @@ -13,6 +13,7 @@ CREATE INDEX i2 ON t4 (c3);
# Catalog Error: Cannot alter entry "t4" because there are entries that depend on it.
statement error
ALTER TABLE t4 ADD c1 BLOB;
----

# the table should still be in a usable state after the alter
statement ok
Expand Down
4 changes: 4 additions & 0 deletions test/fuzzer/pedro/alter_table_rowid.test
Expand Up @@ -10,12 +10,16 @@ CREATE TABLE t0(c0 INTEGER, c1 INTEGER);

statement error
ALTER TABLE t0 DROP COLUMN rowid;
----

statement error
ALTER TABLE t0 RENAME rowid TO ups;
----

statement error
ALTER TABLE t0 ALTER rowid TYPE VARCHAR;
----

statement error
ALTER TABLE t0 ALTER rowidx SET DEFAULT 0;
----
2 changes: 1 addition & 1 deletion test/fuzzer/pedro/art_concatenate_prefix.test
Expand Up @@ -12,4 +12,4 @@ statement ok
INSERT INTO t0 VALUES (-2041046163), (35016222);

statement ok
TRUNCATE t0;
TRUNCATE t0;
2 changes: 1 addition & 1 deletion test/fuzzer/pedro/art_prefix_error.test
Expand Up @@ -8,4 +8,4 @@ CREATE TABLE t0 (c0 BLOB PRIMARY KEY);
statement error
INSERT INTO t0(c0) VALUES (BLOB '\x00a'), (BLOB '');
----
ART indexes cannot contain BLOBs with zero bytes.
ART indexes cannot contain BLOBs with zero bytes.
2 changes: 1 addition & 1 deletion test/fuzzer/pedro/between_type_mismatch.test
Expand Up @@ -9,4 +9,4 @@ statement ok
CREATE TABLE t0 (c1 USMALLINT);

statement ok
SELECT 1 FROM (SELECT 1) t1(c0) JOIN t0 ON c1 BETWEEN c0 AND 1;
SELECT 1 FROM (SELECT 1) t1(c0) JOIN t0 ON c1 BETWEEN c0 AND 1;
3 changes: 3 additions & 0 deletions test/fuzzer/pedro/blob_wrong_optimization.test
Expand Up @@ -41,9 +41,12 @@ SELECT 1 FROM t1;

statement error
SELECT 1 FROM t1 WHERE decode('\xC0'::BLOB) IS NULL; --1 row, wrong?
----

statement error
SELECT 1 FROM t1 WHERE NOT (decode('\xC0'::BLOB) IS NULL); --1 row
----

statement error
SELECT 1 FROM t1 WHERE (decode('\xC0'::BLOB) IS NULL) IS NULL; --1 row, wrong?
----
1 change: 1 addition & 0 deletions test/fuzzer/pedro/complex_offset_clause_crash.test
Expand Up @@ -7,3 +7,4 @@ PRAGMA enable_verification

statement error
SELECT 6 OFFSET count(*) FILTER ((SELECT 2 UNION (SELECT 2) OFFSET (SELECT LAST))) OVER ();
----
2 changes: 2 additions & 0 deletions test/fuzzer/pedro/correlated_offset_subquery.test
Expand Up @@ -7,6 +7,8 @@ PRAGMA enable_verification

statement error
SELECT (SELECT 1 OFFSET c0) FROM (VALUES(1)) c0;
----

statement error
SELECT 0 FROM (SELECT 8 c0) WHERE (SELECT 1 LIMIT c0);
----
2 changes: 1 addition & 1 deletion test/fuzzer/pedro/create_index_error.test
Expand Up @@ -60,4 +60,4 @@ INSERT INTO t1 VALUES (1);
Conversion Error: Failure in decode: could not convert blob to UTF8 string, the blob contained invalid UTF8 characters

statement ok
CREATE INDEX i1 ON t1 USING ART (c1);
CREATE INDEX i1 ON t1 USING ART (c1);
3 changes: 3 additions & 0 deletions test/fuzzer/pedro/create_replace_table_union.test
Expand Up @@ -15,11 +15,14 @@ loop i 0 10

statement error
CREATE OR REPLACE TABLE t1 AS (SELECT * FROM range(10) ORDER BY 1) UNION ALL (SELECT * FROM range(10) ORDER BY 1);
----

statement error
CREATE OR REPLACE TABLE t1 AS (SELECT 1) UNION ALL (SELECT * FROM range(10) ORDER BY 1);
----

statement error
CREATE OR REPLACE TABLE t1 AS ((SELECT 1) UNION ALL ((SELECT 2) INTERSECT ALL (SELECT 2)));
----

endloop
1 change: 1 addition & 0 deletions test/fuzzer/pedro/currval_sequence_dependency.test
Expand Up @@ -24,5 +24,6 @@ DROP SEQUENCE seq CASCADE;
# this also drops the table
statement error
INSERT INTO t1 VALUES (1)
----

endloop
1 change: 1 addition & 0 deletions test/fuzzer/pedro/decimal_with_invalid_scale.test
Expand Up @@ -4,3 +4,4 @@
# scale is bigger than width, and both these numbers are ginormous
statement error
CREATE TABLE x(x DECIMAL(38763269, 77914819));
----