memgraph / mage

MAGE - Memgraph Advanced Graph Extensions :crystal_ball:
Apache License 2.0
244 stars 24 forks source link

[BUG] Iterator inconsistency #380

Open antejavor opened 10 months ago

antejavor commented 10 months ago

TODO: Check into the more details why is this happening, something with iterator copy.

Describe the bug

    auto nodes = g.Nodes();

    auto it = nodes.begin();
    while (it != nodes.end()) {
        mgp::Node node = *it;
      // Fail in this case (copy operation) 
      // it++; 16:47:17.821][Error]Unexpected error during mg API call: std::visit: variant is valueless
     // works 
     ++it;
}

Expected behavior I think this should be consistent in both cases when working with iterators or properly documented.