Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit ecf29be1
authored
Apr 17, 2014
by
José Moreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Alias from SubQuery vs Column.Field and better expects on test unit
Fixes #1640
1 parent
6eb60161
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
lib/dialects/abstract/query-generator.js
test/include/findAll.test.js
lib/dialects/abstract/query-generator.js
View file @
ecf29be
...
...
@@ -763,13 +763,20 @@ module.exports = (function() {
// Filter statement
// Used by both join and subquery where
if
(
subQuery
&&
!
include
.
subQuery
&&
include
.
parent
.
subQuery
)
{
where
=
self
.
quoteIdentifier
(
tableLeft
+
"."
+
attrLeft
)
+
" = "
}
else
{
where
=
self
.
quoteTable
(
tableLeft
)
+
"."
+
self
.
quoteIdentifier
(
attrLeft
)
+
" = "
}
where
+=
self
.
quoteTable
(
tableRight
)
+
"."
+
self
.
quoteIdentifier
(
attrRight
)
where
=
// Left side
(
(
subQuery
&&
!
include
.
subQuery
&&
include
.
parent
.
subQuery
&&
!
(
include
.
hasParentRequired
&&
include
.
hasParentWhere
)
)
&&
self
.
quoteIdentifier
(
tableLeft
+
"."
+
attrLeft
)
||
self
.
quoteTable
(
tableLeft
)
+
"."
+
self
.
quoteIdentifier
(
attrLeft
)
)
+
" = "
+
// Right side
(
(
subQuery
&&
!
include
.
subQuery
&&
include
.
parent
.
subQuery
&&
(
include
.
hasParentRequired
&&
include
.
hasParentWhere
)
)
&&
self
.
quoteIdentifier
(
tableRight
+
"."
+
attrRight
)
||
self
.
quoteTable
(
tableRight
)
+
"."
+
self
.
quoteIdentifier
(
attrRight
)
)
// Generate join SQL
joinQueryItem
+=
joinType
+
self
.
quoteTable
(
table
,
as
)
+
" ON "
...
...
test/include/findAll.test.js
View file @
ecf29be
...
...
@@ -854,7 +854,8 @@ describe(Support.getTestDialectTeaser("Include"), function () {
]
}).
done
(
function
(
err
,
john
)
{
expect
(
err
).
not
.
to
.
be
.
ok
expect
(
john
.
addresses
).
to
.
have
.
length
(
1
)
expect
(
john
.
address
).
to
.
be
.
ok
expect
(
john
.
address
.
street
).
to
.
be
.
ok
done
();
})
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment