Fix wrong offset in db.table string when checking for foreign key match. Fixes issue #3160.

This commit is contained in:
Ansgar Becker
2013-04-14 05:21:04 +00:00
parent 7f87bc7eb2
commit e42cb467fc

View File

@@ -2227,8 +2227,8 @@ begin
RefTable := Key.ReferenceTable;
i := Pos('.', RefTable);
if i > 0 then begin
RefDatabase := Copy(RefTable, 1, i);
RefTable := Copy(RefTable, i, MaxInt);
RefDatabase := Copy(RefTable, 1, i-1);
RefTable := Copy(RefTable, i+1, MaxInt);
end;
RefCreateCode := DBObject.Connection.GetCreateCode(RefDatabase, RefTable, lntTable);
RefColumns := TTableColumnList.Create(True);