goldmedal commented on code in PR #13327: URL: https://github.com/apache/datafusion/pull/13327#discussion_r1835701840
########## datafusion/sqllogictest/test_files/prepare.slt: ########## @@ -77,6 +81,28 @@ EXECUTE my_plan('Foo', 'Bar'); statement error Prepared statement \'my_plan\' already exists PREPARE my_plan(STRING, STRING) AS SELECT * FROM (VALUES(1, $1), (2, $2)) AS t (num, letter); +# deallocate a plan +statement ok +DEALLOCATE my_plan; + +# can't EXECUTE a deallocated plan +statement error Prepared statement \'my_plan\' does not exist +EXECUTE my_plan('Foo', 'Bar'); + +# re-prepare a deallocated plan +statement ok +PREPARE my_plan(STRING, STRING) AS SELECT * FROM (VALUES(1, $1), (2, $2)) AS t (num, letter); + +query IT +EXECUTE my_plan('Foo', 'Bar'); +---- +1 Foo +2 Bar + +# deallocate with the PREPARE keyword +statement ok +DEALLOCATE PREPARE my_plan; + Review Comment: Hmmm, I rethink it. I think we should test it to be deallocated and re-prepare again. Let's keep your version 👍 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org