From 3a8606cd1ea0163df2d4fc0c803719a02de416c4 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Tue, 25 Dec 2018 14:59:03 +0530 Subject: [PATCH] refactor(recorder): Collect PROFILE and EXPLAIN results in a dict --- frappe/recorder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/recorder.py b/frappe/recorder.py index 51cf6bce74..9d4dbc13c1 100644 --- a/frappe/recorder.py +++ b/frappe/recorder.py @@ -124,12 +124,12 @@ def recorder(function): # Built in profiler is already turned on # Now fetch the profile data for last query # This must be done after collecting query from _cursor._executed - profile_result = function("SHOW PROFILE ALL") + profile_result = function("SHOW PROFILE ALL", as_dict=True) # Collect EXPLAIN for executed query if query.lower().strip().split()[0] in ("select", "update", "delete"): # Only SELECT/UPDATE/DELETE queries can be "EXPLAIN"ed - explain_result = function("EXPLAIN EXTENDED {}".format(query)) + explain_result = function("EXPLAIN EXTENDED {}".format(query), as_dict=True) else: explain_result = ""