Menu

#2716 (ok 2.11.9) Saved queries greater 1000 chars not displayed

2.11.7
fixed
Interface (555)
1
2013-06-11
2008-06-28
Maik Wiege
No

If you save a sql query it is available in the "saved sql queries" drop down of the SQL tab.
Next to the drop down are three radio buttons, on eis to only display the selected query without running it e.g. to only edit the query.
The bug:
If the saved SQL query is longer than 1000 chars, the query is not displayed.

Reproducing steps:
Navigate to a table in your DB and select the SQL tab.
Enter the SQL query:
SELECT count(*) AS a FROM 'table'
enter 'test' into the save sql text box under it and check both check boxes next to it.
Hit OK.
Go again to the SQL tab
Select the 'test' entry from the drop down list in the button and select "display only" from the radio buttons.
Hit OK
Now you see how it should work: The SQL query is displayed again in the text area above.
Now change the sql query to make it longer than 1000 chars by simply appending about 1000 'a's to the 'AS a' clause.
Now redo all steps from above: enter 'test' in the text box under it, check both check boxes .... try to display the saved query again:
It now displays the standard query in the text area not the saved one.

Discussion

  • Maik Wiege

    Maik Wiege - 2008-06-28

    Logged In: YES
    user_id=1826895
    Originator: YES

    Responsible for this behavior is line 180 in import.lib.php. Changing $max_sql_len > 1000 e.g. to $max_sql_len > 50000 will display the above test just fine. But I think this is not the perfect sollution. It just moves the border. What should be done is skipping this block not only if the query is executed but also if it is only displayed. So line 178 should be changed from
    if (!$go_sql) {
    to
    if (!$go_sql && !$sql_is_only_displayed) {
    $sql_is_only_displayed should be replaced with the propriate variable, because I don't know which one whould be correct here fot this purpose.

    Regards
    Maik

     
  • Jürgen Wind

    Jürgen Wind - 2008-06-29

    Logged In: YES
    user_id=1383652
    Originator: NO

    what if you set
    $cfg['MaxCharactersInDisplayedSQL'] = 1000;
    to a higher value?

     
  • Maik Wiege

    Maik Wiege - 2008-06-29

    Logged In: YES
    user_id=1826895
    Originator: YES

    Changing $cfg['MaxCharactersInDisplayedSQL'] does not help, because the "1000" is hard coded in line 180 in import.lib.php
    Also changing the value whould only result in "moving" the problem to greater values.

     
  • Marc Delisle

    Marc Delisle - 2008-08-01
    • assigned_to: nobody --> lem9
     
  • Marc Delisle

    Marc Delisle - 2008-08-01

    Logged In: YES
    user_id=210714
    Originator: NO

    Fixed in subversion, thanks for reporting.

     
  • Marc Delisle

    Marc Delisle - 2008-08-01
    • priority: 5 --> 1
    • summary: Saved SQL-Queries greater 1000 chars not displayed --> (ok 2.11.9) Saved queries greater 1000 chars not displayed
    • status: open --> open-fixed
     
  • Marc Delisle

    Marc Delisle - 2008-08-28
    • status: open-fixed --> closed-fixed
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-fixed --> fixed
     
MongoDB Logo MongoDB