Fix SQL error in table editor on MySQL below 4.0.18: Use TYPE instead of ENGINE in these cases. Fixes issue #1517

This commit is contained in:
Ansgar Becker
2009-12-09 18:12:45 +00:00
parent a24c2bb847
commit 1de8e6344b

View File

@@ -471,8 +471,12 @@ begin
Specs.Add('COMMENT=' + esc(memoComment.Text));
if (comboCollation.Tag = ModifiedFlag) or (chkCharsetConvert.Checked) then
Specs.Add('COLLATE=' + comboCollation.Text);
if comboEngine.Tag = ModifiedFlag then
Specs.Add('ENGINE=' + comboEngine.Text);
if comboEngine.Tag = ModifiedFlag then begin
if Mainform.Connection.ServerVersionInt < 40018 then
Specs.Add('TYPE=' + comboEngine.Text)
else
Specs.Add('ENGINE=' + comboEngine.Text);
end;
if comboRowFormat.Tag = ModifiedFlag then
Specs.Add('ROW_FORMAT=' + comboRowFormat.Text);
if chkChecksum.Tag = ModifiedFlag then
@@ -651,8 +655,12 @@ begin
Result := Result + 'COMMENT='+esc(memoComment.Text) + CRLF;
if comboCollation.Text <> '' then
Result := Result + 'COLLATE='+comboCollation.Text + CRLF;
if comboEngine.Text <> '' then
Result := Result + 'ENGINE='+comboEngine.Text + CRLF;
if comboEngine.Text <> '' then begin
if Mainform.Connection.ServerVersionInt < 40018 then
Result := Result + 'TYPE='+comboEngine.Text + CRLF
else
Result := Result + 'ENGINE='+comboEngine.Text + CRLF;
end;
if comboRowFormat.Text <> '' then
Result := Result + 'ROW_FORMAT='+comboRowFormat.Text + CRLF;
if chkChecksum.Checked then