File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
app/code/core/Mage/ImportExport/Model/Resource/Helper Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -48,12 +48,17 @@ public function getMaxDataSize()
48
48
*/
49
49
public function getNextAutoincrement ($ tableName )
50
50
{
51
- $ adapter = $ this ->_getReadAdapter ();
52
- $ entityStatus = $ adapter ->showTableStatus ($ tableName );
51
+ $ connection = $ this ->_getReadAdapter ();
53
52
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 ' ])) {
55
59
Mage::throwException (Mage::helper ('importexport ' )->__ ('Cannot get autoincrement value ' ));
56
60
}
57
- return $ entityStatus ['Auto_increment ' ];
61
+
62
+ return $ entityStatus ['AUTO_INCREMENT ' ];
58
63
}
59
64
}
You can’t perform that action at this time.
0 commit comments