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
4d172813
Unverified
Commit
4d172813
authored
Jul 21, 2020
by
Sergei Morozov
Committed by
GitHub
Jul 21, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4167 from morozov/remove-wrapper-query-exec
Remove deprecated methods from the wrapper Connection
parents
5ceeed8c
ea020aa5
Changes
34
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
107 additions
and
286 deletions
+107
-286
UPGRADE.md
UPGRADE.md
+8
-2
bootstrap.php
ci/continuousphp/bootstrap.php
+1
-1
Connection.php
src/Connection.php
+3
-71
PrimaryReadReplicaConnection.php
src/Connections/PrimaryReadReplicaConnection.php
+2
-76
SQLSessionInit.php
src/Event/Listeners/SQLSessionInit.php
+1
-1
SQLServerSchemaManager.php
src/Schema/SQLServerSchemaManager.php
+1
-1
AbstractSchemaSynchronizer.php
src/Schema/Synchronizer/AbstractSchemaSynchronizer.php
+2
-2
ConnectionTest.php
tests/ConnectionTest.php
+0
-12
SQLSessionInitTest.php
tests/Events/SQLSessionInitTest.php
+1
-1
BlobTest.php
tests/Functional/BlobTest.php
+1
-1
ConnectionLostTest.php
tests/Functional/Connection/ConnectionLostTest.php
+1
-1
DataAccessTest.php
tests/Functional/DataAccessTest.php
+3
-4
ConnectionTest.php
tests/Functional/Driver/PDO/PgSQL/ConnectionTest.php
+1
-2
ExceptionTest.php
tests/Functional/ExceptionTest.php
+7
-7
ModifyLimitQueryTest.php
tests/Functional/ModifyLimitQueryTest.php
+9
-2
DateExpressionTest.php
tests/Functional/Platform/DateExpressionTest.php
+1
-1
DefaultExpressionTest.php
tests/Functional/Platform/DefaultExpressionTest.php
+3
-3
NewPrimaryKeyWithNewAutoIncrementColumnTest.php
.../Platform/NewPrimaryKeyWithNewAutoIncrementColumnTest.php
+1
-1
PortabilityTest.php
tests/Functional/PortabilityTest.php
+4
-5
PrimaryReadReplicaConnectionTest.php
tests/Functional/PrimaryReadReplicaConnectionTest.php
+0
-44
ForeignKeyTest.php
tests/Functional/Schema/ForeignKeyTest.php
+1
-1
MySqlSchemaManagerTest.php
tests/Functional/Schema/MySqlSchemaManagerTest.php
+4
-4
OracleSchemaManagerTest.php
tests/Functional/Schema/OracleSchemaManagerTest.php
+1
-1
PostgreSqlSchemaManagerTest.php
tests/Functional/Schema/PostgreSqlSchemaManagerTest.php
+7
-7
SchemaManagerFunctionalTestCase.php
tests/Functional/Schema/SchemaManagerFunctionalTestCase.php
+10
-10
SqliteSchemaManagerTest.php
tests/Functional/Schema/SqliteSchemaManagerTest.php
+6
-6
TableGeneratorTest.php
tests/Functional/TableGeneratorTest.php
+1
-1
TemporaryTableTest.php
tests/Functional/TemporaryTableTest.php
+13
-5
DBAL202Test.php
tests/Functional/Ticket/DBAL202Test.php
+3
-3
DBAL630Test.php
tests/Functional/Ticket/DBAL630Test.php
+2
-2
DBAL752Test.php
tests/Functional/Ticket/DBAL752Test.php
+1
-1
TransactionTest.php
tests/Functional/TransactionTest.php
+1
-1
WriteTest.php
tests/Functional/WriteTest.php
+6
-5
TestUtil.php
tests/TestUtil.php
+1
-1
No files found.
UPGRADE.md
View file @
4d172813
# Upgrade to 3.0
## BC BREAK: removed wrapper `Connection` methods
The following methods of the
`Connection`
class have been removed:
1.
`query()`
.
2.
`exec()`
.
3.
`executeUpdate()`
.
## BC BREAK: Changes in the wrapper-level API ancestry
The wrapper-level
`Connection`
and
`Statement`
classes no longer implement the corresponding driver-level interfaces.
...
...
@@ -50,8 +58,6 @@ The following classes have been renamed:
The following driver-level methods are allowed to throw a Driver
\E
xception:
-
`Connection::prepare()`
-
`Connection::query()`
-
`Connection::exec()`
-
`Connection::lastInsertId()`
-
`Connection::beginTransaction()`
-
`Connection::commit()`
...
...
ci/continuousphp/bootstrap.php
View file @
4d172813
...
...
@@ -12,5 +12,5 @@ use Doctrine\DBAL\DriverManager;
'user'
=>
'ORACLE'
,
'password'
=>
'ORACLE'
,
'dbname'
=>
'XE'
,
])
->
query
(
'ALTER USER ORACLE IDENTIFIED BY ORACLE'
);
])
->
executeStatement
(
'ALTER USER ORACLE IDENTIFIED BY ORACLE'
);
})();
src/Connection.php
View file @
4d172813
...
...
@@ -12,7 +12,6 @@ use Doctrine\DBAL\Cache\QueryCacheProfile;
use
Doctrine\DBAL\Driver\API\ExceptionConverter
;
use
Doctrine\DBAL\Driver\Connection
as
DriverConnection
;
use
Doctrine\DBAL\Driver\Exception
as
DriverException
;
use
Doctrine\DBAL\Driver\Result
as
DriverResult
;
use
Doctrine\DBAL\Driver\ServerInfoAwareConnection
;
use
Doctrine\DBAL\Driver\Statement
as
DriverStatement
;
use
Doctrine\DBAL\Exception\ConnectionLost
;
...
...
@@ -1028,48 +1027,6 @@ class Connection
return
new
Result
(
$result
,
$this
);
}
/**
* @deprecated Use {@link executeQuery()} instead.
*
* @throws DBALException
*/
public
function
query
(
string
$sql
)
:
DriverResult
{
$connection
=
$this
->
getWrappedConnection
();
$logger
=
$this
->
_config
->
getSQLLogger
();
if
(
$logger
!==
null
)
{
$logger
->
startQuery
(
$sql
);
}
try
{
return
$connection
->
query
(
$sql
);
}
catch
(
DriverException
$e
)
{
throw
$this
->
convertExceptionDuringQuery
(
$e
,
$sql
);
}
finally
{
if
(
$logger
!==
null
)
{
$logger
->
stopQuery
();
}
}
}
/**
* Executes an SQL INSERT/UPDATE/DELETE query with the given parameters
* and returns the number of affected rows.
*
* @deprecated Use {@link executeStatement()} instead.
*
* @param string $query The SQL query.
* @param array<mixed> $params The query parameters.
* @param array<int|string|null> $types The parameter types.
*
* @throws DBALException
*/
public
function
executeUpdate
(
string
$query
,
array
$params
=
[],
array
$types
=
[])
:
int
{
return
$this
->
executeStatement
(
$query
,
$params
,
$types
);
}
/**
* Executes an SQL statement with the given parameters and returns the number of affected rows.
*
...
...
@@ -1126,31 +1083,6 @@ class Connection
}
}
/**
* @deprecated Use {@link executeStatement()} instead.
*
* @throws DBALException
*/
public
function
exec
(
string
$statement
)
:
int
{
$connection
=
$this
->
getWrappedConnection
();
$logger
=
$this
->
_config
->
getSQLLogger
();
if
(
$logger
!==
null
)
{
$logger
->
startQuery
(
$statement
);
}
try
{
return
$connection
->
exec
(
$statement
);
}
catch
(
DriverException
$e
)
{
throw
$this
->
convertExceptionDuringQuery
(
$e
,
$statement
);
}
finally
{
if
(
$logger
!==
null
)
{
$logger
->
stopQuery
();
}
}
}
/**
* Returns the current transaction nesting level.
*
...
...
@@ -1436,7 +1368,7 @@ class Connection
throw
ConnectionException
::
savepointsNotSupported
();
}
$this
->
execute
Update
(
$this
->
platform
->
createSavePoint
(
$savepoint
));
$this
->
execute
Statement
(
$this
->
platform
->
createSavePoint
(
$savepoint
));
}
/**
...
...
@@ -1458,7 +1390,7 @@ class Connection
return
;
}
$this
->
execute
Update
(
$this
->
platform
->
releaseSavePoint
(
$savepoint
));
$this
->
execute
Statement
(
$this
->
platform
->
releaseSavePoint
(
$savepoint
));
}
/**
...
...
@@ -1476,7 +1408,7 @@ class Connection
throw
ConnectionException
::
savepointsNotSupported
();
}
$this
->
execute
Update
(
$this
->
platform
->
rollbackSavePoint
(
$savepoint
));
$this
->
execute
Statement
(
$this
->
platform
->
rollbackSavePoint
(
$savepoint
));
}
/**
...
...
src/Connections/PrimaryReadReplicaConnection.php
View file @
4d172813
...
...
@@ -9,16 +9,13 @@ use Doctrine\DBAL\DBALException;
use
Doctrine\DBAL\Driver
;
use
Doctrine\DBAL\Driver\Connection
as
DriverConnection
;
use
Doctrine\DBAL\Driver\Exception
as
DriverException
;
use
Doctrine\DBAL\Driver\Result
;
use
Doctrine\DBAL\Event\ConnectionEventArgs
;
use
Doctrine\DBAL\Events
;
use
Doctrine\DBAL\Statement
;
use
InvalidArgumentException
;
use
function
array_rand
;
use
function
assert
;
use
function
count
;
use
function
func_get_args
;
/**
* Primary-Replica Connection
...
...
@@ -30,9 +27,8 @@ use function func_get_args;
*
* 1. Replica if primary was never picked before and ONLY if 'getWrappedConnection'
* or 'executeQuery' is used.
* 2. Primary picked when 'exec', 'executeUpdate', 'executeStatement', 'insert', 'delete', 'update', 'createSavepoint',
* 'releaseSavepoint', 'beginTransaction', 'rollback', 'commit', 'query' or
* 'prepare' is called.
* 2. Primary picked when 'executeStatement', 'insert', 'delete', 'update', 'createSavepoint',
* 'releaseSavepoint', 'beginTransaction', 'rollback', 'commit' or 'prepare' is called.
* 3. If Primary was picked once during the lifetime of the connection it will always get picked afterwards.
* 4. One replica connection is randomly picked ONCE during a request.
*
...
...
@@ -260,18 +256,6 @@ class PrimaryReadReplicaConnection extends Connection
return
$config
;
}
/**
* {@inheritDoc}
*
* @deprecated Use {@link executeStatement()} instead.
*/
public
function
executeUpdate
(
string
$query
,
array
$params
=
[],
array
$types
=
[])
:
int
{
$this
->
ensureConnectedToPrimary
();
return
parent
::
executeUpdate
(
$query
,
$params
,
$types
);
}
/**
* {@inheritDoc}
*/
...
...
@@ -312,16 +296,6 @@ class PrimaryReadReplicaConnection extends Connection
return
parent
::
rollBack
();
}
/**
* {@inheritDoc}
*/
public
function
delete
(
$tableName
,
array
$identifier
,
array
$types
=
[])
{
$this
->
ensureConnectedToPrimary
();
return
parent
::
delete
(
$tableName
,
$identifier
,
$types
);
}
/**
* {@inheritDoc}
*/
...
...
@@ -335,33 +309,6 @@ class PrimaryReadReplicaConnection extends Connection
$this
->
connections
=
[
'primary'
=>
null
,
'replica'
=>
null
];
}
/**
* {@inheritDoc}
*/
public
function
update
(
$tableName
,
array
$data
,
array
$identifier
,
array
$types
=
[])
{
$this
->
ensureConnectedToPrimary
();
return
parent
::
update
(
$tableName
,
$data
,
$identifier
,
$types
);
}
/**
* {@inheritDoc}
*/
public
function
insert
(
$tableName
,
array
$data
,
array
$types
=
[])
{
$this
->
ensureConnectedToPrimary
();
return
parent
::
insert
(
$tableName
,
$data
,
$types
);
}
public
function
exec
(
string
$statement
)
:
int
{
$this
->
ensureConnectedToPrimary
();
return
parent
::
exec
(
$statement
);
}
/**
* {@inheritDoc}
*/
...
...
@@ -392,27 +339,6 @@ class PrimaryReadReplicaConnection extends Connection
parent
::
rollbackSavepoint
(
$savepoint
);
}
public
function
query
(
string
$sql
)
:
Result
{
$this
->
ensureConnectedToPrimary
();
assert
(
$this
->
_conn
instanceof
DriverConnection
);
$args
=
func_get_args
();
$logger
=
$this
->
getConfiguration
()
->
getSQLLogger
();
if
(
$logger
!==
null
)
{
$logger
->
startQuery
(
$sql
);
}
$statement
=
$this
->
_conn
->
query
(
$sql
);
if
(
$logger
!==
null
)
{
$logger
->
stopQuery
();
}
return
$statement
;
}
public
function
prepare
(
string
$sql
)
:
Statement
{
$this
->
ensureConnectedToPrimary
();
...
...
src/Event/Listeners/SQLSessionInit.php
View file @
4d172813
...
...
@@ -30,7 +30,7 @@ class SQLSessionInit implements EventSubscriber
*/
public
function
postConnect
(
ConnectionEventArgs
$args
)
{
$args
->
getConnection
()
->
execute
Update
(
$this
->
sql
);
$args
->
getConnection
()
->
execute
Statement
(
$this
->
sql
);
}
/**
...
...
src/Schema/SQLServerSchemaManager.php
View file @
4d172813
...
...
@@ -278,7 +278,7 @@ class SQLServerSchemaManager extends AbstractSchemaManager
foreach
(
$tableDiff
->
removedColumns
as
$col
)
{
$columnConstraintSql
=
$this
->
getColumnConstraintSQL
(
$tableDiff
->
name
,
$col
->
getName
());
foreach
(
$this
->
_conn
->
fetchAllAssociative
(
$columnConstraintSql
)
as
$constraint
)
{
$this
->
_conn
->
exec
(
$this
->
_conn
->
exec
uteStatement
(
sprintf
(
'ALTER TABLE %s DROP CONSTRAINT %s'
,
$tableDiff
->
name
,
...
...
src/Schema/Synchronizer/AbstractSchemaSynchronizer.php
View file @
4d172813
...
...
@@ -28,7 +28,7 @@ abstract class AbstractSchemaSynchronizer implements SchemaSynchronizer
{
foreach
(
$sql
as
$s
)
{
try
{
$this
->
conn
->
exec
(
$s
);
$this
->
conn
->
exec
uteStatement
(
$s
);
}
catch
(
Throwable
$e
)
{
}
}
...
...
@@ -44,7 +44,7 @@ abstract class AbstractSchemaSynchronizer implements SchemaSynchronizer
protected
function
processSql
(
array
$sql
)
{
foreach
(
$sql
as
$s
)
{
$this
->
conn
->
exec
(
$s
);
$this
->
conn
->
exec
uteStatement
(
$s
);
}
}
}
tests/ConnectionTest.php
View file @
4d172813
...
...
@@ -174,18 +174,6 @@ class ConnectionTest extends TestCase
*/
public
static
function
getQueryMethods
()
:
iterable
{
yield
'exec'
=>
[
static
function
(
Connection
$connection
,
string
$statement
)
:
void
{
$connection
->
exec
(
$statement
);
},
];
yield
'query'
=>
[
static
function
(
Connection
$connection
,
string
$statement
)
:
void
{
$connection
->
query
(
$statement
);
},
];
yield
'executeQuery'
=>
[
static
function
(
Connection
$connection
,
string
$statement
)
:
void
{
$connection
->
executeQuery
(
$statement
);
...
...
tests/Events/SQLSessionInitTest.php
View file @
4d172813
...
...
@@ -17,7 +17,7 @@ class SQLSessionInitTest extends TestCase
{
$connectionMock
=
$this
->
createMock
(
Connection
::
class
);
$connectionMock
->
expects
(
self
::
once
())
->
method
(
'execute
Update
'
)
->
method
(
'execute
Statement
'
)
->
with
(
self
::
equalTo
(
"SET SEARCH_PATH TO foo, public, TIMEZONE TO 'Europe/Berlin'"
));
$eventArgs
=
new
ConnectionEventArgs
(
$connectionMock
);
...
...
tests/Functional/BlobTest.php
View file @
4d172813
...
...
@@ -158,7 +158,7 @@ class BlobTest extends FunctionalTestCase
private
function
assertBlobContains
(
string
$text
)
:
void
{
$rows
=
$this
->
connection
->
query
(
'SELECT blobfield FROM blob_table'
)
->
fetchFirstColumn
(
);
$rows
=
$this
->
connection
->
fetchFirstColumn
(
'SELECT blobfield FROM blob_table'
);
self
::
assertCount
(
1
,
$rows
);
...
...
tests/Functional/Connection/ConnectionLostTest.php
View file @
4d172813
...
...
@@ -30,7 +30,7 @@ class ConnectionLostTest extends FunctionalTestCase
public
function
testConnectionLost
()
:
void
{
$this
->
connection
->
query
(
'SET SESSION wait_timeout=1'
);
$this
->
connection
->
executeStatement
(
'SET SESSION wait_timeout=1'
);
sleep
(
2
);
...
...
tests/Functional/DataAccessTest.php
View file @
4d172813
...
...
@@ -546,7 +546,7 @@ class DataAccessTest extends FunctionalTestCase
*/
public
function
testBitComparisonExpressionSupport
()
:
void
{
$this
->
connection
->
exec
(
'DELETE FROM fetch_table'
);
$this
->
connection
->
exec
uteStatement
(
'DELETE FROM fetch_table'
);
$platform
=
$this
->
connection
->
getDatabasePlatform
();
$bitmap
=
[];
...
...
@@ -601,7 +601,7 @@ class DataAccessTest extends FunctionalTestCase
$this
->
connection
->
insert
(
'fetch_table'
,
[
'test_int'
=>
10
,
'test_string'
=>
'foo'
]);
$sql
=
'SELECT test_int FROM fetch_table'
;
$values
=
$this
->
connection
->
query
(
$sql
)
->
fetchFirstColumn
(
);
$values
=
$this
->
connection
->
fetchFirstColumn
(
$sql
);
self
::
assertEquals
([
1
,
10
],
$values
);
}
...
...
@@ -612,9 +612,8 @@ class DataAccessTest extends FunctionalTestCase
public
function
testEmptyFetchOneReturnsFalse
()
:
void
{
$this
->
connection
->
beginTransaction
();
$this
->
connection
->
exec
(
'DELETE FROM fetch_table'
);
$this
->
connection
->
exec
uteStatement
(
'DELETE FROM fetch_table'
);
self
::
assertFalse
(
$this
->
connection
->
fetchOne
(
'SELECT test_int FROM fetch_table'
));
self
::
assertFalse
(
$this
->
connection
->
query
(
'SELECT test_int FROM fetch_table'
)
->
fetchOne
());
$this
->
connection
->
rollBack
();
}
...
...
tests/Functional/Driver/PDO/PgSQL/ConnectionTest.php
View file @
4d172813
...
...
@@ -40,8 +40,7 @@ class ConnectionTest extends FunctionalTestCase
self
::
assertEquals
(
$charset
,
$connection
->
query
(
'SHOW client_encoding'
)
->
fetchOne
()
$connection
->
fetchOne
(
'SHOW client_encoding'
)
);
}
...
...
tests/Functional/ExceptionTest.php
View file @
4d172813
...
...
@@ -86,7 +86,7 @@ class ExceptionTest extends FunctionalTestCase
public
function
testForeignKeyConstraintViolationExceptionOnInsert
()
:
void
{
if
(
$this
->
connection
->
getDatabasePlatform
()
->
getName
()
===
'sqlite'
)
{
$this
->
connection
->
exec
(
'PRAGMA foreign_keys=ON'
);
$this
->
connection
->
exec
uteStatement
(
'PRAGMA foreign_keys=ON'
);
}
$this
->
setUpForeignKeyConstraintViolationExceptionTest
();
...
...
@@ -231,7 +231,7 @@ class ExceptionTest extends FunctionalTestCase
$table
->
setPrimaryKey
([
'id'
]);
foreach
(
$schema
->
toSql
(
$this
->
connection
->
getDatabasePlatform
())
as
$sql
)
{
$this
->
connection
->
exec
(
$sql
);
$this
->
connection
->
exec
uteStatement
(
$sql
);
}
$this
->
expectException
(
Exception\NotNullConstraintViolationException
::
class
);
...
...
@@ -246,7 +246,7 @@ class ExceptionTest extends FunctionalTestCase
$table
->
addColumn
(
'id'
,
'integer'
,
[]);
foreach
(
$schema
->
toSql
(
$this
->
connection
->
getDatabasePlatform
())
as
$sql
)
{
$this
->
connection
->
exec
(
$sql
);
$this
->
connection
->
exec
uteStatement
(
$sql
);
}
$this
->
expectException
(
Exception\InvalidFieldNameException
::
class
);
...
...
@@ -264,7 +264,7 @@ class ExceptionTest extends FunctionalTestCase
$table2
->
addColumn
(
'id'
,
'integer'
);
foreach
(
$schema
->
toSql
(
$this
->
connection
->
getDatabasePlatform
())
as
$sql
)
{
$this
->
connection
->
exec
(
$sql
);
$this
->
connection
->
exec
uteStatement
(
$sql
);
}
$sql
=
'SELECT id FROM ambiguous_list_table, ambiguous_list_table_2'
;
...
...
@@ -281,7 +281,7 @@ class ExceptionTest extends FunctionalTestCase
$table
->
addUniqueIndex
([
'id'
]);
foreach
(
$schema
->
toSql
(
$this
->
connection
->
getDatabasePlatform
())
as
$sql
)
{
$this
->
connection
->
exec
(
$sql
);
$this
->
connection
->
exec
uteStatement
(
$sql
);
}
$this
->
connection
->
insert
(
'unique_field_table'
,
[
'id'
=>
5
]);
...
...
@@ -345,7 +345,7 @@ EOT
try
{
foreach
(
$schema
->
toSql
(
$conn
->
getDatabasePlatform
())
as
$sql
)
{
$conn
->
exec
(
$sql
);
$conn
->
exec
uteStatement
(
$sql
);
}
}
finally
{
$this
->
cleanupReadOnlyFile
(
$filename
);
...
...
@@ -390,7 +390,7 @@ EOT
$this
->
expectException
(
Exception\ConnectionException
::
class
);
foreach
(
$schema
->
toSql
(
$conn
->
getDatabasePlatform
())
as
$sql
)
{
$conn
->
exec
(
$sql
);
$conn
->
exec
uteStatement
(
$sql
);
}
}
...
...
tests/Functional/ModifyLimitQueryTest.php
View file @
4d172813
...
...
@@ -35,8 +35,15 @@ class ModifyLimitQueryTest extends FunctionalTestCase
self
::
$tableCreated
=
true
;
}
$this
->
connection
->
exec
(
$this
->
connection
->
getDatabasePlatform
()
->
getTruncateTableSQL
(
'modify_limit_table'
));
$this
->
connection
->
exec
(
$this
->
connection
->
getDatabasePlatform
()
->
getTruncateTableSQL
(
'modify_limit_table2'
));
$platform
=
$this
->
connection
->
getDatabasePlatform
();
$this
->
connection
->
executeStatement
(
$platform
->
getTruncateTableSQL
(
'modify_limit_table'
)
);
$this
->
connection
->
executeStatement
(
$platform
->
getTruncateTableSQL
(
'modify_limit_table2'
)
);
}
public
function
testModifyLimitQuerySimpleQuery
()
:
void
...
...
tests/Functional/Platform/DateExpressionTest.php
View file @
4d172813
...
...
@@ -27,7 +27,7 @@ class DateExpressionTest extends FunctionalTestCase
$platform
=
$this
->
connection
->
getDatabasePlatform
();
$sql
=
sprintf
(
'SELECT %s FROM date_expr_test'
,
$platform
->
getDateDiffExpression
(
'date1'
,
'date2'
));
$diff
=
$this
->
connection
->
query
(
$sql
)
->
fetchOne
(
);
$diff
=
$this
->
connection
->
fetchOne
(
$sql
);
self
::
assertEquals
(
$expected
,
$diff
);
}
...
...
tests/Functional/Platform/DefaultExpressionTest.php
View file @
4d172813
...
...
@@ -62,16 +62,16 @@ class DefaultExpressionTest extends FunctionalTestCase
$table
->
addColumn
(
'default_value'
,
$type
,
[
'default'
=>
$defaultSql
]);
$this
->
connection
->
getSchemaManager
()
->
dropAndCreateTable
(
$table
);
$this
->
connection
->
exec
(
$this
->
connection
->
exec
uteStatement
(
sprintf
(
'INSERT INTO default_expr_test (actual_value) VALUES (%s)'
,
$defaultSql
)
);
[
$actualValue
,
$defaultValue
]
=
$this
->
connection
->
query
(
[
$actualValue
,
$defaultValue
]
=
$this
->
connection
->
fetchNumeric
(
'SELECT default_value, actual_value FROM default_expr_test'
)
->
fetchNumeric
()
;
);
self
::
assertEquals
(
$actualValue
,
$defaultValue
);
}
...
...
tests/Functional/Platform/NewPrimaryKeyWithNewAutoIncrementColumnTest.php
View file @
4d172813
...
...
@@ -48,7 +48,7 @@ final class NewPrimaryKeyWithNewAutoIncrementColumnTest extends FunctionalTestCa
$diff
=
(
new
Comparator
())
->
compare
(
$schema
,
$newSchema
);
foreach
(
$diff
->
toSql
(
$this
->
getPlatform
())
as
$sql
)
{
$this
->
connection
->
exec
(
$sql
);
$this
->
connection
->
exec
uteStatement
(
$sql
);
}
$validationSchema
=
$schemaManager
->
createSchema
();
...
...
tests/Functional/PortabilityTest.php
View file @
4d172813
...
...
@@ -53,7 +53,7 @@ class PortabilityTest extends FunctionalTestCase
$rows
=
$this
->
connection
->
fetchAllAssociative
(
'SELECT * FROM portability_table'
);
$this
->
assertFetchResultRows
(
$rows
);
$result
=
$this
->
connection
->
q
uery
(
'SELECT * FROM portability_table'
);
$result
=
$this
->
connection
->
executeQ
uery
(
'SELECT * FROM portability_table'
);
while
((
$row
=
$result
->
fetchAssociative
()))
{
$this
->
assertFetchResultRow
(
$row
);
...
...
@@ -73,7 +73,7 @@ class PortabilityTest extends FunctionalTestCase
$rows
=
$this
->
connection
->
fetchAllAssociative
(
'SELECT * FROM portability_table'
);
$this
->
assertFetchResultRows
(
$rows
);
$result
=
$this
->
connection
->
q
uery
(
'SELECT * FROM portability_table'
);
$result
=
$this
->
connection
->
executeQ
uery
(
'SELECT * FROM portability_table'
);
while
((
$row
=
$result
->
fetchAssociative
()))
{
$this
->
assertFetchResultRow
(
$row
);
}
...
...
@@ -120,7 +120,7 @@ class PortabilityTest extends FunctionalTestCase
*/
public
function
testFetchColumn
(
string
$field
,
array
$expected
)
:
void
{
$result
=
$this
->
connection
->
q
uery
(
'SELECT '
.
$field
.
' FROM portability_table'
);
$result
=
$this
->
connection
->
executeQ
uery
(
'SELECT '
.
$field
.
' FROM portability_table'
);
$column
=
$result
->
fetchFirstColumn
();
self
::
assertEquals
(
$expected
,
$column
);
...
...
@@ -145,9 +145,8 @@ class PortabilityTest extends FunctionalTestCase
public
function
testFetchAllNullColumn
()
:
void
{
$
result
=
$this
->
connection
->
query
(
'SELECT Test_Null FROM portability_table'
);
$
column
=
$this
->
connection
->
fetchFirstColumn
(
'SELECT Test_Null FROM portability_table'
);
$column
=
$result
->
fetchFirstColumn
();
self
::
assertSame
([
null
,
null
],
$column
);
}
}
tests/Functional/PrimaryReadReplicaConnectionTest.php
View file @
4d172813
...
...
@@ -189,48 +189,4 @@ class PrimaryReadReplicaConnectionTest extends FunctionalTestCase
$conn
->
ensureConnectedToPrimary
();
self
::
assertTrue
(
$conn
->
isConnectedToPrimary
());
}
public
function
testQueryOnPrimary
()
:
void
{
$conn
=
$this
->
createPrimaryReadReplicaConnection
();
$query
=
'SELECT count(*) as num FROM primary_replica_table'
;
$result
=
$conn
->
query
(
$query
);
//Query must be executed only on Primary
self
::
assertTrue
(
$conn
->
isConnectedToPrimary
());
$data
=
$result
->
fetchAllAssociative
();
self
::
assertArrayHasKey
(
0
,
$data
);
self
::
assertArrayHasKey
(
'num'
,
$data
[
0
]);
//Could be set in other fetchmodes
self
::
assertArrayNotHasKey
(
0
,
$data
[
0
]);
self
::
assertEquals
(
1
,
$data
[
0
][
'num'
]);
}
public
function
testQueryOnReplica
()
:
void
{
$conn
=
$this
->
createPrimaryReadReplicaConnection
();
$conn
->
ensureConnectedToReplica
();
$query
=
'SELECT count(*) as num FROM primary_replica_table'
;
$result
=
$conn
->
query
(
$query
);
//Query must be executed only on Primary, even when we connect to the replica
self
::
assertTrue
(
$conn
->
isConnectedToPrimary
());
$data
=
$result
->
fetchAllAssociative
();
self
::
assertArrayHasKey
(
0
,
$data
);
self
::
assertArrayHasKey
(
'num'
,
$data
[
0
]);
//Could be set in other fetchmodes
self
::
assertArrayNotHasKey
(
0
,
$data
[
0
]);
self
::
assertEquals
(
1
,
$data
[
0
][
'num'
]);
}
}
tests/Functional/Schema/ForeignKeyTest.php
View file @
4d172813
...
...
@@ -26,7 +26,7 @@ class ForeignKeyTest extends FunctionalTestCase
);
foreach
(
$schema
->
toSql
(
$this
->
connection
->
getDatabasePlatform
())
as
$sql
)
{
$this
->
connection
->
exec
(
$sql
);
$this
->
connection
->
exec
uteStatement
(
$sql
);
}
self
::
assertCount
(
...
...
tests/Functional/Schema/MySqlSchemaManagerTest.php
View file @
4d172813
...
...
@@ -520,7 +520,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
public
function
testEnsureTableOptionsAreReflectedInMetadata
()
:
void
{
$this
->
connection
->
query
(
'DROP TABLE IF EXISTS test_table_metadata'
);
$this
->
connection
->
executeStatement
(
'DROP TABLE IF EXISTS test_table_metadata'
);
$sql
=
<<<'SQL'
CREATE TABLE test_table_metadata(
...
...
@@ -534,7 +534,7 @@ AUTO_INCREMENT=42
PARTITION BY HASH (col1)
SQL;
$this
->
connection
->
query
(
$sql
);
$this
->
connection
->
executeStatement
(
$sql
);
$onlineTable
=
$this
->
schemaManager
->
listTableDetails
(
'test_table_metadata'
);
self
::
assertEquals
(
'InnoDB'
,
$onlineTable
->
getOption
(
'engine'
));
...
...
@@ -549,9 +549,9 @@ SQL;
public
function
testEnsureTableWithoutOptionsAreReflectedInMetadata
()
:
void
{
$this
->
connection
->
query
(
'DROP TABLE IF EXISTS test_table_empty_metadata'
);
$this
->
connection
->
executeStatement
(
'DROP TABLE IF EXISTS test_table_empty_metadata'
);
$this
->
connection
->
query
(
'CREATE TABLE test_table_empty_metadata(col1 INT NOT NULL)'
);
$this
->
connection
->
executeStatement
(
'CREATE TABLE test_table_empty_metadata(col1 INT NOT NULL)'
);
$onlineTable
=
$this
->
schemaManager
->
listTableDetails
(
'test_table_empty_metadata'
);
self
::
assertNotEmpty
(
$onlineTable
->
getOption
(
'engine'
));
...
...
tests/Functional/Schema/OracleSchemaManagerTest.php
View file @
4d172813
...
...
@@ -28,7 +28,7 @@ class OracleSchemaManagerTest extends SchemaManagerFunctionalTestCase
}
TestUtil
::
getPrivilegedConnection
()
->
exec
(
'GRANT ALL PRIVILEGES TO '
.
$GLOBALS
[
'db_user'
]);
->
exec
uteStatement
(
'GRANT ALL PRIVILEGES TO '
.
$GLOBALS
[
'db_user'
]);
self
::
$privilegesGranted
=
true
;
}
...
...
tests/Functional/Schema/PostgreSqlSchemaManagerTest.php
View file @
4d172813
...
...
@@ -66,10 +66,10 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
public
function
testSupportDomainTypeFallback
()
:
void
{
$createDomainTypeSQL
=
'CREATE DOMAIN MyMoney AS DECIMAL(18,2)'
;
$this
->
connection
->
exec
(
$createDomainTypeSQL
);
$this
->
connection
->
exec
uteStatement
(
$createDomainTypeSQL
);
$createTableSQL
=
'CREATE TABLE domain_type_test (id INT PRIMARY KEY, value MyMoney)'
;
$this
->
connection
->
exec
(
$createTableSQL
);
$this
->
connection
->
exec
uteStatement
(
$createTableSQL
);
$table
=
$this
->
connection
->
getSchemaManager
()
->
listTableDetails
(
'domain_type_test'
);
self
::
assertInstanceOf
(
DecimalType
::
class
,
$table
->
getColumn
(
'value'
)
->
getType
());
...
...
@@ -154,7 +154,7 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
*/
public
function
testTableWithSchema
()
:
void
{
$this
->
connection
->
exec
(
'CREATE SCHEMA nested'
);
$this
->
connection
->
exec
uteStatement
(
'CREATE SCHEMA nested'
);
$nestedRelatedTable
=
new
Table
(
'nested.schemarelated'
);
$column
=
$nestedRelatedTable
->
addColumn
(
'id'
,
'integer'
);
...
...
@@ -190,10 +190,10 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
public
function
testReturnQuotedAssets
()
:
void
{
$sql
=
'create table dbal91_something ( id integer CONSTRAINT id_something PRIMARY KEY NOT NULL ,"table" integer );'
;
$this
->
connection
->
exec
(
$sql
);
$this
->
connection
->
exec
uteStatement
(
$sql
);
$sql
=
'ALTER TABLE dbal91_something ADD CONSTRAINT something_input FOREIGN KEY( "table" ) REFERENCES dbal91_something ON UPDATE CASCADE;'
;
$this
->
connection
->
exec
(
$sql
);
$this
->
connection
->
exec
uteStatement
(
$sql
);
$table
=
$this
->
schemaManager
->
listTableDetails
(
'dbal91_something'
);
...
...
@@ -349,8 +349,8 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
public
function
testListTableDetailsWhenCurrentSchemaNameQuoted
()
:
void
{
$this
->
connection
->
exec
(
'CREATE SCHEMA "001_test"'
);
$this
->
connection
->
exec
(
'SET search_path TO "001_test"'
);
$this
->
connection
->
exec
uteStatement
(
'CREATE SCHEMA "001_test"'
);
$this
->
connection
->
exec
uteStatement
(
'SET search_path TO "001_test"'
);
try
{
$this
->
testListQuotedTable
();
...
...
tests/Functional/Schema/SchemaManagerFunctionalTestCase.php
View file @
4d172813
...
...
@@ -86,7 +86,7 @@ abstract class SchemaManagerFunctionalTestCase extends FunctionalTestCase
//TODO: SchemaDiff does not drop removed namespaces?
try
{
//sql server versions below 2016 do not support 'IF EXISTS' so we have to catch the exception here
$this
->
connection
->
exec
(
'DROP SCHEMA testschema'
);
$this
->
connection
->
exec
uteStatement
(
'DROP SCHEMA testschema'
);
}
catch
(
DBALException
$e
)
{
return
;
}
...
...
@@ -643,7 +643,7 @@ abstract class SchemaManagerFunctionalTestCase extends FunctionalTestCase
$diff
->
newNamespaces
[]
=
'testschema'
;
foreach
(
$diff
->
toSql
(
$this
->
schemaManager
->
getDatabasePlatform
())
as
$sql
)
{
$this
->
connection
->
exec
(
$sql
);
$this
->
connection
->
exec
uteStatement
(
$sql
);
}
//test if table is create in namespace
...
...
@@ -1440,17 +1440,17 @@ abstract class SchemaManagerFunctionalTestCase extends FunctionalTestCase
$this
->
connection
->
insert
(
'test_pk_auto_increment'
,
[
'text'
=>
'1'
]);
$
result
=
$this
->
connection
->
query
(
'SELECT id FROM test_pk_auto_increment WHERE text = \'1\''
);
$lastUsedIdBeforeDelete
=
(
int
)
$result
->
fetchOne
(
);
$
lastUsedIdBeforeDelete
=
(
int
)
$this
->
connection
->
fetchOne
(
"SELECT id FROM test_pk_auto_increment WHERE text = '1'"
);
$this
->
connection
->
query
(
'DELETE FROM test_pk_auto_increment'
);
$this
->
connection
->
executeStatement
(
'DELETE FROM test_pk_auto_increment'
);
$this
->
connection
->
insert
(
'test_pk_auto_increment'
,
[
'text'
=>
'2'
]);
$
result
=
$this
->
connection
->
query
(
'SELECT id FROM test_pk_auto_increment WHERE text = \'2\''
);
$lastUsedIdAfterDelete
=
(
int
)
$result
->
fetchOne
(
);
$
lastUsedIdAfterDelete
=
(
int
)
$this
->
connection
->
fetchOne
(
"SELECT id FROM test_pk_auto_increment WHERE text = '2'"
);
self
::
assertGreaterThan
(
$lastUsedIdBeforeDelete
,
$lastUsedIdAfterDelete
);
}
...
...
@@ -1505,7 +1505,7 @@ abstract class SchemaManagerFunctionalTestCase extends FunctionalTestCase
$sqls
=
$diff
->
toSql
(
$platform
);
foreach
(
$sqls
as
$sql
)
{
$this
->
connection
->
exec
(
$sql
);
$this
->
connection
->
exec
uteStatement
(
$sql
);
}
$schema
=
new
Schema
([
...
...
tests/Functional/Schema/SqliteSchemaManagerTest.php
View file @
4d172813
...
...
@@ -77,7 +77,7 @@ class SqliteSchemaManagerTest extends SchemaManagerFunctionalTestCase
public
function
testListForeignKeysFromExistingDatabase
()
:
void
{
$this
->
connection
->
exec
(
<<<EOS
$this
->
connection
->
exec
uteStatement
(
<<<EOS
CREATE TABLE user (
id INTEGER PRIMARY KEY AUTOINCREMENT,
page INTEGER CONSTRAINT FK_1 REFERENCES page (key) DEFERRABLE INITIALLY DEFERRED,
...
...
@@ -165,7 +165,7 @@ CREATE TABLE dbal_1779 (
)
SQL;
$this
->
connection
->
exec
(
$sql
);
$this
->
connection
->
exec
uteStatement
(
$sql
);
$columns
=
$this
->
schemaManager
->
listTableColumns
(
'dbal_1779'
);
...
...
@@ -234,13 +234,13 @@ SQL;
$this
->
connection
->
insert
(
'test_pk_auto_increment'
,
[
'text'
=>
'1'
]);
$this
->
connection
->
query
(
'DELETE FROM test_pk_auto_increment'
);
$this
->
connection
->
executeStatement
(
'DELETE FROM test_pk_auto_increment'
);
$this
->
connection
->
insert
(
'test_pk_auto_increment'
,
[
'text'
=>
'2'
]);
$
result
=
$this
->
connection
->
query
(
'SELECT id FROM test_pk_auto_increment WHERE text = "2"'
);
$lastUsedIdAfterDelete
=
(
int
)
$result
->
fetchOne
(
);
$
lastUsedIdAfterDelete
=
(
int
)
$this
->
connection
->
fetchOne
(
'SELECT id FROM test_pk_auto_increment WHERE text = "2"'
);
// with an empty table, non autoincrement rowid is always 1
self
::
assertEquals
(
1
,
$lastUsedIdAfterDelete
);
...
...
tests/Functional/TableGeneratorTest.php
View file @
4d172813
...
...
@@ -31,7 +31,7 @@ class TableGeneratorTest extends FunctionalTestCase
$schema
->
visit
(
$visitor
);
foreach
(
$schema
->
toSql
(
$platform
)
as
$sql
)
{
$this
->
connection
->
exec
(
$sql
);
$this
->
connection
->
exec
uteStatement
(
$sql
);
}
}
catch
(
Throwable
$e
)
{
}
...
...
tests/Functional/TemporaryTableTest.php
View file @
4d172813
...
...
@@ -13,7 +13,9 @@ class TemporaryTableTest extends FunctionalTestCase
{
parent
::
setUp
();
try
{
$this
->
connection
->
exec
(
$this
->
connection
->
getDatabasePlatform
()
->
getDropTableSQL
(
'nontemporary'
));
$this
->
connection
->
executeStatement
(
$this
->
connection
->
getDatabasePlatform
()
->
getDropTableSQL
(
'nontemporary'
)
);
}
catch
(
Throwable
$e
)
{
}
}
...
...
@@ -23,7 +25,9 @@ class TemporaryTableTest extends FunctionalTestCase
if
(
$this
->
connection
)
{
try
{
$tempTable
=
$this
->
connection
->
getDatabasePlatform
()
->
getTemporaryTableName
(
'my_temporary'
);
$this
->
connection
->
exec
(
$this
->
connection
->
getDatabasePlatform
()
->
getDropTemporaryTableSQL
(
$tempTable
));
$this
->
connection
->
executeStatement
(
$this
->
connection
->
getDatabasePlatform
()
->
getDropTemporaryTableSQL
(
$tempTable
)
);
}
catch
(
Throwable
$e
)
{
}
}
...
...
@@ -56,7 +60,9 @@ class TemporaryTableTest extends FunctionalTestCase
$this
->
connection
->
beginTransaction
();
$this
->
connection
->
insert
(
'nontemporary'
,
[
'id'
=>
1
]);
$this
->
connection
->
exec
(
$platform
->
getDropTemporaryTableSQL
(
$tempTable
));
$this
->
connection
->
executeStatement
(
$platform
->
getDropTemporaryTableSQL
(
$tempTable
)
);
$this
->
connection
->
insert
(
'nontemporary'
,
[
'id'
=>
2
]);
$this
->
connection
->
rollBack
();
...
...
@@ -90,13 +96,15 @@ class TemporaryTableTest extends FunctionalTestCase
$this
->
connection
->
beginTransaction
();
$this
->
connection
->
insert
(
'nontemporary'
,
[
'id'
=>
1
]);
$this
->
connection
->
exec
(
$createTempTableSQL
);
$this
->
connection
->
exec
uteStatement
(
$createTempTableSQL
);
$this
->
connection
->
insert
(
'nontemporary'
,
[
'id'
=>
2
]);
$this
->
connection
->
rollBack
();
try
{
$this
->
connection
->
exec
(
$platform
->
getDropTemporaryTableSQL
(
$tempTable
));
$this
->
connection
->
executeStatement
(
$platform
->
getDropTemporaryTableSQL
(
$tempTable
)
);
}
catch
(
Throwable
$e
)
{
}
...
...
tests/Functional/Ticket/DBAL202Test.php
View file @
4d172813
...
...
@@ -19,7 +19,7 @@ class DBAL202Test extends FunctionalTestCase
}
if
(
$this
->
connection
->
getSchemaManager
()
->
tablesExist
(
'DBAL202'
))
{
$this
->
connection
->
exec
(
'DELETE FROM DBAL202'
);
$this
->
connection
->
exec
uteStatement
(
'DELETE FROM DBAL202'
);
}
else
{
$table
=
new
Table
(
'DBAL202'
);
$table
->
addColumn
(
'id'
,
'integer'
);
...
...
@@ -36,7 +36,7 @@ class DBAL202Test extends FunctionalTestCase
$stmt
->
execute
();
$this
->
connection
->
rollBack
();
self
::
assertEquals
(
0
,
$this
->
connection
->
query
(
'SELECT COUNT(1) FROM DBAL202'
)
->
fetchOne
(
));
self
::
assertEquals
(
0
,
$this
->
connection
->
fetchOne
(
'SELECT COUNT(1) FROM DBAL202'
));
}
public
function
testStatementCommit
()
:
void
...
...
@@ -46,6 +46,6 @@ class DBAL202Test extends FunctionalTestCase
$stmt
->
execute
();
$this
->
connection
->
commit
();
self
::
assertEquals
(
1
,
$this
->
connection
->
query
(
'SELECT COUNT(1) FROM DBAL202'
)
->
fetchOne
(
));
self
::
assertEquals
(
1
,
$this
->
connection
->
fetchOne
(
'SELECT COUNT(1) FROM DBAL202'
));
}
}
tests/Functional/Ticket/DBAL630Test.php
View file @
4d172813
...
...
@@ -26,8 +26,8 @@ class DBAL630Test extends FunctionalTestCase
}
try
{
$this
->
connection
->
exec
(
'CREATE TABLE dbal630 (id SERIAL, bool_col BOOLEAN NOT NULL);'
);
$this
->
connection
->
exec
(
'CREATE TABLE dbal630_allow_nulls (id SERIAL, bool_col BOOLEAN);'
);
$this
->
connection
->
exec
uteStatement
(
'CREATE TABLE dbal630 (id SERIAL, bool_col BOOLEAN NOT NULL);'
);
$this
->
connection
->
exec
uteStatement
(
'CREATE TABLE dbal630_allow_nulls (id SERIAL, bool_col BOOLEAN);'
);
}
catch
(
DBALException
$e
)
{
}
...
...
tests/Functional/Ticket/DBAL752Test.php
View file @
4d172813
...
...
@@ -23,7 +23,7 @@ class DBAL752Test extends FunctionalTestCase
public
function
testUnsignedIntegerDetection
()
:
void
{
$this
->
connection
->
exec
(
<<<SQL
$this
->
connection
->
exec
uteStatement
(
<<<SQL
CREATE TABLE dbal752_unsigneds (
small SMALLINT,
small_unsigned SMALLINT UNSIGNED,
...
...
tests/Functional/TransactionTest.php
View file @
4d172813
...
...
@@ -29,7 +29,7 @@ class TransactionTest extends FunctionalTestCase
public
function
testCommitFalse
()
:
void
{
$this
->
connection
->
query
(
'SET SESSION wait_timeout=1'
);
$this
->
connection
->
executeStatement
(
'SET SESSION wait_timeout=1'
);
self
::
assertTrue
(
$this
->
connection
->
beginTransaction
());
...
...
tests/Functional/WriteTest.php
View file @
4d172813
...
...
@@ -174,8 +174,9 @@ class WriteTest extends FunctionalTestCase
return
strtolower
(
$sequence
->
getName
())
===
'write_table_id_seq'
;
}));
$result
=
$this
->
connection
->
query
(
$this
->
connection
->
getDatabasePlatform
()
->
getSequenceNextValSQL
(
'write_table_id_seq'
));
$nextSequenceVal
=
$result
->
fetchOne
();
$nextSequenceVal
=
$this
->
connection
->
fetchOne
(
$this
->
connection
->
getDatabasePlatform
()
->
getSequenceNextValSQL
(
'write_table_id_seq'
)
);
$lastInsertId
=
$this
->
lastInsertId
(
'write_table_id_seq'
);
...
...
@@ -276,7 +277,7 @@ class WriteTest extends FunctionalTestCase
}
foreach
(
$platform
->
getCreateTableSQL
(
$table
)
as
$sql
)
{
$this
->
connection
->
exec
(
$sql
);
$this
->
connection
->
exec
uteStatement
(
$sql
);
}
$seqName
=
$platform
->
usesSequenceEmulatedIdentityColumns
()
...
...
@@ -285,11 +286,11 @@ class WriteTest extends FunctionalTestCase
$sql
=
$platform
->
getEmptyIdentityInsertSQL
(
'test_empty_identity'
,
'id'
);
$this
->
connection
->
exec
(
$sql
);
$this
->
connection
->
exec
uteStatement
(
$sql
);
$firstId
=
$this
->
lastInsertId
(
$seqName
);
$this
->
connection
->
exec
(
$sql
);
$this
->
connection
->
exec
uteStatement
(
$sql
);
$secondId
=
$this
->
lastInsertId
(
$seqName
);
...
...
tests/TestUtil.php
View file @
4d172813
...
...
@@ -106,7 +106,7 @@ class TestUtil
$stmts
=
$schema
->
toDropSql
(
$testConn
->
getDatabasePlatform
());
foreach
(
$stmts
as
$stmt
)
{
$testConn
->
exec
(
$stmt
);
$testConn
->
exec
uteStatement
(
$stmt
);
}
}
}
...
...
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