sqlDescribeCol not setting null flag correctly for sqlDescribeCol

--0016e6471bdaef96a30474b904eb
Content-Type: text/plain; charset=ISO-8859-1

A basic table is described where one column has a null constraint: create
table TNUM( RNUM integer not null, CNUM numeric(7,2) )
A simple view is defined that projects all the columns of said table: create
view VNUM as select * from TNUM
A query which projects the columns of the table or the view will return
inconsistent null flags when you call sqlDescribeCol after sqlPrepare

Does not matter if you have parse, server side prepare etc
enabled/disabled.

Looks like another bug to me.

SQL_DRIVER_NAME=6, 30, "PSQLODBC35W.DLL"
SQL_DRIVER_ODBC_VER=77, 10, "03.51"
SQL_DRIVER_VER=7, 20, "08.04.0100"


Describe Column All:
icol, szColName, *pcbColName, *pfSqlType, *pcbColDef, *pibScale,
*pfNullable
1, rnum, 4, SQL_INTEGER=4, 10, 0, SQL_NO_NULLS=0
2, cnum, 4, SQL_NUMERIC=2, 7, 2, SQL_NULLABLE=1

Describe Column All:
icol, szColName, *pcbColName, *pfSqlType, *pcbColDef, *pibScale,
*pfNullable
1, rnum, 4, SQL_INTEGER=4, 10, 0, SQL_NULLABLE=1
2, cnum, 4, SQL_NUMERIC=2, 7, 2, SQL_NULLABLE=1

--0016e6471bdaef96a30474b904eb
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div><br></div><div>A basic table is described where one column has a null =
constraint:=A0create table TNUM( RNUM integer not null, CNUM numeric(7,2) =
=A0)</div><div>A simple view is defined that projects all the columns of sa=
id table:=A0create view VNUM as select * from TNUM</div>

<div>A query which projects the columns of the table or the view will retur=
n inconsistent null flags when you call sqlDescribeCol after sqlPrepare</di=
v><div><br></div><div>Does not matter if you have parse, server side prepar=
e etc enabled/disabled.=A0</div>

<div><br></div><div>Looks like another bug to me.=A0</div><div><br></div><d=
iv><div><span style=3D"white-space:pre"> </span>SQL_DRIVER_NAME=3D6, 30, &=
quot;PSQLODBC35W.DLL"</div><div><span style=3D"white-space:pre"> </sp=
an>SQL_DRIVER_ODBC_VER=3D77, 10, "03.51"</div>

<div><span style=3D"white-space:pre"> </span>SQL_DRIVER_VER=3D7, 20, "=
;08.04.0100"</div></div><div><br></div><br><div><div>Describe Column A=
ll:=A0</div><div><span style=3D"white-space:pre"> </span>icol, szColName,=
*pcbColName, *pfSqlType, *pcbColDef, *pibScale, *pfNullable=A0</div>

<div><span style=3D"white-space:pre"> </span>1, rnum, 4, SQL_INTEGER=3D4,=
10, 0, SQL_NO_NULLS=3D0=A0</div><div><span style=3D"white-space:pre"> </=
span>2, cnum, 4, SQL_NUMERIC=3D2, 7, 2, SQL_NULLABLE=3D1=A0</div>
<div><br></div><div>Describe Column All:=A0</div><div><span style=3D"white-=
space:pre"> </span>icol, szColName, *pcbColName, *pfSqlType, *pcbColDef,=
*pibScale, *pfNullable=A0</div>
<div><span style=3D"white-space:pre"> </span>1, rnum, 4, SQL_INTEGER=3D4=
, 10, 0, SQL_NULLABLE=3D1=A0</div><div><span style=3D"white-space:pre"> =
</span>2, cnum, 4, SQL_NUMERIC=3D2, 7, 2, SQL_NULLABLE=3D1=A0</div>
</div>

--0016e6471bdaef96a30474b904eb--
the6campbells [ Di, 29 September 2009 17:25 ] [ ID #2017426 ]

Re: sqlDescribeCol not setting null flag correctly for sqlDescribeCol

the6campbells wrote:
>
> A basic table is described where one column has a null
> constraint: create table TNUM( RNUM integer not null, CNUM numeric(7,2) )
> A simple view is defined that projects all the columns of said
> table: create view VNUM as select * from TNUM
> A query which projects the columns of the table or the view will return
> inconsistent null flags when you call sqlDescribeCol after sqlPrepare
>
> Does not matter if you have parse, server side prepare etc
> enabled/disabled.
>
> Looks like another bug to me.

It seems very hard for the driver to get more accurate results
than psql does. I see the following result via psql.

xxxxx=> \d tnum
Table "public.tnum"
Column | Type | Modifiers
--------+--------------+-----------
rnum | integer | not null
cnum | numeric(7,2) |

xxxxx=> \d vnum
View "public.vnum"
Column | Type | Modifiers
--------+--------------+-----------
rnum | integer |
cnum | numeric(7,2) |
View definition:
SELECT tnum.rnum, tnum.cnum
FROM tnum;

regards,
Hiroshi Inoue


--
Sent via pgsql-odbc mailing list (pgsql-odbc [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
Hiroshi Inoue [ Mi, 30 September 2009 08:22 ] [ ID #2017563 ]
Datenbanken » gmane.comp.db.postgresql.odbc » sqlDescribeCol not setting null flag correctly for sqlDescribeCol

Vorheriges Thema: PsqlODBC with a SSL connection
Nächstes Thema: cannot find pg_hba.conf file