Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
8053082e
Commit
8053082e
authored
Mar 22, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #2848: Individual queries should be enclosed within parenthesis in a UNION query
parent
7f6f3f6f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
+12
-5
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
QueryBuilder.php
framework/db/QueryBuilder.php
+8
-2
QueryBuilder.php
framework/db/oci/QueryBuilder.php
+3
-3
No files found.
framework/CHANGELOG.md
View file @
8053082e
...
...
@@ -61,6 +61,7 @@ Yii Framework 2 Change Log
-
Bug #2740: Fixed the issue that
`CaptchaAction::run()`
was using obsolete
`Controller::createUrl()`
method (tonydspaniard)
-
Bug #2760: Fixed GridView
`filterUrl`
parameters (qiangxue, AlexGx)
-
Bug #2834: When overriding i18n translation sources from config using
`app*`
or
`yii*`
default
`app`
and
`yii`
sources were not removed (samdark)
-
Bug #2848: Individual queries should be enclosed within parenthesis in a UNION query (qiangxue)
-
Bug: Fixed
`Call to a member function registerAssetFiles() on a non-object`
in case of wrong
`sourcePath`
for an asset bundle (samdark)
-
Bug: Fixed incorrect event name for
`yii\jui\Spinner`
(samdark)
-
Bug: Json::encode() did not handle objects that implement JsonSerializable interface correctly (cebe)
...
...
framework/db/QueryBuilder.php
View file @
8053082e
...
...
@@ -87,10 +87,16 @@ class QueryBuilder extends \yii\base\Object
$this
->
buildHaving
(
$query
->
having
,
$params
),
$this
->
buildOrderBy
(
$query
->
orderBy
),
$this
->
buildLimit
(
$query
->
limit
,
$query
->
offset
),
$this
->
buildUnion
(
$query
->
union
,
$params
),
];
return
[
implode
(
$this
->
separator
,
array_filter
(
$clauses
)),
$params
];
$sql
=
implode
(
$this
->
separator
,
array_filter
(
$clauses
));
$union
=
$this
->
buildUnion
(
$query
->
union
,
$params
);
if
(
$union
!==
''
)
{
$sql
=
"(
$sql
)
{
$this
->
separator
}
$union
"
;
}
return
[
$sql
,
$params
];
}
/**
...
...
framework/db/oci/QueryBuilder.php
View file @
8053082e
...
...
@@ -40,9 +40,9 @@ class QueryBuilder extends \yii\db\QueryBuilder
$this
->
sql
=
$this
->
buildLimit
(
$query
->
limit
,
$query
->
offset
);
$union
s
=
$this
->
buildUnion
(
$query
->
union
,
$params
);
if
(
$union
s
!==
''
)
{
$this
->
sql
.=
$this
->
separator
.
$unions
;
$union
=
$this
->
buildUnion
(
$query
->
union
,
$params
);
if
(
$union
!==
''
)
{
$this
->
sql
=
"
{
$this
->
sql
}{
$this
->
separator
}
$union
"
;
}
return
[
$this
->
sql
,
$params
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment