Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser doesn't handle nested selects #6118

Closed
pma-import opened this issue May 17, 2004 · 15 comments
Closed

Parser doesn't handle nested selects #6118

pma-import opened this issue May 17, 2004 · 15 comments
Milestone

Comments

@pma-import
Copy link

@pma-import pma-import commented May 17, 2004

I use phpMyAdmin-2.5.6
Here is a query I get from my bookmarks.

SELECT items.itemID, serialNumber, partNumber, S1.notes
AS ACTIONNote, room, shelf,
LEVEL , employees.firstName
FROM items
LEFT JOIN actions S1 ON S1.itemID = items.itemID
LEFT JOIN locationInt ON locationInt.locationID =
S1.locationIntID
LEFT JOIN ToolsCommonDB.employees ON
employees.employeeID = desk
WHERE owner
LIKE ‘CS’ AND tmsp = (
SELECT max( S2.tmsp )
FROM actions S2
WHERE S1.itemID = S2.itemID )

I use the ‘export’ link at the bottom of the page.

When the page is displayed, the query has been changed to :
SELECT max( S2 . tmsp ) FROM actions S2 WHERE S1 .
itemID = S2 . itemID )

My email is wilfried.kopp@wanadoo.fr

Best regards,
Will

- Original URL: https://sourceforge.net/p/phpmyadmin/feature-requests/1419/
- Original author: *anonymous

@pma-import
Copy link
Author

@pma-import pma-import commented May 17, 2004

Logged In: YES
user_id=192186

Could you please post here structure of these tables and
some testing data?

- Original author: nijel

@pma-import
Copy link
Author

@pma-import pma-import commented May 17, 2004

- assigned_to: nobody —> nijel

- Original author: nijel

@pma-import
Copy link
Author

@pma-import pma-import commented May 26, 2004

Logged In: YES
user_id=192186

Any chance to get these?

- Original author: nijel

@pma-import
Copy link
Author

@pma-import pma-import commented Jul 15, 2004

Logged In: YES
user_id=192186

Export of this query fixed, however SQL parser should handle
this situation correctly, so leaving open.

- Original author: nijel

@pma-import
Copy link
Author

@pma-import pma-import commented Jul 15, 2004

- milestone: —> Latest_Git
- summary: Bug when exporting a query with more than 1 select —> Parser doesn’t handle nested selects
- assigned_to: nijel —> nobody
- labels: 546627 —> MySQL Parser

- Original author: nijel

@pma-import
Copy link
Author

@pma-import pma-import commented Jul 15, 2004

- priority: 5 —> 7

- Original author: nijel

@pma-import
Copy link
Author

@pma-import pma-import commented Jan 20, 2006

- priority: 7 —> 5

- Original author: lem9

@pma-import
Copy link
Author

@pma-import pma-import commented Jan 19, 2013

  • assigned_to: Marc Delisle

  • Original author: lem9
@pma-import
Copy link
Author

@pma-import pma-import commented Jan 19, 2013

  • assigned_to: Marc Delisle --> nobody

  • Original author: lem9
@pma-import
Copy link
Author

@pma-import pma-import commented Apr 9, 2013

Ticket moved from /p/phpmyadmin/bugs/1249/


  • Original author: lem9
@pma-import
Copy link
Author

@pma-import pma-import commented Feb 15, 2015

  • Priority: 5 --> Normal

  • Original author: lem9
@pma-import
Copy link
Author

@pma-import pma-import commented Feb 20, 2015

  • labels: MySQL Parser --> MySQL Parser, gsoc
  • assigned_to: Marc Delisle
  • Group: Latest_Git --> Needs_decision

  • Original author: madhuracj
@pma-import
Copy link
Author

@pma-import pma-import commented Feb 20, 2015

Assigning to Marc since there is a proposed GSoC project on parser rewrite mentored by Marc.


  • Original author: madhuracj
@udan11
Copy link
Contributor

@udan11 udan11 commented Jul 25, 2015

This works fine now.

I tested it with the following query:

select `a`.`actor_id` AS `actor_id`,`a`.`first_name` AS `first_name`,`a`.`last_name` AS `last_name`,group_concat(distinct concat(`c`.`name`,': ',(select group_concat(`f`.`title` order by `f`.`title` ASC separator ', ') from ((`sakila`.`film` `f` join `sakila`.`film_category` `fc` on((`f`.`film_id` = `fc`.`film_id`))) join `sakila`.`film_actor` `fa` on((`f`.`film_id` = `fa`.`film_id`))) where ((`fc`.`category_id` = `c`.`category_id`) and (`fa`.`actor_id` = `a`.`actor_id`)))) order by `c`.`name` ASC separator '; ') AS `film_info` from (((`sakila`.`actor` `a` left join `sakila`.`film_actor` `fa` on((`a`.`actor_id` = `fa`.`actor_id`))) left join `sakila`.`film_category` `fc` on((`fa`.`film_id` = `fc`.`film_id`))) left join `sakila`.`category` `c` on((`fc`.`category_id` = `c`.`category_id`))) group by `a`.`actor_id`,`a`.`first_name`,`a`.`last_name`
@lem9 lem9 added this to the 4.5.0 milestone Jul 26, 2015
@lem9 lem9 closed this in 086e906 Jul 26, 2015
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
@lem9 @udan11 @pma-import and others