Re: [Fwd: Re: Compile of DBD Solid]

From: Patricia Markiewicz (Patricia.Markiewicz_at_rrd.com)
Date: 11/14/03


To: dbi-users@perl.org
Date: Fri, 14 Nov 2003 07:51:42 -0600


Here are the results of my grep, hopefully this helps:

# ls
ANNOUNCE Makefile Solid.bs Solid.pm dbdimp.c
pm_to_blib
Changes Makefile.PL Solid.c Solid.xs dbdimp.h t
Const README Solid.h bench dbdimp.o
MANIFEST README.longs Solid.o blib make.out
# grep -i SQL_SUCCESS *
Changes: like SQL_NO_DATA_FOUND and SQL_SUCCESS_WITH_INFO only
dbdimp.c: if ( rc != SQL_SUCCESS )
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: if( rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO )
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: /* error code 00000 also means SQL_SUCCESS, according
dbdimp.c: if (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO)
dbdimp.c: } while (rc == SQL_SUCCESS || rc ==
SQL_SUCCESS_WITH_INFO);
dbdimp.c: if (badrc != SQL_SUCCESS && what)
dbdimp.c: if (badrc != SQL_SUCCESS)
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: i < imp_sth->n_result_cols && rc == SQL_SUCCESS;
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: imp_sth->eod = SQL_SUCCESS;
dbdimp.c: if( rc == SQL_SUCCESS_WITH_INFO )
dbdimp.c: /* with par: is always OK, *par gets SQL_SUCCESS */
dbdimp.c: *(RETCODE*)par = SQL_SUCCESS;
dbdimp.c: case SQL_SUCCESS:
dbdimp.c: case SQL_SUCCESS_WITH_INFO:
dbdimp.c: imp_sth->eod = SQL_SUCCESS;
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: if( rc == SQL_SUCCESS_WITH_INFO )
dbdimp.c: if( rc != SQL_SUCCESS )
dbdimp.c: if( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO )
dbdimp.c: if( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO )
dbdimp.c: if( rc != SQL_SUCCESS )
#

# grep SQL_SUCCESS *
Const.c: if (strEQ(name, "SQL_SUCCESS"))
Const.c:#ifdef SQL_SUCCESS
Const.c: return SQL_SUCCESS;
Const.c: if (strEQ(name, "SQL_SUCCESS_WITH_INFO"))
Const.c:#ifdef SQL_SUCCESS_WITH_INFO
Const.c: return SQL_SUCCESS_WITH_INFO;
Const.pm: SQL_SUCCESS
Const.pm: SQL_SUCCESS_WITH_INFO
Const.xs: if (strEQ(name, "SQL_SUCCESS"))
Const.xs:#ifdef SQL_SUCCESS
Const.xs: return SQL_SUCCESS;
Const.xs: if (strEQ(name, "SQL_SUCCESS_WITH_INFO"))
Const.xs:#ifdef SQL_SUCCESS_WITH_INFO
Const.xs: return SQL_SUCCESS_WITH_IN

                                                                           
             Jim Cromie
             <jcromie@divsol.c
             om> To
                                       Patricia.Markiewicz@rrd.com
             11/12/2003 04:19 cc
             PM
                                                                   Subject
                                       [Fwd: Re: Compile of DBD Solid]
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           

Patty,

Tim Bunce (the author of DBI) has asked a question that youre
in a position to answer, as you have the source code. See below for his
words.

please grep for SQL_SUCCESS in the Solid source-code and post an
excerpt/summary.

I infer that it should be used to conditionally define the rest of the
constants,
ala:

#ifndef SQL_SUCCESS
#define SQL_VARCHAR ....
....
#endif

but its possible that it is just unconditionally defined along with the
others

This could cause probs;

if its included *after* DBI/sql_types.h, which (properly, I infer) does
a conditional test on SQL_SUCCESS before defining the SQL_* constants
but which doesnt encounter the defined symbol

and if (as i believe) inclusion order matters, and is controlled from
command-line options -L
The warning messages seems to corroborate this reading, but im not 100%
sure im
interpreting it right, and I dont have the inclination at this point to
construct a test.

thanks (in advance) for following up.

jimc

-------- Original Message --------
Subject: Re: Compile of DBD Solid
Date: Tue, 11 Nov 2003 20:57:27 +0000
From: Tim Bunce <Tim.Bunce@pobox.com>
To: Jim Cromie <jcromie@divsol.com>
CC: Patricia.Markiewicz@rrd.com, dbi-users@perl.org
References:
<OFE96D9564.F9210AFC-ON86256DDA.006FB836-86256DDA.0074B6B9@rrd.com>
<3FB1300C.3090907@divsol.com>

On Tue, Nov 11, 2003 at 11:53:00AM -0700, Jim Cromie wrote:
> Patricia.Markiewicz@rrd.com wrote:
>
> >Here is the error I am getting when I run the make:
> >
> ># make .....
> >
> >In file included from Solid.h:57,
> > from Solid.xs:7:
> >/usr/solid/include/sqlext.h:398: warning: `SQL_INTERVAL_YEAR' redefined
> >/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/DBI/dbi_sql.h:58:
> >warning: this is the location of the previous definition
> >
>
> DBI/dbi_sql.h defines constants for sql data-types.
> apparently so does /usr/solid/include/sqlext.h
>
> but these are warnings, ok as long as the defined values are consistent.
>
> Q to list - is there a risk in adding #ifndef SQL_VARCHAR 'ing around
> the SQL datatype codes ?
> or is SQL_SUCCESS the standard way of doing this - and Solid not
> following the ODBC standard ?

Does Solid not define SQL_SUCCESS?

Certainly the DBI code could use defined(SQL_VARCHAR) ||
defined(SQL_SUCCESS)
to disable the defines. Or it could even add #ifdef's around each #define.
Any volunteers to send a patch?

Tim.



Relevant Pages

  • Re: Solids use of ODBC standard defines.
    ... >Here are the results of my grep, ... By your comments, you have a liscensed copy, and Solid support. ... >The warning messages seems to corroborate this reading, ... >Certainly the DBI code could use defined|| ...
    (perl.dbi.users)
  • Solids use of ODBC standard defines.
    ... Actually, I was hoping that your grep would be on SOLID code/tarball, ... By your comments, you have a liscensed copy, and Solid support. ... >The warning messages seems to corroborate this reading, ... >Certainly the DBI code could use defined|| ...
    (perl.dbi.users)