mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
Fix incorrect base SQL for large SQL dumps which need more than 100MB loop. Reported via forum: http://www.heidisql.com/forum.php?t=4769
This commit is contained in:
@ -1083,17 +1083,17 @@ begin
|
||||
if comboExportData.Text = DATA_REPLACE then
|
||||
Output('DELETE FROM '+TargetDbAndObject, True, True, True, True, True);
|
||||
Output('/*!40000 ALTER TABLE '+TargetDbAndObject+' DISABLE KEYS */', True, True, True, True, True);
|
||||
BaseInsert := 'INSERT INTO ';
|
||||
if comboExportData.Text = DATA_INSERTNEW then
|
||||
BaseInsert := 'INSERT IGNORE INTO '
|
||||
else if comboExportData.Text = DATA_UPDATE then
|
||||
BaseInsert := 'REPLACE INTO ';
|
||||
BaseInsert := BaseInsert + TargetDbAndObject + ' (';
|
||||
while true do begin
|
||||
Data := Mainform.Connection.GetResults('SELECT * FROM '+m(DBObj.Database)+'.'+m(DBObj.Name)+' LIMIT '+IntToStr(Offset)+', '+IntToStr(Limit));
|
||||
Inc(Offset, Limit);
|
||||
if Data.RecordCount = 0 then
|
||||
break;
|
||||
BaseInsert := 'INSERT INTO ';
|
||||
if comboExportData.Text = DATA_INSERTNEW then
|
||||
BaseInsert := 'INSERT IGNORE INTO '
|
||||
else if comboExportData.Text = DATA_UPDATE then
|
||||
BaseInsert := 'REPLACE INTO ';
|
||||
BaseInsert := BaseInsert + TargetDbAndObject + ' (';
|
||||
for i:=0 to Data.ColumnCount-1 do
|
||||
BaseInsert := BaseInsert + m(Data.ColumnNames[i]) + ', ';
|
||||
Delete(BaseInsert, Length(BaseInsert)-1, 2);
|
||||
|
Reference in New Issue
Block a user