Skip to content

Commit

Permalink
comment: add test comment
Browse files Browse the repository at this point in the history
  • Loading branch information
kysshsy committed Oct 4, 2024
1 parent 95bf491 commit f08ae75
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()?;
Expand All @@ -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);

Expand Down

0 comments on commit f08ae75

Please sign in to comment.