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,53 @@
# name: test/sql/select/test_positional_reference.test
# description: Positional reference
# group: [select]
statement ok
PRAGMA enable_verification
query I
SELECT #1 FROM range(1)
----
0
# multiple tables
query I
SELECT #1+#2 FROM range(1) tbl, range(1) tbl2
----
0
# subqueries
query I
SELECT #1 FROM (SELECT * FROM range(1)) tbl
----
0
# positional references only consider the inner-most table
statement error
select (select #1) from range(1);
----
<REGEX>:.*Binder Error.*out of range.*
# out of range
statement error
SELECT #2 FROM range(1)
----
<REGEX>:.*Binder Error.*out of range.*
# no from clause
statement error
SELECT #1
----
<REGEX>:.*Binder Error.*out of range.*
# zero always fails
statement error
SELECT #0 FROM range(1)
----
<REGEX>:.*Parser Error.*Positional reference node needs.*
# as do negative numbers
statement error
SELECT #-1 FROM range(1)
----
<REGEX>:.*Parser Error.*syntax error.*