Page 1 of 1

Possible bug in TZStoredProc designtime component - Params

Posted: 04.10.2008, 17:11
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

Posted: 05.10.2008, 11:40
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?

Posted: 05.10.2008, 15:33
by nostradumbass
Thanks! :)

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

Regards,
Notra Damus

Posted: 05.10.2008, 20:50
by mdaems
Is in SVN now. (Rev. 482). This patch will get into 6.6-patches.
Thanks for testing.

Mark