소스 검색

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 년 전
부모
커밋
26bb470
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);