diff --git a/modules/datastore/modules/datastore_mysql_import/src/Service/MysqlImport.php b/modules/datastore/modules/datastore_mysql_import/src/Service/MysqlImport.php index 3c4544a427..d880c98835 100644 --- a/modules/datastore/modules/datastore_mysql_import/src/Service/MysqlImport.php +++ b/modules/datastore/modules/datastore_mysql_import/src/Service/MysqlImport.php @@ -58,10 +58,7 @@ protected function runIt() { $spec = $this->generateTableSpec($columns); $this->dataStorage->setSchema(['fields' => $spec]); - // @todo Find a better way to ensure creation of datastore tables. - $this->dataStorage->innodbStrictMode(FALSE); $this->dataStorage->count(); - $this->dataStorage->innodbStrictMode(TRUE); // Construct and execute a SQL import statement using the information // gathered from the CSV file being imported. $this->getDatabaseConnectionCapableOfDataLoad()->query( diff --git a/modules/datastore/src/Storage/DatabaseTable.php b/modules/datastore/src/Storage/DatabaseTable.php index 4c949c6165..2b8a4a2209 100755 --- a/modules/datastore/src/Storage/DatabaseTable.php +++ b/modules/datastore/src/Storage/DatabaseTable.php @@ -6,7 +6,6 @@ use Drupal\datastore\DatastoreResource; use Drupal\common\LoggerTrait; use Drupal\common\Storage\AbstractDatabaseTable; -use Drupal\Core\Database\Driver\mysql\Connection as MysqlConnection; /** * Database storage object. @@ -167,20 +166,6 @@ public function setSchema($schema): void { parent::setSchema($schema); } - /** - * Disable/enable InnoDB strict mode for the given database connection. - * - * @param bool $on - * Whether strict mode should be "ON" or "OFF". - */ - public function innodbStrictMode(bool $on) { - $value = $on ? "ON" : "OFF"; - // Only if we're using MySQL. - if ($this->connection instanceof MysqlConnection) { - $this->connection->query("SET SESSION innodb_strict_mode=:value", [':value' => $value]); - } - } - /** * Get the table schema in Drupal Schema API format. * diff --git a/modules/datastore/tests/src/Functional/Storage/DatabaseTableTest.php b/modules/datastore/tests/src/Functional/Storage/DatabaseTableTest.php deleted file mode 100644 index 0b3eb30275..0000000000 --- a/modules/datastore/tests/src/Functional/Storage/DatabaseTableTest.php +++ /dev/null @@ -1,48 +0,0 @@ -query("SHOW SESSION VARIABLES LIKE 'innodb_strict_mode'")->fetchObject(); - $this->assertEquals($result->Value, "ON"); - - $resource = new DatastoreResource('123', '/tmp', 'text/csv'); - - $databaseTable = new DatabaseTable($connection, $resource); - $databaseTable->innodbStrictMode(FALSE); - - $result = $connection->query("SHOW SESSION VARIABLES LIKE 'innodb_strict_mode'")->fetchObject(); - $this->assertEquals($result->Value, "OFF"); - - // Other database connection not affected. - $connection2 = \Drupal::service('database'); - $result = $connection2->query("SHOW SESSION VARIABLES LIKE 'innodb_strict_mode'")->fetchObject(); - $this->assertEquals($result->Value, "ON"); - - // Safe mode can be turned back on. - $databaseTable->innodbStrictMode(TRUE); - $result = $connection->query("SHOW SESSION VARIABLES LIKE 'innodb_strict_mode'")->fetchObject(); - $this->assertEquals($result->Value, "ON"); - } - -} diff --git a/modules/metastore/modules/metastore_search/src/Plugin/DkanApiDocs/MetastoreSearchApiDocs.php b/modules/metastore/modules/metastore_search/src/Plugin/DkanApiDocs/MetastoreSearchApiDocs.php index 097f91c857..9f39a44ca5 100644 --- a/modules/metastore/modules/metastore_search/src/Plugin/DkanApiDocs/MetastoreSearchApiDocs.php +++ b/modules/metastore/modules/metastore_search/src/Plugin/DkanApiDocs/MetastoreSearchApiDocs.php @@ -15,6 +15,8 @@ * id = "metastore_search_api_docs", * description = "Search docs" * ) + * + * @codeCoverageIgnore */ class MetastoreSearchApiDocs extends DkanApiDocsBase {