Skip to content

Commit

Permalink
fix table function error in madsim + fix postgres_query tvf test
Browse files Browse the repository at this point in the history
  • Loading branch information
kwannoel committed Oct 8, 2024
1 parent 3967bad commit ad7db51
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions e2e_test/source/tvf/postgres_query.slt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
system ok
PGHOST=db PGPORT=5432 PGUSER=postgres PGPASSWORD=postgres PGDATABASE=postgres_query psql -c "CREATE TABLE test (id bigint primary key, x int);"
PGHOST=db PGPORT=5432 PGUSER=postgres PGPASSWORD=postgres PGDATABASE=cdc_test psql -c "CREATE TABLE test (id bigint primary key, x int);"

system ok
PGHOST=db PGPORT=5432 PGUSER=postgres PGPASSWORD=postgres PGDATABASE=postgres_query psql -c "INSERT INTO test select id, id::int from generate_series(1, 100) as t(id);"
PGHOST=db PGPORT=5432 PGUSER=postgres PGPASSWORD=postgres PGDATABASE=cdc_test psql -c "INSERT INTO test select id, id::int from generate_series(1, 100) as t(id);"

query II
select * from postgres_scan('db', '5432', 'postgres', 'postgres', 'postgres_query', 'select * from test where id > 90;');
select * from postgres_query('db', '5432', 'postgres', 'postgres', 'cdc_test', 'select * from test where id > 90;');
----
3 changes: 2 additions & 1 deletion src/frontend/src/expr/table_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ impl TableFunction {
{
return Err(crate::error::ErrorCode::BindError(
"table_scan can't be used in the madsim mode".to_string(),
));
)
.into());
}

#[cfg(not(madsim))]
Expand Down

0 comments on commit ad7db51

Please sign in to comment.