postgresql-interfaces/psqlodbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: Hunaid2000 (@Hunaid2000) <[email protected]>
To: postgresql-interfaces/psqlodbc <[email protected]>
Subject: Re: [postgresql-interfaces/psqlodbc] issue #51: SQL_DESC_OCTET_LENGTH regression test difference
Date: Sat, 05 Oct 2024 10:10:20 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

It basically depends on client encoding, I guess.
I get 20 on Windows and 40 on Ubuntu. The length is set in `pgtype_attr_buffer_length` function.
 
https://github.com/postgresql-interfaces/psqlodbc/blob/59728b929b54b3b230aead909895483b5b2f35a1/pgty...

It depends on `coef = conn->mb_maxbyte_per_char;` which is set on the line `629` in this block.
https://github.com/postgresql-interfaces/psqlodbc/blob/59728b929b54b3b230aead909895483b5b2f35a1/conn...

In case of Ubuntu:
```
postgres=# show client_encoding;
 client_encoding
-----------------
 UTF8
(1 row)
```
https://github.com/postgresql-interfaces/psqlodbc/blob/59728b929b54b3b230aead909895483b5b2f35a1/mult...

which maps to 4 here: `pg_mb_maxlen(self->ccsc);`. As a result, we get 10 * 4 = 40.
For Windows, I believe its just `prec * WCLEN` so 10 * 2 = 20.

@df7cb In your case, I guess `pg_mb_maxlen` returns 1.

view thread (11+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: github://postgresql-interfaces/psqlodbc
  Cc: [email protected], [email protected]
  Subject: Re: [postgresql-interfaces/psqlodbc] issue #51: SQL_DESC_OCTET_LENGTH regression test difference
  In-Reply-To: <<[email protected]>>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox