File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
app/code/core/Mage/ImportExport/Model/Resource/Helper Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -61,12 +61,21 @@ public function getMaxDataSize()
61
61
*/
62
62
public function getNextAutoincrement ($ tableName )
63
63
{
64
- $ adapter = $ this ->_getReadAdapter ();
65
- $ entityStatus = $ adapter ->showTableStatus ($ tableName );
64
+ $ connection = $ this ->getConnection ();
65
+ $ entityStatus = $ connection ->showTableStatus ($ tableName );
66
66
67
67
if (empty ($ entityStatus ['Auto_increment ' ])) {
68
- Mage::throwException (Mage::helper ('importexport ' )->__ ('Cannot get autoincrement value ' ));
68
+ $ sql = sprintf (
69
+ 'SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = %s AND TABLE_SCHEMA = DATABASE() ' ,
70
+ $ this ->quote ($ tableName )
71
+ );
72
+ $ entityStatus = $ connection ->fetchRow ($ sql );
73
+ if (empty ($ entityStatus ['AUTO_INCREMENT ' ]))
74
+ {
75
+ throw new \Magento \Framework \Exception \LocalizedException (__ ('Cannot get autoincrement value ' ));
69
76
}
70
- return $ entityStatus ['Auto_increment ' ];
77
+
78
+ return $ entityStatus ['AUTO_INCREMENT ' ];
79
+
71
80
}
72
81
}
You can’t perform that action at this time.
0 commit comments