From aad22b923c15ae85a0c087a1f3bf20deb39d7eb8 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Tue, 12 Jan 2010 06:33:02 +0000 Subject: [PATCH] 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 --- source/tabletools.pas | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/tabletools.pas b/source/tabletools.pas index 1959a048..033635f4 100644 --- a/source/tabletools.pas +++ b/source/tabletools.pas @@ -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);