 
         render_error: (query, err, js_error) =>
             @view_object?.remove()
-            @view_object = undefined
+            @view_object = null
+            @query_result?.discard()
             @$el.html @error_template
                 query: query
                 error: err.toString().replace(/^(\s*)/, '')

            $(window).mousedown @handle_mousedown
            @keep_suggestions_on_blur = false

            @render()

            @databases_available = {}
            @fetch_data()

                            @$('.value-'+expandable_columns[0]['col']).css 'max-width', current_size+max_size-20
                        expandable_columns = []

            return @

    class RawView extends ResultView
        className: 'results raw_view_container'

        template: Handlebars.templates['dataexplorer_result_raw-template']

        initialize: (args...) =>
            super args...
            @render()
            @fetch_batch_rows (row) => @render()

        init_after_dom_rendered: =>
            height = @$('.raw_view_textarea')[0].scrollHeight
