diff options
Diffstat (limited to 'debug_toolbar/views.py')
| -rw-r--r-- | debug_toolbar/views.py | 14 | 
1 files changed, 12 insertions, 2 deletions
| diff --git a/debug_toolbar/views.py b/debug_toolbar/views.py index 53ad3c9..436cb07 100644 --- a/debug_toolbar/views.py +++ b/debug_toolbar/views.py @@ -90,8 +90,18 @@ def sql_profile(request):              cursor.execute("SET PROFILING=1")  # Enable profiling              cursor.execute(sql, params)  # Execute SELECT              cursor.execute("SET PROFILING=0")  # Disable profiling -            # The Query ID should always be 1 here but I'll subselect to get the last one just in case... -            cursor.execute("SELECT * FROM information_schema.profiling WHERE query_id=(SELECT query_id FROM information_schema.profiling ORDER BY query_id DESC LIMIT 1)") +            # The Query ID should always be 1 here but I'll subselect to get +            # the last one just in case... +            cursor.execute(""" +  SELECT  * +    FROM  information_schema.profiling +   WHERE  query_id = ( +          SELECT  query_id +            FROM  information_schema.profiling +        ORDER BY  query_id DESC +           LIMIT  1 +        ) +""")              headers = [d[0] for d in cursor.description]              result = cursor.fetchall()          except Exception: | 
