不要怂,就是干,撸起袖子干!

Commit 6e13407a by Matt Broadstone

unify selectQuery between abstract and mssql dialects

1 parent d1b914f7
...@@ -1083,7 +1083,9 @@ module.exports = (function() { ...@@ -1083,7 +1083,9 @@ module.exports = (function() {
} else { } else {
if (association.associationType !== 'BelongsTo') { if (association.associationType !== 'BelongsTo') {
// Alias the left attribute if the left attribute is not from a subqueried main table // Alias the left attribute if the left attribute is not from a subqueried main table
// When doing a query like SELECT aliasedKey FROM (SELECT primaryKey FROM primaryTable) only aliasedKey is available to the join, this is not the case when doing a regular select where you can't used the aliased attribute // When doing a query like SELECT aliasedKey FROM (SELECT primaryKey FROM primaryTable)
// only aliasedKey is available to the join, this is not the case when doing a regular
// select where you can't used the aliased attribute
if (!subQuery || (subQuery && !include.subQuery && include.parent.model !== mainModel)) { if (!subQuery || (subQuery && !include.subQuery && include.parent.model !== mainModel)) {
if (left.rawAttributes[attrLeft].field) { if (left.rawAttributes[attrLeft].field) {
attrLeft = left.rawAttributes[attrLeft].field; attrLeft = left.rawAttributes[attrLeft].field;
......
...@@ -229,7 +229,7 @@ describe(Support.getTestDialectTeaser("Include"), function () { ...@@ -229,7 +229,7 @@ describe(Support.getTestDialectTeaser("Include"), function () {
}, callback) }, callback)
}, },
function (err) { function (err) {
console.log('err', err); // console.log('err', err);
expect(err).not.to.be.ok expect(err).not.to.be.ok
done() done()
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!