{"action":"created","issue":{"url":"https://api.github.com/repos/VoltDB/voltdb/issues/2325","labels_url":"https://api.github.com/repos/VoltDB/voltdb/issues/2325/labels{/name}","comments_url":"https://api.github.com/repos/VoltDB/voltdb/issues/2325/comments","events_url":"https://api.github.com/repos/VoltDB/voltdb/issues/2325/events","html_url":"https://github.com/VoltDB/voltdb/pull/2325","id":75286125,"number":2325,"title":"Avoid wrong answers when using subqueries within other expressions","user":{"login":"wolffcm","id":7902964,"avatar_url":"https://avatars.githubusercontent.com/u/7902964?v=3","gravatar_id":"","url":"https://api.github.com/users/wolffcm","html_url":"https://github.com/wolffcm","followers_url":"https://api.github.com/users/wolffcm/followers","following_url":"https://api.github.com/users/wolffcm/following{/other_user}","gists_url":"https://api.github.com/users/wolffcm/gists{/gist_id}","starred_url":"https://api.github.com/users/wolffcm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolffcm/subscriptions","organizations_url":"https://api.github.com/users/wolffcm/orgs","repos_url":"https://api.github.com/users/wolffcm/repos","events_url":"https://api.github.com/users/wolffcm/events{/privacy}","received_events_url":"https://api.github.com/users/wolffcm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-11T16:48:17Z","updated_at":"2015-05-14T05:07:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/VoltDB/voltdb/pulls/2325","html_url":"https://github.com/VoltDB/voltdb/pull/2325","diff_url":"https://github.com/VoltDB/voltdb/pull/2325.diff","patch_url":"https://github.com/VoltDB/voltdb/pull/2325.patch"},"body":"These changes add a post-pass over parsed expression trees to wrap scalar subqueries in an instance of ScalarValueExpression where needed.  I also pushed the check for single-column schema in to the code that creates the ScalarValueExpression node.\r\n\r\nAnother approach might be to always create the ScalarValueExpression over subqueries, and then remove the SVE node if its parent is a comparison operator or an EXISTS operator.  We still wouldn't avoid the overhead of a post-pass though: we would need to check that the subquery children of SVE nodes have only one column after parsing is complete."},"comment":{"url":"https://api.github.com/repos/VoltDB/voltdb/issues/comments/101914024","html_url":"https://github.com/VoltDB/voltdb/pull/2325#issuecomment-101914024","issue_url":"https://api.github.com/repos/VoltDB/voltdb/issues/2325","id":101914024,"user":{"login":"wolffcm","id":7902964,"avatar_url":"https://avatars.githubusercontent.com/u/7902964?v=3","gravatar_id":"","url":"https://api.github.com/users/wolffcm","html_url":"https://github.com/wolffcm","followers_url":"https://api.github.com/users/wolffcm/followers","following_url":"https://api.github.com/users/wolffcm/following{/other_user}","gists_url":"https://api.github.com/users/wolffcm/gists{/gist_id}","starred_url":"https://api.github.com/users/wolffcm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolffcm/subscriptions","organizations_url":"https://api.github.com/users/wolffcm/orgs","repos_url":"https://api.github.com/users/wolffcm/repos","events_url":"https://api.github.com/users/wolffcm/events{/privacy}","received_events_url":"https://api.github.com/users/wolffcm/received_events","type":"User","site_admin":false},"created_at":"2015-05-14T05:07:47Z","updated_at":"2015-05-14T05:07:47Z","body":"I added a commit to recurse into the `m_args` field for expressions, and a test case for IN.\r\n\r\nI also updated the `validate` method for IN expressions (even though it seems to be unused) because it misled me---the args field is not used for IN as far as I can tell."}}