orientechnologies / orientechnologies/orientdb

Cannot use variable as query target: $current DB name="test"

Open
#9,689 4 comments 0 reactions 1 assignee View on GitHub

@luigidellaquila is already working on this.

Since Oct 6, 2021.

Dominant language
Java
Stars
5k
Forks
868
Avg merge
15h 6m
Merged PRs (30d)
18

Description

OrientDB Version: 3.2.2, same behavior with latest 3.0 and 3.1
Java Version: Java 8
OS: Linux (docker image)

Expected behavior

The query below successfully executes and returns empty result set on the empty DB - as was exhibited by OrientDB 2.2.x series.

Current SQL documentation puts no restrictions on the usage of the variables as query targets.

Actual behavior

The query below fails with

com.orientechnologies.orient.core.exception.OCommandExecutionException: 
     Cannot use variable as query target: $current DB name="test"

Steps to reproduce

  • Create new database with the OrientDB Studio
  • Execute following query
select $t from (select from v)
let
  $t = (select from $current)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.