浏览代码

HUE-6802 [editor] Don't check for column existence in the location handler when a column is prefixed with a table name or alias

Johan Ahlen 8 年之前
父节点
当前提交
26bb4707ec
共有 1 个文件被更改,包括 9 次插入3 次删除
  1. 9 3
      desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

+ 9 - 3
desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

@@ -3629,7 +3629,7 @@
                     silenceErrors: true,
                     successCallback: function (data) {
                       try {
-                        if (typeof data.columns !== 'undefined' && data.columns.indexOf(location.identifierChain[0].name) !== -1) {
+                        if (typeof data.columns !== 'undefined' && data.columns.indexOf(location.identifierChain[0].name.toLowerCase()) !== -1) {
                           location.identifierChain = nextTable.identifierChain.concat(location.identifierChain);
                           delete location.tables;
                           token.parseLocation = location;
@@ -3644,8 +3644,14 @@
                   findIdentifierChainInTable(tablesToGo);
                 }
               };
-
-              findIdentifierChainInTable(location.tables.concat());
+              if (location.tables.length > 1) {
+                findIdentifierChainInTable(location.tables.concat());
+              } else if (location.tables.length == 1 && location.tables[0].identifierChain) {
+                location.identifierChain = location.tables[0].identifierChain.concat(location.identifierChain);
+                delete location.tables;
+                token.parseLocation = location;
+                activeTokens.push(token);
+              }
             } else {
               token.parseLocation = location;
               activeTokens.push(token);