Subject | Re: [IB-Architect] Suppress whitespace in transmit buffers |
---|---|
Author | Bill Karwin |
Post date | 2000-05-10T02:33:18Z |
> From: "Jason Wharton" <jwharton@...>Okay, just calm down...
> I don't think I need to remind you how the VARCHAR column type works do I?
I just did some experiments to refresh my memory. Here's what I found out:
1. I did a binary dump (od -c) of the gdb file shows that VARCHAR does not
store any more bytes than the significant bytes in the string.
2. I did a memset('*') of my XSQLVARs before I fetch the data via a remote
connection, and force my print routines to print out all sqllen bytes
instead of just the number indicated by the vary_len. What comes out is the
string followed by null bytes, _not_ whitespace characters.
If I insert literal whitespace characters into my gdb file, I see the
whitespace both in the binary dump and in the XSQLVAR.
I conclude that Varchars aren't padded with spaces either in storage or in
the XSQLVAR. I haven't bothered to do a TCP sniff, but I assume that the
server does not pad spaces onto the Varchar and then strip them off in the
client.
Bill Karwin