should be it

This commit is contained in:
2025-10-24 19:21:19 -05:00
parent a4b23fc57c
commit f09560c7b1
14047 changed files with 3161551 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
# name: test/fuzzer/pedro/C_C++_API_query_verification.test
# description: Issue #5984 (25): C/C++ API missing backslash interpretation
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t0 (c0 INT);
statement ok
INSERT INTO t0 VALUES (1), (-2), (0);
statement ok
UPDATE t0 SET c0 = (~1);
query I
SELECT c0 FROM t0;
----
-2
-2
-2
statement ok
SELECT CAST((((1!) << CASE WHEN 1 THEN 1 WHEN 1 THEN 1 END) IS NULL) AS USMALLINT)

View File

@@ -0,0 +1,34 @@
# name: test/fuzzer/pedro/aggregate_assertion_errors.test
# description: Various aggregate assertion errors
# group: [pedro]
statement ok
PRAGMA enable_verification
query I
SELECT reservoir_quantile(1, 1 ORDER BY 1);
----
1
statement ok
CREATE TABLE t1 (c0 INT);
query I
SELECT entropy(1 ORDER BY 1) FROM t1;
----
0
query I
SELECT approx_count_distinct(1 ORDER BY 1) FROM t1;
----
0
query I
SELECT count(c0 ORDER BY 0) FROM (SELECT 2 EXCEPT SELECT 2) c0;
----
0
query I
SELECT mode((c0, 0)) FROM (SELECT 1 c0), (SELECT 2);
----
(1, 0)

View File

@@ -0,0 +1,39 @@
# name: test/fuzzer/pedro/alter_column_generated.test
# description: Issue #4677: heap-buffer-overflow on ALTER statement
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t0(c0 AS (1), c1 INT);
statement ok
ALTER TABLE t0 ALTER c1 SET NOT NULL;
statement ok
ALTER TABLE t0 ALTER c1 SET NOT NULL;
statement error
ALTER TABLE t0 ALTER c0 SET NOT NULL;
----
<REGEX>:Binder Error.*Unsupported constraint.*
statement error
INSERT INTO t0 VALUES (NULL);
----
<REGEX>:Constraint Error.*NOT NULL.*failed.*
statement ok
DROP TABLE t0;
statement ok
CREATE TABLE t0(c0 AS (1), c1 INT);
statement ok
INSERT INTO t0 VALUES (NULL);
statement error
ALTER TABLE t0 ALTER c1 SET NOT NULL;
----
<REGEX>:Constraint Error.*NOT NULL.*failed.*

View File

@@ -0,0 +1,26 @@
# name: test/fuzzer/pedro/alter_dependencies.test
# description: Issue #4696: Alter table dependency conflict
# group: [pedro]
statement ok
CREATE TABLE t1 (c2 INT, c1 INT);
statement ok
CREATE INDEX i1 ON t1 (c1);
statement ok
START TRANSACTION;
statement error
ALTER TABLE t1 ALTER c2 TYPE BOOLEAN;
----
Cannot alter
# committing triggers a rollback
statement ok
COMMIT;
statement error
ALTER TABLE t1 ALTER c2 SET NOT NULL;
----
Cannot alter

View File

@@ -0,0 +1,26 @@
# name: test/fuzzer/pedro/alter_dependency_conflict.test
# description: Issue #4696: Alter table dependency conflict
# group: [pedro]
load __TEST_DIR__/alter_dependency_conflict.db
statement ok
CREATE TABLE t4 (c0 DATE, c3 VARCHAR(10));
statement ok
CREATE INDEX i2 ON t4 (c3);
statement ok
ALTER TABLE t4 ADD c1 BLOB;
statement ok
INSERT INTO t4 VALUES (NULL, NULL, NULL)
statement ok
START TRANSACTION;
statement ok
CREATE INDEX i3 ON t4 (c3);
statement ok
COMMIT;

View File

@@ -0,0 +1,29 @@
# name: test/fuzzer/pedro/alter_table_rowid.test
# description: Issue #4587: Alter table statements with rowid column
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t0(c0 INTEGER, c1 INTEGER);
statement error
ALTER TABLE t0 DROP COLUMN rowid;
----
<REGEX>:Binder Error.*does not have a column with name.*
statement error
ALTER TABLE t0 RENAME rowid TO ups;
----
<REGEX>:Binder Error.*does not have a column with name.*
statement error
ALTER TABLE t0 ALTER rowid TYPE VARCHAR;
----
<REGEX>:Binder Error.*does not have a column with name.*
statement error
ALTER TABLE t0 ALTER rowidx SET DEFAULT 0;
----
<REGEX>:Binder Error.*does not have a column with name.*

View File

@@ -0,0 +1,15 @@
# name: test/fuzzer/pedro/alter_type_null_mix.test
# description: ALTER TYPE large with mix of NULLs and non-nulls
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t1 (c0 USMALLINT);
statement ok
INSERT INTO t1 SELECT CASE WHEN i%2=0 THEN NULL ELSE 0 END FROM range(3000) t(i);
statement ok
ALTER TABLE t1 ALTER c0 TYPE USMALLINT;

View File

@@ -0,0 +1,16 @@
# name: test/fuzzer/pedro/alter_virtual_column_segfault.test
# description: Alter type of virtual column crashes
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t1(c2 AS (1) VIRTUAL, c1 TIME WITH TIME ZONE);
statement error
ALTER TABLE t1 ALTER c1 TYPE TIME USING(c2);
----
generated columns

View File

@@ -0,0 +1,10 @@
# name: test/fuzzer/pedro/analyze_nonexistant.test
# group: [pedro]
statement ok
CREATE TABLE t0(c0 TINYINT);
statement error
ANALYZE t0(c4);
----
does not exist

View File

@@ -0,0 +1,31 @@
# name: test/fuzzer/pedro/another_binder_error.test
# description: Issue #4978 (issue 48): Another Binder Issue
# group: [pedro]
mode skip
statement error
SELECT avg(0) c0, (SELECT 0 OFFSET c0);
----
Correlated columns not supported in LIMIT/OFFSET
statement error
SELECT avg(0) c0, (SELECT 0 OFFSET c0 + 1);
----
Correlated columns not supported in LIMIT/OFFSET
query II
SELECT 1 c0, (SELECT 0 OFFSET c0 - 1);
----
1 0
statement error
SELECT (SELECT avg(0)) c0, (SELECT 0 OFFSET c0 + 1);
----
Serialization Error: Cannot copy BoundSubqueryExpression
query II
select avg(0) AS c0, (SELECT c0);
----
0.0 0.0

View File

@@ -0,0 +1,15 @@
# name: test/fuzzer/pedro/art_concatenate_prefix.test
# description: Issue #7128, number 14
# group: [pedro]
statement ok
CREATE TABLE t0(c0 INT);
statement ok
CREATE INDEX i0 ON t0 (c0, (BLOB '\xE7\x1F\x8B&\xF0'));
statement ok
INSERT INTO t0 VALUES (-2041046163), (35016222);
statement ok
TRUNCATE t0;

View File

@@ -0,0 +1,10 @@
# name: test/fuzzer/pedro/art_prefix_error.test
# description: Issue #5984, number 59
# group: [pedro]
statement ok
CREATE TABLE t0 (c0 BLOB PRIMARY KEY);
statement ok
INSERT INTO t0(c0) VALUES (BLOB '\x00a'), (BLOB '');

View File

@@ -0,0 +1,16 @@
# name: test/fuzzer/pedro/between_mark_reference.test
# description: Test deletions with USING clause
# group: [pedro]
statement ok
PRAGMA enable_verification;
query I
SELECT 1 WHERE '23:' > ALL(SELECT '0') BETWEEN false AND true;
----
1
statement error
SELECT 1 WHERE '23:' > ALL(SELECT '0') BETWEEN '0' AND '0:';
----
'0:'

View File

@@ -0,0 +1,12 @@
# name: test/fuzzer/pedro/between_type_mismatch.test
# description: Between type mismatch
# group: [pedro]
statement ok
PRAGMA enable_verification;
statement ok
CREATE TABLE t0 (c1 USMALLINT);
statement ok
SELECT 1 FROM (SELECT 1) t1(c0) JOIN t0 ON c1 BETWEEN c0 AND 1;

View File

@@ -0,0 +1,65 @@
# name: test/fuzzer/pedro/binder_assertion_error.test
# description: Issue #4978 (16): Binder assertion error
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t0 (c0 INT);
query I
SELECT (SELECT 2) c0 WHERE (SELECT (SELECT (SELECT c0)));
----
2
query I
SELECT (SELECT 0) c0 WHERE (SELECT c0);
----
statement error
select (select 42) as a, (select a);
----
This is not yet supported
# The last a should resolve to 1 from the (select 1) a
# The b should resolve to 3
query I
select (select 1) a where (select (select 3) b where (select b) > (select a));
----
1
# the b alias resolves to the where alias binder in the subquery
# the a alias resolves to the where alias binder from the select clause.
query I
select (select 5) a where (select (select 3) b where (select b) > (select a));
----
# Similar to the above test case but it is a positive case
query II
select (select 5) a, (select 7) c where (select (select 3) b where (select a) > (select b) and (select c) > (select a));
----
5 7
statement ok
INSERT INTO t0 VALUES (1), (2), (3), (4);
# a3 is in the where clause is qualified to the a3 in the select
# there are two instances of an a1 alias, which are both correctly qualified using the
# alias binder in the first wherebinder encountered when attempting to bind correlated subqueries
#
# the where clause subquery resolves to a1 + c0 in (2)
# so a1 and c0 both need to be 1
query III
select (select 1) a1, (select 3) as a3, c0
from t0 where a1 + c0 in (select c0 as a1 from t0 where a1 + 1 = a3);
----
1 3 1
# same test as above except a negative case where nothing is returned.
# The subquery in the where clause is not satisfied
query III
select (select 1) a1, (select 3) as a3, c0
from t0 where a1 + c0 in (select c0 as a1 from t0 where a1 + 5 = a3);
----

View File

@@ -0,0 +1,40 @@
# name: test/fuzzer/pedro/binder_error_with_having_statement.test
# description: Issue #5984 (8, 12, 15): Another Binder Error
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t2(c1 INT, c2 INT);
statement error
SELECT 1 alias1 FROM (SELECT 1) t2(c1) GROUP BY ALL HAVING (SELECT c1);
----
Binder Error
statement error
SELECT 1 alias1 FROM (SELECT 1) t2(c1) GROUP BY ALL HAVING (SELECT alias1);
----
Binder Error
# works without a group by all
query I
SELECT 1 alias1 FROM (SELECT 1) t2(c1) GROUP BY c1 HAVING (SELECT c1);
----
1
statement ok
CREATE TABLE t1 (c0 INT);
statement error
SELECT 0 c0 FROM t1 GROUP BY ALL HAVING c0 < ALL(SELECT 0 FROM ((SELECT 2) UNION (SELECT 2)) t2 WHERE substr('b', 1, c0) GROUP BY ALL);
----
Binder Error
statement error
SELECT 1 FROM (SELECT 1) t1(c0) GROUP BY ALL HAVING EXISTS (SELECT 1 FROM (SELECT 1) t0(c2) HAVING c0);
----
Binder Error

View File

@@ -0,0 +1,55 @@
# name: test/fuzzer/pedro/blob_wrong_optimization.test
# description: Blob wrong optimization
# group: [pedro]
statement ok
PRAGMA enable_verification;
statement ok
CREATE TABLE t0 (c0 INT);
statement ok
CREATE VIEW t1(c1, c0) AS (SELECT 1, max(c0) FROM t0);
query I
SELECT 1 FROM t1;
----
1
statement error
SELECT 1 FROM t1 WHERE '\x96'::BLOB IN (1);
----
<REGEX>:Conversion Error.*Unimplemented type for cast.*
statement error
SELECT 1 FROM t1 WHERE NOT ('\x96'::BLOB IN (1));
----
<REGEX>:Conversion Error.*Unimplemented type for cast.*
statement error
SELECT 1 FROM t1 WHERE ('\x96'::BLOB IN (1)) IS NULL;
----
<REGEX>:Conversion Error.*Unimplemented type for cast.*
statement ok
CREATE OR REPLACE VIEW t1(c0) AS (SELECT (SELECT 1 WHERE FALSE));
query I
SELECT 1 FROM t1;
----
1
statement error
SELECT 1 FROM t1 WHERE decode('\xC0'::BLOB) IS NULL; --1 row, wrong?
----
<REGEX>:Conversion Error.*Failure in decode.*to UTF8 string.*
statement error
SELECT 1 FROM t1 WHERE NOT (decode('\xC0'::BLOB) IS NULL); --1 row
----
<REGEX>:Conversion Error.*Failure in decode.*to UTF8 string.*
statement error
SELECT 1 FROM t1 WHERE (decode('\xC0'::BLOB) IS NULL) IS NULL; --1 row, wrong?
----
<REGEX>:Conversion Error.*Failure in decode.*to UTF8 string.*

View File

@@ -0,0 +1,26 @@
# name: test/fuzzer/pedro/buffer_manager_out_of_memory.test
# description: Issue #5984 (32): Buffer manager out-of-memory issue
# group: [pedro]
statement ok
PRAGMA MEMORY_LIMIT='10MB';
statement ok
SET threads=8;
statement ok
SELECT ((SELECT 1::VARCHAR) EXCEPT (SELECT ('\xF1\x85\x96\xBA'::BLOB)::VARCHAR GROUP BY 1 ORDER BY 1));
statement ok
PRAGMA MEMORY_LIMIT='2MB';
statement error
SELECT t0.*, min(1 ORDER BY *) FROM (VALUES ('1')) t0(c0) GROUP BY ALL;
----
STAR
statement ok
SELECT t0.*, min(1 ORDER BY COLUMNS(*)) FROM (VALUES ('1')) t0(c0) GROUP BY ALL;
statement ok
SELECT t0.*, min(1 ORDER BY ALL) FROM (VALUES ('1')) t0(c0) GROUP BY ALL;

View File

@@ -0,0 +1,34 @@
# name: test/fuzzer/pedro/buffer_manager_resize_issue.test
# description: Issue #5984, number 49
# group: [pedro]
statement ok
CREATE TABLE t1 (c1 INT, c0 INT);
statement ok
CREATE TABLE t2 (c1 INT, c0 INT);
statement ok
START TRANSACTION;
statement ok
CREATE INDEX i1 ON t2 (c1);
statement error
CREATE INDEX i1 ON t1 (c0);
----
<REGEX>:Catalog Error.*Index with name "i1" already exists.*
statement ok
ROLLBACK
statement ok
CREATE UNIQUE INDEX i1 ON t2 (c1);
statement ok
INSERT INTO t2(c1,c0) VALUES (235,36), (43,81), (246,187), (28,149), (206,20), (135,11), (170,205), (202,63), (69,78), (160,50), (6,34), (207,28);
statement error
INSERT INTO t2(c1,c0) VALUES (86,98), (96,107), (237,190), (253,242), (229,9), (6,147);
----
<REGEX>:Constraint Error.*Duplicate key "c1: 6" violates unique constraint.*

View File

@@ -0,0 +1,19 @@
# name: test/fuzzer/pedro/cardinality_estimator_assertion_error.test
# description: Issue #4978 (issue 4): Cardinality estimator runtime issue
# group: [pedro]
statement ok
PRAGMA enable_verification
statement error
SELECT 1 FROM (SELECT 2) t0, (SELECT 3) t1 WHERE INTERVAL '1' DAYS USING SAMPLE (1 ROWS) REPEATABLE (1);
----
Conversion Error: Unimplemented type for cast (INTERVAL -> BOOLEAN)
statement error
SELECT (SELECT 1 WHERE INTERVAL '1' DAY HAVING EXISTS (SELECT 1));
----
Conversion Error: Unimplemented type for cast (INTERVAL -> BOOLEAN)
statement ok
SELECT 1 FROM (SELECT 2) t0, (SELECT 3) t1 WHERE (SELECT 1 NOT IN (SELECT 2));

View File

@@ -0,0 +1,19 @@
# name: test/fuzzer/pedro/cardinality_estimator_runtime_issue.test
# description: Issue #4682: Cardinality estimator runtime issue
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t0 AS (SELECT 2);
statement ok
DELETE FROM t0 USING generate_series(1);
query I
SELECT * FROM t0
----
statement ok
DELETE FROM t0 USING generate_series(1);

View File

@@ -0,0 +1,14 @@
# name: test/fuzzer/pedro/comparison_to_string.test
# description: Issue #4827: Parsed statement differs from original result
# group: [pedro]
statement ok
PRAGMA enable_verification
query I nosort
SELECT 1 WHERE (1 IS DISTINCT FROM 1) > ANY(SELECT 2);
----
query I nosort
SELECT 1 WHERE (1 IS DISTINCT FROM 1) IS NULL;
----

View File

@@ -0,0 +1,11 @@
# name: test/fuzzer/pedro/complex_offset_clause_crash.test
# description: Issue #4581: NULL pointer on complex OFFSET clause
# group: [pedro]
statement ok
PRAGMA enable_verification
statement error
SELECT 6 OFFSET count(*) FILTER ((SELECT 2 UNION (SELECT 2) OFFSET (SELECT LAST))) OVER ();
----
Not implemented Error: Unimplemented expression class

View File

@@ -0,0 +1,47 @@
# name: test/fuzzer/pedro/complex_type_all_subquery.test
# description: Use complex types in ALL clause
# group: [pedro]
statement ok
PRAGMA enable_verification
# cast from struct to int not supported
statement error
VALUES((0, 0) = ALL(SELECT 2));
----
Subquery returns 1 columns - expected 2
# use ALL with complex types
statement error
SELECT {'a': 42} = ALL(SELECT {'a': '42'})
----
explicit cast is required
foreach val 42 [1,2,3] {'a':42} {'a':[1,2,3],'b':'thisisalongstring'}
query I
SELECT ${val} = ALL(SELECT ${val})
----
1
query I
SELECT ${val} = ALL(SELECT ${val} UNION ALL SELECT NULL)
----
NULL
query I
SELECT ${val} = ALL(SELECT ${val} FROM range(3000))
----
1
query I
SELECT ${val} > ANY(SELECT ${val} FROM range(3000))
----
0
query I
SELECT ${val} >= ANY(SELECT ${val} FROM range(3000))
----
1
endloop

View File

@@ -0,0 +1,17 @@
# name: test/fuzzer/pedro/concurrent_catalog_usage.test
# description: Concurrent catalog usage
# group: [pedro]
# FIXME: add a dependency to 't2' to see how the DependencyManager behaves in that case
statement ok
CREATE TABLE t2 AS (SELECT 42);
concurrentloop i 1 100
statement maybe
CREATE OR REPLACE TABLE t2 AS (SELECT -54124033386577348004002656426531535114 FROM t2 LIMIT 70%);
----
write-write conflict
endloop

View File

@@ -0,0 +1,9 @@
# name: test/fuzzer/pedro/concurrent_set_threads.test
# group: [pedro]
concurrentloop i 1 10
statement ok
SET threads=${i}
endloop

View File

@@ -0,0 +1,21 @@
# name: test/fuzzer/pedro/constraints_temp_table.test
# description: Reference issue in duckdb_constraints with temporary tables
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t0 (c1 INT, c0 INT CONSTRAINT k1 REFERENCES t0(c0) UNIQUE);
statement ok
CREATE TABLE t1 AS (SELECT 1);
statement ok
CREATE TEMP TABLE t0 AS (SELECT 1);
statement ok
SELECT * FROM duckdb_constraints()
statement ok
SHOW

View File

@@ -0,0 +1,21 @@
# name: test/fuzzer/pedro/correlated_in_segv.test
# description: Correlated IN segfault
# group: [pedro]
statement ok
PRAGMA enable_verification
query I
SELECT (SELECT 1 WHERE 1 IN (c0) GROUP BY ()) FROM (SELECT 1) t0(c0);
----
1
query I
SELECT ((SELECT 1) EXCEPT (SELECT c0 LIMIT 0)) FROM VALUES (0), t0(c0);
----
1
query I
SELECT 1 + count() FILTER (WHERE EXISTS (SELECT EXISTS (SELECT 1)));
----
2

View File

@@ -0,0 +1,14 @@
# name: test/fuzzer/pedro/correlated_limit_rowid.test
# description: Issue #4580: heap-buffer-overflow when creating index on table with generated columns
# group: [pedro]
statement ok
CREATE TABLE t0 (c0 INT);
statement ok
CREATE TABLE t1 (c0 INT);
statement error
SELECT (SELECT 1 LIMIT t1.rowid) FROM t1 NATURAL JOIN t0;
----
Correlated

View File

@@ -0,0 +1,16 @@
# name: test/fuzzer/pedro/correlated_offset_subquery.test
# description: Issue #4563: Correlated offset subquery
# group: [pedro]
statement ok
PRAGMA enable_verification
statement error
SELECT (SELECT 1 OFFSET c0) FROM (VALUES(1)) c0;
----
<REGEX>:Binder Error.*not supported.*
statement error
SELECT 0 FROM (SELECT 8 c0) WHERE (SELECT 1 LIMIT c0);
----
<REGEX>:Binder Error.*not supported.*

View File

@@ -0,0 +1,13 @@
# name: test/fuzzer/pedro/correlated_subquery_downcast_error.test
# description: Issue #4568: UndefinedBehaviorSanitizer on downcast from correlated subquery
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t0(c0 INT);
query I
SELECT count(*) OVER() = ANY(SELECT * FROM t0 t1 WHERE(c0 = t0.c0)) FROM t0;
----

View File

@@ -0,0 +1,68 @@
# name: test/fuzzer/pedro/create_index_error.test
# description: Errors while inserting into indexes
# group: [pedro]
# create an index with an expression that leads to an error on insert
statement ok
CREATE TABLE t0 (c0 VARCHAR, c1 INT);
statement ok
INSERT INTO t0(c0) VALUES ('a');
# error (should) is already thrown during index creation
# cannot CAST str to int
statement error
CREATE INDEX i1 ON t0 (c1, CAST('c' AS INT));
----
Conversion Error: Could not convert string 'c' to INT32
statement ok
CREATE INDEX i0 ON t0 (c0);
statement ok
DROP TABLE t0
# create an index with an expression that leads to an error on insert, then delete from that table
statement ok
CREATE TABLE t0 (c1 INT, c0 INT);
statement ok
INSERT INTO t0(c0) VALUES (1);
# error (should) is already thrown during index creation
# Error: Conversion Error: Failure in decode: [...] blob contained invalid UTF8 characters
statement error
CREATE INDEX i1 ON t0 ((decode('\x0C\xE4\x85\xF5'::BLOB)::VARCHAR), c1);
----
Conversion Error: Failure in decode: could not convert blob to UTF8 string, the blob contained invalid UTF8 characters
statement ok
DELETE FROM t0;
statement ok
DROP TABLE t0;
statement ok
CREATE TABLE t1 (c1 BOOLEAN);
statement ok
INSERT INTO t1 VALUES (0);
statement ok
DELETE FROM t1;
statement ok
CREATE INDEX i0 ON t1 (c1, (decode('\x81\x5C\xE5'::BLOB)::VARCHAR));
statement error
INSERT INTO t1 VALUES (1);
----
TransactionContext Error: Failed to commit: 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);
statement error
create index i2 ON t1(c1) WHERE c1 != TRUE;
----
Creating partial indexes is not supported currently

View File

@@ -0,0 +1,31 @@
# name: test/fuzzer/pedro/create_replace_table_union.test
# description: Error thrown in CREATE TABLE AS
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE OR REPLACE TABLE t0 AS ((SELECT 1) UNION ALL ((SELECT 2) INTERSECT ALL (SELECT 2)));
statement ok
CREATE VIEW t1(c1) AS ((SELECT 1) UNION DISTINCT (SELECT 1));
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);
----
type View
statement error
CREATE OR REPLACE TABLE t1 AS (SELECT 1) UNION ALL (SELECT * FROM range(10) ORDER BY 1);
----
type View
statement error
CREATE OR REPLACE TABLE t1 AS ((SELECT 1) UNION ALL ((SELECT 2) INTERSECT ALL (SELECT 2)));
----
type View
endloop

View File

@@ -0,0 +1,33 @@
# name: test/fuzzer/pedro/currval_sequence_dependency.test
# description: Test sequence dependency in currval
# group: [pedro]
# FIXME - during checkpoint recovery we no longer bind so we no longer have dependency information
require skip_reload
statement ok
PRAGMA enable_verification
foreach fun nextval currval
statement ok
CREATE SEQUENCE seq;
statement ok
CREATE TABLE t1(c1 INT, CHECK(${fun}('seq')));
statement error
DROP SEQUENCE seq;
----
<REGEX>:Dependency Error.*table "t1" depends on index "seq".*
statement ok
DROP SEQUENCE seq CASCADE;
# this also drops the table
statement error
INSERT INTO t1 VALUES (1)
----
<REGEX>:Catalog Error.*t1 does not exist.*
endloop

View File

@@ -0,0 +1,18 @@
# name: test/fuzzer/pedro/date_int_optimizer_error.test
# description: Issue #4573: Date = int optimized vs non optimized
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t0 (c0 INT);
query I
SELECT 1 FROM t0 WHERE DATE '2010-1-1' = 2;
----
query I
SELECT 1 FROM (VALUES (1),(2),(NULL),(4)) t0(c0) WHERE c0 BETWEEN 3 AND (CAST('inf' AS REAL) - 2);
----
1

View File

@@ -0,0 +1,8 @@
# name: test/fuzzer/pedro/decimal_with_invalid_scale.test
# group: [pedro]
# scale is bigger than width, and both these numbers are ginormous
statement error
CREATE TABLE x(x DECIMAL(38763269, 77914819));
----
Parser Error: Width must be between 1 and 38

View File

@@ -0,0 +1,48 @@
# name: test/fuzzer/pedro/delete_add_column.test
# description: Delete from altered table triggers assertion
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t1 AS SELECT 1 c1;
statement ok
ALTER TABLE t1 ADD c0 INT;
query II
SELECT * FROM t1
----
1 NULL
statement ok
TRUNCATE t1;
query II
SELECT * FROM t1
----
statement ok
DROP TABLE t1
statement ok
CREATE TABLE t1(c0 VARCHAR);
statement ok
ALTER TABLE t1 ADD c1 INT;
statement ok
INSERT INTO t1 AS t0(c0) VALUES(4);
query II
SELECT * FROM t1
----
4 NULL
statement ok
DELETE FROM t1;
query II
SELECT * FROM t1
----

View File

@@ -0,0 +1,16 @@
# name: test/fuzzer/pedro/delete_using_bindings.test
# description: Test correlated limit
# group: [pedro]
statement ok
CREATE TABLE t0(c0 INT);
statement error
DELETE FROM t0 USING ((SELECT 1) t1 INNER JOIN (SELECT 2) t2 ON t0.c0);
----
"t0" not found
statement error
DELETE FROM t0 USING ((SELECT 1) t1 INNER JOIN (SELECT 2) t2 ON c0);
----
"c0" not found

View File

@@ -0,0 +1,12 @@
# name: test/fuzzer/pedro/drop_gcol.test
# description: Issue #4571: Duplicate table name at CTE in INSERT statement
# group: [pedro]
statement ok
pragma enable_verification
statement ok
CREATE TABLE t0 (c0 INT AS (0), c1 INT, CHECK(c1 > 0));
statement ok
ALTER TABLE t0 DROP c0;

View File

@@ -0,0 +1,19 @@
# name: test/fuzzer/pedro/duplicate_cte.test
# description: Issue #4571: Duplicate table name at CTE in INSERT statement
# group: [pedro]
statement ok
pragma enable_verification
statement ok
CREATE TABLE t0(c0 INT);
require no_alternative_verify
statement ok
WITH t0 AS (SELECT 2) INSERT INTO t0 (WITH t0 AS (SELECT 2) SELECT 2);
query I
SELECT * FROM t0
----
2

View File

@@ -0,0 +1,47 @@
# name: test/fuzzer/pedro/duplicate_using_clause.test
# description: Issue #4561: Binding assertion error
# group: [pedro]
statement ok
pragma enable_verification
statement ok
CREATE TABLE t1(c0 INT);
query I
SELECT * FROM t1 JOIN t1 t2 USING (c0, c0)
----
query II
SELECT * FROM (t1 JOIN t1 t2 USING (c0)), (SELECT 42)
----
query II
SELECT * FROM (t1 JOIN t1 t2 USING (c0, c0)), (SELECT 42)
----
statement ok
create table tbl as select 42 AS i;
query I
select * from tbl t1 join tbl t2 using (i) join tbl t3 using (i);
----
42
query I
select * from tbl t1 join tbl t2 using (i, i) join tbl t3 using (i, i, i);
----
42
statement ok
create or replace table tbl as select 42 AS i, 84 as j;
query II
select * from tbl t1 join tbl t2 using (i, j) join tbl t3 using (i, j);
----
42 84
query II
select * from tbl t1 join tbl t2 using (i, j, i) join tbl t3 using (i, i, i, j, i);
----
42 84

View File

@@ -0,0 +1,12 @@
# name: test/fuzzer/pedro/escaped_trim_function_call.test
# description: Issue #4586: Escaped trim function call
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
SELECT "trim"('hello');
statement ok
SELECT trim('hello');

View File

@@ -0,0 +1,43 @@
# name: test/fuzzer/pedro/export_parquet_generated.test
# description: Generated columns and Parquet export
# group: [pedro]
require parquet
statement ok
PRAGMA enable_verification
statement ok
BEGIN;
statement ok
CREATE TABLE t0 (c0 INT AS (1), c1 INT);
statement ok
EXPORT DATABASE '__TEST_DIR__/parquet_generated_dump' (FORMAT PARQUET);
statement ok
ROLLBACK;
statement ok
IMPORT DATABASE '__TEST_DIR__/parquet_generated_dump';
statement ok
COPY (SELECT 42) TO '__TEST_DIR__/parquet_single.parquet'
statement ok
COPY t0 FROM '__TEST_DIR__/parquet_single.parquet'
query II
FROM t0
----
1 42
statement ok
COPY t0 (c1) FROM '__TEST_DIR__/parquet_single.parquet'
query II
FROM t0
----
1 42
1 42

View File

@@ -0,0 +1,14 @@
# name: test/fuzzer/pedro/first_value_window_crash.test
# description: first_value window crash
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t1 (c0 INT);
query I
SELECT first_value((1 || mode() WITHIN GROUP (ORDER BY 1)) IGNORE NULLS) OVER () FROM t1;
----
NULL

View File

@@ -0,0 +1,70 @@
# name: test/fuzzer/pedro/floating_point_conversion_overflow.test
# description: Floating-point conversion overflow
# group: [pedro]
statement ok
PRAGMA enable_verification
foreach float_type REAL DOUBLE
foreach type UTINYINT USMALLINT UINTEGER UBIGINT
statement ok
SELECT 0::${float_type}::${type}
statement error
SELECT (-1)::${float_type}::${type}
----
<REGEX>:Conversion Error.*out of range for.*UINT.*
endloop
statement ok
SELECT 255::${float_type}::UTINYINT
statement error
SELECT 256::${float_type}::UTINYINT
----
<REGEX>:Conversion Error.*out of range for.*UINT8.*
statement ok
SELECT 65535::${float_type}::USMALLINT
statement error
SELECT 65536::${float_type}::USMALLINT
----
<REGEX>:Conversion Error.*out of range for.*UINT16.*
endloop
statement ok
SELECT 4294967167::REAL::UINTEGER
statement error
SELECT 4294967168::REAL::UINTEGER
----
<REGEX>:Conversion Error.*out of range for.*UINT32.*
statement ok
SELECT 4294967295::DOUBLE::UINTEGER
statement error
SELECT 4294967296::DOUBLE::UINTEGER
----
<REGEX>:Conversion Error.*out of range for.*UINT32.*
statement ok
SELECT 18446743523953736703::REAL::UBIGINT
statement error
SELECT 18446743523953736704::REAL::UBIGINT
----
<REGEX>:Conversion Error.*out of range for.*UINT64.*
statement ok
SELECT 18446744073709550591::DOUBLE::UBIGINT
statement error
SELECT 18446744073709550592::DOUBLE::UBIGINT
----
<REGEX>:Conversion Error.*out of range for.*UINT64.*

View File

@@ -0,0 +1,15 @@
# name: test/fuzzer/pedro/floating_point_inequality.test
# group: [pedro]
statement ok
pragma enable_verification
query II
SELECT -0::DOUBLE, 0::DOUBLE;
----
-0.0 0.0
query II
SELECT '+nan'::DOUBLE, '-nan'::DOUBLE;
----
nan -nan

View File

@@ -0,0 +1,9 @@
# name: test/fuzzer/pedro/force_external_blob.test
# description: Issue #4630: Order with force external assertion error
# group: [pedro]
statement ok
PRAGMA DEBUG_FORCE_EXTERNAL=1;
statement ok
SELECT BLOB 't\xF0\xC0\xD3\x86\xF1p?\xCE;\xC6~H' ORDER BY 1;

View File

@@ -0,0 +1,11 @@
# name: test/fuzzer/pedro/force_no_cross_product.test
# group: [pedro]
statement ok
PRAGMA debug_force_no_cross_product=1;
# Requires cross-product but 'force_no_cross_product' is enabled
statement error
SELECT 1 FROM (SELECT 1), (SELECT 1);
----
Invalid Input Error: Query requires a cross-product, but 'force_no_cross_product'

View File

@@ -0,0 +1,12 @@
# name: test/fuzzer/pedro/forced_parallelism_empty_select.test
# description: Issue #4574: Forced parallelism with an empty select
# group: [pedro]
statement ok
PRAGMA verify_parallelism;
statement ok
CREATE TABLE t0 (c0 INT, c1 INT);
statement ok
SELECT c1 FROM t0 WHERE (c0 + c1) = 2;

View File

@@ -0,0 +1,24 @@
# name: test/fuzzer/pedro/foreign_key_binding_issue.test
# description: Referencing the same column multiple twice in constraint definition.
# group: [pedro]
statement ok
PRAGMA enable_verification
statement error
CREATE TABLE t0 (c0 INT, UNIQUE (c0, c0));
----
<REGEX>:Parser Error.*appears twice in primary key constraint.*
statement error
CREATE TABLE t0 (c0 INT, FOREIGN KEY (c0, c0) REFERENCES t0(c0, c0), UNIQUE (c0, c0));
----
<REGEX>:Parser Error.*duplicate primary key referenced in FOREIGN KEY constraint.*
statement error
CREATE TABLE t0 (c0 INT, c1 INT, FOREIGN KEY (c0, c0) REFERENCES t0(c0, c1), UNIQUE (c0, c1));
----
<REGEX>:Parser Error.*duplicate key specified in FOREIGN KEY constraint.*
statement ok
CREATE TABLE t0 (c0 INT, c1 INT, FOREIGN KEY (c0, c1) REFERENCES t0(c0, c1), UNIQUE (c0, c1));

View File

@@ -0,0 +1,17 @@
# name: test/fuzzer/pedro/foreign_key_type_mismatch.test
# description: Foreign key type mismatch
# group: [pedro]
# foreign key type mismatch on self-referencing fk constraint
statement error
CREATE TABLE t0 (c2 INT CONSTRAINT k0 UNIQUE, c0 DECIMAL, CONSTRAINT k1 FOREIGN KEY (c0) REFERENCES t0 (c2));
----
incompatible types
statement ok
CREATE TABLE t0 (c2 INT CONSTRAINT k0 UNIQUE);
statement error
CREATE TABLE t1 (c0 DECIMAL, CONSTRAINT k1 FOREIGN KEY (c0) REFERENCES t0 (c2));
----
incompatible types

View File

@@ -0,0 +1,30 @@
# name: test/fuzzer/pedro/gcol_stack_overflow.test
# group: [pedro]
statement ok
pragma enable_verification
statement ok
CREATE TABLE t0 (c2 AS (c0) VIRTUAL, c0 INT);
statement ok
insert into t0 VALUES(5);
foreach table_alias t0 c0 c2 order_id total_profit amount_sold price "a.b.c"
query I
SELECT 1 FROM t0 as ${table_alias}(c0) WHERE c0 = 0;
----
query I
select 1 from t0 as ${table_alias}(c0);
----
1
query I
select c0 from t0 as ${table_alias}(c0);
----
5
#table_alias
endloop

View File

@@ -0,0 +1,24 @@
# name: test/fuzzer/pedro/group_by_all_row_alias.test
# description: Binder issue when using GROUP BY ALL together
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t0(c1 INT);
query II
SELECT c1 c2, ROW(t0.c1, c2) FROM t0 GROUP BY ALL;
----
statement ok
DROP TABLE t0
statement ok
CREATE TABLE t0(c0 INT);
statement error
SELECT rowid c2 FROM t0 GROUP BY ALL ORDER BY (t0.rowid, c2);
----
GROUP BY ALL will only group entries in the SELECT list

View File

@@ -0,0 +1,21 @@
# name: test/fuzzer/pedro/hash_finalize_race.test
# description: Issue #4694: Race condition at HashJoinFinalizeEvent
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE SEQUENCE t4;
statement ok
PRAGMA DEBUG_FORCE_EXTERNAL=1;
loop i 0 10
statement error
SELECT 1 FROM ((SELECT 2) INTERSECT (SELECT 2)) t2(c3) WHERE "currval"('t4') = EXISTS (SELECT 2);
----
<REGEX>:Sequence Error.*currval.*not yet defined.*
endloop

View File

@@ -0,0 +1,25 @@
# name: test/fuzzer/pedro/having_query_wrong_result.test
# description: Issue #4680: Having query with wrong result?
# group: [pedro]
require skip_reload
statement ok
CREATE SEQUENCE seq;
query I
SELECT nextval('seq');
----
1
query I
SELECT currval('seq');
----
1
statement ok
PRAGMA enable_verification
query I
SELECT 1 FROM (SELECT 1) t0(c0) GROUP BY CUBE (1) HAVING (currval('seq') IS NULL);
----

View File

@@ -0,0 +1,37 @@
# name: test/fuzzer/pedro/having_subquery_failed_to_bind.test
# description: Having subquery alias in subquery
# group: [pedro]
statement ok
PRAGMA enable_verification;
statement error
SELECT sum(c2) c0 FROM (SELECT 1) t1(c2) HAVING (SELECT c0);
----
cannot reference alias
statement error
SELECT count() as c0 FROM (SELECT 1) t1(c2) HAVING 1 = (SELECT c0 WHERE EXISTS (SELECT 1));
----
cannot reference alias
statement error
SELECT count() as c0 FROM (SELECT 1) t1(c2) GROUP BY c0 HAVING 1 = (SELECT c0 WHERE EXISTS (SELECT 1));
----
Binder Error: GROUP BY clause cannot contain aggregates
statement ok
SELECT count() c0 FROM (SELECT 1) t1(c2) HAVING c0 = 1
statement ok
CREATE TABLE t1 (c0 INT);
statement error
SELECT count(*) c1 HAVING EXISTS (SELECT 1 FROM t1 WHERE c1 BETWEEN c0 AND 0);
----
cannot reference alias
statement error
SELECT count(*) c1 HAVING EXISTS (SELECT 1 FROM t1 WHERE c1 = c0);
----
cannot reference alias

View File

@@ -0,0 +1,41 @@
# name: test/fuzzer/pedro/in_clause_optimization_error.test
# description: Issue #4584: In clause optimization error
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t0(c0 INT);
statement ok
INSERT INTO t0 VALUES (42)
statement error
SELECT 0 FROM t0 WHERE ? IN (1);
----
<REGEX>:Invalid Input Error.*Expected 1 parameters, but none were supplied.*
statement ok
PREPARE v1 AS SELECT 0 FROM t0 WHERE ? IN (1);
query I
EXECUTE v1(0)
----
query I
EXECUTE v1(1)
----
0
statement ok
PREPARE v2 AS SELECT $1 FROM t0 WHERE $1 IN (1);
query I
EXECUTE v2(0)
----
query I
EXECUTE v2(1)
----
1

View File

@@ -0,0 +1,22 @@
# name: test/fuzzer/pedro/in_clause_setop_rewrite.test
# description: "Type mismatch for SET OPERATION", with IN with more than 4 elements, and UNION
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
create table t0(id int);
statement ok
insert into t0 values(1);
query I
SELECT c1 FROM ((SELECT 1 AS c1) UNION (SELECT id AS c1 FROM t0 limit 1)) A where c1 IN (1, 2, 3, 4);
----
1
query I
SELECT c1 FROM ((SELECT 1 AS c1) UNION (SELECT id AS c1 FROM t0 limit 1)) A where c1 IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
----
1

View File

@@ -0,0 +1,47 @@
# name: test/fuzzer/pedro/incomplete_checkpoint.test
# description: Issue #4644: Incomplete checkpoints issue
# group: [pedro]
require skip_reload
load __TEST_DIR__/incomplete_checkpoint.db
statement ok
PRAGMA wal_autocheckpoint='1TB';
statement ok
PRAGMA enable_verification
statement ok
CREATE SCHEMA s1;
statement ok
CHECKPOINT;
statement ok
DROP SCHEMA s1;
statement ok
CHECKPOINT;
statement ok
PRAGMA DEBUG_CHECKPOINT_ABORT = 'after_free_list_write';
statement ok
CREATE SCHEMA s3;
# error Checkpoint aborted after free list write because of PRAGMA checkpoint_abort flag
statement error
CHECKPOINT;
----
<REGEX>:FATAL Error.*Checkpoint aborted.*checkpoint_abort flag.*
statement error
CHECKPOINT;
----
<REGEX>:FATAL Error.*Checkpoint aborted.*checkpoint_abort flag.*
restart
statement ok
CREATE TABLE s3.integers(i INTEGER)

View File

@@ -0,0 +1,16 @@
# name: test/fuzzer/pedro/incorrect_offset_result.test
# description: Issue #4575: OFFSET query with wrong results
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t0 (c0 INT, c1 INT);
statement ok
INSERT INTO t0 (VALUES (1, 1),(2, 2),(3, 3));
query I
SELECT c0 FROM t0 WHERE ((c0 + c1) = 2) OFFSET 10;
----

View File

@@ -0,0 +1,53 @@
# name: test/fuzzer/pedro/index_current_timestamp.test
# description: Get current timestamp and similar functions cannot be used in indexes
# group: [pedro]
load __TEST_DIR__/index_current_timestamp.db
statement ok
CREATE TABLE t1(c0 INT, c1 VARCHAR);
statement ok
INSERT INTO t1(c1) VALUES(1);
statement ok
CREATE SEQUENCE seq
statement error
CREATE INDEX i1 ON t1((get_current_timestamp()), c1);
----
Index keys cannot contain expressions with side effects.
statement error
CREATE INDEX i1 ON t1((random()), c1);
----
Index keys cannot contain expressions with side effects.
statement error
CREATE INDEX i1 ON t1((nextval('seq')), c1);
----
Index keys cannot contain expressions with side effects.
statement ok
DELETE FROM t1;
# now with an empty table
statement error
CREATE INDEX i1 ON t1((get_current_timestamp()), c1);
----
Index keys cannot contain expressions with side effects.
# but attempting to insert a value borks it up
statement ok
INSERT INTO t1 VALUES (42, 'hello')
restart
statement error
CREATE INDEX i1 ON t1((get_current_timestamp()), c1);
----
Index keys cannot contain expressions with side effects.
statement ok
INSERT INTO t1 VALUES (42, 'hello')

View File

@@ -0,0 +1,31 @@
# name: test/fuzzer/pedro/index_generated_column.test
# description: Issue #4580: heap-buffer-overflow when creating index on table with generated columns
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t0 (c0 INT AS (1), c1 INT);
statement ok
CREATE INDEX i0 ON t0 USING ART ((c0 + c1));
query II
SELECT * FROM t0 WHERE (c0 + c1) = 3
----
statement ok
INSERT INTO t0 VALUES (2)
query II
SELECT * FROM t0 WHERE (c0 + c1) = 3
----
1 2
statement ok
DELETE FROM t0
query II
SELECT * FROM t0 WHERE (c0 + c1) = 3
----

View File

@@ -0,0 +1,53 @@
# name: test/fuzzer/pedro/index_insert_from_union.test
# description: Issue #4978 (33): Insert into ART index leaf assertion error
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t2 (c1 INT, PRIMARY KEY (c1));
statement error
INSERT INTO t2 VALUES (2), (2);
----
<REGEX>:Constraint Error.*duplicate key.*
statement error
INSERT INTO t2 SELECT 2 FROM range(10);
----
<REGEX>:Constraint Error.*duplicate key.*
statement error
INSERT INTO t2 SELECT 2 UNION ALL SELECT 2;
----
<REGEX>:Constraint Error.*duplicate key.*
statement ok
BEGIN TRANSACTION
statement ok
INSERT INTO t2 SELECT 1 UNION ALL SELECT 2;
query I
SELECT * FROM t2 WHERE c1>1
----
2
query I
SELECT * FROM t2 WHERE c1<2
----
1
statement ok
COMMIT
query I
SELECT * FROM t2 WHERE c1>1
----
2
query I
SELECT * FROM t2 WHERE c1<2
----
1

View File

@@ -0,0 +1,17 @@
# name: test/fuzzer/pedro/index_not_updated_returning.test
# description: Issue #4978 (23): Index not updated assertion
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t2 AS SELECT 1 c1, 1 c2;
statement ok
CREATE INDEX i0 ON t2 (c1);
query II
UPDATE t2 SET c2 = 2 RETURNING *;
----
1 2

View File

@@ -0,0 +1,25 @@
# name: test/fuzzer/pedro/index_on_altered_table.test
# description: Issue #4696: Alter table transaction conflict
# group: [pedro]
load __TEST_DIR__/index_on_altered_table.db
statement ok
CREATE TABLE t4 (c0 DATE, c3 VARCHAR(10));
statement ok con1
BEGIN TRANSACTION
statement ok con1
ALTER TABLE t4 ADD c1 BLOB;
statement error
CREATE INDEX i3 ON t4 (c3);
----
<REGEX>:TransactionContext Error.*cannot add.*index.*table.*altered.*
statement ok con1
COMMIT;
statement ok
CHECKPOINT

View File

@@ -0,0 +1,25 @@
# name: test/fuzzer/pedro/insert_or_replace_only_pk.test
# description: Insert or replace with only columns that are part of the primary key constraint
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t2 (c1 INT PRIMARY KEY);
statement ok
INSERT OR REPLACE INTO t2 VALUES (1);
query I
SELECT * FROM t2
----
1
statement ok
INSERT OR REPLACE INTO t2 VALUES (1);
query I
SELECT * FROM t2
----
1

View File

@@ -0,0 +1,17 @@
# name: test/fuzzer/pedro/intersect_correlated_subquery.test
# description: Intersect correlated subquery
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t0 (c1 TINYINT);
query I
SELECT (SELECT 1 INTERSECT SELECT 1 HAVING true) FROM t0;
----
query I
SELECT (SELECT 1 INTERSECT SELECT 1 HAVING t0.rowid) FROM t0;
----

View File

@@ -0,0 +1,11 @@
# name: test/fuzzer/pedro/intersect_empty_array.test
# description: Intersect empty array
# group: [pedro]
statement ok
pragma enable_verification
statement error
SELECT 2 INTERSECT VALUES([]);
----
Unimplemented

View File

@@ -0,0 +1,15 @@
# name: test/fuzzer/pedro/is_distinct_from_validation.test
# group: [pedro]
statement ok
pragma enable_verification
query I
SELECT (0 IS DISTINCT FROM 2) = 0;
----
false
query I
SELECT CASE 8 WHEN(0 IS DISTINCT FROM 0) THEN 2 END;
----
NULL

View File

@@ -0,0 +1,10 @@
# name: test/fuzzer/pedro/lag_window_function.test
# group: [pedro]
statement ok
PRAGMA enable_verification
query I
SELECT lag(1) OVER (ORDER BY 0 RANGE BETWEEN CURRENT ROW AND 1 FOLLOWING);
----
NULL

View File

@@ -0,0 +1,17 @@
# name: test/fuzzer/pedro/last_memory_leak.test
# description: Memory leak on "last" aggregate
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t0 (c1 VARCHAR);
statement ok
INSERT INTO t0(c1) VALUES (NULL), ('a'),('-801673450963');
query I
SELECT "last"(c1) FROM t0;
----
-801673450963

View File

@@ -0,0 +1,15 @@
# name: test/fuzzer/pedro/lateral_join.test
# description: Lateral index join
# group: [pedro]
statement ok
PRAGMA enable_verification;
statement ok
CREATE TABLE t1 (c1 INT);
statement ok
CREATE INDEX i0 ON t1 (c1);
statement ok
SELECT 1 FROM t1 JOIN (SELECT t1.c1) t0(c0) ON 1 = CAST(72837647112 AS UINTEGER);

View File

@@ -0,0 +1,26 @@
# name: test/fuzzer/pedro/like_empty_list.test
# description: Issue #4978 (#6): Like empty list assertion error
# group: [pedro]
statement ok
PRAGMA enable_verification
statement error
SELECT '1' LIKE [];
----
No function matches
statement error
SELECT [] LIKE 1;
----
No function matches
statement error
SELECT [] LIKE [];
----
No function matches
statement error
SELECT 1 FROM (SELECT 2) t1(c0) NATURAL RIGHT JOIN (SELECT 2) t0(c0) WHERE (0, t1.c0) NOT LIKE '0';
----
No function matches

View File

@@ -0,0 +1,17 @@
# name: test/fuzzer/pedro/limit_on_any_subquery.test
# group: [pedro]
statement ok
PRAGMA enable_verification
query I
SELECT 1 WHERE 1 < ANY(SELECT 2 LIMIT 0%);
----
statement ok
CREATE TABLE test (x INT);
query I
SELECT 1 WHERE 1 < ANY(SELECT 2 FROM test);
----

View File

@@ -0,0 +1,15 @@
# name: test/fuzzer/pedro/local_transaction_delete_empty_tree.test
# description: Empty segment tree error when deleting in local transaction
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
START TRANSACTION;
statement ok
CREATE TABLE t1 AS (SELECT 1);
statement ok
DELETE FROM t1 RETURNING 1;

View File

@@ -0,0 +1,24 @@
# name: test/fuzzer/pedro/logical_column_index_out_of_range.test
# description: Issue #5984 (4): Logical column index 1 out of range during natural joins
# group: [pedro]
statement ok
pragma enable_verification
statement ok
CREATE TABLE t0(c1 INT);
statement ok
CREATE TABLE t1(c0 INT, c2 INT);
statement ok
CREATE TABLE t2(c1 INT, c2 INT);
statement ok
SELECT 1 FROM t1 t2(c1) NATURAL RIGHT JOIN t0, t2 t1(c0) WHERE t2.c2 >= c0;
statement ok
SELECT 1 FROM t1 t2(c1) NATURAL LEFT JOIN t0, t2 t1(c0) WHERE t2.c2 >= c0;
statement ok
SELECT 1 FROM t1 t2(c1) NATURAL INNER JOIN t0, t2 t1(c0) WHERE t2.c2 >= c0;

View File

@@ -0,0 +1,21 @@
# name: test/fuzzer/pedro/missing_subquery_error.test
# description: Issue #4570: Missing error message at subquery
# group: [pedro]
statement ok
PRAGMA enable_verification
statement error
WITH t2 AS (SELECT 3 WHERE count(*) FILTER (1)) SELECT 0 FROM t2
----
<REGEX>:Binder Error.*WHERE clause cannot contain aggregates.*
statement error
SELECT (WITH t2 AS (SELECT 3 WHERE count(*)) SELECT 0 FROM t2);
----
<REGEX>:Binder Error.*Aggregate with only constant.*in the root subquery.*
statement error
SELECT (WITH t2 AS (SELECT 3 WHERE count(*) FILTER (1)) SELECT 0 FROM t2);
----
<REGEX>:Binder Error.*Aggregate with only constant.*in the root subquery.*

View File

@@ -0,0 +1,16 @@
# name: test/fuzzer/pedro/multiplication_verification.test
# description: Issue #4567: Multiplication verification issue
# group: [pedro]
statement ok
PRAGMA enable_verification
statement error
SELECT 1 * (1 < 1);
----
<REGEX>:Binder Error.*No function matches.*
query I
SELECT 2 * (1 << 2);
----
8

View File

@@ -0,0 +1,29 @@
# name: test/fuzzer/pedro/nan_as_seed.test
# description: Issue #4984 (42): Nan as seed
# group: [pedro]
statement ok
create table test as select range i from range(10000)
foreach type FLOAT DOUBLE REAL
foreach val nan
statement error
SELECT setseed('${val}'::${type});
----
SETSEED accepts seed values
statement ok
SELECT setseed(0.5);
statement ok
SELECT 1, random();
statement ok
select * from test using sample 100;
endloop
endloop

View File

@@ -0,0 +1,25 @@
# name: test/fuzzer/pedro/natural_join_generated_heap_overflow.test
# description: Issue #4675: Natural join with generated column heap overflow
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t0 (c1 AS (1), c0 INT);
query I
SELECT 1 FROM t0 JOIN (SELECT 8) t1(c0) USING (c0);
----
query I
SELECT 1 FROM t0 NATURAL INNER JOIN (SELECT 8) t1(c0);
----
statement ok
INSERT INTO t0 VALUES (8)
query I
SELECT 1 FROM t0 NATURAL INNER JOIN (SELECT 8) t1(c0);
----
1

View File

@@ -0,0 +1,18 @@
# name: test/fuzzer/pedro/natural_join_index_out_of_range.test
# description: Natural join index out of range
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t0(c1 INT);
statement ok
CREATE TABLE t1(c0 INT, c2 INT);
statement ok
CREATE TABLE t2(c1 INT, c2 INT);
statement ok
SELECT 1 FROM t1 t2(c1) NATURAL RIGHT JOIN t0, t2 t1(c0) WHERE t2.c2 >= c0;

View File

@@ -0,0 +1,32 @@
# name: test/fuzzer/pedro/nested_limit_subquery.test
# description: Test correlated limit
# group: [pedro]
statement ok
PRAGMA enable_verification
query I
SELECT 1 FROM (SELECT 1) t0(c0) WHERE (SELECT c0);
----
1
query I
SELECT 1 FROM (SELECT 1) t0(c0) WHERE (SELECT (SELECT c0));
----
1
query I
SELECT 1 FROM (SELECT 1) t0(c0) WHERE (SELECT (SELECT 1 ORDER BY c0));
----
1
statement error
SELECT 1 FROM (SELECT 1) t0(c0) WHERE (SELECT 1 LIMIT c0);
----
Correlated columns not supported in LIMIT/OFFSET
statement error
SELECT 1 FROM (SELECT 1) t0(c0) WHERE (SELECT (SELECT 1 LIMIT c0));
----
Correlated columns not supported in LIMIT/OFFSET

View File

@@ -0,0 +1,22 @@
# name: test/fuzzer/pedro/nested_subquery_table_function.test
# description: Issue #4676: Subquery as Table UDF argument assertion error
# group: [pedro]
statement ok
PRAGMA enable_verification
query I
SELECT 1 FROM range((SELECT 1) - 0);
----
1
query I
SELECT (SELECT 1 FROM range((SELECT 1) - 0));
----
1
query I
FROM range((SELECT 3) - 1)
----
0
1

View File

@@ -0,0 +1,16 @@
# name: test/fuzzer/pedro/non_boolean_aggregate_filter.test
# description: Issue #4570: Non-boolean aggregate filter
# group: [pedro]
statement ok
PRAGMA enable_verification
query I
SELECT mode(1) FILTER (0);
----
NULL
query II
SELECT SUM(i), SUM(i) FILTER (i%2) FROM range(10) tbl(i);
----
45 25

View File

@@ -0,0 +1,16 @@
# name: test/fuzzer/pedro/offset_query_allocator_assertion.test
# description: Issue #4576: OFFSET query taking too long
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t0 (c0 INT, c1 INT);
statement ok
INSERT INTO t0 (VALUES (1, 1),(2, 2),(3, 3));
query I
SELECT c0 FROM t0 OFFSET 42949672960;
----

View File

@@ -0,0 +1,12 @@
# name: test/fuzzer/pedro/order_by_all_with_union.test
# group: [pedro]
statement ok
PRAGMA enable_verification
query I
(SELECT 2 ORDER BY(SELECT 2)) UNION SELECT 1 ORDER BY ALL;
----
1
2

View File

@@ -0,0 +1,26 @@
# name: test/fuzzer/pedro/overflow_parsing_interval.test
# group: [pedro]
statement ok
PRAGMA enable_verification
# Parsing as a double loses prcision
query I
SELECT INTERVAL '-9223372036854775808' MICROSECONDS;
----
-2562047788:00:54.775808
query I
SELECT INTERVAL '-9223372036854775807' MICROSECONDS;
----
-2562047788:00:54.775808
statement error
SELECT INTERVAL '9223372036854775296' MICROSECONDS;
----
the value is out of range for the destination type
query I
SELECT INTERVAL '9223372036854775295' MICROSECONDS;
----
2562047788:00:54.774784

View File

@@ -0,0 +1,25 @@
# name: test/fuzzer/pedro/overflow_varchar_decimal_cast.test
# group: [pedro]
statement ok
PRAGMA enable_verification
statement error
SELECT CAST(strftime(TIMESTAMP '1-1-1 0:00:00',340282346638528859811704183484516925440.0) AS DECIMAL(10,2));
----
<REGEX>:Binder Error.*No function matches.*add explicit type casts.*
query I
SELECT '552.123242346e+11'::DECIMAL;
----
55212324234600.000
query I
SELECT '-3.4028234663852886e+16'::DECIMAL(30);
----
-34028234663852886
statement error
SELECT '-3.4028234663852886e+38'::DECIMAL;
----
<REGEX>:Conversion Error.*Could not convert string.*to DECIMAL.*

View File

@@ -0,0 +1,46 @@
# name: test/fuzzer/pedro/parser_roundtrip.test
# description: Failed parser round-trip verification
# group: [pedro]
statement ok
PRAGMA enable_verification
query I
SELECT BLOB '\x27'
----
\x27
statement ok
SELECT "/"(42, 84);
statement ok
SELECT "x-x"."y-y" FROM (SELECT 42) AS "x-x"("y-y");
# FIXME: explicit cross joins not rendered correctly (yet)
mode skip
query I
SELECT 1 FROM ((SELECT 2) t0(c0) JOIN (SELECT 3) t1(c0) ON TRUE), ((SELECT 4) t2(c0) JOIN ((SELECT 5) t3(c0) CROSS JOIN (SELECT 6) t4(c0)) ON TRUE);
----
1
mode unskip
query I
SELECT CAST('1' COLLATE "nocase" AS INT);
----
1
statement ok
CREATE TABLE t0(c0 INT);
statement ok
INSERT INTO t0 VALUES (42);
statement ok
UPDATE t0 SET c0 = (~1);
query I
SELECT * FROM t0
----
-2

View File

@@ -0,0 +1,23 @@
# name: test/fuzzer/pedro/prepared_statement_recursive_cte.test
# description: Issue #4681: Prepared statement recursive CTE heap-use-after-free
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
PREPARE p0 AS WITH RECURSIVE t1(c2) AS ((SELECT 1) UNION DISTINCT (SELECT (c2 + 1) FROM t1 WHERE (c2 < 3))) SELECT * FROM t1 ORDER BY c2 NULLS LAST;
query I
EXECUTE p0;
----
1
2
3
query I
EXECUTE p0;
----
1
2
3

View File

@@ -0,0 +1,22 @@
# name: test/fuzzer/pedro/pushdown_assertion_error.test
# description: Use complex types in ALL clause
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t2 (c2 INT);
statement ok
CREATE SEQUENCE t0;
statement error
SELECT 1 FROM t2 WHERE currval('t0') BETWEEN TRY_CAST(0 AS TIMESTAMP WITH TIME ZONE) AND 1;
----
explicit cast is required
statement error
SELECT 1 FROM t2 WHERE currval('t0') BETWEEN TRY_CAST(0 AS TIMESTAMP WITH TIME ZONE) AND -156587962151166338620429995158284936977;
----
explicit cast is required

View File

@@ -0,0 +1,36 @@
# name: test/fuzzer/pedro/pushdown_error.test
# description: WAL cannot alter table
# group: [pedro]
# fuzzer
statement ok
PRAGMA enable_verification
load __TEST_DIR__/wal_crash.db
statement ok
CREATE TABLE t2(c1 INT);
statement ok
CREATE INDEX i0 ON t2(c1);
statement ok
CHECKPOINT;
statement ok
SET wal_autocheckpoint='1TB';
statement ok
PRAGMA disable_checkpoint_on_shutdown;
statement ok
DROP INDEX i0;
statement ok
ALTER TABLE t2 ALTER c1 SET DEFAULT 0;
restart
query I
SELECT * FROM t2;

View File

@@ -0,0 +1,34 @@
# name: test/fuzzer/pedro/pushdown_simplification_overflow.test
# description: Blob wrong optimization
# group: [pedro]
#statement ok
#PRAGMA enable_verification;
statement ok
CREATE TABLE t1(c0 INT);
statement ok
INSERT INTO t1(c0) VALUES (1),(2),(3);
query I
SELECT 1 FROM t1;
----
1
1
1
statement error
SELECT 1 FROM t1 WHERE -9223372036854775808 >= (6892203265207104503 - (-7595956987701092486));
----
Overflow
statement error
SELECT 1 FROM t1 WHERE NOT (-9223372036854775808 >= (6892203265207104503 - (-7595956987701092486)));
----
Overflow
statement error
SELECT 1 FROM t1 WHERE (-9223372036854775808 >= (6892203265207104503 - (-7595956987701092486))) IS NULL;
----
Overflow

View File

@@ -0,0 +1,36 @@
# name: test/fuzzer/pedro/qualify_binder_error.test
# description: Qualify clause binder error
# group: [pedro]
statement ok
PRAGMA enable_verification
query II
SELECT c0, count(c0) over () AS count_window FROM (SELECT 1) t0(c0) GROUP BY c0 QUALIFY count_window;
----
1 1
query I
SELECT * FROM (SELECT 1) t0(c0) GROUP BY c0 QUALIFY count(c0) OVER ();
----
1
statement error
SELECT * FROM (SELECT 1) t0(c0) GROUP BY ALL QUALIFY count(c0) OVER ();
----
Combining QUALIFY with GROUP BY ALL is not supported yet
statement error
SELECT 1 FROM (SELECT 2) t0(c0) QUALIFY (c0, dense_rank() OVER(), mode(0));
----
Cannot mix aggregates with non-aggregated columns
query I
SELECT 1 FROM (SELECT 2) t0(c0) QUALIFY (count(sum(42)) OVER());
----
1
query I
SELECT 1 FROM (SELECT 2) t0(c0) QUALIFY (count(sum(c0)) OVER());
----
1

View File

@@ -0,0 +1,16 @@
# name: test/fuzzer/pedro/random_engine_use_after_free.test
# description: Random engine heap use after free
# group: [pedro]
load __TEST_DIR__/random_engine_use_after_free.db
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t1 (c0 INT CHECK (current_schema()='main'));
restart
statement ok
INSERT INTO t1 VALUES(0);

View File

@@ -0,0 +1,11 @@
# name: test/fuzzer/pedro/recursive_cte_dependent_join.test
# description: Issue #4679: Recursive CTE dependent join internal error
# group: [pedro]
statement ok
PRAGMA enable_verification
query I
SELECT (WITH RECURSIVE t1 AS (SELECT 1 UNION SELECT 1 FROM t1 WHERE c2 < 3) SELECT 2 FROM t1) FROM (SELECT 1 c2) t1;
----
2

View File

@@ -0,0 +1,16 @@
# name: test/fuzzer/pedro/recursive_cte_limit_percent.test
# description: Recursive CTE error
# group: [pedro]
statement ok
PRAGMA enable_verification
query I
WITH RECURSIVE t1(c0) AS ((SELECT 1, 1 c1) UNION (SELECT 1, 1 FROM (SELECT 1) x(x) JOIN t1 ON FALSE LIMIT 1%)) SELECT 1 FROM t1 JOIN t1 t0 USING (c1);
----
1
query I
WITH RECURSIVE t1(c0) AS ((SELECT 1, 1 c1) UNION (SELECT 1, 1 FROM (SELECT 1) x(x) JOIN t1 ON FALSE LIMIT 1)) SELECT 1 FROM t1 JOIN t1 t0 USING (c1);
----
1

View File

@@ -0,0 +1,12 @@
# name: test/fuzzer/pedro/regr_count_validity.test
# description: Recursive CTE error
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t0 (c0 INT);
statement ok
SELECT regr_count(1,1) FROM t0;

View File

@@ -0,0 +1,29 @@
# name: test/fuzzer/pedro/rename_column_assertion.test
# description: Assertion trigger on rename column
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t1 (c1 INT, c2 INT);
statement ok
CREATE INDEX i0 ON t1 (c2);
statement ok
START TRANSACTION;
statement error
ALTER TABLE t1 ALTER c2 DROP NOT NULL;
----
Cannot alter entry
statement error
ALTER TABLE t1 RENAME c1 TO c3;
----
transaction is aborted
statement ok
ROLLBACK;

View File

@@ -0,0 +1,30 @@
# name: test/fuzzer/pedro/rename_restart.test
# description: Rename table restart
# group: [pedro]
load __TEST_DIR__/rename_restart.db
statement ok
SET wal_autocheckpoint='10MB';
statement ok
CREATE TABLE t0(c0 INT);
statement ok
CREATE VIEW t1 AS SELECT 1 c0;
statement ok
CREATE INDEX i1 ON t0(c0);
statement error
ALTER TABLE t0 RENAME TO t1;
----
t1
statement ok
CHECKPOINT;
restart
statement ok
select 42

Some files were not shown because too many files have changed in this diff Show More