From 663586b8d07c979218ceff79576bb549ee1973c5 Mon Sep 17 00:00:00 2001 From: Marcos Magueta Date: Mon, 22 Jun 2026 21:58:54 -0300 Subject: Ephemeral relations --- src/CursorManager.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/CursorManager.cpp') diff --git a/src/CursorManager.cpp b/src/CursorManager.cpp index 0d71b1c..23f826f 100644 --- a/src/CursorManager.cpp +++ b/src/CursorManager.cpp @@ -61,17 +61,18 @@ namespace nt { }; if (label == EPHEMERAL_RELATION) { - // Cursor is created exhausted — the JOIN operator writes args and - // resets the state before the first probe. The generator is copied - // off the registry-owned ephemeral_object_type so Next() never has - // to dereference the handle again. + // Cursor opens ready for a standalone scan (no bound args, offset + // zero) so a named ephemeral can be drained like a stored relation. + // A JOIN probe overwrites this state anyway: the operator writes + // args and resets the cursor before the first probe. The generator + // is copied off the registry-owned ephemeral_object_type so Next() + // never has to dereference the handle again. auto* etype = static_cast( handle->object->head->type.get()); auto* c = new cursor(); c->is_ephemeral = true; c->generator = etype->generator; - c->exhausted = true; pin_snapshot(c); return c; } -- cgit v1.2.3