pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
SQLColAttributes and SQL_DESC_NULLABLE
4+ messages / 3 participants
[nested] [flat]

* SQLColAttributes and SQL_DESC_NULLABLE
@ 2005-12-02 01:27 Robert Jireš <robert.jires@centrum.cz>
  2005-12-05 11:10 ` Re: SQLColAttributes and SQL_DESC_NULLABLE Ludek Finstrle <luf@pzkagis.cz>
  2005-12-06 22:55 ` Re: SQLColAttributes and SQL_DESC_NULLABLE Ludek Finstrle <luf@pzkagis.cz>
  0 siblings, 2 replies; 4+ messages in thread

From: Robert Jireš @ 2005-12-02 01:27 UTC (permalink / raw)
  To: 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




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: SQLColAttributes and SQL_DESC_NULLABLE
  2005-12-02 01:27 SQLColAttributes and SQL_DESC_NULLABLE Robert Jireš <robert.jires@centrum.cz>
@ 2005-12-05 11:10 ` Ludek Finstrle <luf@pzkagis.cz>
  1 sibling, 0 replies; 4+ messages in thread

From: Ludek Finstrle @ 2005-12-05 11:10 UTC (permalink / raw)
  To: Robert Jireš <robert.jires@centrum.cz>; +Cc: 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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: SQLColAttributes and SQL_DESC_NULLABLE
  2005-12-02 01:27 SQLColAttributes and SQL_DESC_NULLABLE Robert Jireš <robert.jires@centrum.cz>
@ 2005-12-06 22:55 ` Ludek Finstrle <luf@pzkagis.cz>
  1 sibling, 0 replies; 4+ messages in thread

From: Ludek Finstrle @ 2005-12-06 22:55 UTC (permalink / raw)
  To: Robert Jireš <robert.jires@centrum.cz>; +Cc: 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

Attachments:

psqlodbc-colattributes_manual_result.diff (text/plain, 603B) download diff -c psqlodbc.orig\results.c psqlodbc\results.c *** psqlodbc.orig\results.c Wed Nov 30 13:44:36 2005 --- psqlodbc\results.c Wed Dec 07 00:48:11 2005 *************** *** 447,453 **** unknown_sizes = UNKNOWNS_AS_MAX; parse_ok = FALSE; ! if (!stmt->manual_result && ci->drivers.parse && stmt->statement_type == STMT_TYPE_SELECT) { if (stmt->parse_status == STMT_PARSE_NONE) { --- 447,453 ---- unknown_sizes = UNKNOWNS_AS_MAX; parse_ok = FALSE; ! if (ci->drivers.parse && stmt->statement_type == STMT_TYPE_SELECT) { if (stmt->parse_status == STMT_PARSE_NONE) {
^ permalink raw reply [nested|flat] 4+ messages in thread

* Re: SQLColAttributes and SQL_DESC_NULLABLE
@ 2005-12-08 09:30 Dave Page <dpage@vale-housing.co.uk>
  0 siblings, 0 replies; 4+ messages in thread

From: Dave Page @ 2005-12-08 09:30 UTC (permalink / raw)
  To: Ludek Finstrle <luf@pzkagis.cz>; Robert Jireš <robert.jires@centrum.cz>; +Cc: pgsql-odbc

 

> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org 
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Ludek Finstrle
> Sent: 06 December 2005 22:55
> To: Robert Jireš
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] SQLColAttributes and SQL_DESC_NULLABLE
> 
> > 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.

No regressions I can find - patch applied, thanks!

*However*, whilst testing I did find an issue with SQLTables that seems surprisingly similar to the one you fixed before. It's pretty easy to recreate in the Microsoft test suite.

- Connect to a data source with Declare/Fetch enabled.
- SQLExecDirect "SELECT * FROM pg_class"
- Get Data All (from the results menu)
- SQLTables
- Get Data All

It never stops retrieving data! Seems that you need to do the SQLExecDirect first - SQLExecute doesn't trigger the problem. SQLColumns is similarly affected - perhaps there are more as well.

Wanna take a look, or shall I log a bug until one of us gets time?

Regards, Dave.



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2005-12-08 09:30 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-12-02 01:27 SQLColAttributes and SQL_DESC_NULLABLE Robert Jireš <robert.jires@centrum.cz>
2005-12-05 11:10 ` Ludek Finstrle <luf@pzkagis.cz>
2005-12-06 22:55 ` Ludek Finstrle <luf@pzkagis.cz>
2005-12-08 09:30 Re: SQLColAttributes and SQL_DESC_NULLABLE Dave Page <dpage@vale-housing.co.uk>

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