GeezerVison is showing github.com — Comparisons with `schema:types` properties inside `if` are incorrect · Issue #986 · ArcadeData/arcadedb
Comparisons with schema:types properties inside if are incorrect #986DescriptionArcadeDB Version: 23.2.1 (build e8f512f/1677638572021/main)
JDK Version: openjdk 11.0.18 2023-01-17
OS: MacOS 12.6
When using comparison against the name property of schema:types inside a (conditional) expression, wrong logical results are returned.
Expected behavior
'doc' true true true true
Actual behavior
'doc' true false false false
Steps to reproduce
CREATE DOCUMENT TYPE doc;
SELECT name, (name = 'doc'),
if( (name = 'doc'), true, false),
if( (name IN ['doc','XXX']), true, false),
ifnull( (name = 'doc'), null)
FROM schema:types
Activitychanged the title [-]Comparisons with `schema:type` properties inside `if` are incorrect[/-] [+]Comparisons with `schema:types` properties inside `if` are incorrect[/+] on Mar 31, 2023lvca commented on Mar 31, 2023 Trying to reproduce this without success:
@Test
public void testIfWithSchemaResult() throws IOException {
Assertions.assertTrue(console.parse("connect " + URL));
Assertions.assertTrue(console.parse("CREATE DOCUMENT TYPE doc;"));
Assertions.assertTrue(console.parse("CREATE PROPERTY doc.prop STRING;"));
Assertions.assertTrue(console.parse("INSERT INTO doc set name = 'doc'"));
final ResultSet resultSet = console.getDatabase().command("sql",
"SELECT name, (name = 'doc') as name2, if( (name = 'doc'), true, false) as name3, if( (name IN ['doc','XXX']), true, false) as name4, ifnull( (name = 'doc'), null) as name5 FROM schema:types");
Assertions.assertTrue(resultSet.hasNext());
final Result result = resultSet.next();
Assertions.assertEquals("doc", result.getProperty("name"));
Assertions.assertTrue((boolean) result.getProperty("name2"));
Assertions.assertTrue((boolean) result.getProperty("name3"));
Assertions.assertTrue((boolean) result.getProperty("name4"));
Assertions.assertTrue((boolean) result.getProperty("name5"));
}gramian commented on Mar 31, 2023 CollaboratorAuthor More actions I found this using 23.2.1 in Studio. I just tested the repo head with Studio and Console and it works.
Sorry, I should have also tested right away on the current head. lvca commented on Mar 31, 2023 Np, the test case now is in our test suite so we'll avoid any regression on this.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|