|
@@ -3650,9 +3650,24 @@
|
|
|
self.clearMarkedErrors();
|
|
self.clearMarkedErrors();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- AceLocationHandler.prototype.verifyExists = function (token) {
|
|
|
|
|
|
|
+ AceLocationHandler.prototype.verifyExists = function (token, allLocations) {
|
|
|
var self = this;
|
|
var self = this;
|
|
|
|
|
|
|
|
|
|
+ var knownTableAliases = [];
|
|
|
|
|
+
|
|
|
|
|
+ if (token.parseLocation.type === 'table') {
|
|
|
|
|
+ for (var i = 0; i < allLocations.length; i++) {
|
|
|
|
|
+ var location = allLocations[i];
|
|
|
|
|
+ if (location.type === 'alias' && (location.source === 'table' || location.source === 'subquery')) {
|
|
|
|
|
+ knownTableAliases.push(location.alias.toLowerCase());
|
|
|
|
|
+ if (token.value.toLowerCase() === location.alias.toLowerCase()) {
|
|
|
|
|
+ console.log(token.value + ' return');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// the syntax worker is only defined when syntax check is on
|
|
// the syntax worker is only defined when syntax check is on
|
|
|
// TODO: Only do this when browser caching is turned on
|
|
// TODO: Only do this when browser caching is turned on
|
|
|
if (self.aceSqlSyntaxWorker && token.parseLocation && token.parseLocation.identifierChain) {
|
|
if (self.aceSqlSyntaxWorker && token.parseLocation && token.parseLocation.identifierChain) {
|
|
@@ -3792,7 +3807,7 @@
|
|
|
delete location.tables;
|
|
delete location.tables;
|
|
|
token.parseLocation = location;
|
|
token.parseLocation = location;
|
|
|
activeTokens.push(token);
|
|
activeTokens.push(token);
|
|
|
- self.verifyExists(token);
|
|
|
|
|
|
|
+ self.verifyExists(token, e.data.locations);
|
|
|
} else if (tablesToGo.length > 0) {
|
|
} else if (tablesToGo.length > 0) {
|
|
|
findIdentifierChainInTable(tablesToGo);
|
|
findIdentifierChainInTable(tablesToGo);
|
|
|
}
|
|
}
|
|
@@ -3814,7 +3829,7 @@
|
|
|
} else {
|
|
} else {
|
|
|
token.parseLocation = location;
|
|
token.parseLocation = location;
|
|
|
activeTokens.push(token);
|
|
activeTokens.push(token);
|
|
|
- self.verifyExists(token);
|
|
|
|
|
|
|
+ self.verifyExists(token, e.data.locations);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|