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
6d766f61
Commit
6d766f61
authored
Dec 31, 2014
by
Steve Müller
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #752 from nicolas-grekas/fix-error-handling
Fix error handling in mysqli driver
parents
aea8383c
6285c67a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
11 deletions
+5
-11
MysqliConnection.php
lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php
+4
-10
MysqliStatement.php
lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php
+1
-1
No files found.
lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php
View file @
6d766f61
...
...
@@ -65,21 +65,15 @@ class MysqliConnection implements Connection, PingableConnection, ServerInfoAwar
$this
->
setDriverOptions
(
$driverOptions
);
$previousHandler
=
set_error_handler
(
function
()
{
});
set_error_handler
(
function
()
{});
if
(
!
$this
->
_conn
->
real_connect
(
$params
[
'host'
],
$username
,
$password
,
$dbname
,
$port
,
$socket
,
$flags
))
{
set_error_handler
(
$previousHandler
);
restore_error_handler
(
);
$sqlState
=
'HY000'
;
if
(
@
$this
->
_conn
->
sqlstate
)
{
$sqlState
=
$this
->
_conn
->
sqlstate
;
throw
new
MysqliException
(
$this
->
_conn
->
connect_error
,
@
$this
->
_conn
->
sqlstate
?:
'HY000'
,
$this
->
_conn
->
connect_errno
);
}
throw
new
MysqliException
(
$this
->
_conn
->
connect_error
,
$sqlState
,
$this
->
_conn
->
connect_errno
);
}
set_error_handler
(
$previousHandler
);
restore_error_handler
();
if
(
isset
(
$params
[
'charset'
]))
{
$this
->
_conn
->
set_charset
(
$params
[
'charset'
]);
...
...
lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php
View file @
6d766f61
...
...
@@ -300,7 +300,7 @@ class MysqliStatement implements \IteratorAggregate, Statement
return
false
;
}
return
$row
[
$columnIndex
]
;
return
isset
(
$row
[
$columnIndex
])
?
$row
[
$columnIndex
]
:
null
;
}
/**
...
...
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