1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
# name: test/sql/prepared/invalid_prepare.test
# description: Test invalid prepare statements
# group: [prepared]
# cannot execute a statement with prepared statement parameters
statement error
select ?;
----
# cannot create a view with prepared statement parameters
statement error
create view v1 as select ?;
----
# start with a higher index than 1
statement ok
prepare v1 as select $2::int;
statement error
execute v1(0);
----
# cannot cast from varchar to int
statement ok
prepare v2 as select $1::int;
statement error
execute v2('hello');
----
statement ok
prepare v3 as select $1::int where 1=0;
statement ok
execute v3(1);
|