mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 20:00:16 +08:00
Do not reset remove AUTO_INCREMENT clause from CREATE TABLE when no data gets exported. Fixes issue #1110.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user