Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add test for multi-page result. #403

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions driver/tests/driver/select_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,23 @@ async fn select_numbers() {
assert_eq!(ret, vec![0, 1, 2, 3, 4]);
}

#[tokio::test]
async fn select_multi_page() {
let (conn, _) = prepare("select_multi_page").await;
// default page size is 10000
let n = 46000;
let sql = format!("select * from NUMBERS({n}) order by number");
let rows = conn.query_iter(&sql).await.unwrap();
let ret: Vec<u64> = rows
.map(|r| r.unwrap().try_into().unwrap())
.collect::<Vec<(u64,)>>()
.await
.into_iter()
.map(|r| r.0)
.collect();
assert_eq!(ret, (0..n).collect::<Vec<u64>>());
}

#[tokio::test]
async fn select_sleep() {
let (conn, _) = prepare("select_sleep").await;
Expand Down