Skip to content

Commit c4a9415

Browse files
authored
Catch errors for < mysql8 and remove comment
1 parent fc18e1f commit c4a9415

File tree

1 file changed

+5
-2
lines changed
  • app/code/core/Mage/ImportExport/Model/Resource/Helper

1 file changed

+5
-2
lines changed

app/code/core/Mage/ImportExport/Model/Resource/Helper/Mysql4.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ public function getMaxDataSize()
5656
public function getNextAutoincrement($tableName)
5757
{
5858
$adapter = $this->_getReadAdapter();
59-
$this->setInformationSchemaStatsExpiry();
59+
try {
60+
$this->setInformationSchemaStatsExpiry();
61+
} catch (Exception $e) {
62+
//this will throw an exception for < mysql8
63+
}
6064
$entityStatus = $adapter->showTableStatus($tableName);
6165
if (empty($entityStatus['Auto_increment'])) {
6266
Mage::throwException(Mage::helper('importexport')->__('Cannot get autoincrement value'));
@@ -70,7 +74,6 @@ public function getNextAutoincrement($tableName)
7074
public function setInformationSchemaStatsExpiry()
7175
{
7276
if (!self::$instantInformationSchemaStatsExpiry) {
73-
// Set information_schema_stats_expiry to 0
7477
$this->_getReadAdapter()->query('SET information_schema_stats_expiry = 0;');
7578
self::$instantInformationSchemaStatsExpiry = true;
7679
}

0 commit comments

Comments
 (0)