#3936 (ok 4.0.3) Query profiler chart not loading from SQL Query page

4.0.1
fixed
None
1
2013-06-11
2013-05-15
No

When executing a query from the SQL query page (tbl_sql.php), the query profile chart is not displayed. If you hit the refresh button on the page, it gets drawn after the ajax request returns.

I'm not 100% sure, but it looks like the problem is that the required js for the chart doesn't get loaded before it's needed the first time the query is run. After you hit the refresh button and the ajax request returns, the needed js files are loaded, allowing the chart to be drawn.

I will be submitting a pull request soon for feature request #1363 which improves the query profiler and adds sorting to the profiler results tables. The sorting for the tables also does not get loaded for the same reason that the chart is not drawn.

Discussion

  • Brad Jorgensen

    Brad Jorgensen - 2013-05-15

    I forgot to mention this in the original message, but it is probably implied. To see this bug, you need to turn profiling on from a query result page before going to the SQL query page and running a query.

     
  • Atul Pratap Singh

    • assigned_to: Atul Pratap Singh
     
  • Atul Pratap Singh

    • summary: Query Profiler Chart Not Loading From SQL Query Page --> (ok 4.0.2) Query profiler chart not loading from SQL Query page
    • status: open --> open-fixed
    • Priority: 5 --> 1
     
  • Atul Pratap Singh

    Fixed in QA_4_0

     
  • Atul Pratap Singh

    • summary: (ok 4.0.2) Query profiler chart not loading from SQL Query page --> Query profiler chart not loading from SQL Query page
    • status: open-fixed --> open
     
  • Atul Pratap Singh

    • summary: Query profiler chart not loading from SQL Query page --> (ok 4.0.2) Query profiler chart not loading from SQL Query page
    • status: open --> open-fixed
     
  • Brad Jorgensen

    Brad Jorgensen - 2013-05-17

    I just tested the changes you made and they don't appear to fix the problem for me. I tested on the public demo server with the latest build, which had your update, and on my local fork with the update and the problem still exists. The problem still is that the required scripts (the jqchart base js and plugins) aren't loaded when coming directly from the SQL page.

     
    Last edit: Brad Jorgensen 2013-05-17
  • Marc Delisle

    Marc Delisle - 2013-05-17

    Brad,
    did you clear your browser cache?

     
  • Brad Jorgensen

    Brad Jorgensen - 2013-05-17

    Yes I did and my cache is disabled while viewing my local branch.

    Steps to reproduce:

    1. Log in to the dev demo server: http://demo.phpmyadmin.net/master/?pma_username=root
    2. browse 'account_balance.account_balance_table' from the left menu
    3. check the profiling checkbox below the query
    4. click the "SQL" tab at the top of the page
    5. ctrl + f5 to reload the page - this should reload to the SQL query page with SELECT * FROMaccount_balance_tableWHERE 1 in the query box
    6. click the "go" button
    7. page loads with profiling table, but the profiling chart is not drawn
     
  • Marc Delisle

    Marc Delisle - 2013-05-17

    Brad,
    I confirm that with your steps I also see the bug.

     
  • Marc Delisle

    Marc Delisle - 2013-05-17
    • summary: (ok 4.0.2) Query profiler chart not loading from SQL Query page --> Query profiler chart not loading from SQL Query page
    • status: open-fixed --> open
    • Priority: 1 --> 5
     
  • Atul Pratap Singh

    Generally, on 'SQL' page, loading more scripts is not required when executing a query by clicking on 'Go', so it's a normal ajax_request and no more scripts are loaded.
    But in this case when session profiling is 'on', and when landing directly on 'SQL' page, loading jqplot scripts is needed after clicking on 'Go' button. In this example (https://github.com/zixtor/phpmyadmin/commit/f6458d2199f7f6af302a8c201f954e1c653e961e), I have manually loaded scripts on 'Go' click, and chart is drawn fine.

    Optionally and preferably, we could also load these required scripts before clicking on 'Go' that is on 'SQL' page load, subject to whether profiling is 'on' or not, will try to do that soon.

     
  • Marc Delisle

    Marc Delisle - 2013-05-24

    So this bug should be marked as being fixed for 4.0.3 ?

     
  • Atul Pratap Singh

    Profiling chart display and table sorting work fine for me.

     
  • Atul Pratap Singh

    • summary: Query profiler chart not loading from SQL Query page --> (ok 4.0.3) Query profiler chart not loading from SQL Query page
    • status: open --> open-fixed
    • Priority: 5 --> 1
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: open-fixed --> resolved
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: resolved --> fixed