mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-22 06:00:33 +08:00
Tests that NULL parameters to generate_series return no rows
This commit is contained in:
parent
3fe9a7f2cd
commit
84362c02c6
@ -316,6 +316,16 @@ mod test {
|
|||||||
let series: Vec<i32> = s.query([])?.map(|r| r.get(0)).collect()?;
|
let series: Vec<i32> = s.query([])?.map(|r| r.get(0)).collect()?;
|
||||||
assert_eq!(vec![30, 25, 20, 15, 10, 5, 0], series);
|
assert_eq!(vec![30, 25, 20, 15, 10, 5, 0], series);
|
||||||
|
|
||||||
|
let mut s = db.prepare("SELECT * FROM generate_series(NULL)")?;
|
||||||
|
let series: Vec<i32> = s.query([])?.map(|r| r.get(0)).collect()?;
|
||||||
|
assert_eq!(Vec::<i32>::new(), series);
|
||||||
|
let mut s = db.prepare("SELECT * FROM generate_series(5,NULL)")?;
|
||||||
|
let series: Vec<i32> = s.query([])?.map(|r| r.get(0)).collect()?;
|
||||||
|
assert_eq!(Vec::<i32>::new(), series);
|
||||||
|
let mut s = db.prepare("SELECT * FROM generate_series(5,10,NULL)")?;
|
||||||
|
let series: Vec<i32> = s.query([])?.map(|r| r.get(0)).collect()?;
|
||||||
|
assert_eq!(Vec::<i32>::new(), series);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user