#3635 (ok 3.5.3) Error searching table with many fields

3.5.2
fixed
1
2013-06-11
2012-07-06
Victor Volkov
No

If table have more than 100 (not sure about exact number) fields, trying to search in it shows SQL error saying:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0, 30'

And PHP errors like this:
Notice in ./tbl_select.php#259
Undefined variable: max_number_of_fields

Notice in ./tbl_select.php#273
Undefined variable: where
...etc.

On the test server there is a database named "jf" and table "players" with 179 fields in it (error displays). The same table is in attachment. You can try to reproduce the error with it.

I have to say that not every server displays the error, it is possible that some PHP settings could be the reason of this behavior.

Discussion

  • Victor Volkov
    Victor Volkov
    2012-07-06

    Test table with 179 fields

     
    Attachments
  • Marc Delisle
    Marc Delisle
    2012-07-07

    • assigned_to: nobody --> lem9
     
  • Marc Delisle
    Marc Delisle
    2012-07-07

    Hi Victor,
    I can reproduce this problem on my test server.

     
  • Victor Volkov
    Victor Volkov
    2012-07-07

    Hello Marc.

    I have a test server on Windows XP with PHP 5.3.10 and there is no problem at all. Sorry, don't know how can I help you to solve this.

     
  • Marc Delisle
    Marc Delisle
    2012-07-08

    Victor,
    on my Linux test server, I tried with both PHP 5.4.4 and 5.3.13 and have the problem.

     
  • Marc Delisle
    Marc Delisle
    2012-07-08

    • assigned_to: lem9 --> nobody
     
  • Suhosin, possible culprit???

     
  • Marc Delisle
    Marc Delisle
    2012-08-05

    No Suhosin in my case.

     
  • Hi Marc,
    What is the value of the PHP configuration max_input_vars? Is it set to 1000?

    Following are some observation I got when I tried to reproduce the bug with the attached sql on the demo server.
    1. Number of columns in the table > 165 ---> Can reproduce the bug described here.
    2. Number of columns in the table = 165 (This corresponds to 1002 form data according to the Crome network tab) ----> I get the bug described in 3519157[1]
    3. Number of columns in the table = 164 (Corresponds to 996 form data) ----> Search works just fine

    [1] https://sourceforge.net/tracker/?func=detail&atid=377408&aid=3519157&group_id=23067

     
  • Marc Delisle
    Marc Delisle
    2012-08-05

    Hi Madhura,
    max_input_vars is 1000.This is the default value suggested for the production version of php.ini, and is a protection against DOS attacks, Moreover, it cannot be changed in a script.

    Your analysis is quite good (but did you look at the Search page or the Insert page?) and I believe that this error cannot be fixed at the phpMyAdmin level.

     
  • Marc Delisle
    Marc Delisle
    2012-08-05

    • status: open --> pending-rejected
     
  • Search page

     
    • status: pending-rejected --> open
     
    • status: open --> pending-rejected
     
    • assigned_to: nobody --> madhuracj
    • status: pending-rejected --> open
     
  • This bug was fixed in repository and will be part of a future release; thanks for reporting.

     
    • summary: Error searching table with many fields --> (ok 3.5.3) Error searching table with many fields
    • priority: 5 --> 1
    • status: open --> open-fixed
     
  • Marc Delisle
    Marc Delisle
    2012-10-08

    • status: open-fixed --> closed-fixed
     
  • Michal Čihař
    Michal Čihař
    2013-06-11

    • Status: closed-fixed --> fixed