SCM

[#1010777] String syntax for function call parameters

View Trackers | Patches | Download .csv | Monitor

Date:
2010-03-15 15:48
Priority:
3
State:
Open
Submitted by:
Noah Misch (nmisch)
Assigned to:
Nobody (None)
Category:
Group:
Resolution:
None
 
Summary:
String syntax for function call parameters

Detailed description
This code:

cmd = new NpgsqlCommand("length", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new NpgsqlParameter());
cmd.Parameters[0].NpgsqlDbType = NpgsqlDbType.Varchar;
cmd.Parameters[0].Value = "fo\\o";

produces this SQL statement:

select * from length(('fo\\o')::varchar)

The string has an extra backslash under standard_conforming_strings=on, while standard_conforming_strings=off && escape_string_warning=on produces a warning. This patch reuses the logic from the non-function-call case to make the behavior consistent. I include a new test case based on the one it follows.

Thanks,
nm

Followup

Message
Date: 2010-03-16 01:45
Sender: Francisco Figueiredo jr.

Patch applied!

Thank you very much.

If you have ideas for PassParam optimizations they would be very much welcome!

Attached Files:

Attachments:
npgsql-funcall-escape.patch

Changes:

Field Old Value Date By
File Added457: npgsql-funcall-escape.patch2010-03-15 15:48nmisch
Powered By FusionForge