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
b5f90e09
Commit
b5f90e09
authored
Jun 06, 2010
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed recent DBAL test failures with several open connections and Dummy Select statements
parent
3caada2b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
6 deletions
+37
-6
AbstractPlatform.php
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
+10
-0
DB2Platform.php
lib/Doctrine/DBAL/Platforms/DB2Platform.php
+5
-0
OraclePlatform.php
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
+10
-0
ConnectionTest.php
tests/Doctrine/Tests/DBAL/Functional/ConnectionTest.php
+3
-2
WriteTest.php
tests/Doctrine/Tests/DBAL/Functional/WriteTest.php
+1
-2
DbalFunctionalTestCase.php
tests/Doctrine/Tests/DbalFunctionalTestCase.php
+8
-2
No files found.
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
View file @
b5f90e09
...
...
@@ -1901,4 +1901,14 @@ abstract class AbstractPlatform
{
return
'TRUNCATE '
.
$tableName
;
}
/**
* This is for test reasons, many vendors have special requirements for dummy statements.
*
* @return string
*/
public
function
getDummySelectSQL
()
{
return
'SELECT 1'
;
}
}
\ No newline at end of file
lib/Doctrine/DBAL/Platforms/DB2Platform.php
View file @
b5f90e09
...
...
@@ -518,4 +518,9 @@ class DB2Platform extends AbstractPlatform
{
return
' WITH RR USE AND KEEP UPDATE LOCKS'
;
}
public
function
getDummySelectSQL
()
{
return
'SELECT 1 FROM sysibm.sysdummy1'
;
}
}
\ No newline at end of file
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
View file @
b5f90e09
...
...
@@ -650,4 +650,14 @@ LEFT JOIN all_cons_columns r_cols
{
return
'TRUNCATE TABLE '
.
$tableName
;
}
/**
* This is for test reasons, many vendors have special requirements for dummy statements.
*
* @return string
*/
public
function
getDummySelectSQL
()
{
return
'SELECT 1 FROM DUAL'
;
}
}
tests/Doctrine/Tests/DBAL/Functional/ConnectionTest.php
View file @
b5f90e09
...
...
@@ -88,7 +88,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
{
try
{
$this
->
_conn
->
transactional
(
function
(
$conn
)
{
$conn
->
executeQuery
(
"select 1"
);
$conn
->
executeQuery
(
$conn
->
getDatabasePlatform
()
->
getDummySelectSQL
()
);
throw
new
\RuntimeException
(
"Ooops!"
);
});
}
catch
(
\RuntimeException
$expected
)
{
...
...
@@ -99,7 +99,8 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
public
function
testTransactional
()
{
$this
->
_conn
->
transactional
(
function
(
$conn
)
{
$conn
->
executeQuery
(
"select 1"
);
/* @var $conn Connection */
$conn
->
executeQuery
(
$conn
->
getDatabasePlatform
()
->
getDummySelectSQL
());
});
}
}
\ No newline at end of file
tests/Doctrine/Tests/DBAL/Functional/WriteTest.php
View file @
b5f90e09
...
...
@@ -27,8 +27,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
public
function
testExecuteUpdate
()
{
$sql
=
"INSERT INTO "
.
$this
->
_conn
->
quoteIdentifier
(
'write_table'
)
.
" ( "
.
$this
->
_conn
->
quoteIdentifier
(
'test_int'
)
.
" ) VALUES ( "
.
$this
->
_conn
->
quote
(
1
)
.
")"
;
$sql
=
"INSERT INTO write_table (test_int) VALUES ( "
.
$this
->
_conn
->
quote
(
1
)
.
")"
;
$affected
=
$this
->
_conn
->
executeUpdate
(
$sql
);
$this
->
assertEquals
(
1
,
$affected
,
"executeUpdate() should return the number of affected rows!"
);
...
...
tests/Doctrine/Tests/DbalFunctionalTestCase.php
View file @
b5f90e09
...
...
@@ -14,8 +14,14 @@ class DbalFunctionalTestCase extends DbalTestCase
protected
function
resetSharedConn
()
{
$this
->
sharedFixture
[
'conn'
]
=
null
;
self
::
$_sharedConn
=
null
;
if
(
$this
->
sharedFixture
[
'conn'
])
{
$this
->
sharedFixture
[
'conn'
]
->
close
();
$this
->
sharedFixture
[
'conn'
]
=
null
;
}
if
(
self
::
$_sharedConn
)
{
self
::
$_sharedConn
->
close
();
self
::
$_sharedConn
=
null
;
}
}
protected
function
setUp
()
...
...
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