{"action":"opened","issue":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4530","labels_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4530/labels{/name}","comments_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4530/comments","events_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4530/events","html_url":"https://github.com/orientechnologies/orientdb/issues/4530","id":93749338,"number":4530,"title":"Select query with \"=\" in where clause gives different results than \"in\" clause even if the subquery returns exactly one record","user":{"login":"nagarajasr","id":7237012,"avatar_url":"https://avatars.githubusercontent.com/u/7237012?v=3","gravatar_id":"","url":"https://api.github.com/users/nagarajasr","html_url":"https://github.com/nagarajasr","followers_url":"https://api.github.com/users/nagarajasr/followers","following_url":"https://api.github.com/users/nagarajasr/following{/other_user}","gists_url":"https://api.github.com/users/nagarajasr/gists{/gist_id}","starred_url":"https://api.github.com/users/nagarajasr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nagarajasr/subscriptions","organizations_url":"https://api.github.com/users/nagarajasr/orgs","repos_url":"https://api.github.com/users/nagarajasr/repos","events_url":"https://api.github.com/users/nagarajasr/events{/privacy}","received_events_url":"https://api.github.com/users/nagarajasr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-08T09:46:09Z","updated_at":"2015-07-08T09:46:09Z","closed_at":null,"body":"\r\nOrientDB version 2.1-rc4\r\n\r\nI have the following data model:\r\nDevice and Rack are Vertices\r\nDevicePlacedInRack is an Edge having a property called OccupiedBayNums EmbeddedList Integer.\r\n\r\nDevice --> DevicePlacedInRack --> Rack\r\n\r\nThe following query incorrectly returns zero records:\r\n\r\n```sql\r\n\r\nselect from DevicePlacedInRack where in = (select @rid from Rack where ID=404)\r\n\r\n\r\n0 item(s) found. Query executed in 0.242 sec(s).\r\n\r\n```\r\n\r\nIf the = is changed to in clause, the correct results are displayed:\r\n\r\n```sql\r\nselect from DevicePlacedInRack where in in (select @rid from Rack where ID=404)\r\n----+--------+------------------+---------------+-----+--------\r\n#   |@RID    |@CLASS            |OccupiedBayNums|in   |out\r\n----+--------+------------------+---------------+-----+--------\r\n0   |#27:19  |DevicePlacedInRack|[1]            |#37:1|#17:30\r\n1   |#27:22  |DevicePlacedInRack|[2]            |#37:1|#17:33\r\n2   |#27:261 |DevicePlacedInRack|[3]            |#37:1|#17:353\r\n3   |#27:301 |DevicePlacedInRack|null           |#37:1|#17:417\r\n4   |#27:4038|DevicePlacedInRack|[1]            |#37:1|#17:6358\r\n5   |#27:4098|DevicePlacedInRack|[2]            |#37:1|#17:6442\r\n----+--------+------------------+---------------+-----+--------\r\n\r\n6 item(s) found. Query executed in 0.23 sec(s).\r\n\r\n```\r\n\r\nNote that there is only one record of Rack having ID=404:\r\n\r\n```sql\r\norientdb {db=SRIMS}> select @rid from Rack where ID=404\r\n\r\n----+------+-----\r\n#   |@CLASS|rid\r\n----+------+-----\r\n0   |null  |#37:1\r\n----+------+-----\r\n\r\n1 item(s) found. Query executed in 0.005 sec(s).\r\n\r\n```\r\n\r\nseems to me could be an issue with parser?\r\n\r\nI am using OrientDB version 2.1-rc4\r\n\r\n"}}