From 1de8e6344b239af6148f5bb91a42598c49e5cf57 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Wed, 9 Dec 2009 18:12:45 +0000 Subject: [PATCH] Fix SQL error in table editor on MySQL below 4.0.18: Use TYPE instead of ENGINE in these cases. Fixes issue #1517 --- source/table_editor.pas | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/source/table_editor.pas b/source/table_editor.pas index 5671c3f1..9327f800 100644 --- a/source/table_editor.pas +++ b/source/table_editor.pas @@ -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