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
2eab0857
Unverified
Commit
2eab0857
authored
Jun 23, 2020
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rework deprecated OCI8 exceptions
parent
b7ee1fbc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
77 additions
and
7 deletions
+77
-7
NonTerminatedStringLiteral.php
...DBAL/Driver/OCI8/Exception/NonTerminatedStringLiteral.php
+27
-0
SequenceDoesNotExist.php
...trine/DBAL/Driver/OCI8/Exception/SequenceDoesNotExist.php
+20
-0
UnknownParameterIndex.php
...rine/DBAL/Driver/OCI8/Exception/UnknownParameterIndex.php
+24
-0
OCI8Connection.php
lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php
+2
-1
OCI8Statement.php
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
+4
-6
No files found.
lib/Doctrine/DBAL/Driver/OCI8/Exception/NonTerminatedStringLiteral.php
0 → 100644
View file @
2eab0857
<?php
declare
(
strict_types
=
1
);
namespace
Doctrine\DBAL\Driver\OCI8\Exception
;
use
Doctrine\DBAL\Driver\OCI8\OCI8Exception
;
use
function
sprintf
;
/**
* @internal
*
* @psalm-immutable
*/
final
class
NonTerminatedStringLiteral
extends
OCI8Exception
{
public
static
function
new
(
int
$offset
)
:
self
{
return
new
self
(
sprintf
(
'The statement contains non-terminated string literal starting at offset %d.'
,
$offset
)
);
}
}
lib/Doctrine/DBAL/Driver/OCI8/Exception/SequenceDoesNotExist.php
0 → 100644
View file @
2eab0857
<?php
declare
(
strict_types
=
1
);
namespace
Doctrine\DBAL\Driver\OCI8\Exception
;
use
Doctrine\DBAL\Driver\OCI8\OCI8Exception
;
/**
* @internal
*
* @psalm-immutable
*/
final
class
SequenceDoesNotExist
extends
OCI8Exception
{
public
static
function
new
()
:
self
{
return
new
self
(
'lastInsertId failed: Query was executed but no result was returned.'
);
}
}
lib/Doctrine/DBAL/Driver/OCI8/Exception/UnknownParameterIndex.php
0 → 100644
View file @
2eab0857
<?php
declare
(
strict_types
=
1
);
namespace
Doctrine\DBAL\Driver\OCI8\Exception
;
use
Doctrine\DBAL\Driver\OCI8\OCI8Exception
;
use
function
sprintf
;
/**
* @internal
*
* @psalm-immutable
*/
final
class
UnknownParameterIndex
extends
OCI8Exception
{
public
static
function
new
(
int
$index
)
:
self
{
return
new
self
(
sprintf
(
'Could not find variable mapping with index %d, in the SQL statement'
,
$index
)
);
}
}
lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php
View file @
2eab0857
...
...
@@ -3,6 +3,7 @@
namespace
Doctrine\DBAL\Driver\OCI8
;
use
Doctrine\DBAL\Driver\Connection
as
ConnectionInterface
;
use
Doctrine\DBAL\Driver\OCI8\Exception\SequenceDoesNotExist
;
use
Doctrine\DBAL\Driver\ServerInfoAwareConnection
;
use
Doctrine\DBAL\ParameterType
;
use
UnexpectedValueException
;
...
...
@@ -166,7 +167,7 @@ class OCI8Connection implements ConnectionInterface, ServerInfoAwareConnection
$result
=
$stmt
->
fetchColumn
();
if
(
$result
===
false
)
{
throw
new
OCI8Exception
(
'lastInsertId failed: Query was executed but no result was returned.'
);
throw
SequenceDoesNotExist
::
new
(
);
}
return
(
int
)
$result
;
...
...
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
View file @
2eab0857
...
...
@@ -3,6 +3,8 @@
namespace
Doctrine\DBAL\Driver\OCI8
;
use
Doctrine\DBAL\Driver\FetchUtils
;
use
Doctrine\DBAL\Driver\OCI8\Exception\NonTerminatedStringLiteral
;
use
Doctrine\DBAL\Driver\OCI8\Exception\UnknownParameterIndex
;
use
Doctrine\DBAL\Driver\Result
;
use
Doctrine\DBAL\Driver\Statement
as
StatementInterface
;
use
Doctrine\DBAL\Driver\StatementIterator
;
...
...
@@ -31,7 +33,6 @@ use function oci_num_rows;
use
function
oci_parse
;
use
function
preg_match
;
use
function
preg_quote
;
use
function
sprintf
;
use
function
substr
;
use
const
OCI_ASSOC
;
...
...
@@ -163,10 +164,7 @@ class OCI8Statement implements IteratorAggregate, StatementInterface, Result
}
while
(
$result
);
if
(
$currentLiteralDelimiter
)
{
throw
new
OCI8Exception
(
sprintf
(
'The statement contains non-terminated string literal starting at offset %d'
,
$tokenOffset
-
1
));
throw
NonTerminatedStringLiteral
::
new
(
$tokenOffset
-
1
);
}
$fragments
[]
=
substr
(
$statement
,
$fragmentOffset
);
...
...
@@ -286,7 +284,7 @@ class OCI8Statement implements IteratorAggregate, StatementInterface, Result
{
if
(
is_int
(
$param
))
{
if
(
!
isset
(
$this
->
_paramMap
[
$param
]))
{
throw
new
OCI8Exception
(
sprintf
(
'Could not find variable mapping with index %d, in the SQL statement'
,
$param
)
);
throw
UnknownParameterIndex
::
new
(
$param
);
}
$param
=
$this
->
_paramMap
[
$param
];
...
...
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