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 1b8c3898
authored
Apr 30, 2019
by
Simon Schick
Committed by
GitHub
Apr 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(querying): prevent `having` clause from cascading (#10859)
1 parent
dc418750
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
lib/model.js
lib/model.js
View file @
1b8c389
...
@@ -29,6 +29,9 @@ const validQueryKeywords = new Set(['where', 'attributes', 'paranoid', 'include'
...
@@ -29,6 +29,9 @@ const validQueryKeywords = new Set(['where', 'attributes', 'paranoid', 'include'
'scope'
,
'group'
,
'through'
,
'defaults'
,
'distinct'
,
'primary'
,
'exception'
,
'type'
,
'hooks'
,
'force'
,
'scope'
,
'group'
,
'through'
,
'defaults'
,
'distinct'
,
'primary'
,
'exception'
,
'type'
,
'hooks'
,
'force'
,
'name'
]);
'name'
]);
// List of attributes that should not be implicitly passed into subqueries/includes.
const
nonCascadingOptions
=
[
'include'
,
'attributes'
,
'originalAttributes'
,
'order'
,
'where'
,
'limit'
,
'offset'
,
'plain'
,
'group'
,
'having'
];
/**
/**
* A Model represents a table in the database. Instances of this class represent a database row.
* A Model represents a table in the database. Instances of this class represent a database row.
*
*
...
@@ -1829,7 +1832,7 @@ class Model {
...
@@ -1829,7 +1832,7 @@ class Model {
return
include
.
association
.
get
(
results
,
Object
.
assign
(
return
include
.
association
.
get
(
results
,
Object
.
assign
(
{},
{},
_
.
omit
(
options
,
[
'include'
,
'attributes'
,
'originalAttributes'
,
'order'
,
'where'
,
'limit'
,
'offset'
,
'plain'
,
'group'
]
),
_
.
omit
(
options
,
nonCascadingOptions
),
_
.
omit
(
include
,
[
'parent'
,
'association'
,
'as'
,
'originalAttributes'
])
_
.
omit
(
include
,
[
'parent'
,
'association'
,
'as'
,
'originalAttributes'
])
)).
then
(
map
=>
{
)).
then
(
map
=>
{
for
(
const
result
of
results
)
{
for
(
const
result
of
results
)
{
...
...
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