Message-ID: From: "Hunaid2000 (@Hunaid2000)" To: "postgresql-interfaces/psqlodbc" Date: Thu, 23 May 2024 10:17:40 +0000 Subject: [postgresql-interfaces/psqlodbc] issue #24: Issues in SQLSetDescField & SQLGetDescField functions List-Id: X-GitHub-Author-Id: 76044242 X-GitHub-Author-Login: Hunaid2000 X-GitHub-Issue: 24 X-GitHub-Repo: postgresql-interfaces/psqlodbc X-GitHub-State: open X-GitHub-Type: issue X-GitHub-Url: https://github.com/postgresql-interfaces/psqlodbc/issues/24 Content-Type: text/plain; charset=utf-8 - No [consistency checks](https://learn.microsoft.com/en-us/sql/odbc/reference/syntax/sqlsetdescrec-function?view=sql-server-ver16#consistency-checks) are performed in `SQLSetDescField` & `SQLGetDescField` functions. - A call to `SQLSetDescField` function with field SQL_DESC_TYPE should set some fields to [default](https://learn.microsoft.com/en-us/sql/odbc/reference/syntax/sqlsetdescfield-function?view=sql-server-ver16#:~:text=When%20the%20SQL_DESC_TYPE%20field%20is%20set%20by%20a%20call%20to%20SQLBindCol%2C%20SQLBindParameter%2C%20or%20SQLSetDescField%2C%20the%20following%20fields%20are%20set%20to%20the%20following%20default%20values%2C%20as%20shown%20in%20the%20table%20below.%20The%20values%20of%20the%20remaining%20fields%20of%20the%20same%20record%20are%20undefined.) values. - Some descriptor fields are R/W according to [API reference](https://learn.microsoft.com/en-us/sql/odbc/reference/syntax/sqlsetdescfield-function?view=sql-server-ver16#initialization-of-descriptor-fields) but throws error when set/get is called for them. Example from `ARDSetField` that is used inside `SQLSetDescField` function: https://github.com/postgresql-interfaces/psqlodbc/blob/7ec2337580447068b20dd3230c50229eae85dc08/pgapi30.c#L636-L641