DBD::mysql dbdimp.c does not compile - solution

DBD::mysql dbdimp.c does not compile - solution

am 02.11.2005 12:45:40 von Martin.Evans

Just in case this helps anyone else.

I've just tried DBD::mysql for the first time and it failed to compile with gcc
2.95.3. It appears there are functions in dbdimp.c which declare variables
after code in:


1. dbd_st_prepare, code in #if before searchptr etc declared:

{
int i;
SV **svp;
D_imp_dbh_from_sth;

#if MYSQL_VERSION_ID >= SERVER_PREPARE_VERSION
/* Set default value of 'mysql_emulated_prepare' attribute for sth from dbh */
imp_sth->use_server_side_prepare= imp_dbh->use_server_side_prepare;
if (attribs)
{
svp= DBD_ATTRIB_GET_SVP(attribs, "mysql_emulated_prepare", 22);
imp_sth->use_server_side_prepare = (svp) ?
SvTRUE(*svp) : imp_dbh->use_server_side_prepare;
}

char *searchptr;
int col_type;
int limit_flag= 0;
int statement_length= 0;
MYSQL_BIND *bind, *bind_end;
imp_sth_phb_t *fbind;

2. same as 1, in mysql_st_internal_execute

else
{
D_imp_sth(h);
D_imp_dbh_from_sth;
bind_type_guessing= imp_dbh->bind_type_guessing;
}

char *salloc = parse_params(svsock,
sbuf,
&slen,
params,
num_params,
bind_type_guessing);

I fixed be moving the declarations.

Martin
--
Martin J. Evans
Easysoft Ltd, UK
Development

RE: DBD::mysql dbdimp.c does not compile - solution

am 02.11.2005 12:49:32 von Martin.Evans

oops, forgot to say this was the DBD::mysql developers release 3.0002_3.

Martin
--
Martin J. Evans
Easysoft Ltd, UK
Development


On 02-Nov-2005 Martin J. Evans wrote:
> Just in case this helps anyone else.
>
> I've just tried DBD::mysql for the first time and it failed to compile with
> gcc
> 2.95.3. It appears there are functions in dbdimp.c which declare variables
> after code in:
>
>
> 1. dbd_st_prepare, code in #if before searchptr etc declared:
>
> {
> int i;
> SV **svp;
> D_imp_dbh_from_sth;
>
>#if MYSQL_VERSION_ID >= SERVER_PREPARE_VERSION
> /* Set default value of 'mysql_emulated_prepare' attribute for sth from dbh
> */
> imp_sth->use_server_side_prepare= imp_dbh->use_server_side_prepare;
> if (attribs)
> {
> svp= DBD_ATTRIB_GET_SVP(attribs, "mysql_emulated_prepare", 22);
> imp_sth->use_server_side_prepare = (svp) ?
> SvTRUE(*svp) : imp_dbh->use_server_side_prepare;
> }
>
> char *searchptr;
> int col_type;
> int limit_flag= 0;
> int statement_length= 0;
> MYSQL_BIND *bind, *bind_end;
> imp_sth_phb_t *fbind;
>
> 2. same as 1, in mysql_st_internal_execute
>
> else
> {
> D_imp_sth(h);
> D_imp_dbh_from_sth;
> bind_type_guessing= imp_dbh->bind_type_guessing;
> }
>
> char *salloc = parse_params(svsock,
> sbuf,
> &slen,
> params,
> num_params,
> bind_type_guessing);
>
> I fixed be moving the declarations.
>
> Martin
> --
> Martin J. Evans
> Easysoft Ltd, UK
> Development

Re: DBD::mysql dbdimp.c does not compile - solution

am 02.11.2005 18:59:32 von patg

Martin J. Evans wrote:


Martin,

Thanks much!

I'll be rolling a 3.0002_4 dev release really soon with this fix, also
with multi-result set support.

Kind regards,

Patrick

>oops, forgot to say this was the DBD::mysql developers release 3.0002_3.
>
>Martin
>--
>Martin J. Evans
>Easysoft Ltd, UK
>Development
>
>
>On 02-Nov-2005 Martin J. Evans wrote:
>
>
>>Just in case this helps anyone else.
>>
>>I've just tried DBD::mysql for the first time and it failed to compile with
>>gcc
>>2.95.3. It appears there are functions in dbdimp.c which declare variables
>>after code in:
>>
>>
>>1. dbd_st_prepare, code in #if before searchptr etc declared:
>>
>>{
>> int i;
>> SV **svp;
>> D_imp_dbh_from_sth;
>>
>>#if MYSQL_VERSION_ID >= SERVER_PREPARE_VERSION
>> /* Set default value of 'mysql_emulated_prepare' attribute for sth from dbh
>>*/
>> imp_sth->use_server_side_prepare= imp_dbh->use_server_side_prepare;
>> if (attribs)
>> {
>> svp= DBD_ATTRIB_GET_SVP(attribs, "mysql_emulated_prepare", 22);
>> imp_sth->use_server_side_prepare = (svp) ?
>> SvTRUE(*svp) : imp_dbh->use_server_side_prepare;
>> }
>>
>> char *searchptr;
>> int col_type;
>> int limit_flag= 0;
>> int statement_length= 0;
>> MYSQL_BIND *bind, *bind_end;
>> imp_sth_phb_t *fbind;
>>
>>2. same as 1, in mysql_st_internal_execute
>>
>> else
>> {
>> D_imp_sth(h);
>> D_imp_dbh_from_sth;
>> bind_type_guessing= imp_dbh->bind_type_guessing;
>> }
>>
>> char *salloc = parse_params(svsock,
>> sbuf,
>> &slen,
>> params,
>> num_params,
>> bind_type_guessing);
>>
>>I fixed be moving the declarations.
>>
>>Martin
>>--
>>Martin J. Evans
>>Easysoft Ltd, UK
>>Development
>>
>>