Skip to content

bug: running a query with $slot bind tokens through execute() reports an internal error (INT-025) #407

Closed

Description

@adityamukho

Summary

A query that uses $slot bind tokens is meant for prepare(). When it goes through execute() (or the REPL), the user gets an internal error that sounds like an engine bug:

(query [:find ?status
        :as-of $tx
        :valid-at $date
        :where [$entity :employment/status ?status]])
;; => Error: [INT-025] internal: unsubstituted :valid-at bind slot reached the executor

This example is copied from the wiki Datalog Reference (prepared queries section).

Expected

A clear user error with an API or parser code, for example: "query contains bind slots ($tx, $date, $entity); use db.prepare(...) and execute it with bind values". It should be raised before execution, in execute() or the parser. INT-0xx codes are for "should never happen" cases.

Notes

This does not change behavior; only the error code and message change. Add the new code to docs/ERROR_REFERENCE.md.

Found while checking the wiki examples; see #383.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions