File tree Expand file tree Collapse file tree 3 files changed +33
-2
lines changed
app/code/core/Mage/ImportExport/Model/Resource/Helper Expand file tree Collapse file tree 3 files changed +33
-2
lines changed Original file line number Diff line number Diff line change 1418
1418
"contributions" : [
1419
1419
" code"
1420
1420
]
1421
+ },
1422
+ {
1423
+ "login" : " leissbua" ,
1424
+ "name" : " Michael Leiss" ,
1425
+ "avatar_url" : " https://avatars.githubusercontent.com/u/68073221?v=4" ,
1426
+ "profile" : " https://github.com/leissbua" ,
1427
+ "contributions" : [
1428
+ " code"
1429
+ ]
1421
1430
}
1422
1431
],
1423
1432
"contributorsPerLine" : 7
Original file line number Diff line number Diff line change 1
1
<p align =" center " >
2
2
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
3
- <a href =" #contributors- " ><img src =" https://img.shields.io/badge/all_contributors-156 -orange.svg " alt =" All Contributors " ></a >
3
+ <a href =" #contributors- " ><img src =" https://img.shields.io/badge/all_contributors-157 -orange.svg " alt =" All Contributors " ></a >
4
4
<!-- ALL-CONTRIBUTORS-BADGE:END -->
5
5
<a href =" https://packagist.org/packages/openmage/magento-lts " ><img src =" https://poser.pugx.org/openmage/magento-lts/d/total.svg " alt =" Total Downloads " ></a >
6
6
<a href =" https://packagist.org/packages/openmage/magento-lts " ><img src =" https://poser.pugx.org/openmage/magento-lts/license.svg " alt =" License " ></a >
@@ -590,6 +590,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
590
590
<td align="center" valign="top" width="14.28%"><a href="https://juhoholsa.com/"><img src="https://avatars.githubusercontent.com/u/15036353?v=4" loading="lazy" width="100" alt=""/><br /><sub><b>Juho Hölsä</b></sub></a></td>
591
591
<td align="center" valign="top" width="14.28%"><a href="https://github.com/seifer7"><img src="https://avatars.githubusercontent.com/u/13601073?v=4" loading="lazy" width="100" alt=""/><br /><sub><b>Kane</b></sub></a></td>
592
592
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Sdfendor"><img src="https://avatars.githubusercontent.com/u/2728018?v=4" loading="lazy" width="100" alt=""/><br /><sub><b>Kevin Jakob</b></sub></a></td>
593
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/leissbua"><img src="https://avatars.githubusercontent.com/u/68073221?v=4" loading="lazy" width="100" alt=""/><br /><sub><b>leissbua</b></sub></a></td>
593
594
</tr>
594
595
</tbody >
595
596
</table >
Original file line number Diff line number Diff line change @@ -27,6 +27,13 @@ class Mage_ImportExport_Model_Resource_Helper_Mysql4 extends Mage_Core_Model_Res
27
27
public const DB_MAX_PACKET_SIZE = 1048576 ; // Maximal packet length by default in MySQL
28
28
public const DB_MAX_PACKET_COEFFICIENT = 0.85 ; // The coefficient of useful data from maximum packet length
29
29
30
+ /**
31
+ * Semaphore to disable schema stats only once
32
+ *
33
+ * @var bool
34
+ */
35
+ private static $ instantInformationSchemaStatsExpiry = false ;
36
+
30
37
/**
31
38
* Returns maximum size of packet, that we can send to DB
32
39
*
@@ -49,11 +56,25 @@ public function getMaxDataSize()
49
56
public function getNextAutoincrement ($ tableName )
50
57
{
51
58
$ adapter = $ this ->_getReadAdapter ();
59
+ $ this ->setInformationSchemaStatsExpiry ();
52
60
$ entityStatus = $ adapter ->showTableStatus ($ tableName );
53
-
54
61
if (empty ($ entityStatus ['Auto_increment ' ])) {
55
62
Mage::throwException (Mage::helper ('importexport ' )->__ ('Cannot get autoincrement value ' ));
56
63
}
57
64
return $ entityStatus ['Auto_increment ' ];
58
65
}
66
+
67
+ /**
68
+ * Set information_schema_stats_expiry to 0 if not already set.
69
+ */
70
+ public function setInformationSchemaStatsExpiry (): void
71
+ {
72
+ if (!self ::$ instantInformationSchemaStatsExpiry ) {
73
+ try {
74
+ $ this ->_getReadAdapter ()->query ('SET information_schema_stats_expiry = 0; ' );
75
+ } catch (Exception $ e ) {
76
+ }
77
+ self ::$ instantInformationSchemaStatsExpiry = true ;
78
+ }
79
+ }
59
80
}
You can’t perform that action at this time.
0 commit comments