Re: SQLColAttributes and SQL_DESC_NULLABLE

Lists: pgsql-odbc
From: Robert Jireš <robert(dot)jires(at)centrum(dot)cz>
To: pgsql-odbc(at)postgresql(dot)org
Subject: SQLColAttributes and SQL_DESC_NULLABLE
Date: 2005-12-02 01:27:34
Message-ID: 438FA306.4070503@centrum.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-odbc

Hello,
I'm using .Net Odbc Data Provider, ODBC driver 8.1.x and PostgreSQL 8.1.0.
To find out whether column can be null, the .NET calls ODBC function
SQLColAttributes. Problem is, that this function allways returns
SQL_NULLABLE, even for columns declared as NOT NULL. I tried to enable
"Parse Statements" option of the driver, but it didn't help.
I downloaded the latest sources, compiled them to see what's going on
inside and found this:
It seems that for SQLColAttributes to return something else than
SQL_NULLABLE, "Parse Statements" option MUST be turned on. Am i right?
For some reason stmt->manual_result is true, which causes that the
statement is not parsed. What does this stmt->manual_result mean?

Thanks in advance.

Robert Jires


From: Ludek Finstrle <luf(at)pzkagis(dot)cz>
To: Robert Jireš <robert(dot)jires(at)centrum(dot)cz>
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: SQLColAttributes and SQL_DESC_NULLABLE
Date: 2005-12-05 11:10:32
Message-ID: 20051205111032.GA14417@soptik.pzkagis.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-odbc

> SQLColAttributes. Problem is, that this function allways returns
> SQL_NULLABLE, even for columns declared as NOT NULL. I tried to enable
> "Parse Statements" option of the driver, but it didn't help.

Please, could you add this bug report to pgfoundry?
Feel free to try patch it.

> I downloaded the latest sources, compiled them to see what's going on
> inside and found this:
> It seems that for SQLColAttributes to return something else than
> SQL_NULLABLE, "Parse Statements" option MUST be turned on. Am i right?
> For some reason stmt->manual_result is true, which causes that the
> statement is not parsed. What does this stmt->manual_result mean?

We think manual_result is only way to get result now. This problem
was create during convert to using libpq.

The driver isn't fully cleaned after rewrite to libpq support.
You can contact me directly in czech ;-) as my english is poor.

Luf


From: Ludek Finstrle <luf(at)pzkagis(dot)cz>
To: Robert Jireš <robert(dot)jires(at)centrum(dot)cz>
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: SQLColAttributes and SQL_DESC_NULLABLE
Date: 2005-12-06 22:55:17
Message-ID: 20051206225517.GA26095@soptik.pzkagis.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-odbc

> It seems that for SQLColAttributes to return something else than
> SQL_NULLABLE, "Parse Statements" option MUST be turned on. Am i right?
> For some reason stmt->manual_result is true, which causes that the
> statement is not parsed. What does this stmt->manual_result mean?

I attach patch which solve this problem. Thanks to Robert to point
it and find the solution.

I don't know if it works with declare/fetch or server side prepare
(maybe other options could break it too). Please is there someone
who can test it? I can upload Windows DLL to test it if you want.

Thanks

Luf

Attachment Content-Type Size
psqlodbc-colattributes_manual_result.diff text/plain 604 bytes