mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-22 07:09:20 +08:00
Handles NULL generate_series params via defaults
This commit is contained in:
parent
379c6c8dcf
commit
256cfdd311
@ -200,19 +200,19 @@ unsafe impl VTabCursor for SeriesTabCursor<'_> {
|
|||||||
let mut idx_num = QueryPlanFlags::from_bits_truncate(idx_num);
|
let mut idx_num = QueryPlanFlags::from_bits_truncate(idx_num);
|
||||||
let mut i = 0;
|
let mut i = 0;
|
||||||
if idx_num.contains(QueryPlanFlags::START) {
|
if idx_num.contains(QueryPlanFlags::START) {
|
||||||
self.min_value = args.get(i)?;
|
self.min_value = args.get::<Option<_>>(i)?.unwrap_or_default();
|
||||||
i += 1;
|
i += 1;
|
||||||
} else {
|
} else {
|
||||||
self.min_value = 0;
|
self.min_value = 0;
|
||||||
}
|
}
|
||||||
if idx_num.contains(QueryPlanFlags::STOP) {
|
if idx_num.contains(QueryPlanFlags::STOP) {
|
||||||
self.max_value = args.get(i)?;
|
self.max_value = args.get::<Option<_>>(i)?.unwrap_or_default();
|
||||||
i += 1;
|
i += 1;
|
||||||
} else {
|
} else {
|
||||||
self.max_value = 0xffff_ffff;
|
self.max_value = 0xffff_ffff;
|
||||||
}
|
}
|
||||||
if idx_num.contains(QueryPlanFlags::STEP) {
|
if idx_num.contains(QueryPlanFlags::STEP) {
|
||||||
self.step = args.get(i)?;
|
self.step = args.get::<Option<_>>(i)?.unwrap_or_default();
|
||||||
if self.step == 0 {
|
if self.step == 0 {
|
||||||
self.step = 1;
|
self.step = 1;
|
||||||
} else if self.step < 0 {
|
} else if self.step < 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user