File: recursive_view_expression_assertion.test

package info (click to toggle)
duckdb 1.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 299,196 kB
  • sloc: cpp: 865,414; ansic: 57,292; python: 18,871; sql: 12,663; lisp: 11,751; yacc: 7,412; lex: 1,682; sh: 747; makefile: 558
file content (20 lines) | stat: -rw-r--r-- 733 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# name: test/issues/fuzz/recursive_view_expression_assertion.test
# description: Issue #3354: Assertion Failed at expression_iterator.cpp:187
# group: [fuzz]

statement ok
PRAGMA enable_verification

statement ok
PRAGMA threads=1

statement ok
create view strings as (with recursive t(a) as (select 1 union select a+1 from t where a < 3) select * from t order by a);

# this is the original issue #3354 bug
statement ok
SELECT a, (SELECT a FROM strings i2 WHERE a=(SELECT SUM(a) FROM strings i2 WHERE i2.a>i1.a)) FROM strings i1 ORDER BY 1;

# related issue #4445 bug
statement ok
SELECT a, (SELECT a FROM strings i2 RIGHT JOIN (SELECT SUM(a) sum_a FROM strings i2 WHERE i2.a>i1.a) sq ON i2.a = sq.sum_a) FROM strings i1 ORDER BY 1;