Thread: Errors compiling psqlodbc

Errors compiling psqlodbc

From
"Rich Silva"
Date:

 

 

Hmmm, I was building the latest (07.03.0200) sources for a Linux system and I found first one then another issue…

 

First issue (and already submitted as a bug): The default ODBCVER is not 0x0300, but 0x0250. Configure does not set ODBCVER unless the –with-odbcver option is used… In psqlodbc.h, if ODBCVER is not set it defaults to 0x0250. I’m now using the configure line:

 

./configure --with-unixodbc --prefix=/usr --sysconfdir=/etc --with-odbcver=0x0300 

 

Second issue (and still diagnosing), once I’ve configured with that define the project will not compile, generating the following errors:

convert.c: In function `copy_and_convert_field':

convert.c:1194: incompatible types in assignment

convert.c:1196: incompatible types in assignment

convert.c:1202: incompatible types in assignment

convert.c:1204: incompatible types in assignment

(example line: *((SQLBIGINT *) rgbValueBindRow) = ATOI64(neut_str);)

 

odbcapi.c: In function `SQLFetch':

odbcapi.c:349: warning: initialization from incompatible pointer type

(line: SQLINTEGER *pcRow = irdopts->rowsFetched;)

 

odbcapi30.c: In function `SQLFetchScroll':

odbcapi30.c:204: warning: initialization from incompatible pointer type

(line: SQLINTEGER *pcRow = irdopts->rowsFetched, bkmarkoff = 0;)

 

pgapi30.c: In function `IRDSetField':

pgapi30.c:755: warning: assignment from incompatible pointer type

(example: opts->rowsFetched = (SQLUINTEGER *) Value;)

pgapi30.c: In function `IPDSetField':

pgapi30.c:811: warning: assignment from incompatible pointer type

pgapi30.c: In function `PGAPI_GetStmtAttr':

pgapi30.c:1424: warning: assignment from incompatible pointer type

pgapi30.c:1440: warning: assignment from incompatible pointer type

pgapi30.c:1448: warning: assignment from incompatible pointer type

pgapi30.c:1460: warning: assignment from incompatible pointer type

pgapi30.c: In function `PGAPI_SetStmtAttr':

pgapi30.c:1685: warning: assignment from incompatible pointer type

pgapi30.c:1697: warning: assignment from incompatible pointer type

pgapi30.c:1703: warning: assignment from incompatible pointer type

pgapi30.c:1712: warning: assignment from incompatible pointer type

 

Now, I’m not yet claiming to be a programmer, so I’m hoping that someone has tackled these before…

 

Thanx for the help!

Rich Silva

 

Re: Errors compiling psqlodbc

From
"Rich Silva"
Date:

A follow up on the four errors in convert.c…

 

Checking on what’s defined and what’s not… Here is some data… I’m a little confused and the code looks, well, lets call it interesting…

 

#ifdef GCC (its defined)

isqlext.h:           typedef long long int ODBCINT64;

isqlext.h:           typedef ODBCINT64 SQLBIGINT;

 

#ifdef ODBCINT64 (its defined)

#ifdef HAVE_STRTOLL (its defined)

convert.c:         #define ATOI64(val)     strtoll(val, NULL, 10)

 

(from the man page for strtoll())

long long int strtoll(const char *nptr, char **endptr, int base);

 

The original line is:

*((SQLBIGINT *) rgbValueBindRow) = ATOI64(neut_str);

 

The turns into (once you replace typedef’d and defined stuff with their equivalents:

const char *neut_str;

char *rgbValueBindRow;

*(( long long int *) rgbValueBindRow) = (long long int) strtoll (neut_str, NULL, 10);

 

I don’t like the left hand term at all, but its “form” is generally in use “up and down” this same method…

 

 


From: pgsql-odbc-owner@postgresql.org [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Rich Silva
Sent: Saturday, October 16, 2004 3:59 PM
To: pgsql-odbc@postgresql.org
Subject: [ODBC] Errors compiling psqlodbc

 

 

Hmmm, I was building the latest (07.03.0200) sources for a Linux system and I found first one then another issue…

  

./configure --with-unixodbc --prefix=/usr --sysconfdir=/etc --with-odbcver=0x0300 

 

Second issue (and still diagnosing), once I’ve configured with that define the project will not compile, generating the following errors:

convert.c: In function `copy_and_convert_field':

convert.c:1194: incompatible types in assignment

convert.c:1196: incompatible types in assignment

convert.c:1202: incompatible types in assignment

convert.c:1204: incompatible types in assignment

(example line: *((SQLBIGINT *) rgbValueBindRow) = ATOI64(neut_str);)

 

Re: Errors compiling psqlodbc

From
Peter Eisentraut
Date:
Rich Silva wrote:
> Hmmm, I was building the latest (07.03.0200) sources for a Linux
> system and I found first one then another issue.

These problems are fixed in the latest snapshot releases.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


Re: Errors compiling psqlodbc

From
"Dave Page"
Date:
Apologies for top posting (dodgy webmail)...

With 07.03.0200, 2.5 *was* the correct default ODBC version. That has been removed from the current code for some time
nowthough, so fixes or bugs related to the ODBC version are now pretty much irrelevant unless they are also present in
thecurrent code. 

The 08.00.0002 snapshot is pretty stable judging by the lack of bugs reports we have seen about it - please try that
version.

Regards, Dave.



-----Original Message-----
From: pgsql-odbc-owner@postgresql.org on behalf of Rich Silva
Sent: Sat 10/16/2004 11:58 PM
To: pgsql-odbc@postgresql.org
Subject: [ODBC] Errors compiling psqlodbc





Hmmm, I was building the latest (07.03.0200) sources for a Linux system and
I found first one then another issue.



First issue (and already submitted as a bug): The default ODBCVER is not
0x0300, but 0x0250. Configure does not set ODBCVER unless the -with-odbcver
option is used. In psqlodbc.h, if ODBCVER is not set it defaults to 0x0250.
I'm now using the configure line:



./configure --with-unixodbc --prefix=/usr --sysconfdir=/etc
--with-odbcver=0x0300



Second issue (and still diagnosing), once I've configured with that define
the project will not compile, generating the following errors:

convert.c: In function `copy_and_convert_field':

convert.c:1194: incompatible types in assignment

convert.c:1196: incompatible types in assignment

convert.c:1202: incompatible types in assignment

convert.c:1204: incompatible types in assignment

(example line: *((SQLBIGINT *) rgbValueBindRow) = ATOI64(neut_str);)



odbcapi.c: In function `SQLFetch':

odbcapi.c:349: warning: initialization from incompatible pointer type

(line: SQLINTEGER *pcRow = irdopts->rowsFetched;)



odbcapi30.c: In function `SQLFetchScroll':

odbcapi30.c:204: warning: initialization from incompatible pointer type

(line: SQLINTEGER *pcRow = irdopts->rowsFetched, bkmarkoff = 0;)



pgapi30.c: In function `IRDSetField':

pgapi30.c:755: warning: assignment from incompatible pointer type

(example: opts->rowsFetched = (SQLUINTEGER *) Value;)

pgapi30.c: In function `IPDSetField':

pgapi30.c:811: warning: assignment from incompatible pointer type

pgapi30.c: In function `PGAPI_GetStmtAttr':

pgapi30.c:1424: warning: assignment from incompatible pointer type

pgapi30.c:1440: warning: assignment from incompatible pointer type

pgapi30.c:1448: warning: assignment from incompatible pointer type

pgapi30.c:1460: warning: assignment from incompatible pointer type

pgapi30.c: In function `PGAPI_SetStmtAttr':

pgapi30.c:1685: warning: assignment from incompatible pointer type

pgapi30.c:1697: warning: assignment from incompatible pointer type

pgapi30.c:1703: warning: assignment from incompatible pointer type

pgapi30.c:1712: warning: assignment from incompatible pointer type



Now, I'm not yet claiming to be a programmer, so I'm hoping that someone has
tackled these before.



Thanx for the help!

Rich Silva





Re: Errors compiling psqlodbc

From
"Rich Silva"
Date:
Thanx, I also received a reply from Peter on some of this...

Good to know the 08.00.0002 branch is "stable"... We'll give that a try...

Rich

> -----Original Message-----
> From: Dave Page [mailto:dpage@vale-housing.co.uk]
> Sent: Sunday, October 17, 2004 10:57 AM
> To: Rich Silva; pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] Errors compiling psqlodbc
>
> Apologies for top posting (dodgy webmail)...
>
> With 07.03.0200, 2.5 *was* the correct default ODBC version. That has been
> removed from the current code for some time now though, so fixes or bugs
> related to the ODBC version are now pretty much irrelevant unless they are
> also present in the current code.
>
> The 08.00.0002 snapshot is pretty stable judging by the lack of bugs
> reports we have seen about it - please try that version.
>
> Regards, Dave.
>
>
>
> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org on behalf of Rich Silva
> Sent: Sat 10/16/2004 11:58 PM
> To: pgsql-odbc@postgresql.org
> Subject: [ODBC] Errors compiling psqlodbc
>
>
>
>
>
> Hmmm, I was building the latest (07.03.0200) sources for a Linux system
> and
> I found first one then another issue.
>
>
>
> First issue (and already submitted as a bug): The default ODBCVER is not
> 0x0300, but 0x0250. Configure does not set ODBCVER unless the -with-
> odbcver
> option is used. In psqlodbc.h, if ODBCVER is not set it defaults to
> 0x0250.
> I'm now using the configure line:
>
>
>
> ./configure --with-unixodbc --prefix=/usr --sysconfdir=/etc
> --with-odbcver=0x0300
>
>
>
> Second issue (and still diagnosing), once I've configured with that define
> the project will not compile, generating the following errors:
>
> convert.c: In function `copy_and_convert_field':
>
> convert.c:1194: incompatible types in assignment
>
> convert.c:1196: incompatible types in assignment
>
> convert.c:1202: incompatible types in assignment
>
> convert.c:1204: incompatible types in assignment
>
> (example line: *((SQLBIGINT *) rgbValueBindRow) = ATOI64(neut_str);)
>
>
>
> odbcapi.c: In function `SQLFetch':
>
> odbcapi.c:349: warning: initialization from incompatible pointer type
>
> (line: SQLINTEGER *pcRow = irdopts->rowsFetched;)
>
>
>
> odbcapi30.c: In function `SQLFetchScroll':
>
> odbcapi30.c:204: warning: initialization from incompatible pointer type
>
> (line: SQLINTEGER *pcRow = irdopts->rowsFetched, bkmarkoff = 0;)
>
>
>
> pgapi30.c: In function `IRDSetField':
>
> pgapi30.c:755: warning: assignment from incompatible pointer type
>
> (example: opts->rowsFetched = (SQLUINTEGER *) Value;)
>
> pgapi30.c: In function `IPDSetField':
>
> pgapi30.c:811: warning: assignment from incompatible pointer type
>
> pgapi30.c: In function `PGAPI_GetStmtAttr':
>
> pgapi30.c:1424: warning: assignment from incompatible pointer type
>
> pgapi30.c:1440: warning: assignment from incompatible pointer type
>
> pgapi30.c:1448: warning: assignment from incompatible pointer type
>
> pgapi30.c:1460: warning: assignment from incompatible pointer type
>
> pgapi30.c: In function `PGAPI_SetStmtAttr':
>
> pgapi30.c:1685: warning: assignment from incompatible pointer type
>
> pgapi30.c:1697: warning: assignment from incompatible pointer type
>
> pgapi30.c:1703: warning: assignment from incompatible pointer type
>
> pgapi30.c:1712: warning: assignment from incompatible pointer type
>
>
>
> Now, I'm not yet claiming to be a programmer, so I'm hoping that someone
> has
> tackled these before.
>
>
>
> Thanx for the help!
>
> Rich Silva
>
>





Re: Errors compiling psqlodbc

From
"Rich Silva"
Date:
One other question I know my guys are going to come with is whether ODBC
03.51 (or 03.52) is supported... I did notice some checks for that in the
source... Thought I'd check with the group...

Rich

> -----Original Message-----
> From: Dave Page [mailto:dpage@vale-housing.co.uk]
> Sent: Sunday, October 17, 2004 10:57 AM
> To: Rich Silva; pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] Errors compiling psqlodbc
>
> Apologies for top posting (dodgy webmail)...
>
> With 07.03.0200, 2.5 *was* the correct default ODBC version. That has been
> removed from the current code for some time now though, so fixes or bugs
> related to the ODBC version are now pretty much irrelevant unless they are
> also present in the current code.
>
> The 08.00.0002 snapshot is pretty stable judging by the lack of bugs
> reports we have seen about it - please try that version.
>
> Regards, Dave.





Re: Errors compiling psqlodbc

From
"Dave Page"
Date:

> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Rich Silva
> Sent: 17 October 2004 21:20
> To: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Errors compiling psqlodbc
>
>
> One other question I know my guys are going to come with is
> whether ODBC
> 03.51 (or 03.52) is supported... I did notice some checks for
> that in the source... Thought I'd check with the group...

We support 3.0 "officially", though as you have spotted, there is some
3.51 code in there. I have no idea what state it's in though.

Regards, Dave

Re: Errors compiling psqlodbc

From
"Rich Silva"
Date:
Just to add more data to this...

I tried both the 08.00.0001 and 0002 source drops and although they compiled
with no errors our test program generated the following errors (some of this
is Wine Debug output, a trace...

The "environment" is Red Hat EL3. Postgres is 7.4.5 from RPMs (it may be a
Fedora release, but I think not, just don't have the trail, although I do
still have the rpms...). The Driver Manager is unixODBC 2.2.10-1.

We wrote this test program to help us diagnose why various operations that
we could make work in a Windows environment would not work in a Linux
environment. The program connects to the DSN, digs out some version
information then tries to create a table, fill it with data using
bulkoperations. The program is a windows binary, we run it using the WINE
emulator.

For what its worth, this same program works with version 07.05.0001,
although at the end of the test it invalidly reports "zero data" even though
the data was inserted into the table. (After I get this project over the
current hump, I can help generate some other data for this group if useful)

Rich

[Horse_08.00.0002_03.00]
Database Manager        : PostgreSQL
Database Manager Version: 08.00.0002 PostgreSQL 7.4.5 on
i686-redhat-linux-gnu, compiled by GCC gcc (GCC) 3.2.3 20030502 (Red Hat
Linux 3.2.3-39)

CLI Driver Name         : libpsqlodbc.so
CLI Driver Version      : 08.00.0002

SQL_DRIVER_ODBC_VER     : 03.00
SQL_ODBC_VER            : 03.52

The ODBC SQLSetPos function is supported!
The ODBC SQLBulkOperations function is supported!

SQLSetStmtAttr: SQLError = 1, [unixODBC]Requested value changed.;
ERROR:  table "emp_bulk_test" does not exist

wine: Unhandled exception (thread 0009), starting debugger...
fixme:console:SetConsoleCtrlHandler (0x778dadc0,1) - no error checking or
testing yet
WineDbg starting on pid 0x8
Unhandled exception: page fault on read access to 0x00000000 in 32-bit code
(0x7f62a3d3).
In 32 bit mode.
fixme:dbghelp:elf_load_debug_info Unsupported Dwarf2 information
0x7f62a3d3: movl        0x0(%eax,%edi,4),%edx
Wine-dbg>where
Backtrace:
=>1 0x7f62a3d3 (0x778edf90)
  2 0x7f63a93e (0x778edfd0)
  3 0x7f63aa8e (0x778ee020)
  4 0x7f638132 (0x778ee050)
  5 0x7ff92a7d SQLBulkOperations+0x33d in libodbc.so (0x778ee190)
  6 0x777ea136 SQLBulkOperations+0x96 in odbc32 (0x778ee1b4)
  7 0x004148faerr:dbghelp_msc:pe_load_debug_directory Got a page fault while
loading symbols
 (0x778efec8)
  8 0x0041948c (0x778eff20)
  9 0x77b83ef5 (0x778efff4)
  10 0xb75c10b1 wine_switch_to_stack+0x11 in libwine.so.1 (0x00000000)
Wine-dbg>

> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org [mailto:pgsql-odbc-
> owner@postgresql.org] On Behalf Of Rich Silva
> Sent: Sunday, October 17, 2004 12:58 PM
> To: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Errors compiling psqlodbc
>
>
> Thanx, I also received a reply from Peter on some of this...
>
> Good to know the 08.00.0002 branch is "stable"... We'll give that a try...
>
> Rich
>
> > -----Original Message-----
> > From: Dave Page [mailto:dpage@vale-housing.co.uk]
> > Sent: Sunday, October 17, 2004 10:57 AM
> > To: Rich Silva; pgsql-odbc@postgresql.org
> > Subject: RE: [ODBC] Errors compiling psqlodbc
> >
> > Apologies for top posting (dodgy webmail)...
> >
> > With 07.03.0200, 2.5 *was* the correct default ODBC version. That has
> been
> > removed from the current code for some time now though, so fixes or bugs
> > related to the ODBC version are now pretty much irrelevant unless they
> are
> > also present in the current code.
> >
> > The 08.00.0002 snapshot is pretty stable judging by the lack of bugs
> > reports we have seen about it - please try that version.
> >
> > Regards, Dave.
> >
> >
> >
> > -----Original Message-----
> > From: pgsql-odbc-owner@postgresql.org on behalf of Rich Silva
> > Sent: Sat 10/16/2004 11:58 PM
> > To: pgsql-odbc@postgresql.org
> > Subject: [ODBC] Errors compiling psqlodbc
> >
> >
> >
> >
> >
> > Hmmm, I was building the latest (07.03.0200) sources for a Linux system
> > and
> > I found first one then another issue.
> >
> >
> >
> > First issue (and already submitted as a bug): The default ODBCVER is not
> > 0x0300, but 0x0250. Configure does not set ODBCVER unless the -with-
> > odbcver
> > option is used. In psqlodbc.h, if ODBCVER is not set it defaults to
> > 0x0250.
> > I'm now using the configure line:
> >
> >
> >
> > ./configure --with-unixodbc --prefix=/usr --sysconfdir=/etc
> > --with-odbcver=0x0300
> >
> >
> >
> > Second issue (and still diagnosing), once I've configured with that
> define
> > the project will not compile, generating the following errors:
> >
> > convert.c: In function `copy_and_convert_field':
> >
> > convert.c:1194: incompatible types in assignment
> >
> > convert.c:1196: incompatible types in assignment
> >
> > convert.c:1202: incompatible types in assignment
> >
> > convert.c:1204: incompatible types in assignment
> >
> > (example line: *((SQLBIGINT *) rgbValueBindRow) = ATOI64(neut_str);)
> >
> >
> >
> > odbcapi.c: In function `SQLFetch':
> >
> > odbcapi.c:349: warning: initialization from incompatible pointer type
> >
> > (line: SQLINTEGER *pcRow = irdopts->rowsFetched;)
> >
> >
> >
> > odbcapi30.c: In function `SQLFetchScroll':
> >
> > odbcapi30.c:204: warning: initialization from incompatible pointer type
> >
> > (line: SQLINTEGER *pcRow = irdopts->rowsFetched, bkmarkoff = 0;)
> >
> >
> >
> > pgapi30.c: In function `IRDSetField':
> >
> > pgapi30.c:755: warning: assignment from incompatible pointer type
> >
> > (example: opts->rowsFetched = (SQLUINTEGER *) Value;)
> >
> > pgapi30.c: In function `IPDSetField':
> >
> > pgapi30.c:811: warning: assignment from incompatible pointer type
> >
> > pgapi30.c: In function `PGAPI_GetStmtAttr':
> >
> > pgapi30.c:1424: warning: assignment from incompatible pointer type
> >
> > pgapi30.c:1440: warning: assignment from incompatible pointer type
> >
> > pgapi30.c:1448: warning: assignment from incompatible pointer type
> >
> > pgapi30.c:1460: warning: assignment from incompatible pointer type
> >
> > pgapi30.c: In function `PGAPI_SetStmtAttr':
> >
> > pgapi30.c:1685: warning: assignment from incompatible pointer type
> >
> > pgapi30.c:1697: warning: assignment from incompatible pointer type
> >
> > pgapi30.c:1703: warning: assignment from incompatible pointer type
> >
> > pgapi30.c:1712: warning: assignment from incompatible pointer type
> >
> >
> >
> > Now, I'm not yet claiming to be a programmer, so I'm hoping that someone
> > has
> > tackled these before.
> >
> >
> >
> > Thanx for the help!
> >
> > Rich Silva
> >
> >
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org