mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
Bugfix: avoid calling FieldByName() with a field name that doesn't exist, it causes an exception. Fixes issue #1118.
This commit is contained in:
@ -260,9 +260,9 @@ begin
|
|||||||
zq := Mainform.FetchActiveDbTableList;
|
zq := Mainform.FetchActiveDbTableList;
|
||||||
while not zq.Eof do begin
|
while not zq.Eof do begin
|
||||||
if zq.FieldByName(DBO_NAME).AsWideString = oldTableName then begin
|
if zq.FieldByName(DBO_NAME).AsWideString = oldTableName then begin
|
||||||
if zq.FieldByName(DBO_COLLATION).AsString <> '' then
|
if (zq.FindField(DBO_COLLATION) <> nil) and (zq.FieldByName(DBO_COLLATION).AsString <> '') then
|
||||||
strquery := strquery + ' COLLATE ' + zq.FieldByName(DBO_COLLATION).AsString;
|
strquery := strquery + ' COLLATE ' + zq.FieldByName(DBO_COLLATION).AsString;
|
||||||
if zq.FieldByName(DBO_ENGINE).AsString <> '' then
|
if (zq.FindField(DBO_ENGINE) <> nil) and (zq.FieldByName(DBO_ENGINE).AsString <> '') then
|
||||||
strquery := strquery + ' ENGINE=' + zq.FieldByName(DBO_ENGINE).AsString;
|
strquery := strquery + ' ENGINE=' + zq.FieldByName(DBO_ENGINE).AsString;
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user