From b015b87fcbcbb66b777f998675b771ca7f9043e4 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Mon, 13 Aug 2007 23:25:20 +0000 Subject: [PATCH] Fix confusion with TYPE/ENGINE in CREATE TABLE statements. On target versions below 4.1.2 we now use "TYPE", "ENGINE" on all other versions. Was discussed here: http://www.heidisql.com/forum/viewtopic.php?p=1226#1226 --- source/exportsql.pas | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/source/exportsql.pas b/source/exportsql.pas index 85c3f2e4..c7a3571c 100644 --- a/source/exportsql.pas +++ b/source/exportsql.pas @@ -724,21 +724,23 @@ begin k := 0; while k <= j do k := k + 1 + Pos(' ', Copy(sql, k + 1, Length(sql))); Delete(sql, j, k - j); - end; - {*** - @note ansgarbecker - The ENGINE and TYPE options specify the storage engine for the table. - ENGINE was added in MySQL 4.0.18 (for 4.0) and 4.1.2 (for 4.1). - It is the preferred option name as of those versions, and TYPE has - become deprecated. TYPE is supported throughout the 4.x series, but - likely will be removed in the future. - @see http://dev.mysql.com/doc/refman/4.1/en/create-table.html - } - if target_version < 40000 then + end + else if target_version < 40102 then begin + {*** + @note ansgarbecker + The ENGINE and TYPE options specify the storage engine for the table. + ENGINE was added in MySQL 4.0.18 (for 4.0) and 4.1.2 (for 4.1). + It is the preferred option name as of those versions, and TYPE has + become deprecated. TYPE is supported throughout the 4.x series, but + likely will be removed in the future. + So we use "TYPE" on target versions below 4.1.2 and "ENGINE" on all other versions. + @see http://dev.mysql.com/doc/refman/4.1/en/create-table.html + @see http://www.heidisql.com/forum/viewtopic.php?p=1226#1226 + } sql := stringreplace(sql, 'ENGINE=', 'TYPE=', [rfReplaceAll]); end - else if target_version >= 51000 then + else begin sql := stringreplace(sql, 'TYPE=', 'ENGINE=', [rfReplaceAll]); end;