Skip to content

Commit

Permalink
MAGETWO-59303: SQL error on migration when init statement is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-v-rad committed Oct 5, 2016
1 parent 8fb13de commit 5a25661
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/Migration/ResourceModel/Destination.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ protected function getResourceConfig()
$config['database']['password'] = !empty($destination[$destinationType]['password'])
? $destination[$destinationType]['password']
: '';
$config['database']['initStatements'] = !empty($this->configReader->getOption('init_statements_destination'))
? $this->configReader->getOption('init_statements_destination')
: '';
$initStatements = $this->configReader->getOption('init_statements_destination');
if (!empty($initStatements)) {
$config['database']['initStatements'] = $initStatements;
}
$editionMigrate = $this->configReader->getOption('edition_migrate');
if (in_array($editionMigrate, [Config::EDITION_MIGRATE_CE_TO_EE, Config::EDITION_MIGRATE_EE_TO_EE])) {
$config['init_select_parts'] = ['disable_staging_preview' => true];
Expand Down
7 changes: 4 additions & 3 deletions src/Migration/ResourceModel/Source.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ protected function getResourceConfig()
$config['database']['password'] = !empty($source[$sourceType]['password'])
? $source[$sourceType]['password']
: '';
$initStatements = $this->configReader->getOption('init_statements_source');
if (!empty($initStatements)) {
$config['database']['initStatements'] = $initStatements;
}
$editionMigrate = $this->configReader->getOption('edition_migrate');
$config['database']['initStatements'] = !empty($this->configReader->getOption('init_statements_source'))
? $this->configReader->getOption('init_statements_source')
: '';
if (in_array($editionMigrate, [Config::EDITION_MIGRATE_CE_TO_EE, Config::EDITION_MIGRATE_EE_TO_EE])) {
$config['init_select_parts'] = ['disable_staging_preview' => true];
}
Expand Down

0 comments on commit 5a25661

Please sign in to comment.