From 7629b132cfa8bd2deb8a3e5b2ecf2d2915127831 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Thu, 4 Feb 2010 18:56:30 +0000 Subject: [PATCH] Do not reset remove AUTO_INCREMENT clause from CREATE TABLE when no data gets exported. Fixes issue #1110. --- source/tabletools.pas | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/source/tabletools.pas b/source/tabletools.pas index 19e43c6f..38e33309 100644 --- a/source/tabletools.pas +++ b/source/tabletools.pas @@ -1037,12 +1037,14 @@ begin case DBObj.NodeType of lntTable, lntView: begin Struc := Mainform.Connection.GetVar('SHOW CREATE TABLE '+m(DBObj.Database)+'.'+m(DBObj.Name), 1); - // Remove AUTO_INCREMENT clause - rx := TRegExpr.Create; - rx.ModifierI := True; - rx.Expression := '\sAUTO_INCREMENT\s*\=\s*\d+\s'; - Struc := rx.Replace(Struc, ' ', false); - rx.Free; + // Remove AUTO_INCREMENT clause if no data gets exported + if comboExportData.Text = DATA_NO then begin + rx := TRegExpr.Create; + rx.ModifierI := True; + rx.Expression := '\sAUTO_INCREMENT\s*\=\s*\d+\s'; + Struc := rx.Replace(Struc, ' ', false); + rx.Free; + end; if DBObj.NodeType = lntTable then Insert('IF NOT EXISTS ', Struc, Pos('TABLE', Struc) + 6); if ToDb then begin