fix import

main
Ziyang Hu 2 years ago
parent f82254b843
commit 064ded8d53

@ -245,8 +245,8 @@ impl<'s, S: Storage<'s>> Db<S> {
.iter() .iter()
.map(proc_col) .map(proc_col)
.try_collect()?; .try_collect()?;
let v_store = let v_store = handle
handle.encode_val_for_store(&Tuple(vals), Default::default())?; .encode_val_only_for_store(&Tuple(vals), Default::default())?;
tx.tx.put(&k_store, &v_store)?; tx.tx.put(&k_store, &v_store)?;
} }
} }
@ -340,8 +340,8 @@ impl<'s, S: Storage<'s>> Db<S> {
col.typing.coerce(DataValue::from(v)) col.typing.coerce(DataValue::from(v))
}) })
.try_collect()?; .try_collect()?;
let v_store = let v_store = handle
handle.encode_val_for_store(&Tuple(vals), Default::default())?; .encode_val_only_for_store(&Tuple(vals), Default::default())?;
tx.tx.put(&k_store, &v_store)?; tx.tx.put(&k_store, &v_store)?;
} }
} }

@ -149,6 +149,15 @@ impl RelationHandle {
.unwrap(); .unwrap();
Ok(ret) Ok(ret)
} }
pub(crate) fn encode_val_only_for_store(
&self,
tuple: &Tuple,
_span: SourceSpan,
) -> Result<Vec<u8>> {
let mut ret = self.encode_key_prefix(tuple.0.len());
tuple.0.serialize(&mut Serializer::new(&mut ret)).unwrap();
Ok(ret)
}
pub(crate) fn ensure_compatible(&self, inp: &InputRelationHandle) -> Result<()> { pub(crate) fn ensure_compatible(&self, inp: &InputRelationHandle) -> Result<()> {
let InputRelationHandle { metadata, .. } = inp; let InputRelationHandle { metadata, .. } = inp;
// check that every given key is found and compatible // check that every given key is found and compatible

Loading…
Cancel
Save