Skip to content

Commit

Permalink
Rip out innodb_strict_mode switch (#3887)
Browse files Browse the repository at this point in the history
  • Loading branch information
dafeder authored Dec 14, 2022
1 parent d0b1bee commit cfcd55c
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
15 changes: 0 additions & 15 deletions modules/datastore/src/Storage/DatabaseTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
*
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* id = "metastore_search_api_docs",
* description = "Search docs"
* )
*
* @codeCoverageIgnore
*/
class MetastoreSearchApiDocs extends DkanApiDocsBase {

Expand Down

0 comments on commit cfcd55c

Please sign in to comment.