franciscojunior/Npgsql2 — pull request #93 by glenebob (2013-11-07 22:04:06+00:00)
Title: Boolean binary backend encoding fix

Francisco,

Here is the fix for bug:
http://pgfoundry.org/forum/forum.php?thread_id=15672&forum_id=519&group_id=1000140

Sending binary boolean parameters works properly now. For reference, the encoder was sending the ascii digits '0' or '1', rather than the byte values 0 or 1. PG naturally interprets any non-zero byte value as TRUE.

I [Ignore]'d test TestBoolParameterPrepared2(). This problem is not related to the boolean bug, it is related to all parameter types, and it's way out of scope for this branch. NpgsqlParameter simply does not do automatic type coercion, which it will need to do in order for Prepare() to have the type information it needs to succeed in the situation tested. You may recall our conversation touching on this a few weeks ago I have a branch that fixes this problem, but it is not ready yet, and it is not trivial. I think we have to let this problem slide awhile longer (it's been there a long time already), as I cannot guarantee I'll be ready to commit anything soon enough to be part of the next beta. Developers will need to continue to set parameter types explicitly in order to use Prepare() successfully.

-Glen