SCM

[#1010539] checking for function info

View Trackers | Patches | Download .csv | Monitor

Date:
2008-12-24 23:12
Priority:
3
State:
Open
Submitted by:
Rikard Pavelic (rikard)
Assigned to:
Nobody (None)
Category:
Group:
Resolution:
None
 
Summary:
checking for function info

Detailed description
I noticed that in CheckFunctionHasOutParameters() and CheckFunctionReturn(string) Npgsql creates command in which it incorrectly sets function name.

If I define function as com.CommandText = "public.my_function(@id)"

Npgsql will fill function name as "my_function(@id)" instead of "my_function".

This lines should be added after calculating procedureName

int indx = procedureName.IndexOf('(');
if (indx > 1) procedureName = procedureName.Substring(0, indx).Trim();

Also, are this calls really necesarry? They don't seem to be and they cause three roundtrips.

Followup

Message
Date: 2008-12-25 08:15
Sender: Rikard Pavelic

I don't think excluding parameter names from command text
is a good decision. That will result in required ordering
for parameters which is much more worse. A lot of apps will
break (like mine) which uses complex binding for setting
parameters into command.
Also, while Postgres allowes special characters in function
name i also requires you to specify it using ""
like "my_fu(nction"
You cant create my_fu(nction without ""
Date: 2008-12-25 01:30
Sender: Josh Cooley

The documentation says that you can exclude parameter names. I believe this should be changed to *should* exclude parameter names. Using IndexOf and Substring will cause problems with functions containing these special characters. As odd as it seems, PostgreSQL permits functions containing these characters.

Attached Files:

Changes:

No Changes Have Been Made to This Item

Powered By FusionForge