Subject Re: [firebird-support] Bug with character sets
Author Martijn Tonies
>>> It is "glue", right, but network protocol does not include actual
>>> data length in characters, only in bytes.
>>
>> Then what does it transfer? The server know how many characters
>> there are, doesn't it?
>
> No, server also has no clue about number of characters. Server works
> with binary buffers only. No general difference between BIGINT and
> VARCHAR(4).
>
>> How does this work for VARCHAR?
>>
>> Why is the CHAR buffer padded, but it seems VARCHAR isn't?
>
> Exactly because of that: CHAR _is_ padded, but VARCHAR is put into
> user buffer as is.
> As I already said - CHAR is transferred trimmed and is padded with
> spaces on receiving side. VARCHAR is transferred with it's actual length.

So, the server can transfer CHARs with actual length and let the
client library pad it with spaces to the number of characters required.

With regards,

Martijn Tonies
Upscene Productions
http://www.upscene.com

Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!

Database questions? Check the forum:
http://www.databasedevelopmentforum.com