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
This commit is contained in:
Ansgar Becker
2007-08-13 23:25:20 +00:00
parent c98802dc37
commit b015b87fcb

View File

@ -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;