On 10-8-2013 08:36, Mark Rotteveel wrote: > Anyone? > > On 8-8-2013 19:10, Mark Rotteveel wrote: >> I was looking at implementing boolean in Jaybird trunk (+ backport to >> 2.2.x), but I'd like some confirmation on how it is encoded in the >> XSQLVAR and in the wireprotocol. >> >> A quick skim of the sources seem to indicate that the XSQLVAR sqldata is >> a single byte. And that 0x00 is considered false and anything else is >> considered true. Is that right? If indeed anything else is considered >> true, is there a value that should be preferred (eg true = 1), or is it >> really 'anything goes'? >> >> In the wire protocol it is encoded as a (4-byte) long? I am a bit >> confused about this though as in xdr.cpp there is a xdr_bool which >> doesn't seem to be used anywhere, and instead xdr_datum for >> dtype_boolean uses xdr_opaque. >> >> I hope someone can confirm and/or clarify this. Thanks.
Seems I was wrong: the boolean value is encoded as a single byte value (+ three bytes of padding). So Jaybird now sends 0 for false and 1 for true, but it accepts all byte values except 0 as true. I am still wondering though if it shouldn't actually be using xdr_bool instead of xdr_opaque. Mark -- Mark Rotteveel ------------------------------------------------------------------------------ Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel