Skip to content

Commit 4993e9e

Browse files
committed
rebase
1 parent e0d615e commit 4993e9e

File tree

1 file changed

+9
-4
lines changed
  • app/code/core/Mage/ImportExport/Model/Resource/Helper

1 file changed

+9
-4
lines changed

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,17 @@ public function getMaxDataSize()
4848
*/
4949
public function getNextAutoincrement($tableName)
5050
{
51-
$adapter = $this->_getReadAdapter();
52-
$entityStatus = $adapter->showTableStatus($tableName);
51+
$connection = $this->_getReadAdapter();
5352

54-
if (empty($entityStatus['Auto_increment'])) {
53+
$sql = sprintf(
54+
'SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = %s AND TABLE_SCHEMA = DATABASE()',
55+
$connection->quote($tableName)
56+
);
57+
$entityStatus = $connection->fetchRow($sql);
58+
if (empty($entityStatus['AUTO_INCREMENT'])) {
5559
Mage::throwException(Mage::helper('importexport')->__('Cannot get autoincrement value'));
5660
}
57-
return $entityStatus['Auto_increment'];
61+
62+
return $entityStatus['AUTO_INCREMENT'];
5863
}
5964
}

0 commit comments

Comments
 (0)