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
19fc8065
Commit
19fc8065
authored
Apr 29, 2014
by
jeroendedauw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly instantiate var and fix spelling.
parent
d328488d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
SQLServerPlatform.php
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
+8
-6
No files found.
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
View file @
19fc8065
...
...
@@ -1173,13 +1173,13 @@ class SQLServerPlatform extends AbstractPlatform
//Clear ORDER BY
$orderBy
=
preg_replace
(
'/ORDER\s+BY\s+(.*)/i'
,
'$1'
,
$orderBy
);
$orderByParts
=
explode
(
','
,
$orderBy
);
$order
b
yColumns
=
array
();
$order
B
yColumns
=
array
();
//Split ORDER BY into parts
foreach
(
$orderByParts
as
&
$part
)
{
if
(
preg_match
(
'/(([^\s]*)\.)?([^\.\s]*)\s*(ASC|DESC)?/i'
,
trim
(
$part
),
$matches
))
{
$order
b
yColumns
[]
=
array
(
$order
B
yColumns
[]
=
array
(
'column'
=>
$matches
[
3
],
'hasTable'
=>
(
!
empty
(
$matches
[
2
])),
'sort'
=>
isset
(
$matches
[
4
])
?
$matches
[
4
]
:
null
,
...
...
@@ -1190,10 +1190,12 @@ class SQLServerPlatform extends AbstractPlatform
$isWrapped
=
(
preg_match
(
'/SELECT DISTINCT .* FROM \(.*\) dctrn_result/'
,
$query
))
?
true
:
false
;
//Find alias for each colum used in ORDER BY
if
(
!
empty
(
$orderbyColumns
))
{
foreach
(
$orderbyColumns
as
$column
)
{
$pattern
=
sprintf
(
'/%s\.%s\s+(?:AS\s+)?([^,\s)]+)/i'
,
$column
[
'table'
],
$column
[
'column'
]);
$overColumns
=
array
();
//Find alias for each column used in ORDER BY
if
(
!
empty
(
$orderByColumns
))
{
foreach
(
$orderByColumns
as
$column
)
{
$pattern
=
sprintf
(
'/%s\.%s\s+(?:AS\s+)?([^,\s)]+)/i'
,
$column
[
'table'
],
$column
[
'column'
]);
if
(
$isWrapped
)
{
$overColumn
=
preg_match
(
$pattern
,
$query
,
$matches
)
...
...
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