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
92c0fbf2
Commit
92c0fbf2
authored
Mar 14, 2012
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'DBAL-231' into 2.1.x
parents
148a049d
55fc886c
Changes
2
Show 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 @
92c0fbf2
...
@@ -61,7 +61,7 @@ class SQLParserUtils
...
@@ -61,7 +61,7 @@ class SQLParserUtils
}
else
{
}
else
{
$name
=
""
;
$name
=
""
;
// TODO: Something faster/better to match this than regex?
// 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
];
$name
.=
$statement
[
$j
];
}
}
$paramMap
[
$name
][]
=
$i
;
// named parameters can be duplicated!
$paramMap
[
$name
][]
=
$i
;
// named parameters can be duplicated!
...
...
tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php
View file @
92c0fbf2
...
@@ -33,6 +33,7 @@ class SQLParserUtilsTest extends \Doctrine\Tests\DbalTestCase
...
@@ -33,6 +33,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 * 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' 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
);
);
}
}
...
...
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