Skip to content

Commit a978be6

Browse files
committed
store: Skip null values in fulltext field reconstruction
When inserting rows with fulltext search columns, null source field values caused "fulltext fields must be strings but got Null" errors. Filter out null values the same way missing fields are already filtered, since a null field shouldn't contribute to the fulltext index.
1 parent 314ba71 commit a978be6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

store/postgres/src/relational_queries.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2318,7 +2318,7 @@ impl<'a> InsertRow<'a> {
23182318
let iv = if let Some(fields) = column.fulltext_fields.as_ref() {
23192319
let fulltext_field_values: Vec<_> = fields
23202320
.iter()
2321-
.filter_map(|field| row.entity.get(field))
2321+
.filter_map(|field| row.entity.get(field).filter(|v| !v.is_null()))
23222322
.map(|value| match value {
23232323
Value::String(s) => Ok(s),
23242324
_ => Err(internal_error!(
@@ -2378,6 +2378,7 @@ impl<'a> InsertRow<'a> {
23782378
.iter()
23792379
.find(|(w, _)| w.as_str() == src_col.name.as_str())
23802380
.map(|(_, v)| v)
2381+
.filter(|v| !v.is_null())
23812382
})
23822383
})
23832384
.map(|value| match value {

0 commit comments

Comments
 (0)