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
c0969e11
Commit
c0969e11
authored
Mar 14, 2012
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'DBAL-231'
parents
636286f1
93e58f27
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
SQLParserUtils.php
lib/Doctrine/DBAL/SQLParserUtils.php
+2
-2
SQLParserUtilsTest.php
tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php
+2
-1
No files found.
lib/Doctrine/DBAL/SQLParserUtils.php
View file @
c0969e11
...
...
@@ -61,7 +61,7 @@ class SQLParserUtils
}
else
{
$name
=
""
;
// TODO: Something faster/better to match this than regex?
for
(
$j
=
$i
;
(
$j
<
$stmtLen
&&
preg_match
(
'(([:a-zA-Z0-9]{1}))'
,
$statement
[
$j
]));
$j
++
)
{
for
(
$j
=
$i
;
(
$j
<
$stmtLen
&&
preg_match
(
'(([:a-zA-Z0-9
_
]{1}))'
,
$statement
[
$j
]));
$j
++
)
{
$name
.=
$statement
[
$j
];
}
$paramMap
[
$name
][]
=
$i
;
// named parameters can be duplicated!
...
...
@@ -176,4 +176,4 @@ class SQLParserUtils
return
array
(
$query
,
$params
,
$types
);
}
}
\ No newline at end of file
}
tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php
View file @
c0969e11
...
...
@@ -34,6 +34,7 @@ class SQLParserUtilsTest extends \Doctrine\Tests\DbalTestCase
array
(
'SELECT * FROM Foo WHERE bar IN (:name1, :name2)'
,
false
,
array
(
':name1'
=>
array
(
32
),
':name2'
=>
array
(
40
))),
array
(
'SELECT ":foo" FROM Foo WHERE bar IN (:name1, :name2)'
,
false
,
array
(
':name1'
=>
array
(
37
),
':name2'
=>
array
(
45
))),
array
(
"SELECT ':foo' FROM Foo WHERE bar IN (:name1, :name2)"
,
false
,
array
(
':name1'
=>
array
(
37
),
':name2'
=>
array
(
45
))),
array
(
'SELECT :foo_id'
,
false
,
array
(
':foo_id'
=>
array
(
7
))),
// Ticket DBAL-231
);
}
...
...
@@ -200,4 +201,4 @@ class SQLParserUtilsTest extends \Doctrine\Tests\DbalTestCase
$this
->
assertEquals
(
$expectedParams
,
$params
,
"Params dont match"
);
$this
->
assertEquals
(
$expectedTypes
,
$types
,
"Types dont match"
);
}
}
\ No newline at end of file
}
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