Skip to content

Commit ad32575

Browse files
committed
Only reduce IN predicate if value is provided
1 parent da87320 commit ad32575

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/expr.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
use crate::{geometry::spatial_op, temporal::temporal_op, Error, Geometry, Validator};
2-
use geo_types::Geometry as GGeom;
3-
use geo_types::{coord, Rect};
2+
use geo_types::{coord, Geometry as GGeom, Rect};
43
use json_dotpath::DotPaths;
54
use like::Like;
65
use pg_escape::{quote_identifier, quote_literal};
76
use serde::{Deserialize, Serialize};
87
use serde_json::Value;
9-
use std::collections::HashSet;
10-
use std::fmt::Debug;
11-
use std::ops::{Add, Deref};
12-
use std::str::FromStr;
8+
use std::{
9+
collections::HashSet,
10+
fmt::Debug,
11+
ops::{Add, Deref},
12+
str::FromStr,
13+
};
1314
use unaccent::unaccent;
1415
use wkt::TryFromWkt;
1516

@@ -451,6 +452,9 @@ impl Expr {
451452
Ok(Expr::Operation { op, args })
452453
}
453454
} else if op == "in" {
455+
let Some(_) = j else {
456+
return Ok(Expr::Operation { op, args })
457+
};
454458
let l: String = left.to_text()?;
455459
let r: HashSet<String> = right.try_into()?;
456460
let isin: bool = r.contains(&l);

0 commit comments

Comments
 (0)