                             broken_query: true
 
                         return false
+
+                    if results.profile? and @state.last_query_has_profile is true
+                        cursor = results.value
+                        @profile = results.profile
+                    else
+                        cursor = results
+                        @profile = null # @profile is null if the user deactivated the profiler
+
                     
                     if @index is @queries.length # @index was incremented in execute_portion
                         if cursor?

            profiler: true
        history: []
        focus_on_codemirror: true
        #saved_data: {}



        generate_rdb_global_callback: (id_execution) =>
            rdb_global_callback = (error, results) =>
                if @id_execution is id_execution # We execute the query only if it is the last one
                    get_result_callback = @generate_get_result_callback id_execution

                    if error?
