{"action":"closed","issue":{"url":"https://api.github.com/repos/tgriesser/knex/issues/2543","repository_url":"https://api.github.com/repos/tgriesser/knex","labels_url":"https://api.github.com/repos/tgriesser/knex/issues/2543/labels{/name}","comments_url":"https://api.github.com/repos/tgriesser/knex/issues/2543/comments","events_url":"https://api.github.com/repos/tgriesser/knex/issues/2543/events","html_url":"https://github.com/tgriesser/knex/issues/2543","id":308335399,"number":2543,"title":"Delete query with inner joins outputs wrong sql","user":{"login":"frsechet","id":7351940,"avatar_url":"https://avatars3.githubusercontent.com/u/7351940?v=4","gravatar_id":"","url":"https://api.github.com/users/frsechet","html_url":"https://github.com/frsechet","followers_url":"https://api.github.com/users/frsechet/followers","following_url":"https://api.github.com/users/frsechet/following{/other_user}","gists_url":"https://api.github.com/users/frsechet/gists{/gist_id}","starred_url":"https://api.github.com/users/frsechet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frsechet/subscriptions","organizations_url":"https://api.github.com/users/frsechet/orgs","repos_url":"https://api.github.com/users/frsechet/repos","events_url":"https://api.github.com/users/frsechet/events{/privacy}","received_events_url":"https://api.github.com/users/frsechet/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-25T09:33:02Z","updated_at":"2018-03-25T10:08:43Z","closed_at":"2018-03-25T10:08:43Z","author_association":"NONE","body":"# Environment\r\nKnex version: 0.14.4\r\nDatabase + version: Mysql 5.7\r\nOS: MacOS 10.13.3\r\n\r\n# Bug\r\nThe following:\r\n\r\n    knex('bundle_intent_intent as bii')\r\n        .innerJoin('bundle_intents as bi', 'bi.id', 'bii.bundle_intent_id')\r\n        .innerJoin('bot_bundle as bb', 'bb.bundle_id', 'bi.bundle_id')\r\n        .where({\r\n          'bb.bot_id': 1,\r\n          'bb.bundle_id': 1,\r\n        })\r\n        .del([\r\n          'bii.*',\r\n        ])\r\n        .toString();\r\n\r\noutputs this wrong query, which results in a syntax error:\r\n```\r\ndelete from `bundle_intent_intent` as `bii` where `bb`.`bot_id` = 1 and `bb`.`bundle_id` = 1\r\n```\r\n\r\nI would expect the following output instead:\r\n```\r\ndelete bii.*\r\nfrom bundle_intent_intent bii\r\ninner join bundle_intents as bi on bi.id = bii.bundle_intent_id\r\ninner join bot_bundle as bb on bb.bundle_id = bi.bundle_id\r\nwhere bb.bot_id = 1 and bb.bundle_id = 1\r\n```\r\n\r\nA few things are wrong here:\r\n- inner joins are ignored,\r\n- `del('bii.*')` is ignored\r\n\r\nThis looks like the issue from https://github.com/tgriesser/knex/issues/873, but as it is quite old, I'm opening a new issue with more details.\r\n"}}
{"actor":{"display_login":"elhigu"}}