Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Tomáš Trávníček
doctrine-dbal
Commits
8e8a2c06
Commit
8e8a2c06
authored
Jun 17, 2011
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DBAL-93 - Optimize performance of OraclePlatform::modifyLimitQuery(), thanks cicovec
parent
f22e7c65
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
OraclePlatform.php
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
+5
-7
No files found.
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
View file @
8e8a2c06
...
...
@@ -597,7 +597,7 @@ LEFT JOIN all_cons_columns r_cols
$limit
=
(
int
)
$limit
;
$offset
=
(
int
)
$offset
;
if
(
preg_match
(
'/^\s*SELECT/i'
,
$query
))
{
if
(
!
preg_match
(
'/\sFROM\s/i'
,
$query
))
{
if
(
!
preg_match
(
'/\sFROM\s/i'
,
$query
))
{
$query
.=
" FROM dual"
;
}
if
(
$limit
>
0
)
{
...
...
@@ -605,13 +605,11 @@ LEFT JOIN all_cons_columns r_cols
$column
=
'*'
;
if
(
$offset
>
0
)
{
$min
=
$offset
+
1
;
$query
=
'SELECT b.'
.
$column
.
' FROM ('
.
'SELECT a.*, ROWNUM AS doctrine_rownum FROM ('
.
$query
.
') a '
.
') b '
.
'WHERE doctrine_rownum BETWEEN '
.
$min
.
' AND '
.
$max
;
$query
=
'SELECT * FROM (SELECT a.'
.
$column
.
', rownum AS doctrine_rownum FROM ('
.
$query
.
') a WHERE rownum <= '
.
$max
.
') WHERE doctrine_rownum >= '
.
$min
;
}
else
{
$query
=
'SELECT a.'
.
$column
.
' FROM ('
.
$query
.
') a WHERE ROWNUM <= '
.
$max
;
$query
=
'SELECT a.'
.
$column
.
' FROM ('
.
$query
.
') a WHERE ROWNUM <= '
.
$max
;
}
}
}
...
...
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