Replace $conn->exec() and $conn->executeUpdate() with $conn->executeStatement()

parent d47675e2
...@@ -1027,23 +1027,6 @@ class Connection ...@@ -1027,23 +1027,6 @@ class Connection
return new Result($result, $this); return new Result($result, $this);
} }
/**
* 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. * Executes an SQL statement with the given parameters and returns the number of affected rows.
* *
...@@ -1410,7 +1393,7 @@ class Connection ...@@ -1410,7 +1393,7 @@ class Connection
throw ConnectionException::savepointsNotSupported(); throw ConnectionException::savepointsNotSupported();
} }
$this->executeUpdate($this->platform->createSavePoint($savepoint)); $this->executeStatement($this->platform->createSavePoint($savepoint));
} }
/** /**
...@@ -1432,7 +1415,7 @@ class Connection ...@@ -1432,7 +1415,7 @@ class Connection
return; return;
} }
$this->executeUpdate($this->platform->releaseSavePoint($savepoint)); $this->executeStatement($this->platform->releaseSavePoint($savepoint));
} }
/** /**
...@@ -1450,7 +1433,7 @@ class Connection ...@@ -1450,7 +1433,7 @@ class Connection
throw ConnectionException::savepointsNotSupported(); throw ConnectionException::savepointsNotSupported();
} }
$this->executeUpdate($this->platform->rollbackSavePoint($savepoint)); $this->executeStatement($this->platform->rollbackSavePoint($savepoint));
} }
/** /**
......
...@@ -30,7 +30,7 @@ class SQLSessionInit implements EventSubscriber ...@@ -30,7 +30,7 @@ class SQLSessionInit implements EventSubscriber
*/ */
public function postConnect(ConnectionEventArgs $args) public function postConnect(ConnectionEventArgs $args)
{ {
$args->getConnection()->executeUpdate($this->sql); $args->getConnection()->executeStatement($this->sql);
} }
/** /**
......
...@@ -278,7 +278,7 @@ class SQLServerSchemaManager extends AbstractSchemaManager ...@@ -278,7 +278,7 @@ class SQLServerSchemaManager extends AbstractSchemaManager
foreach ($tableDiff->removedColumns as $col) { foreach ($tableDiff->removedColumns as $col) {
$columnConstraintSql = $this->getColumnConstraintSQL($tableDiff->name, $col->getName()); $columnConstraintSql = $this->getColumnConstraintSQL($tableDiff->name, $col->getName());
foreach ($this->_conn->fetchAllAssociative($columnConstraintSql) as $constraint) { foreach ($this->_conn->fetchAllAssociative($columnConstraintSql) as $constraint) {
$this->_conn->exec( $this->_conn->executeStatement(
sprintf( sprintf(
'ALTER TABLE %s DROP CONSTRAINT %s', 'ALTER TABLE %s DROP CONSTRAINT %s',
$tableDiff->name, $tableDiff->name,
......
...@@ -28,7 +28,7 @@ abstract class AbstractSchemaSynchronizer implements SchemaSynchronizer ...@@ -28,7 +28,7 @@ abstract class AbstractSchemaSynchronizer implements SchemaSynchronizer
{ {
foreach ($sql as $s) { foreach ($sql as $s) {
try { try {
$this->conn->exec($s); $this->conn->executeStatement($s);
} catch (Throwable $e) { } catch (Throwable $e) {
} }
} }
...@@ -44,7 +44,7 @@ abstract class AbstractSchemaSynchronizer implements SchemaSynchronizer ...@@ -44,7 +44,7 @@ abstract class AbstractSchemaSynchronizer implements SchemaSynchronizer
protected function processSql(array $sql) protected function processSql(array $sql)
{ {
foreach ($sql as $s) { foreach ($sql as $s) {
$this->conn->exec($s); $this->conn->executeStatement($s);
} }
} }
} }
...@@ -17,7 +17,7 @@ class SQLSessionInitTest extends TestCase ...@@ -17,7 +17,7 @@ class SQLSessionInitTest extends TestCase
{ {
$connectionMock = $this->createMock(Connection::class); $connectionMock = $this->createMock(Connection::class);
$connectionMock->expects(self::once()) $connectionMock->expects(self::once())
->method('executeUpdate') ->method('executeStatement')
->with(self::equalTo("SET SEARCH_PATH TO foo, public, TIMEZONE TO 'Europe/Berlin'")); ->with(self::equalTo("SET SEARCH_PATH TO foo, public, TIMEZONE TO 'Europe/Berlin'"));
$eventArgs = new ConnectionEventArgs($connectionMock); $eventArgs = new ConnectionEventArgs($connectionMock);
......
...@@ -546,7 +546,7 @@ class DataAccessTest extends FunctionalTestCase ...@@ -546,7 +546,7 @@ class DataAccessTest extends FunctionalTestCase
*/ */
public function testBitComparisonExpressionSupport(): void public function testBitComparisonExpressionSupport(): void
{ {
$this->connection->exec('DELETE FROM fetch_table'); $this->connection->executeStatement('DELETE FROM fetch_table');
$platform = $this->connection->getDatabasePlatform(); $platform = $this->connection->getDatabasePlatform();
$bitmap = []; $bitmap = [];
...@@ -612,7 +612,7 @@ class DataAccessTest extends FunctionalTestCase ...@@ -612,7 +612,7 @@ class DataAccessTest extends FunctionalTestCase
public function testEmptyFetchOneReturnsFalse(): void public function testEmptyFetchOneReturnsFalse(): void
{ {
$this->connection->beginTransaction(); $this->connection->beginTransaction();
$this->connection->exec('DELETE FROM fetch_table'); $this->connection->executeStatement('DELETE FROM fetch_table');
self::assertFalse($this->connection->fetchOne('SELECT test_int FROM fetch_table')); self::assertFalse($this->connection->fetchOne('SELECT test_int FROM fetch_table'));
$this->connection->rollBack(); $this->connection->rollBack();
} }
......
...@@ -86,7 +86,7 @@ class ExceptionTest extends FunctionalTestCase ...@@ -86,7 +86,7 @@ class ExceptionTest extends FunctionalTestCase
public function testForeignKeyConstraintViolationExceptionOnInsert(): void public function testForeignKeyConstraintViolationExceptionOnInsert(): void
{ {
if ($this->connection->getDatabasePlatform()->getName() === 'sqlite') { if ($this->connection->getDatabasePlatform()->getName() === 'sqlite') {
$this->connection->exec('PRAGMA foreign_keys=ON'); $this->connection->executeStatement('PRAGMA foreign_keys=ON');
} }
$this->setUpForeignKeyConstraintViolationExceptionTest(); $this->setUpForeignKeyConstraintViolationExceptionTest();
...@@ -231,7 +231,7 @@ class ExceptionTest extends FunctionalTestCase ...@@ -231,7 +231,7 @@ class ExceptionTest extends FunctionalTestCase
$table->setPrimaryKey(['id']); $table->setPrimaryKey(['id']);
foreach ($schema->toSql($this->connection->getDatabasePlatform()) as $sql) { foreach ($schema->toSql($this->connection->getDatabasePlatform()) as $sql) {
$this->connection->exec($sql); $this->connection->executeStatement($sql);
} }
$this->expectException(Exception\NotNullConstraintViolationException::class); $this->expectException(Exception\NotNullConstraintViolationException::class);
...@@ -246,7 +246,7 @@ class ExceptionTest extends FunctionalTestCase ...@@ -246,7 +246,7 @@ class ExceptionTest extends FunctionalTestCase
$table->addColumn('id', 'integer', []); $table->addColumn('id', 'integer', []);
foreach ($schema->toSql($this->connection->getDatabasePlatform()) as $sql) { foreach ($schema->toSql($this->connection->getDatabasePlatform()) as $sql) {
$this->connection->exec($sql); $this->connection->executeStatement($sql);
} }
$this->expectException(Exception\InvalidFieldNameException::class); $this->expectException(Exception\InvalidFieldNameException::class);
...@@ -264,7 +264,7 @@ class ExceptionTest extends FunctionalTestCase ...@@ -264,7 +264,7 @@ class ExceptionTest extends FunctionalTestCase
$table2->addColumn('id', 'integer'); $table2->addColumn('id', 'integer');
foreach ($schema->toSql($this->connection->getDatabasePlatform()) as $sql) { foreach ($schema->toSql($this->connection->getDatabasePlatform()) as $sql) {
$this->connection->exec($sql); $this->connection->executeStatement($sql);
} }
$sql = 'SELECT id FROM ambiguous_list_table, ambiguous_list_table_2'; $sql = 'SELECT id FROM ambiguous_list_table, ambiguous_list_table_2';
...@@ -281,7 +281,7 @@ class ExceptionTest extends FunctionalTestCase ...@@ -281,7 +281,7 @@ class ExceptionTest extends FunctionalTestCase
$table->addUniqueIndex(['id']); $table->addUniqueIndex(['id']);
foreach ($schema->toSql($this->connection->getDatabasePlatform()) as $sql) { foreach ($schema->toSql($this->connection->getDatabasePlatform()) as $sql) {
$this->connection->exec($sql); $this->connection->executeStatement($sql);
} }
$this->connection->insert('unique_field_table', ['id' => 5]); $this->connection->insert('unique_field_table', ['id' => 5]);
...@@ -345,7 +345,7 @@ EOT ...@@ -345,7 +345,7 @@ EOT
try { try {
foreach ($schema->toSql($conn->getDatabasePlatform()) as $sql) { foreach ($schema->toSql($conn->getDatabasePlatform()) as $sql) {
$conn->exec($sql); $conn->executeStatement($sql);
} }
} finally { } finally {
$this->cleanupReadOnlyFile($filename); $this->cleanupReadOnlyFile($filename);
...@@ -390,7 +390,7 @@ EOT ...@@ -390,7 +390,7 @@ EOT
$this->expectException(Exception\ConnectionException::class); $this->expectException(Exception\ConnectionException::class);
foreach ($schema->toSql($conn->getDatabasePlatform()) as $sql) { foreach ($schema->toSql($conn->getDatabasePlatform()) as $sql) {
$conn->exec($sql); $conn->executeStatement($sql);
} }
} }
......
...@@ -35,8 +35,15 @@ class ModifyLimitQueryTest extends FunctionalTestCase ...@@ -35,8 +35,15 @@ class ModifyLimitQueryTest extends FunctionalTestCase
self::$tableCreated = true; self::$tableCreated = true;
} }
$this->connection->exec($this->connection->getDatabasePlatform()->getTruncateTableSQL('modify_limit_table')); $platform = $this->connection->getDatabasePlatform();
$this->connection->exec($this->connection->getDatabasePlatform()->getTruncateTableSQL('modify_limit_table2'));
$this->connection->executeStatement(
$platform->getTruncateTableSQL('modify_limit_table')
);
$this->connection->executeStatement(
$platform->getTruncateTableSQL('modify_limit_table2')
);
} }
public function testModifyLimitQuerySimpleQuery(): void public function testModifyLimitQuerySimpleQuery(): void
......
...@@ -62,7 +62,7 @@ class DefaultExpressionTest extends FunctionalTestCase ...@@ -62,7 +62,7 @@ class DefaultExpressionTest extends FunctionalTestCase
$table->addColumn('default_value', $type, ['default' => $defaultSql]); $table->addColumn('default_value', $type, ['default' => $defaultSql]);
$this->connection->getSchemaManager()->dropAndCreateTable($table); $this->connection->getSchemaManager()->dropAndCreateTable($table);
$this->connection->exec( $this->connection->executeStatement(
sprintf( sprintf(
'INSERT INTO default_expr_test (actual_value) VALUES (%s)', 'INSERT INTO default_expr_test (actual_value) VALUES (%s)',
$defaultSql $defaultSql
......
...@@ -48,7 +48,7 @@ final class NewPrimaryKeyWithNewAutoIncrementColumnTest extends FunctionalTestCa ...@@ -48,7 +48,7 @@ final class NewPrimaryKeyWithNewAutoIncrementColumnTest extends FunctionalTestCa
$diff = (new Comparator())->compare($schema, $newSchema); $diff = (new Comparator())->compare($schema, $newSchema);
foreach ($diff->toSql($this->getPlatform()) as $sql) { foreach ($diff->toSql($this->getPlatform()) as $sql) {
$this->connection->exec($sql); $this->connection->executeStatement($sql);
} }
$validationSchema = $schemaManager->createSchema(); $validationSchema = $schemaManager->createSchema();
......
...@@ -26,7 +26,7 @@ class ForeignKeyTest extends FunctionalTestCase ...@@ -26,7 +26,7 @@ class ForeignKeyTest extends FunctionalTestCase
); );
foreach ($schema->toSql($this->connection->getDatabasePlatform()) as $sql) { foreach ($schema->toSql($this->connection->getDatabasePlatform()) as $sql) {
$this->connection->exec($sql); $this->connection->executeStatement($sql);
} }
self::assertCount( self::assertCount(
......
...@@ -28,7 +28,7 @@ class OracleSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -28,7 +28,7 @@ class OracleSchemaManagerTest extends SchemaManagerFunctionalTestCase
} }
TestUtil::getPrivilegedConnection() TestUtil::getPrivilegedConnection()
->exec('GRANT ALL PRIVILEGES TO ' . $GLOBALS['db_user']); ->executeStatement('GRANT ALL PRIVILEGES TO ' . $GLOBALS['db_user']);
self::$privilegesGranted = true; self::$privilegesGranted = true;
} }
......
...@@ -66,10 +66,10 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -66,10 +66,10 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
public function testSupportDomainTypeFallback(): void public function testSupportDomainTypeFallback(): void
{ {
$createDomainTypeSQL = 'CREATE DOMAIN MyMoney AS DECIMAL(18,2)'; $createDomainTypeSQL = 'CREATE DOMAIN MyMoney AS DECIMAL(18,2)';
$this->connection->exec($createDomainTypeSQL); $this->connection->executeStatement($createDomainTypeSQL);
$createTableSQL = 'CREATE TABLE domain_type_test (id INT PRIMARY KEY, value MyMoney)'; $createTableSQL = 'CREATE TABLE domain_type_test (id INT PRIMARY KEY, value MyMoney)';
$this->connection->exec($createTableSQL); $this->connection->executeStatement($createTableSQL);
$table = $this->connection->getSchemaManager()->listTableDetails('domain_type_test'); $table = $this->connection->getSchemaManager()->listTableDetails('domain_type_test');
self::assertInstanceOf(DecimalType::class, $table->getColumn('value')->getType()); self::assertInstanceOf(DecimalType::class, $table->getColumn('value')->getType());
...@@ -154,7 +154,7 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -154,7 +154,7 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
*/ */
public function testTableWithSchema(): void public function testTableWithSchema(): void
{ {
$this->connection->exec('CREATE SCHEMA nested'); $this->connection->executeStatement('CREATE SCHEMA nested');
$nestedRelatedTable = new Table('nested.schemarelated'); $nestedRelatedTable = new Table('nested.schemarelated');
$column = $nestedRelatedTable->addColumn('id', 'integer'); $column = $nestedRelatedTable->addColumn('id', 'integer');
...@@ -190,10 +190,10 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -190,10 +190,10 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
public function testReturnQuotedAssets(): void public function testReturnQuotedAssets(): void
{ {
$sql = 'create table dbal91_something ( id integer CONSTRAINT id_something PRIMARY KEY NOT NULL ,"table" integer );'; $sql = 'create table dbal91_something ( id integer CONSTRAINT id_something PRIMARY KEY NOT NULL ,"table" integer );';
$this->connection->exec($sql); $this->connection->executeStatement($sql);
$sql = 'ALTER TABLE dbal91_something ADD CONSTRAINT something_input FOREIGN KEY( "table" ) REFERENCES dbal91_something ON UPDATE CASCADE;'; $sql = 'ALTER TABLE dbal91_something ADD CONSTRAINT something_input FOREIGN KEY( "table" ) REFERENCES dbal91_something ON UPDATE CASCADE;';
$this->connection->exec($sql); $this->connection->executeStatement($sql);
$table = $this->schemaManager->listTableDetails('dbal91_something'); $table = $this->schemaManager->listTableDetails('dbal91_something');
...@@ -349,8 +349,8 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -349,8 +349,8 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
public function testListTableDetailsWhenCurrentSchemaNameQuoted(): void public function testListTableDetailsWhenCurrentSchemaNameQuoted(): void
{ {
$this->connection->exec('CREATE SCHEMA "001_test"'); $this->connection->executeStatement('CREATE SCHEMA "001_test"');
$this->connection->exec('SET search_path TO "001_test"'); $this->connection->executeStatement('SET search_path TO "001_test"');
try { try {
$this->testListQuotedTable(); $this->testListQuotedTable();
......
...@@ -86,7 +86,7 @@ abstract class SchemaManagerFunctionalTestCase extends FunctionalTestCase ...@@ -86,7 +86,7 @@ abstract class SchemaManagerFunctionalTestCase extends FunctionalTestCase
//TODO: SchemaDiff does not drop removed namespaces? //TODO: SchemaDiff does not drop removed namespaces?
try { try {
//sql server versions below 2016 do not support 'IF EXISTS' so we have to catch the exception here //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->executeStatement('DROP SCHEMA testschema');
} catch (DBALException $e) { } catch (DBALException $e) {
return; return;
} }
...@@ -643,7 +643,7 @@ abstract class SchemaManagerFunctionalTestCase extends FunctionalTestCase ...@@ -643,7 +643,7 @@ abstract class SchemaManagerFunctionalTestCase extends FunctionalTestCase
$diff->newNamespaces[] = 'testschema'; $diff->newNamespaces[] = 'testschema';
foreach ($diff->toSql($this->schemaManager->getDatabasePlatform()) as $sql) { foreach ($diff->toSql($this->schemaManager->getDatabasePlatform()) as $sql) {
$this->connection->exec($sql); $this->connection->executeStatement($sql);
} }
//test if table is create in namespace //test if table is create in namespace
...@@ -1505,7 +1505,7 @@ abstract class SchemaManagerFunctionalTestCase extends FunctionalTestCase ...@@ -1505,7 +1505,7 @@ abstract class SchemaManagerFunctionalTestCase extends FunctionalTestCase
$sqls = $diff->toSql($platform); $sqls = $diff->toSql($platform);
foreach ($sqls as $sql) { foreach ($sqls as $sql) {
$this->connection->exec($sql); $this->connection->executeStatement($sql);
} }
$schema = new Schema([ $schema = new Schema([
......
...@@ -77,7 +77,7 @@ class SqliteSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -77,7 +77,7 @@ class SqliteSchemaManagerTest extends SchemaManagerFunctionalTestCase
public function testListForeignKeysFromExistingDatabase(): void public function testListForeignKeysFromExistingDatabase(): void
{ {
$this->connection->exec(<<<EOS $this->connection->executeStatement(<<<EOS
CREATE TABLE user ( CREATE TABLE user (
id INTEGER PRIMARY KEY AUTOINCREMENT, id INTEGER PRIMARY KEY AUTOINCREMENT,
page INTEGER CONSTRAINT FK_1 REFERENCES page (key) DEFERRABLE INITIALLY DEFERRED, page INTEGER CONSTRAINT FK_1 REFERENCES page (key) DEFERRABLE INITIALLY DEFERRED,
...@@ -165,7 +165,7 @@ CREATE TABLE dbal_1779 ( ...@@ -165,7 +165,7 @@ CREATE TABLE dbal_1779 (
) )
SQL; SQL;
$this->connection->exec($sql); $this->connection->executeStatement($sql);
$columns = $this->schemaManager->listTableColumns('dbal_1779'); $columns = $this->schemaManager->listTableColumns('dbal_1779');
......
...@@ -31,7 +31,7 @@ class TableGeneratorTest extends FunctionalTestCase ...@@ -31,7 +31,7 @@ class TableGeneratorTest extends FunctionalTestCase
$schema->visit($visitor); $schema->visit($visitor);
foreach ($schema->toSql($platform) as $sql) { foreach ($schema->toSql($platform) as $sql) {
$this->connection->exec($sql); $this->connection->executeStatement($sql);
} }
} catch (Throwable $e) { } catch (Throwable $e) {
} }
......
...@@ -13,7 +13,9 @@ class TemporaryTableTest extends FunctionalTestCase ...@@ -13,7 +13,9 @@ class TemporaryTableTest extends FunctionalTestCase
{ {
parent::setUp(); parent::setUp();
try { try {
$this->connection->exec($this->connection->getDatabasePlatform()->getDropTableSQL('nontemporary')); $this->connection->executeStatement(
$this->connection->getDatabasePlatform()->getDropTableSQL('nontemporary')
);
} catch (Throwable $e) { } catch (Throwable $e) {
} }
} }
...@@ -23,7 +25,9 @@ class TemporaryTableTest extends FunctionalTestCase ...@@ -23,7 +25,9 @@ class TemporaryTableTest extends FunctionalTestCase
if ($this->connection) { if ($this->connection) {
try { try {
$tempTable = $this->connection->getDatabasePlatform()->getTemporaryTableName('my_temporary'); $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) { } catch (Throwable $e) {
} }
} }
...@@ -56,7 +60,9 @@ class TemporaryTableTest extends FunctionalTestCase ...@@ -56,7 +60,9 @@ class TemporaryTableTest extends FunctionalTestCase
$this->connection->beginTransaction(); $this->connection->beginTransaction();
$this->connection->insert('nontemporary', ['id' => 1]); $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->insert('nontemporary', ['id' => 2]);
$this->connection->rollBack(); $this->connection->rollBack();
...@@ -90,13 +96,15 @@ class TemporaryTableTest extends FunctionalTestCase ...@@ -90,13 +96,15 @@ class TemporaryTableTest extends FunctionalTestCase
$this->connection->beginTransaction(); $this->connection->beginTransaction();
$this->connection->insert('nontemporary', ['id' => 1]); $this->connection->insert('nontemporary', ['id' => 1]);
$this->connection->exec($createTempTableSQL); $this->connection->executeStatement($createTempTableSQL);
$this->connection->insert('nontemporary', ['id' => 2]); $this->connection->insert('nontemporary', ['id' => 2]);
$this->connection->rollBack(); $this->connection->rollBack();
try { try {
$this->connection->exec($platform->getDropTemporaryTableSQL($tempTable)); $this->connection->executeStatement(
$platform->getDropTemporaryTableSQL($tempTable)
);
} catch (Throwable $e) { } catch (Throwable $e) {
} }
......
...@@ -19,7 +19,7 @@ class DBAL202Test extends FunctionalTestCase ...@@ -19,7 +19,7 @@ class DBAL202Test extends FunctionalTestCase
} }
if ($this->connection->getSchemaManager()->tablesExist('DBAL202')) { if ($this->connection->getSchemaManager()->tablesExist('DBAL202')) {
$this->connection->exec('DELETE FROM DBAL202'); $this->connection->executeStatement('DELETE FROM DBAL202');
} else { } else {
$table = new Table('DBAL202'); $table = new Table('DBAL202');
$table->addColumn('id', 'integer'); $table->addColumn('id', 'integer');
......
...@@ -26,8 +26,8 @@ class DBAL630Test extends FunctionalTestCase ...@@ -26,8 +26,8 @@ class DBAL630Test extends FunctionalTestCase
} }
try { try {
$this->connection->exec('CREATE TABLE dbal630 (id SERIAL, bool_col BOOLEAN NOT NULL);'); $this->connection->executeStatement('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->executeStatement('CREATE TABLE dbal630_allow_nulls (id SERIAL, bool_col BOOLEAN);');
} catch (DBALException $e) { } catch (DBALException $e) {
} }
......
...@@ -23,7 +23,7 @@ class DBAL752Test extends FunctionalTestCase ...@@ -23,7 +23,7 @@ class DBAL752Test extends FunctionalTestCase
public function testUnsignedIntegerDetection(): void public function testUnsignedIntegerDetection(): void
{ {
$this->connection->exec(<<<SQL $this->connection->executeStatement(<<<SQL
CREATE TABLE dbal752_unsigneds ( CREATE TABLE dbal752_unsigneds (
small SMALLINT, small SMALLINT,
small_unsigned SMALLINT UNSIGNED, small_unsigned SMALLINT UNSIGNED,
......
...@@ -277,7 +277,7 @@ class WriteTest extends FunctionalTestCase ...@@ -277,7 +277,7 @@ class WriteTest extends FunctionalTestCase
} }
foreach ($platform->getCreateTableSQL($table) as $sql) { foreach ($platform->getCreateTableSQL($table) as $sql) {
$this->connection->exec($sql); $this->connection->executeStatement($sql);
} }
$seqName = $platform->usesSequenceEmulatedIdentityColumns() $seqName = $platform->usesSequenceEmulatedIdentityColumns()
...@@ -286,11 +286,11 @@ class WriteTest extends FunctionalTestCase ...@@ -286,11 +286,11 @@ class WriteTest extends FunctionalTestCase
$sql = $platform->getEmptyIdentityInsertSQL('test_empty_identity', 'id'); $sql = $platform->getEmptyIdentityInsertSQL('test_empty_identity', 'id');
$this->connection->exec($sql); $this->connection->executeStatement($sql);
$firstId = $this->lastInsertId($seqName); $firstId = $this->lastInsertId($seqName);
$this->connection->exec($sql); $this->connection->executeStatement($sql);
$secondId = $this->lastInsertId($seqName); $secondId = $this->lastInsertId($seqName);
......
...@@ -106,7 +106,7 @@ class TestUtil ...@@ -106,7 +106,7 @@ class TestUtil
$stmts = $schema->toDropSql($testConn->getDatabasePlatform()); $stmts = $schema->toDropSql($testConn->getDatabasePlatform());
foreach ($stmts as $stmt) { foreach ($stmts as $stmt) {
$testConn->exec($stmt); $testConn->executeStatement($stmt);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment