Hello all, I am trying to fix the bug https://sourceforge.net/p/phpmyadmin/bugs/4154/. I have few observations regarding this: if you do
SELECT * FROM `sortunion1`UNIONSELECT * FROM `sortunion2`
what I think is that when you are trying to query the above one it transforms it into query as follows
SELECT * FROM `sortunion1` UNION SELECT * FROM `sortunion2` ORDER BY `sortunion2`.`id` DESC LIMIT 0, 25
but instead if it transforms the same query as
SELECT * FROM `sortunion1` UNION (SELECT * FROM `sortunion2` ORDER BY `sortunion2`.`id` DESC ) LIMIT 0, 25
Then there won't be any issue.
Please tell me whether my understanding is correct or not. If yes,then I would like to take up the bug, else please suggest if there is any mistake in my approach.
Thanks,
Lakshit Arora
Le 2013-12-07 07:49, Lakshit Arora a écrit :
Hello all, I am trying to fix the bug https://sourceforge.net/p/phpmyadmin/bugs/4154/ . I have few observations regarding this: if you do
SELECT * FROM `sortunion1` UNION SELECT * FROM `sortunion2`
what I think is that when you are trying to query the above one it transforms it into query as follows
|SELECT * FROM `sortunion1` UNION SELECT * FROM `sortunion2` ORDER BY `sortunion2`.`id` DESC LIMIT 0, 25|
but instead if it transforms the same query as
|SELECT * FROM `sortunion1` UNION (SELECT * FROM `sortunion2` ORDER BY `sortunion2`.`id` DESC ) LIMIT 0, 25|
Then there won't be any issue.
Please tell me whether my understanding is correct or not. If yes,then I would like to take up the bug, else please suggest if there is any mistake in my approach.
Hi Lakshit, a better solution is to avoid adding the ORDER BY clause, since the user did not ask for it.
Hello Marc, Please could you please assign bug https://sourceforge.net/p/phpmyadmin/bugs/4154/ to me. I have possible solution for this as follows: In file sql.lib.php and in function PMA_handleSortOrder it is appending order by clause. I can do one of the following: 1. change PMA_SQP_analyze function: just like it sets query flags for select, join etc we can have a flag set for union also. Then we can bypass the function call PMA_handleSortOrder if its set. Problem with me regarding this is I am unable to find PMA_SQP_analyze or PMA_SQP_parse functions. could please tell me where they are? 2. In the function PMA_handleSortOrder just parse the query string and see if it contains union in it. This seems to be a redundant idea to me. What are your view on this? Thanks, Lakshit Arora
On Sat, Dec 7, 2013 at 6:39 PM, Marc Delisle marc@infomarc.info wrote:
Le 2013-12-07 07:49, Lakshit Arora a écrit :
Hello all, I am trying to fix the bug https://sourceforge.net/p/phpmyadmin/bugs/4154/ . I have few observations regarding this: if you do
SELECT * FROM `sortunion1` UNION SELECT * FROM `sortunion2`
what I think is that when you are trying to query the above one it transforms it into query as follows
|SELECT * FROM `sortunion1` UNION SELECT * FROM `sortunion2` ORDER BY `sortunion2`.`id` DESC LIMIT 0, 25|
but instead if it transforms the same query as
|SELECT * FROM `sortunion1` UNION (SELECT * FROM `sortunion2` ORDER BY `sortunion2`.`id` DESC ) LIMIT 0, 25|
Then there won't be any issue.
Please tell me whether my understanding is correct or not. If yes,then I would like to take up the bug, else please suggest if there is any mistake in my approach.
Hi Lakshit, a better solution is to avoid adding the ORDER BY clause, since the user did not ask for it.
-- Marc Delisle http://infomarc.info | http://phpmyadmin.net
Sponsored by Intel(R) XDK Develop, test and display web and hybrid apps with a single code base. Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.cl... _______________________________________________ Phpmyadmin-devel mailing list Phpmyadmin-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel
Le 2013-12-07 09:59, Lakshit Arora a écrit :
Hello Marc,
Hello, on this list, please use bottom posting (answers below questions).
Please could you please assign bug https://sourceforge.net/p/phpmyadmin/bugs/4154/ to me. I have possible solution for this as follows:
I cannot assign it to you as you are not a member of the team. Just add a comment on this ticket, saying that you work on it.
In file sql.lib.php and in function PMA_handleSortOrder it is appending order by clause. I can do one of the following:
- change PMA_SQP_analyze function: just like it sets query flags for
select, join etc we can have a flag set for union also. Then we can bypass the function call PMA_handleSortOrder if its set. Problem with me regarding this is I am unable to find PMA_SQP_analyze or PMA_SQP_parse functions. could please tell me where they are?
As we want to see your skills for the upcoming GSoC, you should be able to find them yourself. As a hint, the git command permits to do a grep. I hope you have access to command-line git (you do if you're on Linux).
- In the function PMA_handleSortOrder just parse the query string and
see if it contains union in it. This seems to be a redundant idea to me. What are your view on this?
Your idea #1 looks promising.
Thanks, Lakshit Arora
On Sat, Dec 7, 2013 at 6:39 PM, Marc Delisle <marc@infomarc.info mailto:marc@infomarc.info> wrote:
Le 2013-12-07 07:49, Lakshit Arora a écrit : > Hello all, I am trying to fix the bug > https://sourceforge.net/p/phpmyadmin/bugs/4154/ . I have few > observations regarding this: if you do > > SELECT * FROM `sortunion1` UNION SELECT * FROM `sortunion2` > > what I think is that when you are trying to query the above one it > transforms it into query as follows > > > |SELECT * FROM `sortunion1` UNION SELECT * FROM `sortunion2` ORDER > BY `sortunion2`.`id` DESC LIMIT 0, 25| > > but instead if it transforms the same query as > > |SELECT * FROM `sortunion1` UNION (SELECT * FROM `sortunion2` ORDER > BY `sortunion2`.`id` DESC ) LIMIT 0, 25| > > Then there won't be any issue. > > Please tell me whether my understanding is correct or not. If > yes,then I would like to take up the bug, else please suggest if > there is any mistake in my approach. Hi Lakshit, a better solution is to avoid adding the ORDER BY clause, since the user did not ask for it. -- Marc Delisle http://infomarc.info | http://phpmyadmin.net ------------------------------------------------------------------------------ Sponsored by Intel(R) XDK Develop, test and display web and hybrid apps with a single code base. Download it for free now! http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk _______________________________________________ Phpmyadmin-devel mailing list Phpmyadmin-devel@lists.sourceforge.net <mailto:Phpmyadmin-devel@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel
Sponsored by Intel(R) XDK Develop, test and display web and hybrid apps with a single code base. Download it for free now! http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.cl...
Phpmyadmin-devel mailing list Phpmyadmin-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel