From f08ae751a88c0d82d4f2429b6ac9b32e3eb421ad Mon Sep 17 00:00:00 2001 From: kysshsy Date: Fri, 4 Oct 2024 23:34:03 +0800 Subject: [PATCH] comment: add test comment --- tests/scan.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/scan.rs b/tests/scan.rs index c75155a9..bbe70e7e 100644 --- a/tests/scan.rs +++ b/tests/scan.rs @@ -593,6 +593,11 @@ async fn test_prepare_stmt_execute(#[future(awt)] s3: S3, mut conn: PgConnection Ok(()) } +// Note: PostgreSQL will replan the query when certain catalog changes occur, +// such as changes to the search path or when a table is deleted. +// In contrast, DuckDB does not replan when the search path is changed. +// If there are two foreign tables in different schemas and the prepared statements do not specify the schemas, +// it may lead to ambiguity or errors when referencing the tables. #[rstest] async fn test_prepare_search_path(mut conn: PgConnection, tempdir: TempDir) -> Result<()> { let stored_batch = primitive_record_batch()?; @@ -612,6 +617,8 @@ async fn test_prepare_search_path(mut conn: PgConnection, tempdir: TempDir) -> R writer.write(&stored_batch_less)?; writer.close()?; + // In this example, we create two tables with identical structures and names, but in different schemas. + // We expect that when the search path is changed, the correct table (the one in the current schema) will be referenced in DuckDB. "CREATE SCHEMA tpch1".execute(&mut conn); "CREATE SCHEMA tpch2".execute(&mut conn);