orientechnologies / orientechnologies/orientdb

"LET" variables don't work in "eval"

Open
#9,738 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

OrientDB Version: 3.2.3
Java Version: openjdk version "1.8.0_302"
OS: Debian GNU/Linux 10 (buster)

Expected behavior

orientdb v2.2.31

> SELECT description, if(eval("description=='test'"),1,0) AS D1, if(eval("$dsc=='test'"),1,0) AS D2 FROM #2785:0 LET $dsc = description

+----+-----------+----+----+
|#   |description|D1  |D2  |
+----+-----------+----+----+
|0   |test       |1   |1   |
+----+-----------+----+----+

Actual behavior

orientdb v3.2.3

+----+-----------+----+----+
|#   |description|D1  |D2  |
+----+-----------+----+----+
|0   |test       |1   |0   |
+----+-----------+----+----+  

I am in the process of migrating my database.
This same query produces a different result between v2.2 and v3.2
Is this a bug?
Thank you

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.

Research direction

Start by running the provided SELECT query with LET and eval against OrientDB 3.2.3, then compare its result with OrientDB 2.2.31. Trace the query's LET-variable and eval handling to determine whether the version difference is unintended; done means restoring the expected D2 result or documenting the incompatibility with a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.