pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedOdbcapi30.c - 64 bit compiler warning cleanup
26+ messages / 3 participants
[nested] [flat]
* Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-19 11:11 Dave Page <dpage@vale-housing.co.uk>
0 siblings, 1 reply; 26+ messages in thread
From: Dave Page @ 2006-01-19 11:11 UTC (permalink / raw)
To: pgsql-odbc; +Cc: Ludek Finstrle <luf@pzkagis.cz>
<<odbcapi30_64bit.patch>>
The attached patch cleans up the 64 bit compiler warnings in
odbcapi30.c.
Luf, if you're happy, can you add it to your collection of patches ready
for application please? I didn't apply it myself in case I break any of
yours.
Regards, Dave.
Attachments:
odbcapi30_64bit.patch (application/octet-stream, 2.0K) download
Index: odbcapi30.c
===================================================================
RCS file: /cvsroot/psqlodbc/psqlodbc/odbcapi30.c,v
retrieving revision 1.34
diff -c -r1.34 odbcapi30.c
*** odbcapi30.c 20 Oct 2005 13:06:10 -0000 1.34
--- odbcapi30.c 19 Jan 2006 11:05:01 -0000
***************
*** 422,441 ****
switch (Attribute)
{
case SQL_ATTR_CONNECTION_POOLING:
! switch ((SQLUINTEGER) Value)
{
! case SQL_CP_OFF:
! EN_unset_pooling(env);
! ret = SQL_SUCCESS;
! break;
#if defined(WIN_MULTITHREAD_SUPPORT) || defined(POSIX_MULTITHREAD_SUPPORT)
! case SQL_CP_ONE_PER_DRIVER:
! EN_set_pooling(env);
! ret = SQL_SUCCESS;
! break;
#endif /* WIN_MULTITHREAD_SUPPORT */
! default:
! ret = SQL_SUCCESS_WITH_INFO;
}
break;
case SQL_ATTR_CP_MATCH:
--- 422,442 ----
switch (Attribute)
{
case SQL_ATTR_CONNECTION_POOLING:
! if (Value == (PTR) SQL_CP_OFF)
{
! EN_unset_pooling(env);
! ret = SQL_SUCCESS;
! }
#if defined(WIN_MULTITHREAD_SUPPORT) || defined(POSIX_MULTITHREAD_SUPPORT)
! else if (Value == (PTR) SQL_CP_ONE_PER_DRIVER)
! {
! EN_set_pooling(env);
! ret = SQL_SUCCESS;
! }
#endif /* WIN_MULTITHREAD_SUPPORT */
! else
! {
! ret = SQL_SUCCESS_WITH_INFO;
}
break;
case SQL_ATTR_CP_MATCH:
***************
*** 443,456 ****
ret = SQL_SUCCESS;
break;
case SQL_ATTR_ODBC_VERSION:
! if ((SQLUINTEGER) Value == SQL_OV_ODBC2)
EN_set_odbc2(env);
else
EN_set_odbc3(env);
ret = SQL_SUCCESS;
break;
case SQL_ATTR_OUTPUT_NTS:
! if ((SQLUINTEGER) Value == SQL_TRUE)
ret = SQL_SUCCESS;
else
ret = SQL_SUCCESS_WITH_INFO;
--- 444,457 ----
ret = SQL_SUCCESS;
break;
case SQL_ATTR_ODBC_VERSION:
! if (Value == (PTR) SQL_OV_ODBC2)
EN_set_odbc2(env);
else
EN_set_odbc3(env);
ret = SQL_SUCCESS;
break;
case SQL_ATTR_OUTPUT_NTS:
! if (Value == (PTR) SQL_TRUE)
ret = SQL_SUCCESS;
else
ret = SQL_SUCCESS_WITH_INFO;
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-19 11:23 Ludek Finstrle <luf@pzkagis.cz>
parent: Dave Page <dpage@vale-housing.co.uk>
0 siblings, 0 replies; 26+ messages in thread
From: Ludek Finstrle @ 2006-01-19 11:23 UTC (permalink / raw)
To: Dave Page <dpage@vale-housing.co.uk>; +Cc: pgsql-odbc
> The attached patch cleans up the 64 bit compiler warnings in
> odbcapi30.c.
I'll try it today or tomorrow (I hope).
> Luf, if you're happy, can you add it to your collection of patches ready
> for application please? I didn't apply it myself in case I break any of
> yours.
Ok. I apply a lot of them to CVS till end of week. I see no negative
reaction - I have to verify the implicit rollback problem.
Regards,
Luf
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-19 13:42 Dave Page <dpage@vale-housing.co.uk>
0 siblings, 1 reply; 26+ messages in thread
From: Dave Page @ 2006-01-19 13:42 UTC (permalink / raw)
To: Ludek Finstrle <luf@pzkagis.cz>; +Cc: pgsql-odbc
> -----Original Message-----
> From: Ludek Finstrle [mailto:luf@pzkagis.cz]
> Sent: 19 January 2006 11:24
> To: Dave Page
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Odbcapi30.c - 64 bit compiler warning cleanup
>
> > The attached patch cleans up the 64 bit compiler warnings in
> > odbcapi30.c.
>
> I'll try it today or tomorrow (I hope).
Thanks - I should add that I'm not sure how to deal with the other ones.
I think it needs someone far more experienced in 32/64 bit issues than
me to think about it.
Regards, Dave.
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-23 09:06 Ludek Finstrle <luf@pzkagis.cz>
parent: Dave Page <dpage@vale-housing.co.uk>
0 siblings, 2 replies; 26+ messages in thread
From: Ludek Finstrle @ 2006-01-23 09:06 UTC (permalink / raw)
To: Dave Page <dpage@vale-housing.co.uk>; +Cc: pgsql-odbc
> > > The attached patch cleans up the 64 bit compiler warnings in
> > > odbcapi30.c.
> >
> > I'll try it today or tomorrow (I hope).
I'm a little bit late. I had problems with my 64-bit box during weekend.
I have installed pgsql and unixODBC now. I hope I finish this work today.
> Thanks - I should add that I'm not sure how to deal with the other ones.
> I think it needs someone far more experienced in 32/64 bit issues than
> me to think about it.
I take a look on it but I think I'm less experienced in C and I have no
experience with 32/64 bit issue.
Regards,
Luf
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-24 19:25 Ludek Finstrle <luf@pzkagis.cz>
parent: Ludek Finstrle <luf@pzkagis.cz>
1 sibling, 0 replies; 26+ messages in thread
From: Ludek Finstrle @ 2006-01-24 19:25 UTC (permalink / raw)
To: Dave Page <dpage@vale-housing.co.uk>; +Cc: pgsql-odbc
> I'm a little bit late. I had problems with my 64-bit box during weekend.
> I have installed pgsql and unixODBC now. I hope I finish this work today.
I have problem with auto* tools to create configure :-(
I have x86_64 CentOS 4.2 with all updates. auto* versions:
aclocal (GNU automake) 1.9.2
libtoolize (GNU libtool) 1.5.6
autoconf (GNU Autoconf) 2.59
autoheader (GNU Autoconf) 2.59
automake (GNU automake) 1.9.2
I have installed rpms:
postgresql-8.1.2
postgresql-server
postgresql-libs
postgresql-devel
postgresql-pl
configure.ac:10: error: possibly undefined macro: AC_DEFINE
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:18: error: possibly undefined macro: AC_CHECK_LIB
configure.ac:19: error: possibly undefined macro: AC_MSG_ERROR
configure.ac:66: error: possibly undefined macro: AC_CHECK_FUNCS
configure.ac:85: error: possibly undefined macro: AC_TRY_COMPILE
Do I need whole postgresql source code? I try give to aclocal rpm build
dir witoccess.
Any ideas?
Luf
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-24 20:18 Dave Page <dpage@vale-housing.co.uk>
0 siblings, 1 reply; 26+ messages in thread
From: Dave Page @ 2006-01-24 20:18 UTC (permalink / raw)
To: luf@pzkagis.cz; dpage@vale-housing.co.uk; +Cc: pgsql-odbc
-----Original Message-----
From: "Ludek Finstrle"<luf@pzkagis.cz>
Sent: 24/01/06 19:25:45
To: "Dave Page"<dpage@vale-housing.co.uk>
Cc: "pgsql-odbc@postgresql.org"<pgsql-odbc@postgresql.org>
Subject: Re: [ODBC] Odbcapi30.c - 64 bit compiler warning cleanup
> Do I need whole postgresql source code?
Yes - see the unix compilation doc for the full steps.
Regards, Dave
-----Unmodified Original Message-----
> I'm a little bit late. I had problems with my 64-bit box during weekend.
> I have installed pgsql and unixODBC now. I hope I finish this work today.
I have problem with auto* tools to create configure :-(
I have x86_64 CentOS 4.2 with all updates. auto* versions:
aclocal (GNU automake) 1.9.2
libtoolize (GNU libtool) 1.5.6
autoconf (GNU Autoconf) 2.59
autoheader (GNU Autoconf) 2.59
automake (GNU automake) 1.9.2
I have installed rpms:
postgresql-8.1.2
postgresql-server
postgresql-libs
postgresql-devel
postgresql-pl
configure.ac:10: error: possibly undefined macro: AC_DEFINE
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:18: error: possibly undefined macro: AC_CHECK_LIB
configure.ac:19: error: possibly undefined macro: AC_MSG_ERROR
configure.ac:66: error: possibly undefined macro: AC_CHECK_FUNCS
configure.ac:85: error: possibly undefined macro: AC_TRY_COMPILE
Do I need whole postgresql source code? I try give to aclocal rpm build
dir witoccess.
Any ideas?
Luf
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-24 20:39 Ludek Finstrle <luf@pzkagis.cz>
parent: Dave Page <dpage@vale-housing.co.uk>
0 siblings, 1 reply; 26+ messages in thread
From: Ludek Finstrle @ 2006-01-24 20:39 UTC (permalink / raw)
To: Dave Page <dpage@vale-housing.co.uk>; +Cc: pgsql-odbc
> > Do I need whole postgresql source code?
>
> Yes - see the unix compilation doc for the full steps.
I was working with this manual but I maked two mistakes:
1) I didn't copy libtool.m4
2) I used only base pgsql source dir (not config subdir)
I have to better read next time. Now I'm able to build it.
Thanks,
Luf
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-24 21:22 Dave Page <dpage@vale-housing.co.uk>
parent: Ludek Finstrle <luf@pzkagis.cz>
0 siblings, 0 replies; 26+ messages in thread
From: Dave Page @ 2006-01-24 21:22 UTC (permalink / raw)
To: Ludek Finstrle <luf@pzkagis.cz>; +Cc: pgsql-odbc
On 24/1/06 20:39, "Ludek Finstrle" <luf@pzkagis.cz> wrote:
>>> Do I need whole postgresql source code?
>>
>> Yes - see the unix compilation doc for the full steps.
>
> I was working with this manual but I maked two mistakes:
> 1) I didn't copy libtool.m4
> 2) I used only base pgsql source dir (not config subdir)
>
> I have to better read next time. Now I'm able to build it.
I think we've all been there! :-)
Regards, Dave.
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-26 10:17 Ludek Finstrle <luf@pzkagis.cz>
parent: Ludek Finstrle <luf@pzkagis.cz>
1 sibling, 0 replies; 26+ messages in thread
From: Ludek Finstrle @ 2006-01-26 10:17 UTC (permalink / raw)
To: Dave Page <dpage@vale-housing.co.uk>; +Cc: pgsql-odbc
> The attached patch cleans up the 64 bit compiler warnings in
> odbcapi30.c.
I test it and add more warning cleanups. I include your patch into
attached one. I tried it a little bit on 64-bit and 32-bit box.
I don't solve the problem in options.c where 64-bit pointer may
be passwd throught 32-bit number. I don't know how to solve it.
Please review and comment.
Regards,
Luf
Attachments:
psqlodbc-64bit.diff (text/plain, 16.2K) download
diff -c psqlodbc.orig/odbcapi30.c psqlodbc/odbcapi30.c
*** psqlodbc.orig/odbcapi30.c 2006-01-26 00:58:08.000000000 +0100
--- psqlodbc/odbcapi30.c 2006-01-24 20:08:00.000000000 +0100
***************
*** 422,441 ****
switch (Attribute)
{
case SQL_ATTR_CONNECTION_POOLING:
! switch ((SQLUINTEGER) Value)
{
! case SQL_CP_OFF:
! EN_unset_pooling(env);
! ret = SQL_SUCCESS;
! break;
#if defined(WIN_MULTITHREAD_SUPPORT) || defined(POSIX_MULTITHREAD_SUPPORT)
! case SQL_CP_ONE_PER_DRIVER:
! EN_set_pooling(env);
! ret = SQL_SUCCESS;
! break;
#endif /* WIN_MULTITHREAD_SUPPORT */
! default:
! ret = SQL_SUCCESS_WITH_INFO;
}
break;
case SQL_ATTR_CP_MATCH:
--- 422,442 ----
switch (Attribute)
{
case SQL_ATTR_CONNECTION_POOLING:
! if (Value == (PTR) SQL_CP_OFF)
{
! EN_unset_pooling(env);
! ret = SQL_SUCCESS;
! }
#if defined(WIN_MULTITHREAD_SUPPORT) || defined(POSIX_MULTITHREAD_SUPPORT)
! else if (Value == (PTR) SQL_CP_ONE_PER_DRIVER)
! {
! EN_set_pooling(env);
! ret = SQL_SUCCESS;
! }
#endif /* WIN_MULTITHREAD_SUPPORT */
! else
! {
! ret = SQL_SUCCESS_WITH_INFO;
}
break;
case SQL_ATTR_CP_MATCH:
***************
*** 443,456 ****
ret = SQL_SUCCESS;
break;
case SQL_ATTR_ODBC_VERSION:
! if ((SQLUINTEGER) Value == SQL_OV_ODBC2)
EN_set_odbc2(env);
else
EN_set_odbc3(env);
ret = SQL_SUCCESS;
break;
case SQL_ATTR_OUTPUT_NTS:
! if ((SQLUINTEGER) Value == SQL_TRUE)
ret = SQL_SUCCESS;
else
ret = SQL_SUCCESS_WITH_INFO;
--- 444,457 ----
ret = SQL_SUCCESS;
break;
case SQL_ATTR_ODBC_VERSION:
! if (Value == (PTR) SQL_OV_ODBC2)
EN_set_odbc2(env);
else
EN_set_odbc3(env);
ret = SQL_SUCCESS;
break;
case SQL_ATTR_OUTPUT_NTS:
! if (Value == (PTR) SQL_TRUE)
ret = SQL_SUCCESS;
else
ret = SQL_SUCCESS_WITH_INFO;
diff -c psqlodbc.orig/pgapi30.c psqlodbc/pgapi30.c
*** psqlodbc.orig/pgapi30.c 2005-12-02 12:00:43.000000000 +0100
--- psqlodbc/pgapi30.c 2006-01-26 00:54:26.000000000 +0100
***************
*** 475,481 ****
switch (FieldIdentifier)
{
case SQL_DESC_ARRAY_SIZE:
! opts->size_of_rowset = (SQLUINTEGER) Value;
return ret;
case SQL_DESC_ARRAY_STATUS_PTR:
opts->row_operation_ptr = Value;
--- 475,481 ----
switch (FieldIdentifier)
{
case SQL_DESC_ARRAY_SIZE:
! opts->size_of_rowset = (SQLUINTEGER) ((unsigned long) Value);
return ret;
case SQL_DESC_ARRAY_STATUS_PTR:
opts->row_operation_ptr = Value;
***************
*** 484,493 ****
opts->row_offset_ptr = Value;
return ret;
case SQL_DESC_BIND_TYPE:
! opts->bind_size = (SQLUINTEGER) Value;
return ret;
case SQL_DESC_COUNT:
! column_bindings_set(opts, (SQLUINTEGER) Value, FALSE);
return ret;
case SQL_DESC_TYPE:
--- 484,493 ----
opts->row_offset_ptr = Value;
return ret;
case SQL_DESC_BIND_TYPE:
! opts->bind_size = (SQLUINTEGER) ((unsigned long) Value);
return ret;
case SQL_DESC_COUNT:
! column_bindings_set(opts, (SQLUINTEGER) ((unsigned long) Value), FALSE);
return ret;
case SQL_DESC_TYPE:
***************
*** 532,538 ****
{
case SQL_DESC_TYPE:
reset_a_column_binding(opts, RecNumber);
! opts->bindings[row_idx].returntype = (Int4) Value;
break;
case SQL_DESC_DATETIME_INTERVAL_CODE:
switch (opts->bindings[row_idx].returntype)
--- 532,538 ----
{
case SQL_DESC_TYPE:
reset_a_column_binding(opts, RecNumber);
! opts->bindings[row_idx].returntype = (Int4) ((long) Value);
break;
case SQL_DESC_DATETIME_INTERVAL_CODE:
switch (opts->bindings[row_idx].returntype)
***************
*** 541,547 ****
case SQL_C_TYPE_DATE:
case SQL_C_TYPE_TIME:
case SQL_C_TYPE_TIMESTAMP:
! switch ((Int4) Value)
{
case SQL_CODE_DATE:
opts->bindings[row_idx].returntype = SQL_C_TYPE_DATE;
--- 541,547 ----
case SQL_C_TYPE_DATE:
case SQL_C_TYPE_TIME:
case SQL_C_TYPE_TIMESTAMP:
! switch ((Int4) ((long) Value))
{
case SQL_CODE_DATE:
opts->bindings[row_idx].returntype = SQL_C_TYPE_DATE;
***************
*** 557,563 ****
}
break;
case SQL_DESC_CONCISE_TYPE:
! opts->bindings[row_idx].returntype = (Int4) Value;
break;
case SQL_DESC_DATA_PTR:
opts->bindings[row_idx].buffer = Value;
--- 557,563 ----
}
break;
case SQL_DESC_CONCISE_TYPE:
! opts->bindings[row_idx].returntype = (Int4) ((long) Value);
break;
case SQL_DESC_DATA_PTR:
opts->bindings[row_idx].buffer = Value;
***************
*** 574,586 ****
opts->bindings[row_idx].used = Value;
break;
case SQL_DESC_OCTET_LENGTH:
! opts->bindings[row_idx].buflen = (Int4) Value;
break;
case SQL_DESC_PRECISION:
! opts->bindings[row_idx].precision = (Int2)((Int4) Value);
break;
case SQL_DESC_SCALE:
! opts->bindings[row_idx].scale = (Int4) Value;
break;
case SQL_DESC_ALLOC_TYPE: /* read-only */
case SQL_DESC_DATETIME_INTERVAL_PRECISION:
--- 574,586 ----
opts->bindings[row_idx].used = Value;
break;
case SQL_DESC_OCTET_LENGTH:
! opts->bindings[row_idx].buflen = (Int4) ((long) Value);
break;
case SQL_DESC_PRECISION:
! opts->bindings[row_idx].precision = (Int2)((long) Value);
break;
case SQL_DESC_SCALE:
! opts->bindings[row_idx].scale = (Int4) ((long) Value);
break;
case SQL_DESC_ALLOC_TYPE: /* read-only */
case SQL_DESC_DATETIME_INTERVAL_PRECISION:
***************
*** 650,656 ****
switch (FieldIdentifier)
{
case SQL_DESC_ARRAY_SIZE:
! opts->paramset_size = (SQLUINTEGER) Value;
return ret;
case SQL_DESC_ARRAY_STATUS_PTR:
opts->param_operation_ptr = Value;
--- 650,656 ----
switch (FieldIdentifier)
{
case SQL_DESC_ARRAY_SIZE:
! opts->paramset_size = (SQLUINTEGER) ((unsigned long) Value);
return ret;
case SQL_DESC_ARRAY_STATUS_PTR:
opts->param_operation_ptr = Value;
***************
*** 659,668 ****
opts->param_offset_ptr = Value;
return ret;
case SQL_DESC_BIND_TYPE:
! opts->param_bind_type = (SQLUINTEGER) Value;
return ret;
case SQL_DESC_COUNT:
! parameter_bindings_set(opts, (SQLUINTEGER) Value, FALSE);
return ret;
case SQL_DESC_TYPE:
--- 659,668 ----
opts->param_offset_ptr = Value;
return ret;
case SQL_DESC_BIND_TYPE:
! opts->param_bind_type = (SQLUINTEGER) ((unsigned long) Value);
return ret;
case SQL_DESC_COUNT:
! parameter_bindings_set(opts, (SQLUINTEGER) ((unsigned long) Value), FALSE);
return ret;
case SQL_DESC_TYPE:
***************
*** 682,688 ****
{
case SQL_DESC_TYPE:
reset_a_parameter_binding(opts, RecNumber);
! opts->parameters[para_idx].CType = (Int4) Value;
break;
case SQL_DESC_DATETIME_INTERVAL_CODE:
switch (opts->parameters[para_idx].CType)
--- 682,688 ----
{
case SQL_DESC_TYPE:
reset_a_parameter_binding(opts, RecNumber);
! opts->parameters[para_idx].CType = (Int4) ((long) Value);
break;
case SQL_DESC_DATETIME_INTERVAL_CODE:
switch (opts->parameters[para_idx].CType)
***************
*** 691,697 ****
case SQL_C_TYPE_DATE:
case SQL_C_TYPE_TIME:
case SQL_C_TYPE_TIMESTAMP:
! switch ((Int4) Value)
{
case SQL_CODE_DATE:
opts->parameters[para_idx].CType = SQL_C_TYPE_DATE;
--- 691,697 ----
case SQL_C_TYPE_DATE:
case SQL_C_TYPE_TIME:
case SQL_C_TYPE_TIMESTAMP:
! switch ((Int4) ((long) Value))
{
case SQL_CODE_DATE:
opts->parameters[para_idx].CType = SQL_C_TYPE_DATE;
***************
*** 707,713 ****
}
break;
case SQL_DESC_CONCISE_TYPE:
! opts->parameters[para_idx].CType = (Int4) Value;
break;
case SQL_DESC_DATA_PTR:
opts->parameters[para_idx].buffer = Value;
--- 707,713 ----
}
break;
case SQL_DESC_CONCISE_TYPE:
! opts->parameters[para_idx].CType = (Int4) ((long) Value);
break;
case SQL_DESC_DATA_PTR:
opts->parameters[para_idx].buffer = Value;
***************
*** 720,735 ****
}
break;
case SQL_DESC_OCTET_LENGTH:
! opts->parameters[para_idx].buflen = (Int4) Value;
break;
case SQL_DESC_OCTET_LENGTH_PTR:
opts->parameters[para_idx].used = Value;
break;
case SQL_DESC_PRECISION:
! opts->parameters[para_idx].precision = (Int2) ((Int4) Value);
break;
case SQL_DESC_SCALE:
! opts->parameters[para_idx].scale = (Int2) ((Int4) Value);
break;
case SQL_DESC_ALLOC_TYPE: /* read-only */
case SQL_DESC_DATETIME_INTERVAL_PRECISION:
--- 720,735 ----
}
break;
case SQL_DESC_OCTET_LENGTH:
! opts->parameters[para_idx].buflen = (Int4) ((long) Value);
break;
case SQL_DESC_OCTET_LENGTH_PTR:
opts->parameters[para_idx].used = Value;
break;
case SQL_DESC_PRECISION:
! opts->parameters[para_idx].precision = (Int2) ((long) Value);
break;
case SQL_DESC_SCALE:
! opts->parameters[para_idx].scale = (Int2) ((long) Value);
break;
case SQL_DESC_ALLOC_TYPE: /* read-only */
case SQL_DESC_DATETIME_INTERVAL_PRECISION:
***************
*** 815,821 ****
ipdopts->param_processed_ptr = (UInt4 *) Value;
return ret;
case SQL_DESC_UNNAMED: /* only SQL_UNNAMED is allowed */
! if (SQL_UNNAMED != (SQLUINTEGER) Value)
{
ret = SQL_ERROR;
DC_set_error(desc, STMT_INVALID_DESCRIPTOR_IDENTIFIER,
--- 815,821 ----
ipdopts->param_processed_ptr = (UInt4 *) Value;
return ret;
case SQL_DESC_UNNAMED: /* only SQL_UNNAMED is allowed */
! if (SQL_UNNAMED != (SQLUINTEGER) ((unsigned long) Value))
{
ret = SQL_ERROR;
DC_set_error(desc, STMT_INVALID_DESCRIPTOR_IDENTIFIER,
***************
*** 823,829 ****
}
return ret;
case SQL_DESC_COUNT:
! parameter_ibindings_set(ipdopts, (SQLUINTEGER) Value, FALSE);
return ret;
case SQL_DESC_TYPE:
case SQL_DESC_DATETIME_INTERVAL_CODE:
--- 823,829 ----
}
return ret;
case SQL_DESC_COUNT:
! parameter_ibindings_set(ipdopts, (SQLUINTEGER) ((unsigned long) Value), FALSE);
return ret;
case SQL_DESC_TYPE:
case SQL_DESC_DATETIME_INTERVAL_CODE:
***************
*** 842,848 ****
{
case SQL_DESC_TYPE:
reset_a_iparameter_binding(ipdopts, RecNumber);
! ipdopts->parameters[para_idx].SQLType = (Int4) Value;
break;
case SQL_DESC_DATETIME_INTERVAL_CODE:
switch (ipdopts->parameters[para_idx].SQLType)
--- 842,848 ----
{
case SQL_DESC_TYPE:
reset_a_iparameter_binding(ipdopts, RecNumber);
! ipdopts->parameters[para_idx].SQLType = (Int4) ((long) Value);
break;
case SQL_DESC_DATETIME_INTERVAL_CODE:
switch (ipdopts->parameters[para_idx].SQLType)
***************
*** 851,857 ****
case SQL_TYPE_DATE:
case SQL_TYPE_TIME:
case SQL_TYPE_TIMESTAMP:
! switch ((Int4) Value)
{
case SQL_CODE_DATE:
ipdopts->parameters[para_idx].SQLType = SQL_TYPE_DATE;
--- 851,857 ----
case SQL_TYPE_DATE:
case SQL_TYPE_TIME:
case SQL_TYPE_TIMESTAMP:
! switch ((Int4) ((long) Value))
{
case SQL_CODE_DATE:
ipdopts->parameters[para_idx].SQLType = SQL_TYPE_DATE;
***************
*** 867,879 ****
}
break;
case SQL_DESC_CONCISE_TYPE:
! ipdopts->parameters[para_idx].SQLType = (Int4) Value;
break;
case SQL_DESC_PARAMETER_TYPE:
! ipdopts->parameters[para_idx].paramType = (Int2) ((Int4) Value);
break;
case SQL_DESC_SCALE:
! ipdopts->parameters[para_idx].decimal_digits = (Int2) ((Int4) Value);
break;
case SQL_DESC_ALLOC_TYPE: /* read-only */
case SQL_DESC_CASE_SENSITIVE: /* read-only */
--- 867,879 ----
}
break;
case SQL_DESC_CONCISE_TYPE:
! ipdopts->parameters[para_idx].SQLType = (Int4) ((long) Value);
break;
case SQL_DESC_PARAMETER_TYPE:
! ipdopts->parameters[para_idx].paramType = (Int2) ((long) Value);
break;
case SQL_DESC_SCALE:
! ipdopts->parameters[para_idx].decimal_digits = (Int2) ((long) Value);
break;
case SQL_DESC_ALLOC_TYPE: /* read-only */
case SQL_DESC_CASE_SENSITIVE: /* read-only */
***************
*** 1541,1552 ****
{
#if (ODBCVER >= 0x0351)
case SQL_ATTR_ANSI_APP:
! if ((SQLUINTEGER)Value == SQL_AA_TRUE)
conn->unicode = 0;
break;
#endif
case SQL_ATTR_METADATA_ID:
! conn->stmtOptions.metadata_id = (SQLUINTEGER) Value;
break;
case SQL_ATTR_ASYNC_ENABLE:
case SQL_ATTR_AUTO_IPD:
--- 1541,1552 ----
{
#if (ODBCVER >= 0x0351)
case SQL_ATTR_ANSI_APP:
! if (Value == (PTR) SQL_AA_TRUE)
conn->unicode = 0;
break;
#endif
case SQL_ATTR_METADATA_ID:
! conn->stmtOptions.metadata_id = (SQLUINTEGER) ((unsigned long) Value);
break;
case SQL_ATTR_ASYNC_ENABLE:
case SQL_ATTR_AUTO_IPD:
***************
*** 1556,1562 ****
CC_set_error(conn, STMT_OPTION_NOT_FOR_THE_DRIVER, "Unsupported connect attribute (Set)");
return SQL_ERROR;
default:
! ret = PGAPI_SetConnectOption(ConnectionHandle, (UWORD) Attribute, (UDWORD) Value);
}
return ret;
}
--- 1556,1562 ----
CC_set_error(conn, STMT_OPTION_NOT_FOR_THE_DRIVER, "Unsupported connect attribute (Set)");
return SQL_ERROR;
default:
! ret = PGAPI_SetConnectOption(ConnectionHandle, (UWORD) Attribute, (UDWORD) ((unsigned long) Value));
}
return ret;
}
***************
*** 1693,1702 ****
return SQL_ERROR;
case SQL_ATTR_METADATA_ID: /* 10014 */
! stmt->options.metadata_id = (SQLUINTEGER) Value;
break;
case SQL_ATTR_APP_ROW_DESC: /* 10010 */
! if (SQL_NULL_HDESC == Value)
{
stmt->ard = &(stmt->ardi);
}
--- 1693,1702 ----
return SQL_ERROR;
case SQL_ATTR_METADATA_ID: /* 10014 */
! stmt->options.metadata_id = (SQLUINTEGER) ((unsigned long) Value);
break;
case SQL_ATTR_APP_ROW_DESC: /* 10010 */
! if ((PTR) SQL_NULL_HDESC == Value)
{
stmt->ard = &(stmt->ardi);
}
***************
*** 1706,1712 ****
}
break;
case SQL_ATTR_APP_PARAM_DESC: /* 10011 */
! if (SQL_NULL_HDESC == Value)
{
stmt->apd = &(stmt->apdi);
}
--- 1706,1712 ----
}
break;
case SQL_ATTR_APP_PARAM_DESC: /* 10011 */
! if ((PTR) SQL_NULL_HDESC == Value)
{
stmt->apd = &(stmt->apdi);
}
***************
*** 1722,1728 ****
SC_get_APDF(stmt)->param_offset_ptr = (UInt4 *) Value;
break;
case SQL_ATTR_PARAM_BIND_TYPE: /* 18 */
! SC_get_APDF(stmt)->param_bind_type = (SQLUINTEGER) Value;
break;
case SQL_ATTR_PARAM_OPERATION_PTR: /* 19 */
SC_get_APDF(stmt)->param_operation_ptr = Value;
--- 1722,1728 ----
SC_get_APDF(stmt)->param_offset_ptr = (UInt4 *) Value;
break;
case SQL_ATTR_PARAM_BIND_TYPE: /* 18 */
! SC_get_APDF(stmt)->param_bind_type = (SQLUINTEGER) ((unsigned long) Value);
break;
case SQL_ATTR_PARAM_OPERATION_PTR: /* 19 */
SC_get_APDF(stmt)->param_operation_ptr = Value;
***************
*** 1734,1740 ****
SC_get_IPDF(stmt)->param_processed_ptr = (UInt4 *) Value;
break;
case SQL_ATTR_PARAMSET_SIZE: /* 22 */
! SC_get_APDF(stmt)->paramset_size = (SQLUINTEGER) Value;
break;
case SQL_ATTR_ROW_BIND_OFFSET_PTR: /* 23 */
SC_get_ARDF(stmt)->row_offset_ptr = (UInt4 *) Value;
--- 1734,1740 ----
SC_get_IPDF(stmt)->param_processed_ptr = (UInt4 *) Value;
break;
case SQL_ATTR_PARAMSET_SIZE: /* 22 */
! SC_get_APDF(stmt)->paramset_size = (SQLUINTEGER) ((unsigned long) Value);
break;
case SQL_ATTR_ROW_BIND_OFFSET_PTR: /* 23 */
SC_get_ARDF(stmt)->row_offset_ptr = (UInt4 *) Value;
***************
*** 1749,1758 ****
SC_get_IRDF(stmt)->rowsFetched = (UInt4 *) Value;
break;
case SQL_ATTR_ROW_ARRAY_SIZE: /* 27 */
! SC_get_ARDF(stmt)->size_of_rowset = (SQLUINTEGER) Value;
break;
default:
! return PGAPI_SetStmtOption(StatementHandle, (UWORD) Attribute, (UDWORD) Value);
}
return SQL_SUCCESS;
}
--- 1749,1758 ----
SC_get_IRDF(stmt)->rowsFetched = (UInt4 *) Value;
break;
case SQL_ATTR_ROW_ARRAY_SIZE: /* 27 */
! SC_get_ARDF(stmt)->size_of_rowset = (SQLUINTEGER) ((unsigned long) Value);
break;
default:
! return PGAPI_SetStmtOption(StatementHandle, (UWORD) Attribute, (UDWORD) ((unsigned long) Value));
}
return SQL_SUCCESS;
}
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-26 14:55 Dave Page <dpage@vale-housing.co.uk>
0 siblings, 1 reply; 26+ messages in thread
From: Dave Page @ 2006-01-26 14:55 UTC (permalink / raw)
To: Ludek Finstrle <luf@pzkagis.cz>; +Cc: pgsql-odbc; Tom Lane <tgl@sss.pgh.pa.us>
> -----Original Message-----
> From: Ludek Finstrle [mailto:luf@pzkagis.cz]
> Sent: 26 January 2006 10:18
> To: Dave Page
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Odbcapi30.c - 64 bit compiler warning cleanup
>
> > The attached patch cleans up the 64 bit compiler warnings in
> > odbcapi30.c.
>
> I test it and add more warning cleanups. I include your patch into
> attached one. I tried it a little bit on 64-bit and 32-bit box.
Compiles without errors or warnings here.
> I don't solve the problem in options.c where 64-bit pointer may
> be passwd throught 32-bit number. I don't know how to solve it.
No nor I. Any chance of a little help with this one please Tom?
Regards, Dave.
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-26 15:57 Tom Lane <tgl@sss.pgh.pa.us>
parent: Dave Page <dpage@vale-housing.co.uk>
0 siblings, 0 replies; 26+ messages in thread
From: Tom Lane @ 2006-01-26 15:57 UTC (permalink / raw)
To: Dave Page <dpage@vale-housing.co.uk>; +Cc: Ludek Finstrle <luf@pzkagis.cz>; pgsql-odbc
"Dave Page" <dpage@vale-housing.co.uk> writes:
>> From: Ludek Finstrle [mailto:luf@pzkagis.cz]
>> I don't solve the problem in options.c where 64-bit pointer may
>> be passwd throught 32-bit number. I don't know how to solve it.
> No nor I. Any chance of a little help with this one please Tom?
I assume that you can't alter the signature of PGAPI_SetConnectOption,
ie, vParam really has to be SQLUINTEGER and not some other type?
If so, I'd argue that that whole block (the "if (fOption == 30002 &&
vParam)" stuff) ought to be #ifdef WIN32. It's certainly useless on
any other platform, and Microsoft is never going to figure out how
to 64-bit-ify that pile of junk they call an OS, so no need to bend
our brains wondering how this would work on 64-bit Windows.
regards, tom lane
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-26 16:53 Dave Page <dpage@vale-housing.co.uk>
0 siblings, 1 reply; 26+ messages in thread
From: Dave Page @ 2006-01-26 16:53 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Ludek Finstrle <luf@pzkagis.cz>; pgsql-odbc
> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Sent: 26 January 2006 15:57
> To: Dave Page
> Cc: Ludek Finstrle; pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Odbcapi30.c - 64 bit compiler warning cleanup
>
> "Dave Page" <dpage@vale-housing.co.uk> writes:
> >> From: Ludek Finstrle [mailto:luf@pzkagis.cz]
> >> I don't solve the problem in options.c where 64-bit pointer may
> >> be passwd throught 32-bit number. I don't know how to solve it.
>
> > No nor I. Any chance of a little help with this one please Tom?
>
> I assume that you can't alter the signature of PGAPI_SetConnectOption,
> ie, vParam really has to be SQLUINTEGER and not some other type?
The spec actually says it should be a SQLPOINTER. Changing to that
unleashes a whole barrel of extra fun unfortunately.
> If so, I'd argue that that whole block (the "if (fOption == 30002 &&
> vParam)" stuff) ought to be #ifdef WIN32. It's certainly useless on
> any other platform,
That's a good point - it didn't even cross my mind that that code is
only useful on Windows. Thanks Tom!
> and Microsoft is never going to figure out how
> to 64-bit-ify that pile of junk they call an OS, so no need to bend
> our brains wondering how this would work on 64-bit Windows.
There have been 64bit versions of Windows for Itanium for ages, and
2003/XP have also been readily available now for a few months. That
said, psqlODBC definitely doesn't support 64 bit builds on Windows yet.
Regards, Dave
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-26 17:07 Dave Page <dpage@vale-housing.co.uk>
0 siblings, 2 replies; 26+ messages in thread
From: Dave Page @ 2006-01-26 17:07 UTC (permalink / raw)
To: Dave Page <dpage@vale-housing.co.uk>; Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Ludek Finstrle <luf@pzkagis.cz>; pgsql-odbc
> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Dave Page
> Sent: 26 January 2006 16:54
> To: Tom Lane
> Cc: Ludek Finstrle; pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Odbcapi30.c - 64 bit compiler warning cleanup
>
>
> > If so, I'd argue that that whole block (the "if (fOption == 30002 &&
> > vParam)" stuff) ought to be #ifdef WIN32. It's certainly useless on
> > any other platform,
>
> That's a good point - it didn't even cross my mind that that code is
> only useful on Windows. Thanks Tom!
And the resulting patch is attached, including the other 64 bit changes
that Luf & I have made already.
Luf, I think it's about time to apply the outstanding fixes and prepare
for a release. That OK with you?
Regards, Dave.
Attachments:
psqlodbc-64bit.diff (application/octet-stream, 17.1K) download
Index: odbcapi30.c
===================================================================
RCS file: /cvsroot/psqlodbc/psqlodbc/odbcapi30.c,v
retrieving revision 1.34
diff -c -r1.34 odbcapi30.c
*** odbcapi30.c 20 Oct 2005 13:06:10 -0000 1.34
--- odbcapi30.c 26 Jan 2006 17:03:26 -0000
***************
*** 422,441 ****
switch (Attribute)
{
case SQL_ATTR_CONNECTION_POOLING:
! switch ((SQLUINTEGER) Value)
{
! case SQL_CP_OFF:
! EN_unset_pooling(env);
! ret = SQL_SUCCESS;
! break;
#if defined(WIN_MULTITHREAD_SUPPORT) || defined(POSIX_MULTITHREAD_SUPPORT)
! case SQL_CP_ONE_PER_DRIVER:
! EN_set_pooling(env);
! ret = SQL_SUCCESS;
! break;
#endif /* WIN_MULTITHREAD_SUPPORT */
! default:
! ret = SQL_SUCCESS_WITH_INFO;
}
break;
case SQL_ATTR_CP_MATCH:
--- 422,442 ----
switch (Attribute)
{
case SQL_ATTR_CONNECTION_POOLING:
! if (Value == (PTR) SQL_CP_OFF)
{
! EN_unset_pooling(env);
! ret = SQL_SUCCESS;
! }
#if defined(WIN_MULTITHREAD_SUPPORT) || defined(POSIX_MULTITHREAD_SUPPORT)
! else if (Value == (PTR) SQL_CP_ONE_PER_DRIVER)
! {
! EN_set_pooling(env);
! ret = SQL_SUCCESS;
! }
#endif /* WIN_MULTITHREAD_SUPPORT */
! else
! {
! ret = SQL_SUCCESS_WITH_INFO;
}
break;
case SQL_ATTR_CP_MATCH:
***************
*** 443,456 ****
ret = SQL_SUCCESS;
break;
case SQL_ATTR_ODBC_VERSION:
! if ((SQLUINTEGER) Value == SQL_OV_ODBC2)
EN_set_odbc2(env);
else
EN_set_odbc3(env);
ret = SQL_SUCCESS;
break;
case SQL_ATTR_OUTPUT_NTS:
! if ((SQLUINTEGER) Value == SQL_TRUE)
ret = SQL_SUCCESS;
else
ret = SQL_SUCCESS_WITH_INFO;
--- 444,457 ----
ret = SQL_SUCCESS;
break;
case SQL_ATTR_ODBC_VERSION:
! if (Value == (PTR) SQL_OV_ODBC2)
EN_set_odbc2(env);
else
EN_set_odbc3(env);
ret = SQL_SUCCESS;
break;
case SQL_ATTR_OUTPUT_NTS:
! if (Value == (PTR) SQL_TRUE)
ret = SQL_SUCCESS;
else
ret = SQL_SUCCESS_WITH_INFO;
Index: options.c
===================================================================
RCS file: /cvsroot/psqlodbc/psqlodbc/options.c,v
retrieving revision 1.60
diff -c -r1.60 options.c
*** options.c 25 Nov 2005 10:43:25 -0000 1.60
--- options.c 26 Jan 2006 17:03:27 -0000
***************
*** 484,489 ****
--- 484,490 ----
CC_set_error(conn, CONN_UNSUPPORTED_OPTION, "Unknown connect option (Set)");
sprintf(option, "fOption=%d, vParam=%ld", fOption, vParam);
+ #ifdef WIN32
if (fOption == 30002 && vParam)
{
int cmp;
***************
*** 507,512 ****
--- 508,514 ----
return SQL_SUCCESS;
}
}
+ #endif
CC_log_error(func, option, conn);
return SQL_ERROR;
}
Index: pgapi30.c
===================================================================
RCS file: /cvsroot/psqlodbc/psqlodbc/pgapi30.c,v
retrieving revision 1.27
diff -c -r1.27 pgapi30.c
*** pgapi30.c 2 Dec 2005 11:00:43 -0000 1.27
--- pgapi30.c 26 Jan 2006 17:03:27 -0000
***************
*** 475,481 ****
switch (FieldIdentifier)
{
case SQL_DESC_ARRAY_SIZE:
! opts->size_of_rowset = (SQLUINTEGER) Value;
return ret;
case SQL_DESC_ARRAY_STATUS_PTR:
opts->row_operation_ptr = Value;
--- 475,481 ----
switch (FieldIdentifier)
{
case SQL_DESC_ARRAY_SIZE:
! opts->size_of_rowset = (SQLUINTEGER) ((unsigned long) Value);
return ret;
case SQL_DESC_ARRAY_STATUS_PTR:
opts->row_operation_ptr = Value;
***************
*** 484,493 ****
opts->row_offset_ptr = Value;
return ret;
case SQL_DESC_BIND_TYPE:
! opts->bind_size = (SQLUINTEGER) Value;
return ret;
case SQL_DESC_COUNT:
! column_bindings_set(opts, (SQLUINTEGER) Value, FALSE);
return ret;
case SQL_DESC_TYPE:
--- 484,493 ----
opts->row_offset_ptr = Value;
return ret;
case SQL_DESC_BIND_TYPE:
! opts->bind_size = (SQLUINTEGER) ((unsigned long) Value);
return ret;
case SQL_DESC_COUNT:
! column_bindings_set(opts, (SQLUINTEGER) ((unsigned long) Value), FALSE);
return ret;
case SQL_DESC_TYPE:
***************
*** 532,538 ****
{
case SQL_DESC_TYPE:
reset_a_column_binding(opts, RecNumber);
! opts->bindings[row_idx].returntype = (Int4) Value;
break;
case SQL_DESC_DATETIME_INTERVAL_CODE:
switch (opts->bindings[row_idx].returntype)
--- 532,538 ----
{
case SQL_DESC_TYPE:
reset_a_column_binding(opts, RecNumber);
! opts->bindings[row_idx].returntype = (Int4) ((long) Value);
break;
case SQL_DESC_DATETIME_INTERVAL_CODE:
switch (opts->bindings[row_idx].returntype)
***************
*** 541,547 ****
case SQL_C_TYPE_DATE:
case SQL_C_TYPE_TIME:
case SQL_C_TYPE_TIMESTAMP:
! switch ((Int4) Value)
{
case SQL_CODE_DATE:
opts->bindings[row_idx].returntype = SQL_C_TYPE_DATE;
--- 541,547 ----
case SQL_C_TYPE_DATE:
case SQL_C_TYPE_TIME:
case SQL_C_TYPE_TIMESTAMP:
! switch ((Int4) ((long) Value))
{
case SQL_CODE_DATE:
opts->bindings[row_idx].returntype = SQL_C_TYPE_DATE;
***************
*** 557,563 ****
}
break;
case SQL_DESC_CONCISE_TYPE:
! opts->bindings[row_idx].returntype = (Int4) Value;
break;
case SQL_DESC_DATA_PTR:
opts->bindings[row_idx].buffer = Value;
--- 557,563 ----
}
break;
case SQL_DESC_CONCISE_TYPE:
! opts->bindings[row_idx].returntype = (Int4) ((long) Value);
break;
case SQL_DESC_DATA_PTR:
opts->bindings[row_idx].buffer = Value;
***************
*** 574,586 ****
opts->bindings[row_idx].used = Value;
break;
case SQL_DESC_OCTET_LENGTH:
! opts->bindings[row_idx].buflen = (Int4) Value;
break;
case SQL_DESC_PRECISION:
! opts->bindings[row_idx].precision = (Int2)((Int4) Value);
break;
case SQL_DESC_SCALE:
! opts->bindings[row_idx].scale = (Int4) Value;
break;
case SQL_DESC_ALLOC_TYPE: /* read-only */
case SQL_DESC_DATETIME_INTERVAL_PRECISION:
--- 574,586 ----
opts->bindings[row_idx].used = Value;
break;
case SQL_DESC_OCTET_LENGTH:
! opts->bindings[row_idx].buflen = (Int4) ((long) Value);
break;
case SQL_DESC_PRECISION:
! opts->bindings[row_idx].precision = (Int2)((long) Value);
break;
case SQL_DESC_SCALE:
! opts->bindings[row_idx].scale = (Int4) ((long) Value);
break;
case SQL_DESC_ALLOC_TYPE: /* read-only */
case SQL_DESC_DATETIME_INTERVAL_PRECISION:
***************
*** 650,656 ****
switch (FieldIdentifier)
{
case SQL_DESC_ARRAY_SIZE:
! opts->paramset_size = (SQLUINTEGER) Value;
return ret;
case SQL_DESC_ARRAY_STATUS_PTR:
opts->param_operation_ptr = Value;
--- 650,656 ----
switch (FieldIdentifier)
{
case SQL_DESC_ARRAY_SIZE:
! opts->paramset_size = (SQLUINTEGER) ((unsigned long) Value);
return ret;
case SQL_DESC_ARRAY_STATUS_PTR:
opts->param_operation_ptr = Value;
***************
*** 659,668 ****
opts->param_offset_ptr = Value;
return ret;
case SQL_DESC_BIND_TYPE:
! opts->param_bind_type = (SQLUINTEGER) Value;
return ret;
case SQL_DESC_COUNT:
! parameter_bindings_set(opts, (SQLUINTEGER) Value, FALSE);
return ret;
case SQL_DESC_TYPE:
--- 659,668 ----
opts->param_offset_ptr = Value;
return ret;
case SQL_DESC_BIND_TYPE:
! opts->param_bind_type = (SQLUINTEGER) ((unsigned long) Value);
return ret;
case SQL_DESC_COUNT:
! parameter_bindings_set(opts, (SQLUINTEGER) ((unsigned long) Value), FALSE);
return ret;
case SQL_DESC_TYPE:
***************
*** 682,688 ****
{
case SQL_DESC_TYPE:
reset_a_parameter_binding(opts, RecNumber);
! opts->parameters[para_idx].CType = (Int4) Value;
break;
case SQL_DESC_DATETIME_INTERVAL_CODE:
switch (opts->parameters[para_idx].CType)
--- 682,688 ----
{
case SQL_DESC_TYPE:
reset_a_parameter_binding(opts, RecNumber);
! opts->parameters[para_idx].CType = (Int4) ((long) Value);
break;
case SQL_DESC_DATETIME_INTERVAL_CODE:
switch (opts->parameters[para_idx].CType)
***************
*** 691,697 ****
case SQL_C_TYPE_DATE:
case SQL_C_TYPE_TIME:
case SQL_C_TYPE_TIMESTAMP:
! switch ((Int4) Value)
{
case SQL_CODE_DATE:
opts->parameters[para_idx].CType = SQL_C_TYPE_DATE;
--- 691,697 ----
case SQL_C_TYPE_DATE:
case SQL_C_TYPE_TIME:
case SQL_C_TYPE_TIMESTAMP:
! switch ((Int4) ((long) Value))
{
case SQL_CODE_DATE:
opts->parameters[para_idx].CType = SQL_C_TYPE_DATE;
***************
*** 707,713 ****
}
break;
case SQL_DESC_CONCISE_TYPE:
! opts->parameters[para_idx].CType = (Int4) Value;
break;
case SQL_DESC_DATA_PTR:
opts->parameters[para_idx].buffer = Value;
--- 707,713 ----
}
break;
case SQL_DESC_CONCISE_TYPE:
! opts->parameters[para_idx].CType = (Int4) ((long) Value);
break;
case SQL_DESC_DATA_PTR:
opts->parameters[para_idx].buffer = Value;
***************
*** 720,735 ****
}
break;
case SQL_DESC_OCTET_LENGTH:
! opts->parameters[para_idx].buflen = (Int4) Value;
break;
case SQL_DESC_OCTET_LENGTH_PTR:
opts->parameters[para_idx].used = Value;
break;
case SQL_DESC_PRECISION:
! opts->parameters[para_idx].precision = (Int2) ((Int4) Value);
break;
case SQL_DESC_SCALE:
! opts->parameters[para_idx].scale = (Int2) ((Int4) Value);
break;
case SQL_DESC_ALLOC_TYPE: /* read-only */
case SQL_DESC_DATETIME_INTERVAL_PRECISION:
--- 720,735 ----
}
break;
case SQL_DESC_OCTET_LENGTH:
! opts->parameters[para_idx].buflen = (Int4) ((long) Value);
break;
case SQL_DESC_OCTET_LENGTH_PTR:
opts->parameters[para_idx].used = Value;
break;
case SQL_DESC_PRECISION:
! opts->parameters[para_idx].precision = (Int2) ((long) Value);
break;
case SQL_DESC_SCALE:
! opts->parameters[para_idx].scale = (Int2) ((long) Value);
break;
case SQL_DESC_ALLOC_TYPE: /* read-only */
case SQL_DESC_DATETIME_INTERVAL_PRECISION:
***************
*** 815,821 ****
ipdopts->param_processed_ptr = (UInt4 *) Value;
return ret;
case SQL_DESC_UNNAMED: /* only SQL_UNNAMED is allowed */
! if (SQL_UNNAMED != (SQLUINTEGER) Value)
{
ret = SQL_ERROR;
DC_set_error(desc, STMT_INVALID_DESCRIPTOR_IDENTIFIER,
--- 815,821 ----
ipdopts->param_processed_ptr = (UInt4 *) Value;
return ret;
case SQL_DESC_UNNAMED: /* only SQL_UNNAMED is allowed */
! if (SQL_UNNAMED != (SQLUINTEGER) ((unsigned long) Value))
{
ret = SQL_ERROR;
DC_set_error(desc, STMT_INVALID_DESCRIPTOR_IDENTIFIER,
***************
*** 823,829 ****
}
return ret;
case SQL_DESC_COUNT:
! parameter_ibindings_set(ipdopts, (SQLUINTEGER) Value, FALSE);
return ret;
case SQL_DESC_TYPE:
case SQL_DESC_DATETIME_INTERVAL_CODE:
--- 823,829 ----
}
return ret;
case SQL_DESC_COUNT:
! parameter_ibindings_set(ipdopts, (SQLUINTEGER) ((unsigned long) Value), FALSE);
return ret;
case SQL_DESC_TYPE:
case SQL_DESC_DATETIME_INTERVAL_CODE:
***************
*** 842,848 ****
{
case SQL_DESC_TYPE:
reset_a_iparameter_binding(ipdopts, RecNumber);
! ipdopts->parameters[para_idx].SQLType = (Int4) Value;
break;
case SQL_DESC_DATETIME_INTERVAL_CODE:
switch (ipdopts->parameters[para_idx].SQLType)
--- 842,848 ----
{
case SQL_DESC_TYPE:
reset_a_iparameter_binding(ipdopts, RecNumber);
! ipdopts->parameters[para_idx].SQLType = (Int4) ((long) Value);
break;
case SQL_DESC_DATETIME_INTERVAL_CODE:
switch (ipdopts->parameters[para_idx].SQLType)
***************
*** 851,857 ****
case SQL_TYPE_DATE:
case SQL_TYPE_TIME:
case SQL_TYPE_TIMESTAMP:
! switch ((Int4) Value)
{
case SQL_CODE_DATE:
ipdopts->parameters[para_idx].SQLType = SQL_TYPE_DATE;
--- 851,857 ----
case SQL_TYPE_DATE:
case SQL_TYPE_TIME:
case SQL_TYPE_TIMESTAMP:
! switch ((Int4) ((long) Value))
{
case SQL_CODE_DATE:
ipdopts->parameters[para_idx].SQLType = SQL_TYPE_DATE;
***************
*** 867,879 ****
}
break;
case SQL_DESC_CONCISE_TYPE:
! ipdopts->parameters[para_idx].SQLType = (Int4) Value;
break;
case SQL_DESC_PARAMETER_TYPE:
! ipdopts->parameters[para_idx].paramType = (Int2) ((Int4) Value);
break;
case SQL_DESC_SCALE:
! ipdopts->parameters[para_idx].decimal_digits = (Int2) ((Int4) Value);
break;
case SQL_DESC_ALLOC_TYPE: /* read-only */
case SQL_DESC_CASE_SENSITIVE: /* read-only */
--- 867,879 ----
}
break;
case SQL_DESC_CONCISE_TYPE:
! ipdopts->parameters[para_idx].SQLType = (Int4) ((long) Value);
break;
case SQL_DESC_PARAMETER_TYPE:
! ipdopts->parameters[para_idx].paramType = (Int2) ((long) Value);
break;
case SQL_DESC_SCALE:
! ipdopts->parameters[para_idx].decimal_digits = (Int2) ((long) Value);
break;
case SQL_DESC_ALLOC_TYPE: /* read-only */
case SQL_DESC_CASE_SENSITIVE: /* read-only */
***************
*** 1541,1552 ****
{
#if (ODBCVER >= 0x0351)
case SQL_ATTR_ANSI_APP:
! if ((SQLUINTEGER)Value == SQL_AA_TRUE)
conn->unicode = 0;
break;
#endif
case SQL_ATTR_METADATA_ID:
! conn->stmtOptions.metadata_id = (SQLUINTEGER) Value;
break;
case SQL_ATTR_ASYNC_ENABLE:
case SQL_ATTR_AUTO_IPD:
--- 1541,1552 ----
{
#if (ODBCVER >= 0x0351)
case SQL_ATTR_ANSI_APP:
! if (Value == (PTR) SQL_AA_TRUE)
conn->unicode = 0;
break;
#endif
case SQL_ATTR_METADATA_ID:
! conn->stmtOptions.metadata_id = (SQLUINTEGER) ((unsigned long) Value);
break;
case SQL_ATTR_ASYNC_ENABLE:
case SQL_ATTR_AUTO_IPD:
***************
*** 1556,1562 ****
CC_set_error(conn, STMT_OPTION_NOT_FOR_THE_DRIVER, "Unsupported connect attribute (Set)");
return SQL_ERROR;
default:
! ret = PGAPI_SetConnectOption(ConnectionHandle, (UWORD) Attribute, (UDWORD) Value);
}
return ret;
}
--- 1556,1562 ----
CC_set_error(conn, STMT_OPTION_NOT_FOR_THE_DRIVER, "Unsupported connect attribute (Set)");
return SQL_ERROR;
default:
! ret = PGAPI_SetConnectOption(ConnectionHandle, (UWORD) Attribute, (UDWORD) ((unsigned long) Value));
}
return ret;
}
***************
*** 1693,1702 ****
return SQL_ERROR;
case SQL_ATTR_METADATA_ID: /* 10014 */
! stmt->options.metadata_id = (SQLUINTEGER) Value;
break;
case SQL_ATTR_APP_ROW_DESC: /* 10010 */
! if (SQL_NULL_HDESC == Value)
{
stmt->ard = &(stmt->ardi);
}
--- 1693,1702 ----
return SQL_ERROR;
case SQL_ATTR_METADATA_ID: /* 10014 */
! stmt->options.metadata_id = (SQLUINTEGER) ((unsigned long) Value);
break;
case SQL_ATTR_APP_ROW_DESC: /* 10010 */
! if ((PTR) SQL_NULL_HDESC == Value)
{
stmt->ard = &(stmt->ardi);
}
***************
*** 1706,1712 ****
}
break;
case SQL_ATTR_APP_PARAM_DESC: /* 10011 */
! if (SQL_NULL_HDESC == Value)
{
stmt->apd = &(stmt->apdi);
}
--- 1706,1712 ----
}
break;
case SQL_ATTR_APP_PARAM_DESC: /* 10011 */
! if ((PTR) SQL_NULL_HDESC == Value)
{
stmt->apd = &(stmt->apdi);
}
***************
*** 1722,1728 ****
SC_get_APDF(stmt)->param_offset_ptr = (UInt4 *) Value;
break;
case SQL_ATTR_PARAM_BIND_TYPE: /* 18 */
! SC_get_APDF(stmt)->param_bind_type = (SQLUINTEGER) Value;
break;
case SQL_ATTR_PARAM_OPERATION_PTR: /* 19 */
SC_get_APDF(stmt)->param_operation_ptr = Value;
--- 1722,1728 ----
SC_get_APDF(stmt)->param_offset_ptr = (UInt4 *) Value;
break;
case SQL_ATTR_PARAM_BIND_TYPE: /* 18 */
! SC_get_APDF(stmt)->param_bind_type = (SQLUINTEGER) ((unsigned long) Value);
break;
case SQL_ATTR_PARAM_OPERATION_PTR: /* 19 */
SC_get_APDF(stmt)->param_operation_ptr = Value;
***************
*** 1734,1740 ****
SC_get_IPDF(stmt)->param_processed_ptr = (UInt4 *) Value;
break;
case SQL_ATTR_PARAMSET_SIZE: /* 22 */
! SC_get_APDF(stmt)->paramset_size = (SQLUINTEGER) Value;
break;
case SQL_ATTR_ROW_BIND_OFFSET_PTR: /* 23 */
SC_get_ARDF(stmt)->row_offset_ptr = (UInt4 *) Value;
--- 1734,1740 ----
SC_get_IPDF(stmt)->param_processed_ptr = (UInt4 *) Value;
break;
case SQL_ATTR_PARAMSET_SIZE: /* 22 */
! SC_get_APDF(stmt)->paramset_size = (SQLUINTEGER) ((unsigned long) Value);
break;
case SQL_ATTR_ROW_BIND_OFFSET_PTR: /* 23 */
SC_get_ARDF(stmt)->row_offset_ptr = (UInt4 *) Value;
***************
*** 1749,1758 ****
SC_get_IRDF(stmt)->rowsFetched = (UInt4 *) Value;
break;
case SQL_ATTR_ROW_ARRAY_SIZE: /* 27 */
! SC_get_ARDF(stmt)->size_of_rowset = (SQLUINTEGER) Value;
break;
default:
! return PGAPI_SetStmtOption(StatementHandle, (UWORD) Attribute, (UDWORD) Value);
}
return SQL_SUCCESS;
}
--- 1749,1758 ----
SC_get_IRDF(stmt)->rowsFetched = (UInt4 *) Value;
break;
case SQL_ATTR_ROW_ARRAY_SIZE: /* 27 */
! SC_get_ARDF(stmt)->size_of_rowset = (SQLUINTEGER) ((unsigned long) Value);
break;
default:
! return PGAPI_SetStmtOption(StatementHandle, (UWORD) Attribute, (UDWORD) ((unsigned long) Value));
}
return SQL_SUCCESS;
}
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-26 17:16 Tom Lane <tgl@sss.pgh.pa.us>
parent: Dave Page <dpage@vale-housing.co.uk>
1 sibling, 0 replies; 26+ messages in thread
From: Tom Lane @ 2006-01-26 17:16 UTC (permalink / raw)
To: Dave Page <dpage@vale-housing.co.uk>; +Cc: Ludek Finstrle <luf@pzkagis.cz>; pgsql-odbc
"Dave Page" <dpage@vale-housing.co.uk> writes:
>> That's a good point - it didn't even cross my mind that that code is
>> only useful on Windows. Thanks Tom!
I can confirm that Luf's patch gets rid of all the other 64-bit warnings
for me.
> Luf, I think it's about time to apply the outstanding fixes and prepare
> for a release. That OK with you?
I'm getting antsy to have a release for Fedora 5 ...
regards, tom lane
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-26 18:37 Ludek Finstrle <luf@pzkagis.cz>
parent: Dave Page <dpage@vale-housing.co.uk>
0 siblings, 1 reply; 26+ messages in thread
From: Ludek Finstrle @ 2006-01-26 18:37 UTC (permalink / raw)
To: Dave Page <dpage@vale-housing.co.uk>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Ludek Finstrle <luf@pzkagis.cz>; pgsql-odbc
> > >> I don't solve the problem in options.c where 64-bit pointer may
> > >> be passwd throught 32-bit number. I don't know how to solve it.
> >
> > > No nor I. Any chance of a little help with this one please Tom?
> >
> > I assume that you can't alter the signature of PGAPI_SetConnectOption,
> > ie, vParam really has to be SQLUINTEGER and not some other type?
>
> The spec actually says it should be a SQLPOINTER. Changing to that
> unleashes a whole barrel of extra fun unfortunately.
I don't think it will be so problematic. I'll try it. It's the best way
to support Win64.
Very good point Tom.
> > and Microsoft is never going to figure out how
> > to 64-bit-ify that pile of junk they call an OS, so no need to bend
> > our brains wondering how this would work on 64-bit Windows.
>
> There have been 64bit versions of Windows for Itanium for ages, and
> 2003/XP have also been readily available now for a few months. That
> said, psqlODBC definitely doesn't support 64 bit builds on Windows yet.
I have no access to 64-bit windows. I have no 64-bit compiler for win :-(
We have to hope that someone will donate for 64-bit Windows version or
someone with access to 64-bit win with compiler will join us.
Regards,
Luf
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-26 18:40 Ludek Finstrle <luf@pzkagis.cz>
parent: Dave Page <dpage@vale-housing.co.uk>
1 sibling, 0 replies; 26+ messages in thread
From: Ludek Finstrle @ 2006-01-26 18:40 UTC (permalink / raw)
To: Dave Page <dpage@vale-housing.co.uk>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Ludek Finstrle <luf@pzkagis.cz>; pgsql-odbc
> And the resulting patch is attached, including the other 64 bit changes
> that Luf & I have made already.
I'm for wait a few days. I want to take a look at PGAPI_SetConnectOption
problem again.
> Luf, I think it's about time to apply the outstanding fixes and prepare
> for a release. That OK with you?
Partialy Ok. I need you answer me to: [ODBC] Disallow premature is broken.
I apply fixes ASAP (without 64-bit one for PGAPI_SetConnectOption).
Regards,
Luf
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-26 20:58 Ludek Finstrle <luf@pzkagis.cz>
parent: Ludek Finstrle <luf@pzkagis.cz>
0 siblings, 1 reply; 26+ messages in thread
From: Ludek Finstrle @ 2006-01-26 20:58 UTC (permalink / raw)
To: Dave Page <dpage@vale-housing.co.uk>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Ludek Finstrle <luf@pzkagis.cz>; pgsql-odbc
> > > >> I don't solve the problem in options.c where 64-bit pointer may
> > > >> be passwd throught 32-bit number. I don't know how to solve it.
> > >
> > > > No nor I. Any chance of a little help with this one please Tom?
> > >
> > > I assume that you can't alter the signature of PGAPI_SetConnectOption,
> > > ie, vParam really has to be SQLUINTEGER and not some other type?
> >
> > The spec actually says it should be a SQLPOINTER. Changing to that
> > unleashes a whole barrel of extra fun unfortunately.
>
> I don't think it will be so problematic. I'll try it. It's the best way
> to support Win64.
Here is my result. Patch attached. I have no 64-bit box ready at hand here.
I will test it on 64-bit box tomorrow.
Please review and comment
Luf
Attachments:
psqlodbc-64bit_SetConnectOption.diff (text/plain, 9.3K) download
diff -c psqlodbc.orig\options.c psqlodbc\options.c
*** psqlodbc.orig\options.c Wed Nov 30 13:44:27 2005
--- psqlodbc\options.c Thu Jan 26 22:42:12 2006
***************
*** 314,320 ****
RETCODE SQL_API
PGAPI_SetConnectOption(HDBC hdbc,
SQLUSMALLINT fOption,
! SQLUINTEGER vParam)
{
CSTR func = "PGAPI_SetConnectOption";
ConnectionClass *conn = (ConnectionClass *) hdbc;
--- 314,320 ----
RETCODE SQL_API
PGAPI_SetConnectOption(HDBC hdbc,
SQLUSMALLINT fOption,
! SQLPOINTER vParam)
{
CSTR func = "PGAPI_SetConnectOption";
ConnectionClass *conn = (ConnectionClass *) hdbc;
***************
*** 322,328 ****
RETCODE retval;
int i;
! mylog("%s: entering fOption = %d vParam = %d\n", func, fOption, vParam);
if (!conn)
{
CC_log_error(func, "", NULL);
--- 322,328 ----
RETCODE retval;
int i;
! mylog("%s: entering fOption = %d vParam = %d\n", func, fOption, (unsigned long) vParam);
if (!conn)
{
CC_log_error(func, "", NULL);
***************
*** 353,366 ****
for (i = 0; i < conn->num_stmts; i++)
{
if (conn->stmts[i])
! set_statement_option(NULL, conn->stmts[i], fOption, vParam);
}
/*
* Become the default for all future statements on this
* connection
*/
! retval = set_statement_option(conn, NULL, fOption, vParam);
if (retval == SQL_SUCCESS_WITH_INFO)
changed = TRUE;
--- 353,366 ----
for (i = 0; i < conn->num_stmts; i++)
{
if (conn->stmts[i])
! set_statement_option(NULL, conn->stmts[i], fOption, (UDWORD) ((unsigned long) vParam));
}
/*
* Become the default for all future statements on this
* connection
*/
! retval = set_statement_option(conn, NULL, fOption, (UDWORD) ((unsigned long) vParam));
if (retval == SQL_SUCCESS_WITH_INFO)
changed = TRUE;
***************
*** 377,392 ****
break;
case SQL_AUTOCOMMIT:
! if (vParam == SQL_AUTOCOMMIT_ON && CC_is_in_autocommit(conn))
break;
! else if (vParam == SQL_AUTOCOMMIT_OFF && !CC_is_in_autocommit(conn))
break;
if (CC_is_in_trans(conn))
CC_commit(conn);
! mylog("PGAPI_SetConnectOption: AUTOCOMMIT: transact_status=%d, vparam=%d\n", conn->transact_status, vParam);
! switch (vParam)
{
case SQL_AUTOCOMMIT_OFF:
CC_set_autocommit_off(conn);
--- 377,392 ----
break;
case SQL_AUTOCOMMIT:
! if (vParam == (SQLPOINTER) SQL_AUTOCOMMIT_ON && CC_is_in_autocommit(conn))
break;
! else if (vParam == (SQLPOINTER) SQL_AUTOCOMMIT_OFF && !CC_is_in_autocommit(conn))
break;
if (CC_is_in_trans(conn))
CC_commit(conn);
! mylog("PGAPI_SetConnectOption: AUTOCOMMIT: transact_status=%d, vparam=%d\n", conn->transact_status, (SQLUINTEGER) ((unsigned long) vParam));
! switch ((unsigned long) vParam)
{
case SQL_AUTOCOMMIT_OFF:
CC_set_autocommit_off(conn);
***************
*** 423,431 ****
CC_log_error(func, "", conn);
return SQL_ERROR;
}
! if (conn->isolation == vParam)
break;
! switch (vParam)
{
case SQL_TXN_SERIALIZABLE:
if (PG_VERSION_GE(conn, 6.5) &&
--- 423,431 ----
CC_log_error(func, "", conn);
return SQL_ERROR;
}
! if ((SQLPOINTER) conn->isolation == vParam)
break;
! switch ((unsigned long) vParam)
{
case SQL_TXN_SERIALIZABLE:
if (PG_VERSION_GE(conn, 6.5) &&
***************
*** 450,456 ****
char *query;
QResultClass *res;
! if (vParam == SQL_TXN_SERIALIZABLE)
query = "SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE";
else
query = "SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL READ COMMITTED";
--- 450,456 ----
char *query;
QResultClass *res;
! if (vParam == (SQLPOINTER) SQL_TXN_SERIALIZABLE)
query = "SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE";
else
query = "SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL READ COMMITTED";
***************
*** 458,464 ****
if (!res || !QR_command_maybe_successful(res))
retval = SQL_ERROR;
else
! conn->isolation = vParam;
if (res)
QR_Destructor(res);
if (SQL_ERROR == retval)
--- 458,464 ----
if (!res || !QR_command_maybe_successful(res))
retval = SQL_ERROR;
else
! conn->isolation = (SQLUINTEGER) ((unsigned long) vParam);
if (res)
QR_Destructor(res);
if (SQL_ERROR == retval)
***************
*** 483,489 ****
char option[64];
CC_set_error(conn, CONN_UNSUPPORTED_OPTION, "Unknown connect option (Set)");
! sprintf(option, "fOption=%d, vParam=%ld", fOption, vParam);
if (fOption == 30002 && vParam)
{
int cmp;
--- 483,489 ----
char option[64];
CC_set_error(conn, CONN_UNSUPPORTED_OPTION, "Unknown connect option (Set)");
! sprintf(option, "fOption=%d, vParam=%ld", fOption, (unsigned long) vParam);
if (fOption == 30002 && vParam)
{
int cmp;
diff -c psqlodbc.orig\pgapi30.c psqlodbc\pgapi30.c
*** psqlodbc.orig\pgapi30.c Thu Jan 26 22:22:51 2006
--- psqlodbc\pgapi30.c Thu Jan 26 22:43:36 2006
***************
*** 1556,1562 ****
CC_set_error(conn, STMT_OPTION_NOT_FOR_THE_DRIVER, "Unsupported connect attribute (Set)");
return SQL_ERROR;
default:
! ret = PGAPI_SetConnectOption(ConnectionHandle, (UWORD) Attribute, (UDWORD) ((unsigned long) Value));
}
return ret;
}
--- 1556,1562 ----
CC_set_error(conn, STMT_OPTION_NOT_FOR_THE_DRIVER, "Unsupported connect attribute (Set)");
return SQL_ERROR;
default:
! ret = PGAPI_SetConnectOption(ConnectionHandle, (UWORD) Attribute, Value);
}
return ret;
}
***************
*** 1833,1839 ****
}
conn = SC_get_conn(s->stmt);
if (s->auto_commit_needed)
! PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_ON);
irdflds = SC_get_IRDF(s->stmt);
if (irdflds->rowsFetched)
*(irdflds->rowsFetched) = s->processed;
--- 1833,1839 ----
}
conn = SC_get_conn(s->stmt);
if (s->auto_commit_needed)
! PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, (SQLPOINTER) SQL_AUTOCOMMIT_ON);
irdflds = SC_get_IRDF(s->stmt);
if (irdflds->rowsFetched)
*(irdflds->rowsFetched) = s->processed;
***************
*** 1863,1869 ****
{
conn = SC_get_conn(s.stmt);
if (s.auto_commit_needed = (char) CC_is_in_autocommit(conn), s.auto_commit_needed)
! PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF);
}
if (SQL_ADD != s.operation)
{
--- 1863,1869 ----
{
conn = SC_get_conn(s.stmt);
if (s.auto_commit_needed = (char) CC_is_in_autocommit(conn), s.auto_commit_needed)
! PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, (SQLPOINTER) SQL_AUTOCOMMIT_OFF);
}
if (SQL_ADD != s.operation)
{
diff -c psqlodbc.orig\pgapifunc.h psqlodbc\pgapifunc.h
*** psqlodbc.orig\pgapifunc.h Wed Nov 30 13:44:30 2005
--- psqlodbc\pgapifunc.h Thu Jan 26 22:42:08 2006
***************
*** 143,149 ****
SQLINTEGER *pcrow);
RETCODE SQL_API PGAPI_SetConnectOption(HDBC hdbc,
SQLUSMALLINT fOption,
! SQLUINTEGER vParam);
RETCODE SQL_API PGAPI_SetCursorName(HSTMT StatementHandle,
SQLCHAR *CursorName, SQLSMALLINT NameLength);
RETCODE SQL_API PGAPI_SetParam(HSTMT StatementHandle,
--- 143,149 ----
SQLINTEGER *pcrow);
RETCODE SQL_API PGAPI_SetConnectOption(HDBC hdbc,
SQLUSMALLINT fOption,
! SQLPOINTER vParam);
RETCODE SQL_API PGAPI_SetCursorName(HSTMT StatementHandle,
SQLCHAR *CursorName, SQLSMALLINT NameLength);
RETCODE SQL_API PGAPI_SetParam(HSTMT StatementHandle,
diff -c psqlodbc.orig\results.c psqlodbc\results.c
*** psqlodbc.orig\results.c Thu Jan 26 22:22:51 2006
--- psqlodbc\results.c Thu Jan 26 22:43:33 2006
***************
*** 3020,3026 ****
if (SQL_ERROR == ret)
CC_abort(conn);
if (s->auto_commit_needed)
! PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_ON);
if (s->irow > 0)
{
if (SQL_ADD != s->fOption && s->ridx >= 0) /* for SQLGetData */
--- 3020,3026 ----
if (SQL_ERROR == ret)
CC_abort(conn);
if (s->auto_commit_needed)
! PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, (SQLPOINTER) SQL_AUTOCOMMIT_ON);
if (s->irow > 0)
{
if (SQL_ADD != s->fOption && s->ridx >= 0) /* for SQLGetData */
***************
*** 3126,3132 ****
case SQL_DELETE:
case SQL_ADD:
if (s.auto_commit_needed = CC_is_in_autocommit(conn), s.auto_commit_needed)
! PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF);
break;
}
#endif /* DRIVER_CURSOR_IMPLEMENT */
--- 3126,3132 ----
case SQL_DELETE:
case SQL_ADD:
if (s.auto_commit_needed = CC_is_in_autocommit(conn), s.auto_commit_needed)
! PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, (SQLPOINTER) SQL_AUTOCOMMIT_OFF);
break;
}
#endif /* DRIVER_CURSOR_IMPLEMENT */
***************
*** 3187,3193 ****
if (SQL_ERROR == ret)
CC_abort(conn);
if (auto_commit_needed)
! PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_ON);
if (irow > 0)
{
if (SQL_ADD != fOption && ridx >= 0) /* for SQLGetData */
--- 3187,3193 ----
if (SQL_ERROR == ret)
CC_abort(conn);
if (auto_commit_needed)
! PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, (SQLPOINTER) SQL_AUTOCOMMIT_ON);
if (irow > 0)
{
if (SQL_ADD != fOption && ridx >= 0) /* for SQLGetData */
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-27 08:25 Ludek Finstrle <luf@pzkagis.cz>
parent: Ludek Finstrle <luf@pzkagis.cz>
0 siblings, 1 reply; 26+ messages in thread
From: Ludek Finstrle @ 2006-01-27 08:25 UTC (permalink / raw)
To: Dave Page <dpage@vale-housing.co.uk>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-odbc
> > > The spec actually says it should be a SQLPOINTER. Changing to that
> > > unleashes a whole barrel of extra fun unfortunately.
> >
> > I don't think it will be so problematic. I'll try it. It's the best way
> > to support Win64.
>
> Here is my result. Patch attached. I have no 64-bit box ready at hand here.
> I will test it on 64-bit box tomorrow.
I find one problem. New patch attached. I get no warning with this one.
Please review and comment
Luf
Attachments:
psqlodbc-64bit_SetConnectOption.diff (text/plain, 8.8K) download
diff -c psqlodbc.orig/options.c psqlodbc/options.c
*** psqlodbc.orig/options.c 2005-11-25 11:43:25.000000000 +0100
--- psqlodbc/options.c 2006-01-27 12:18:27.000000000 +0100
***************
*** 314,320 ****
RETCODE SQL_API
PGAPI_SetConnectOption(HDBC hdbc,
SQLUSMALLINT fOption,
! SQLUINTEGER vParam)
{
CSTR func = "PGAPI_SetConnectOption";
ConnectionClass *conn = (ConnectionClass *) hdbc;
--- 314,320 ----
RETCODE SQL_API
PGAPI_SetConnectOption(HDBC hdbc,
SQLUSMALLINT fOption,
! SQLPOINTER vParam)
{
CSTR func = "PGAPI_SetConnectOption";
ConnectionClass *conn = (ConnectionClass *) hdbc;
***************
*** 322,328 ****
RETCODE retval;
int i;
! mylog("%s: entering fOption = %d vParam = %d\n", func, fOption, vParam);
if (!conn)
{
CC_log_error(func, "", NULL);
--- 322,328 ----
RETCODE retval;
int i;
! mylog("%s: entering fOption = %d vParam = %d\n", func, fOption, (unsigned long) vParam);
if (!conn)
{
CC_log_error(func, "", NULL);
***************
*** 353,366 ****
for (i = 0; i < conn->num_stmts; i++)
{
if (conn->stmts[i])
! set_statement_option(NULL, conn->stmts[i], fOption, vParam);
}
/*
* Become the default for all future statements on this
* connection
*/
! retval = set_statement_option(conn, NULL, fOption, vParam);
if (retval == SQL_SUCCESS_WITH_INFO)
changed = TRUE;
--- 353,366 ----
for (i = 0; i < conn->num_stmts; i++)
{
if (conn->stmts[i])
! set_statement_option(NULL, conn->stmts[i], fOption, (UDWORD) ((unsigned long) vParam));
}
/*
* Become the default for all future statements on this
* connection
*/
! retval = set_statement_option(conn, NULL, fOption, (UDWORD) ((unsigned long) vParam));
if (retval == SQL_SUCCESS_WITH_INFO)
changed = TRUE;
***************
*** 377,392 ****
break;
case SQL_AUTOCOMMIT:
! if (vParam == SQL_AUTOCOMMIT_ON && CC_is_in_autocommit(conn))
break;
! else if (vParam == SQL_AUTOCOMMIT_OFF && !CC_is_in_autocommit(conn))
break;
if (CC_is_in_trans(conn))
CC_commit(conn);
! mylog("PGAPI_SetConnectOption: AUTOCOMMIT: transact_status=%d, vparam=%d\n", conn->transact_status, vParam);
! switch (vParam)
{
case SQL_AUTOCOMMIT_OFF:
CC_set_autocommit_off(conn);
--- 377,392 ----
break;
case SQL_AUTOCOMMIT:
! if (vParam == (SQLPOINTER) SQL_AUTOCOMMIT_ON && CC_is_in_autocommit(conn))
break;
! else if (vParam == (SQLPOINTER) SQL_AUTOCOMMIT_OFF && !CC_is_in_autocommit(conn))
break;
if (CC_is_in_trans(conn))
CC_commit(conn);
! mylog("PGAPI_SetConnectOption: AUTOCOMMIT: transact_status=%d, vparam=%d\n", conn->transact_status, (SQLUINTEGER) ((unsigned long) vParam));
! switch ((unsigned long) vParam)
{
case SQL_AUTOCOMMIT_OFF:
CC_set_autocommit_off(conn);
***************
*** 423,431 ****
CC_log_error(func, "", conn);
return SQL_ERROR;
}
! if (conn->isolation == vParam)
break;
! switch (vParam)
{
case SQL_TXN_SERIALIZABLE:
if (PG_VERSION_GE(conn, 6.5) &&
--- 423,431 ----
CC_log_error(func, "", conn);
return SQL_ERROR;
}
! if (conn->isolation == (unsigned long) vParam)
break;
! switch ((unsigned long) vParam)
{
case SQL_TXN_SERIALIZABLE:
if (PG_VERSION_GE(conn, 6.5) &&
***************
*** 450,456 ****
char *query;
QResultClass *res;
! if (vParam == SQL_TXN_SERIALIZABLE)
query = "SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE";
else
query = "SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL READ COMMITTED";
--- 450,456 ----
char *query;
QResultClass *res;
! if (vParam == (SQLPOINTER) SQL_TXN_SERIALIZABLE)
query = "SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE";
else
query = "SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL READ COMMITTED";
***************
*** 458,464 ****
if (!res || !QR_command_maybe_successful(res))
retval = SQL_ERROR;
else
! conn->isolation = vParam;
if (res)
QR_Destructor(res);
if (SQL_ERROR == retval)
--- 458,464 ----
if (!res || !QR_command_maybe_successful(res))
retval = SQL_ERROR;
else
! conn->isolation = (SQLUINTEGER) ((unsigned long) vParam);
if (res)
QR_Destructor(res);
if (SQL_ERROR == retval)
***************
*** 483,489 ****
char option[64];
CC_set_error(conn, CONN_UNSUPPORTED_OPTION, "Unknown connect option (Set)");
! sprintf(option, "fOption=%d, vParam=%ld", fOption, vParam);
if (fOption == 30002 && vParam)
{
int cmp;
--- 483,489 ----
char option[64];
CC_set_error(conn, CONN_UNSUPPORTED_OPTION, "Unknown connect option (Set)");
! sprintf(option, "fOption=%d, vParam=%ld", fOption, (unsigned long) vParam);
if (fOption == 30002 && vParam)
{
int cmp;
diff -c psqlodbc.orig/pgapifunc.h psqlodbc/pgapifunc.h
*** psqlodbc.orig/pgapifunc.h 2005-11-25 11:43:25.000000000 +0100
--- psqlodbc/pgapifunc.h 2006-01-27 12:16:05.000000000 +0100
***************
*** 143,149 ****
SQLINTEGER *pcrow);
RETCODE SQL_API PGAPI_SetConnectOption(HDBC hdbc,
SQLUSMALLINT fOption,
! SQLUINTEGER vParam);
RETCODE SQL_API PGAPI_SetCursorName(HSTMT StatementHandle,
SQLCHAR *CursorName, SQLSMALLINT NameLength);
RETCODE SQL_API PGAPI_SetParam(HSTMT StatementHandle,
--- 143,149 ----
SQLINTEGER *pcrow);
RETCODE SQL_API PGAPI_SetConnectOption(HDBC hdbc,
SQLUSMALLINT fOption,
! SQLPOINTER vParam);
RETCODE SQL_API PGAPI_SetCursorName(HSTMT StatementHandle,
SQLCHAR *CursorName, SQLSMALLINT NameLength);
RETCODE SQL_API PGAPI_SetParam(HSTMT StatementHandle,
diff -c psqlodbc.orig/pgapi30.c psqlodbc/pgapi30.c
*** psqlodbc.orig/pgapi30.c 2005-12-02 12:00:43.000000000 +0100
--- psqlodbc/pgapi30.c 2006-01-27 12:15:55.000000000 +0100
***************
*** 1833,1839 ****
}
conn = SC_get_conn(s->stmt);
if (s->auto_commit_needed)
! PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_ON);
irdflds = SC_get_IRDF(s->stmt);
if (irdflds->rowsFetched)
*(irdflds->rowsFetched) = s->processed;
--- 1833,1839 ----
}
conn = SC_get_conn(s->stmt);
if (s->auto_commit_needed)
! PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, (SQLPOINTER) SQL_AUTOCOMMIT_ON);
irdflds = SC_get_IRDF(s->stmt);
if (irdflds->rowsFetched)
*(irdflds->rowsFetched) = s->processed;
***************
*** 1863,1869 ****
{
conn = SC_get_conn(s.stmt);
if (s.auto_commit_needed = (char) CC_is_in_autocommit(conn), s.auto_commit_needed)
! PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF);
}
if (SQL_ADD != s.operation)
{
--- 1863,1869 ----
{
conn = SC_get_conn(s.stmt);
if (s.auto_commit_needed = (char) CC_is_in_autocommit(conn), s.auto_commit_needed)
! PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, (SQLPOINTER) SQL_AUTOCOMMIT_OFF);
}
if (SQL_ADD != s.operation)
{
diff -c psqlodbc.orig/results.c psqlodbc/results.c
*** psqlodbc.orig/results.c 2005-12-08 10:11:28.000000000 +0100
--- psqlodbc/results.c 2006-01-27 12:16:15.000000000 +0100
***************
*** 3020,3026 ****
if (SQL_ERROR == ret)
CC_abort(conn);
if (s->auto_commit_needed)
! PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_ON);
if (s->irow > 0)
{
if (SQL_ADD != s->fOption && s->ridx >= 0) /* for SQLGetData */
--- 3020,3026 ----
if (SQL_ERROR == ret)
CC_abort(conn);
if (s->auto_commit_needed)
! PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, (SQLPOINTER) SQL_AUTOCOMMIT_ON);
if (s->irow > 0)
{
if (SQL_ADD != s->fOption && s->ridx >= 0) /* for SQLGetData */
***************
*** 3125,3131 ****
case SQL_DELETE:
case SQL_ADD:
if (s.auto_commit_needed = CC_is_in_autocommit(conn), s.auto_commit_needed)
! PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF);
break;
}
#endif /* DRIVER_CURSOR_IMPLEMENT */
--- 3125,3131 ----
case SQL_DELETE:
case SQL_ADD:
if (s.auto_commit_needed = CC_is_in_autocommit(conn), s.auto_commit_needed)
! PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, (SQLPOINTER) SQL_AUTOCOMMIT_OFF);
break;
}
#endif /* DRIVER_CURSOR_IMPLEMENT */
***************
*** 3186,3192 ****
if (SQL_ERROR == ret)
CC_abort(conn);
if (auto_commit_needed)
! PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_ON);
if (irow > 0)
{
if (SQL_ADD != fOption && ridx >= 0) /* for SQLGetData */
--- 3186,3192 ----
if (SQL_ERROR == ret)
CC_abort(conn);
if (auto_commit_needed)
! PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, (SQLPOINTER) SQL_AUTOCOMMIT_ON);
if (irow > 0)
{
if (SQL_ADD != fOption && ridx >= 0) /* for SQLGetData */
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-27 08:59 Dave Page <dpage@vale-housing.co.uk>
0 siblings, 1 reply; 26+ messages in thread
From: Dave Page @ 2006-01-27 08:59 UTC (permalink / raw)
To: Ludek Finstrle <luf@pzkagis.cz>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-odbc
> -----Original Message-----
> From: Ludek Finstrle [mailto:luf@pzkagis.cz]
> Sent: 27 January 2006 08:26
> To: Dave Page
> Cc: Tom Lane; pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Odbcapi30.c - 64 bit compiler warning cleanup
>
> > > > The spec actually says it should be a SQLPOINTER.
> Changing to that
> > > > unleashes a whole barrel of extra fun unfortunately.
> > >
> > > I don't think it will be so problematic. I'll try it.
> It's the best way
> > > to support Win64.
> >
> > Here is my result. Patch attached. I have no 64-bit box
> ready at hand here.
> > I will test it on 64-bit box tomorrow.
>
> I find one problem. New patch attached. I get no warning with
> this one.
>
> Please review and comment
Looks good on 64 bit linux and Windows here.
BTW, in your version bump commit, you missed a bit in psqlodbc.rc:
FILEVERSION 8,1,1,8
PRODUCTVERSION 8,1,1,8
I've committed this, but just in case you weren't aware :-)
/D
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-27 09:31 Ludek Finstrle <luf@pzkagis.cz>
parent: Dave Page <dpage@vale-housing.co.uk>
0 siblings, 0 replies; 26+ messages in thread
From: Ludek Finstrle @ 2006-01-27 09:31 UTC (permalink / raw)
To: Dave Page <dpage@vale-housing.co.uk>; +Cc: pgsql-odbc
> > Please review and comment
>
> Looks good on 64 bit linux and Windows here.
>
> BTW, in your version bump commit, you missed a bit in psqlodbc.rc:
>
> FILEVERSION 8,1,1,8
> PRODUCTVERSION 8,1,1,8
My fault. I edit version.h and than I was only looking for '0108' :-(
I hope there is no other problem with versioning.
> I've committed this, but just in case you weren't aware :-)
Thank you a lot Dave.
Regards,
Luf
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-27 09:40 Dave Page <dpage@vale-housing.co.uk>
0 siblings, 0 replies; 26+ messages in thread
From: Dave Page @ 2006-01-27 09:40 UTC (permalink / raw)
To: Ludek Finstrle <luf@pzkagis.cz>; +Cc: pgsql-odbc
> -----Original Message-----
> From: Ludek Finstrle [mailto:luf@pzkagis.cz]
> Sent: 27 January 2006 09:31
> To: Dave Page
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Odbcapi30.c - 64 bit compiler warning cleanup
>
> > > Please review and comment
> >
> > Looks good on 64 bit linux and Windows here.
> >
> > BTW, in your version bump commit, you missed a bit in psqlodbc.rc:
> >
> > FILEVERSION 8,1,1,8
> > PRODUCTVERSION 8,1,1,8
>
> My fault. I edit version.h and than I was only looking for '0108' :-(
> I hope there is no other problem with versioning.
Not that I spotted! That one stands out though because it's what Windows
explorer shows you.
> > I've committed this, but just in case you weren't aware :-)
>
> Thank you a lot Dave.
NP.
/D
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-27 14:30 Tom Lane <tgl@sss.pgh.pa.us>
parent: Ludek Finstrle <luf@pzkagis.cz>
0 siblings, 0 replies; 26+ messages in thread
From: Tom Lane @ 2006-01-27 14:30 UTC (permalink / raw)
To: Ludek Finstrle <luf@pzkagis.cz>; +Cc: Dave Page <dpage@vale-housing.co.uk>; pgsql-odbc
Ludek Finstrle <luf@pzkagis.cz> writes:
> RETCODE SQL_API
> PGAPI_SetConnectOption(HDBC hdbc,
> SQLUSMALLINT fOption,
> ! SQLUINTEGER vParam)
> {
> CSTR func = "PGAPI_SetConnectOption";
> ConnectionClass *conn = (ConnectionClass *) hdbc;
> --- 314,320 ----
> RETCODE SQL_API
> PGAPI_SetConnectOption(HDBC hdbc,
> SQLUSMALLINT fOption,
> ! SQLPOINTER vParam)
> {
> CSTR func = "PGAPI_SetConnectOption";
> ConnectionClass *conn = (ConnectionClass *) hdbc;
The problem with this is that it creates an ABI breakage. I don't think
we can just push this out as a bug fix --- it would require a major
version bump, no?
regards, tom lane
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-27 14:34 Dave Page <dpage@vale-housing.co.uk>
0 siblings, 1 reply; 26+ messages in thread
From: Dave Page @ 2006-01-27 14:34 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; Ludek Finstrle <luf@pzkagis.cz>; +Cc: pgsql-odbc
> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Sent: 27 January 2006 14:31
> To: Ludek Finstrle
> Cc: Dave Page; pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Odbcapi30.c - 64 bit compiler warning cleanup
>
> The problem with this is that it creates an ABI breakage. I
> don't think
> we can just push this out as a bug fix --- it would require a major
> version bump, no?
Is that actually a problem given that apps should link to the driver
manager (which can dynamically load any version of any driver), not
directly to the driver itself?
Regards, Dave.
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-27 14:45 Tom Lane <tgl@sss.pgh.pa.us>
parent: Dave Page <dpage@vale-housing.co.uk>
0 siblings, 0 replies; 26+ messages in thread
From: Tom Lane @ 2006-01-27 14:45 UTC (permalink / raw)
To: Dave Page <dpage@vale-housing.co.uk>; +Cc: Ludek Finstrle <luf@pzkagis.cz>; pgsql-odbc
"Dave Page" <dpage@vale-housing.co.uk> writes:
>> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
>> The problem with this is that it creates an ABI breakage.
> Is that actually a problem given that apps should link to the driver
> manager (which can dynamically load any version of any driver), not
> directly to the driver itself?
Hm, good point. So the question then becomes whether the driver manager
is expecting this parameter to be int-sized or pointer-sized.
I took a quick look at the unixODBC sources (2.0.4 which is what I have
handy, I know it's a bit old) and got completely confused: I see the
parameter declared as SQLUINTEGER in some places and UDWORD in others.
Anyone know that code base well enough to be certain which place is
definitive?
regards, tom lane
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-27 14:55 Dave Page <dpage@vale-housing.co.uk>
0 siblings, 1 reply; 26+ messages in thread
From: Dave Page @ 2006-01-27 14:55 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Ludek Finstrle <luf@pzkagis.cz>; pgsql-odbc
> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Sent: 27 January 2006 14:45
> To: Dave Page
> Cc: Ludek Finstrle; pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Odbcapi30.c - 64 bit compiler warning cleanup
>
> "Dave Page" <dpage@vale-housing.co.uk> writes:
> >> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> >> The problem with this is that it creates an ABI breakage.
>
> > Is that actually a problem given that apps should link to the driver
> > manager (which can dynamically load any version of any driver), not
> > directly to the driver itself?
>
> Hm, good point. So the question then becomes whether the
> driver manager
> is expecting this parameter to be int-sized or pointer-sized.
It /should/ be expecting SQLPOINTER (well, SQLSetConnectAttr expects
SQLPOINTER, and SQLSetConnectOption maps directly to it according to the
spec -
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/ht
m/odbcsqlsetconnectattr.asp)
> I took a quick look at the unixODBC sources (2.0.4 which is
> what I have
> handy, I know it's a bit old) and got completely confused: I see the
> parameter declared as SQLUINTEGER in some places and UDWORD in others.
> Anyone know that code base well enough to be certain which place is
> definitive?
Not I. Our code seems to be a mess of types as well :-(
Regards, Dave.
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Odbcapi30.c - 64 bit compiler warning cleanup
@ 2006-01-27 15:09 Ludek Finstrle <luf@pzkagis.cz>
parent: Dave Page <dpage@vale-housing.co.uk>
0 siblings, 0 replies; 26+ messages in thread
From: Ludek Finstrle @ 2006-01-27 15:09 UTC (permalink / raw)
To: Dave Page <dpage@vale-housing.co.uk>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Ludek Finstrle <luf@pzkagis.cz>; pgsql-odbc
> > >> The problem with this is that it creates an ABI breakage.
> >
> > > Is that actually a problem given that apps should link to the driver
> > > manager (which can dynamically load any version of any driver), not
> > > directly to the driver itself?
> >
> > Hm, good point. So the question then becomes whether the
> > driver manager
> > is expecting this parameter to be int-sized or pointer-sized.
>
> It /should/ be expecting SQLPOINTER (well, SQLSetConnectAttr expects
> SQLPOINTER, and SQLSetConnectOption maps directly to it according to the
> spec -
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/ht
> m/odbcsqlsetconnectattr.asp)
PGAPI_SetConnectOption is private hidden function. It's called from
SQL* functions which are public - exported (I'm sorry I'm using terms
from OOP but I don't know the right one). No one who follows ODBC
specification may use functions which doesn't begin with SQL.
The parameter for SQLSetConnectAttr (from which is
PGAPI_SetConnectOption mainly called) is SQLPOINTER.
I check whole code to calling PGAPI_SetConnectOption so there could be
no problem with it.
> > I took a quick look at the unixODBC sources (2.0.4 which is
> > what I have
> > handy, I know it's a bit old) and got completely confused: I see the
> > parameter declared as SQLUINTEGER in some places and UDWORD in others.
> > Anyone know that code base well enough to be certain which place is
> > definitive?
>
> Not I. Our code seems to be a mess of types as well :-(
There is more types in psqlodbc like UInt4, int, ...
I think the best API manual is on MS web (Dave's link above). unixODBC
follows it.
Regards,
Luf
^ permalink raw reply [nested|flat] 26+ messages in thread
end of thread, other threads:[~2006-01-27 15:09 UTC | newest]
Thread overview: 26+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-01-19 11:11 Odbcapi30.c - 64 bit compiler warning cleanup Dave Page <dpage@vale-housing.co.uk>
2006-01-19 11:23 ` Ludek Finstrle <luf@pzkagis.cz>
2006-01-19 13:42 Re: Odbcapi30.c - 64 bit compiler warning cleanup Dave Page <dpage@vale-housing.co.uk>
2006-01-23 09:06 ` Ludek Finstrle <luf@pzkagis.cz>
2006-01-24 19:25 ` Ludek Finstrle <luf@pzkagis.cz>
2006-01-26 10:17 ` Ludek Finstrle <luf@pzkagis.cz>
2006-01-24 20:18 Re: Odbcapi30.c - 64 bit compiler warning cleanup Dave Page <dpage@vale-housing.co.uk>
2006-01-24 20:39 ` Ludek Finstrle <luf@pzkagis.cz>
2006-01-24 21:22 ` Dave Page <dpage@vale-housing.co.uk>
2006-01-26 14:55 Re: Odbcapi30.c - 64 bit compiler warning cleanup Dave Page <dpage@vale-housing.co.uk>
2006-01-26 15:57 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-01-26 16:53 Re: Odbcapi30.c - 64 bit compiler warning cleanup Dave Page <dpage@vale-housing.co.uk>
2006-01-26 18:37 ` Ludek Finstrle <luf@pzkagis.cz>
2006-01-26 20:58 ` Ludek Finstrle <luf@pzkagis.cz>
2006-01-27 08:25 ` Ludek Finstrle <luf@pzkagis.cz>
2006-01-27 14:30 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-01-26 17:07 Re: Odbcapi30.c - 64 bit compiler warning cleanup Dave Page <dpage@vale-housing.co.uk>
2006-01-26 17:16 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-01-26 18:40 ` Ludek Finstrle <luf@pzkagis.cz>
2006-01-27 08:59 Re: Odbcapi30.c - 64 bit compiler warning cleanup Dave Page <dpage@vale-housing.co.uk>
2006-01-27 09:31 ` Ludek Finstrle <luf@pzkagis.cz>
2006-01-27 09:40 Re: Odbcapi30.c - 64 bit compiler warning cleanup Dave Page <dpage@vale-housing.co.uk>
2006-01-27 14:34 Re: Odbcapi30.c - 64 bit compiler warning cleanup Dave Page <dpage@vale-housing.co.uk>
2006-01-27 14:45 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-01-27 14:55 Re: Odbcapi30.c - 64 bit compiler warning cleanup Dave Page <dpage@vale-housing.co.uk>
2006-01-27 15:09 ` Ludek Finstrle <luf@pzkagis.cz>
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