6

When you process a SELECT through phpmyadmin, behind the scenes, it will sometimes add a LIMIT 0,30, and/or it'll throw a SQL_CALC_FOUND_ROWS into the SELECT so it can tell me how many results there would have been without the LIMIT.

Unfortunately, adding the SQL_CALC_FOUND_ROWS sometimes requires much more processing than I was expecting (i.e. more than if I had ran my original untainted query).

Is there a global config option to disable phpmyadmin's modification(s) of my queries?

What tricks can I use on a per-query basis to prevent phpmyadmin's modification(s)?

Riedsio
  • 9,758
  • 1
  • 24
  • 33
  • You don't seem like the type to need a PHP script to handhold your interactions with your database. Open a mysql client and run your query against the server directly. – Dan Grossman Dec 08 '10 at 23:44
  • I'm not asking for myself per-se (I do favor the command line interface), but rather for my development team. – Riedsio Dec 09 '10 at 02:17

1 Answers1

7

A quick check of the PHPMyAdmin source code says there isn't one.

However, if you look in the file sql.php, and find the else statement labelled // n o t " j u s t b r o w s i n g ". Replace the code between there and // end else "just browsing" with something like $unlim_num_rows = 1000000; you'll prevent it doing its counting query, while still being able to browse.

(you'll have to repeat this each time you update PMA, which you should be doing regularly since its security reputation is not great, to say the least)

grahamparks
  • 16,130
  • 5
  • 49
  • 43