From 14247e71e1ce256d595cd233eb5b3c7661b1427c Mon Sep 17 00:00:00 2001 From: Yang Xiufeng Date: Mon, 22 Apr 2024 16:37:44 +0800 Subject: [PATCH] ci: add tests for multi page result. --- driver/tests/driver/select_iter.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/driver/tests/driver/select_iter.rs b/driver/tests/driver/select_iter.rs index 33c1cfee..4178ba73 100644 --- a/driver/tests/driver/select_iter.rs +++ b/driver/tests/driver/select_iter.rs @@ -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 = rows + .map(|r| r.unwrap().try_into().unwrap()) + .collect::>() + .await + .into_iter() + .map(|r| r.0) + .collect(); + assert_eq!(ret, (0..n).collect::>()); +} + #[tokio::test] async fn select_sleep() { let (conn, _) = prepare("select_sleep").await;