mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-14 10:02:10 +08:00
Decrease pre calculated number of rows per INSERT, to make that safer against exceeding the popular 1MB max_allowed_packet default setting. Fixes issue #1682.
This commit is contained in:
@ -1113,8 +1113,8 @@ begin
|
|||||||
RowCount := 0;
|
RowCount := 0;
|
||||||
// Calculate limit so we select ~100MB per loop
|
// Calculate limit so we select ~100MB per loop
|
||||||
Limit := Round(100 * SIZE_MB / Max(DBObj.AvgRowLen,1));
|
Limit := Round(100 * SIZE_MB / Max(DBObj.AvgRowLen,1));
|
||||||
// Calculate max rows per INSERT, so we always get ~800KB
|
// Calculate max rows per INSERT, so we should never exceed 1MB per INSERT
|
||||||
MaxRowsInChunk := Round(SIZE_MB * 0.6 / Max(DBObj.AvgRowLen,1));
|
MaxRowsInChunk := Round(SIZE_MB * 0.4 / Max(DBObj.AvgRowLen,1));
|
||||||
if comboExportData.Text = DATA_REPLACE then
|
if comboExportData.Text = DATA_REPLACE then
|
||||||
Output('DELETE FROM '+TargetDbAndObject, True, True, True, True, True);
|
Output('DELETE FROM '+TargetDbAndObject, True, True, True, True, True);
|
||||||
Output('/*!40000 ALTER TABLE '+TargetDbAndObject+' DISABLE KEYS */', True, True, True, True, True);
|
Output('/*!40000 ALTER TABLE '+TargetDbAndObject+' DISABLE KEYS */', True, True, True, True, True);
|
||||||
|
Reference in New Issue
Block a user