Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Many to many parent_id to child_id mapping should rely on coerced values #2928

Closed
JingLi1998 opened this issue May 17, 2022 · 1 comment
Closed

Comments

@JingLi1998
Copy link

Currently the query engine is broken for m2m relationships when using bigint as the primary key. Related issue

The culprit seems to be an inconsistent usage of coerced and non-coerced values when inserting and getting values from the id_map variable.

let mut id_map: HashMap<SelectionResult, Vec<SelectionResult>> = HashMap::new();
for (parent_id, child_id) in ids {
match id_map.get_mut(&child_id) {
Some(v) => v.push(parent_id),
None => {
id_map.insert(child_id.coerce_values()?, vec![parent_id.coerce_values()?]);
}
};
}

@Weakky
Copy link
Member

Weakky commented Aug 18, 2022

Hey @JingLi1998,

The original issue was closed a while ago and we just realized you had posted a PR for it. Sorry we didn't see your PR earlier 🙏

Please re-open if you think it's still an issue.

Thanks!

@Weakky Weakky closed this as completed Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants