Possible bug in TZStoredProc designtime component - Params

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
nostradumbass
Junior Boarder
Junior Boarder
Posts: 27
Joined: 22.05.2008, 23:54

Possible bug in TZStoredProc designtime component - Params

Post by nostradumbass »

Using : D2007, Firebird 2.1, Zeos 6.6.3

I have two stored procs in my Firebird 2.1 database :

PATIENT_SEL &
PATIENT_SEL_LST

When I add the TZStoredProc to my datamodule, set the connection to a TZConnection, and set the StoredProcName to PATIENT_SEL, then after I click on the Params... property (in object inspector), I see parameters from the _second_ stored procedure in the parameter list in addition to the parameters from this procedure.

I think this is a bug in the component, that it is retrieving parameters from a stored procedure that has a name which is similar ?

I will be glad to provide more info.


Cheers and keep up the good work!
- Notra Damus
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Hey,

Can you please log bugs to the bug tracker next time ;)

Problem : the underscore character is handled as a wildcard. In this case that should not happen.
I think this problem may be solved by this patch:

Code: Select all

Index: component/ZStoredProcedure.pas
===================================================================
--- component/ZStoredProcedure.pas	(revision 480)
+++ component/ZStoredProcedure.pas	(working copy)
@@ -316,6 +316,7 @@
       Connection.ShowSQLHourGlass;
       try
         SplitQualifiedObjectName(Value, Catalog, Schema, ObjectName);
+        ObjectName := Connection.DbcConnection.GetMetadata.AddEscapeCharToWildcards(ObjectName);
         ResultSet := Connection.DbcConnection.GetMetadata.GetProcedureColumns(Catalog, Schema, ObjectName, '');
         OldParams := TParams.Create;
         try
Index: dbc/ZDbcIntfs.pas
===================================================================
--- dbc/ZDbcIntfs.pas	(revision 480)
+++ dbc/ZDbcIntfs.pas	(working copy)
@@ -324,6 +324,8 @@
 
     procedure ClearCache;overload;
 		procedure ClearCache(const Key: string);overload;
+
+    function AddEscapeCharToWildcards(const Pattern:string): string;
   end;
 
   {**

I know, it's against Testing Branch, but essentially it's adding the AddEscapeCharToWildcards function to the IZDatabaseMetadata interface and call that function when passing the procedure name as a pattern.

Can you please test this and report here?
Image
nostradumbass
Junior Boarder
Junior Boarder
Posts: 27
Joined: 22.05.2008, 23:54

Post by nostradumbass »

Thanks! :)

I've tested it in D5E and can confirm that this patch fixes the bug.

Regards,
Notra Damus
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Is in SVN now. (Rev. 482). This patch will get into 6.6-patches.
Thanks for testing.

Mark
Image
Post Reply