Open mikhalov opened 2 months ago
Hi,
Thanks to report this, will check it.
@tglman Checked the fix in the new release, but one case is still failing:
@Test
void newApiVariable() {
String query = """
select $path.out('Owns')[0].name as name from (
select $current as person
from (select from Person where name = 'John Doe')
)
let
$person = person,
$path = (traverse out('Owns') from $current.$person)""";
try (OResultSet resultSet = db.query(query)) {
assertTrue(resultSet.hasNext());
while (resultSet.hasNext()) {
System.out.println(resultSet.next().toJSON());
}
}
}
com.orientechnologies.orient.core.exception.OCommandExecutionException: Cannot use variable as query target: $current.$person
Hi,
Did you try to just use $person
as target ?
Regards
@tglman, hi I tried, but I'm still getting an exception, even with the test I shared above.
OrientDB Version: 3.2.32 Java Version: 17 OS: Windows
After the fix https://github.com/orientechnologies/orientdb/issues/10281, several new bugs were discovered:
First Bug: It is still impossible to access a variable or result in the context using $current as was possible in the old API.
Second Bug: There is a bug when trying to access the result of a traversal using $path.out('Owns'). Specifically, the issue occurs when you attempt to reference the out('Owns') on the result of the traverse operation stored in the $path variable. This causes an error and does not work as expected.
Also, I am including tests for both bugs using the old and new APIs: