瀏覽代碼

HUE-3869 [editor] If a DDL doesn’t execute, it’s not part of the history

Romain Rigaux 9 年之前
父節點
當前提交
819f800
共有 1 個文件被更改,包括 12 次插入11 次删除
  1. 12 11
      desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

+ 12 - 11
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -635,18 +635,8 @@
           notebook.uuid(data.history_uuid);
           notebook.isHistory(true);
           notebook.parentSavedQueryUuid(data.history_parent_uuid);
-
-          notebook.history.unshift(
-            notebook._makeHistoryRecord(
-              url,
-              data.handle.statement,
-              self.lastExecuted(),
-              self.status(),
-              notebook.name(),
-              notebook.uuid()
-            )
-          );
         }
+
         if (data.status == 0) {
           self.result.handle(data.handle);
           self.result.hasResultset(data.handle.has_result_set);
@@ -661,6 +651,17 @@
           self._ajaxError(data, self.execute);
         }
 
+        notebook.history.unshift(
+          notebook._makeHistoryRecord(
+            url,
+            data.handle.statement,
+            self.lastExecuted(),
+            self.status(),
+            notebook.name(),
+            notebook.uuid()
+          )
+        );
+
         if (data.handle.statements_count != null) {
           self.result.statements_count(data.handle.statements_count);
           self.result.statement_id(data.handle.statement_id);