{"action":"created","issue":{"url":"https://api.github.com/repos/phpmyadmin/phpmyadmin/issues/11604","labels_url":"https://api.github.com/repos/phpmyadmin/phpmyadmin/issues/11604/labels{/name}","comments_url":"https://api.github.com/repos/phpmyadmin/phpmyadmin/issues/11604/comments","events_url":"https://api.github.com/repos/phpmyadmin/phpmyadmin/issues/11604/events","html_url":"https://github.com/phpmyadmin/phpmyadmin/issues/11604","id":113336324,"number":11604,"title":"Export with join table fails","user":{"login":"lowwa132","id":3715048,"avatar_url":"https://avatars.githubusercontent.com/u/3715048?v=3","gravatar_id":"","url":"https://api.github.com/users/lowwa132","html_url":"https://github.com/lowwa132","followers_url":"https://api.github.com/users/lowwa132/followers","following_url":"https://api.github.com/users/lowwa132/following{/other_user}","gists_url":"https://api.github.com/users/lowwa132/gists{/gist_id}","starred_url":"https://api.github.com/users/lowwa132/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lowwa132/subscriptions","organizations_url":"https://api.github.com/users/lowwa132/orgs","repos_url":"https://api.github.com/users/lowwa132/repos","events_url":"https://api.github.com/users/lowwa132/events{/privacy}","received_events_url":"https://api.github.com/users/lowwa132/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/phpmyadmin/phpmyadmin/labels/parser","name":"parser","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-10-26T11:32:05Z","updated_at":"2015-11-02T20:15:53Z","closed_at":null,"body":"I have two problems:\r\n\r\n1. If I execute a query with a joined field on the SELECT clause, from the joined table, then clicking on \"Export\" on the bottom of the page results, I have an endless redirection to the query box (I can click to \"Execute\" again, but it just executes again the query)\r\n2. If I remove the joined field on the SELECT clause, I have the right export page with export option (CSV in my case). The exported file is just an HTML document with the error:\r\n```\r\n#1052 - Column 'id' in field list is ambiguous\r\n```\r\nI can see from the Request Console that my table alias disappeared.\r\n\r\nExemple of SQL Query:\r\n```sql\r\nSELECT sgu.id, sgu.email_address\r\nFROM `sf_guard_user` sgu\r\nRIGHT JOIN `student_course_booking` scb\r\nON sgu.id = scb.user_id\r\nWHERE `has_found_course` = '1'\r\nGROUP BY sgu.id\r\nORDER BY scb.id DESC\r\nLIMIT 0,300\r\n```\r\nIs transformed to:\r\n```sql\r\nSELECT id, email_address\r\nFROM `sf_guard_user`\r\nRIGHT JOIN `student_course_booking` scb\r\nON id = scb.user_id\r\nWHERE `has_found_course` = '1'\r\nGROUP BY id\r\nORDER BY scb.id DESC  \r\n```\r\nLatest stable version PhpMyAdmin 4.5.1"},"comment":{"url":"https://api.github.com/repos/phpmyadmin/phpmyadmin/issues/comments/153144376","html_url":"https://github.com/phpmyadmin/phpmyadmin/issues/11604#issuecomment-153144376","issue_url":"https://api.github.com/repos/phpmyadmin/phpmyadmin/issues/11604","id":153144376,"user":{"login":"udan11","id":4147664,"avatar_url":"https://avatars.githubusercontent.com/u/4147664?v=3","gravatar_id":"","url":"https://api.github.com/users/udan11","html_url":"https://github.com/udan11","followers_url":"https://api.github.com/users/udan11/followers","following_url":"https://api.github.com/users/udan11/following{/other_user}","gists_url":"https://api.github.com/users/udan11/gists{/gist_id}","starred_url":"https://api.github.com/users/udan11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/udan11/subscriptions","organizations_url":"https://api.github.com/users/udan11/orgs","repos_url":"https://api.github.com/users/udan11/repos","events_url":"https://api.github.com/users/udan11/events{/privacy}","received_events_url":"https://api.github.com/users/udan11/received_events","type":"User","site_admin":false},"created_at":"2015-11-02T20:15:53Z","updated_at":"2015-11-02T20:15:53Z","body":"This is the way the new parser works. To get an idea, the old parser only delimited clauses and did some little processing on some of those. Sometimes, this was not enough and some hacks were required which were prone to bugs.\r\n\r\nThe new parser completely transforms the query in an object where every piece of information is easily being accessed. To remove aliases, I have to edit some fields of this object and then completely rebuild the query. At this moment, all aliases are being removed, but only aliases definitions from `SELECT` and `WHERE` clauses should be deleted."}}