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
aa72619c
Commit
aa72619c
authored
Oct 28, 2009
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0][DDC-55] Fixed.
parent
7694e9b7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
AbstractQuery.php
lib/Doctrine/ORM/AbstractQuery.php
+4
-0
QueryException.php
lib/Doctrine/ORM/Query/QueryException.php
+5
-0
QueryTest.php
tests/Doctrine/Tests/ORM/Functional/QueryTest.php
+9
-0
No files found.
lib/Doctrine/ORM/AbstractQuery.php
View file @
aa72619c
...
...
@@ -459,6 +459,10 @@ abstract class AbstractQuery
}
$params
=
$this
->
getParameters
(
$params
);
if
(
isset
(
$params
[
0
]))
{
throw
QueryException
::
invalidParameterPosition
(
0
);
}
// Check result cache
if
(
$this
->
_useResultCache
&&
$cacheDriver
=
$this
->
getResultCacheDriver
())
{
...
...
lib/Doctrine/ORM/Query/QueryException.php
View file @
aa72619c
...
...
@@ -44,4 +44,9 @@ class QueryException extends \Doctrine\Common\DoctrineException
{
return
new
self
(
'[Semantical Error] '
.
$message
);
}
public
static
function
invalidParameterPosition
(
$pos
)
{
return
new
self
(
'Invalid parameter position: '
.
$pos
);
}
}
\ No newline at end of file
tests/Doctrine/Tests/ORM/Functional/QueryTest.php
View file @
aa72619c
...
...
@@ -19,6 +19,15 @@ class QueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this
->
useModelSet
(
'cms'
);
parent
::
setUp
();
}
/**
* @expectedException Doctrine\ORM\Query\QueryException
*/
public
function
testParameterIndexZeroThrowsException
()
{
$query
=
$this
->
_em
->
createQuery
(
"select u from Doctrine\Tests\Models\CMS\CmsUser u where u.username = ?1"
);
$query
->
execute
(
array
(
42
));
// same as array(0 => 42), 0 is invalid parameter position
}
public
function
testSimpleQueries
()
{
...
...
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