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
bde8d33f
Commit
bde8d33f
authored
Dec 13, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes #251
parent
e89bfc8d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
Mssql.php
lib/Doctrine/Connection/Mssql.php
+6
-6
No files found.
lib/Doctrine/Connection/Mssql.php
View file @
bde8d33f
...
...
@@ -116,13 +116,13 @@ class Doctrine_Connection_Mssql extends Doctrine_Connection {
// is there an offset?
if
(
!
$offset
)
{
// no offset, it's a simple TOP count
return
$select
.
' TOP '
.
$
coun
t
.
substr
(
$query
,
$length
);
return
$select
.
' TOP '
.
$
limi
t
.
substr
(
$query
,
$length
);
}
// the total of the count **and** the offset, combined.
// this will be used in the "internal" portion of the
// hacked-up statement.
$total
=
$
coun
t
+
$offset
;
$total
=
$
limi
t
+
$offset
;
// build the "real" order for the external portion.
$order
=
implode
(
','
,
$parts
[
'order'
]);
...
...
@@ -135,13 +135,13 @@ class Doctrine_Connection_Mssql extends Doctrine_Connection {
// create a main statement that replaces the SELECT
// with a SELECT TOP
$main
=
"
\n
$select
TOP
$total
"
.
substr
(
$query
,
$length
)
.
"
\n
"
;
$main
=
$select
.
' TOP '
.
$total
.
substr
(
$query
,
$length
)
;
// build the hacked-up statement.
// do we really need the "as" aliases here?
$query
=
"SELECT * FROM ("
.
"SELECT TOP
$count
* FROM (
$main
) AS select_limit_rev ORDER BY
$reverse
"
.
") AS select_limit ORDER BY
$order
"
;
$query
=
'SELECT * FROM ('
.
'SELECT TOP '
.
$count
.
' * FROM ('
.
$main
.
') AS select_limit_rev ORDER BY '
.
$reverse
.
') AS select_limit ORDER BY '
.
$order
;
}
...
...
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