Hi everybody:
on \src\dbc\ZDbcMetadata.pas
function TZAbstractDatabaseMetadata.CloneCachedResultSet(
ResultSet: IZResultSet): IZResultSet;
var
I: Integer;
Metadata: IZResultSetMetadata;
ColumnInfo: TZColumnInfo;
ColumnsInfo: TObjectList;
begin
Result := nil;
Metadata := ResultSet.GetMetadata;
ColumnsInfo := TObjectList.Create;
try
for I := 1 to Metadata.GetColumnCount do
begin
ColumnInfo := TZColumnInfo.Create;
with ColumnInfo do
begin
ColumnLabel := Metadata.GetColumnLabel(I);
ColumnType := Metadata.GetColumnType(I);
ColumnDisplaySize := Metadata.GetPrecision(I);
Precision := Metadata.GetPrecision(I);
end;
ColumnsInfo.Add(ColumnInfo);
end;
ResultSet.BeforeFirst;
Result := CopyToVirtualResultSet(ResultSet,
TZVirtualResultSet.CreateWithColumns(ColumnsInfo, ''));
ResultSet.BeforeFirst;
finally
// ColumnsInfo.Free;
end;
end;
I don't understand why ResultSet.BeforeFirst; is commented, because uncommenting it several test are passed correctly , so I suggest you uncomment it.
Second this test contain several mistakes .. please change it to this solution:
\test\component\ZTestStoredProcedure.pas
procedure TZTestInterbaseStoredProcedure.TestStoredProc;
begin
StoredProc.StoredProcName := 'PROCEDURE1';
try
CheckEquals(2, StoredProc.Params.Count);
CheckEquals('R1', StoredProc.Params[0].Name);
CheckEquals(ord(ptResult), ord(StoredProc.Params[0].ParamType));
CheckEquals('P1', StoredProc.Params[1].Name);
CheckEquals(ord(ptInput), ord(StoredProc.Params[1].ParamType));
StoredProc.Params[1].AsInteger := 12345;
StoredProc.ExecProc;
except
on e: exception do ShowMessage(e.Message);
end;
CheckEquals(12346, StoredProc.Params[0].AsInteger);
CheckEquals(2, StoredProc.Params.Count);
end;
Best regards
[patch_done] Trouble Metadata + Firebird
Moderators: gto, cipto_kh, EgonHugeist, mdaems
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Seawolf,
I must be blind... What are the real differences you propose? Can you please make ans SVN diff against your code for these changes?
Because :
- for the first change(??) I don't see the BeforeFirst commented in my (=Testing Branch) version
- for the second change I see only the added try...except construct with a showmessage, something that really doesn't belog to a console test program, I believe.
So : is it possible you corrected code that you changed before, yourself?
Mark
I must be blind... What are the real differences you propose? Can you please make ans SVN diff against your code for these changes?
Because :
- for the first change(??) I don't see the BeforeFirst commented in my (=Testing Branch) version
- for the second change I see only the added try...except construct with a showmessage, something that really doesn't belog to a console test program, I believe.
So : is it possible you corrected code that you changed before, yourself?
Mark