瀏覽代碼

HUE-9267 [editor] Add sanity check for delayed ddl execution

Johan Ahlen 5 年之前
父節點
當前提交
080fb745ca
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      desktop/core/src/desktop/js/apps/notebook/snippet.js

+ 5 - 1
desktop/core/src/desktop/js/apps/notebook/snippet.js

@@ -1036,8 +1036,12 @@ class Snippet {
     self.onDdlExecute = function() {
       if (self.result.handle() && self.result.handle().has_more_statements) {
         window.clearTimeout(self.executeNextTimeout);
+        const previousHash = self.result.handle().previous_statement_hash;
         self.executeNextTimeout = setTimeout(() => {
-          self.execute(true); // Execute next, need to wait as we disabled fast click
+          // Don't execute if the handle has changed during the timeout
+          if (previousHash === self.result.handle().previous_statement_hash) {
+            self.execute(true); // Execute next, need to wait as we disabled fast click
+          }
         }, 1000);
       }
       if (