Tim,

For the longest time, there's been this annoying warning with the compile for DBD::mysql:

cc -c -I/Library/Perl/5.8.1/darwin-thread-multi-2level/auto/DBI/ -I/usr/local/mysql/include -fno-omit-frame-pointer -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -g -pipe -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -Os -DVERSION=\"2.9015_3\" -DXS_VERSION=\"2.9015_3\" "-I/System/Library/Perl/5.8.1/darwin-thread-multi-2level/CORE" dbdimp.c
/usr/bin/perl -p -e "s/~DRIVER~/mysql/g" /Library/Perl/5.8.1/darwin-thread-multi-2level/auto/DBI//Driver.xst > mysql.xsi
/usr/bin/perl /System/Library/Perl/5.8.1/ExtUtils/xsubpp -typemap /System/Library/Perl/5.8.1/ExtUtils/typemap mysql.xs > mysql.xsc && mv mysql.xsc mysql.c
Warning: duplicate function definition 'do' detected in mysql.xs, line 224
Warning: duplicate function definition 'rows' detected in mysql.xs, line 560


I looked into this, and it seems that mysql.xsi also is generated with definitions for rows() and do(), and mysql.xs has these functions already declared. It seems that maybe I would have to move them to dbdimp.c. I've tried moving what is rows now:

void
rows(sth)
    SV* sth
  CODE:
    D_imp_sth(sth);
    char buf[64];
    if (imp_sth->row_num+1 ==  (my_ulonglong) -1)
    sprintf(buf, "%d", -1);
  else
    sprintf(buf, "%llu", imp_sth->row_num);

  ST(0) = sv_2mortal(newSVpvn(buf, strlen(buf)));

To dbdimp.c:

int dbd_st_rows(SV *sth, imp_sth_t *imp_sth)
{
    D_imp_sth(sth);
    char buf[64];

< guts cut for brevity>

  /* not really needed now, but keeping here until working */
  sv_2mortal(newSVpvn(buf, strlen(buf)));
  return(imp_sth->row_num);
}

and in dbdimp.h:

#define dbd_st_rows             mysql_st_rows
...
int dbd_st_rows(SV *sth, imp_sth_t *imp_sth);

But now, I get this error:

cc -c -I/Library/Perl/5.8.1/darwin-thread-multi-2level/auto/DBI/ -I/usr/local/mysql/include -fno-omit-frame-pointer -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -g -pipe -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -Os -DVERSION=\"2.9015_3\" -DXS_VERSION=\"2.9015_3\" "-I/System/Library/Perl/5.8.1/darwin-thread-multi-2level/CORE" mysql.c
mysql.c:1725: error: redefinition of `XS_DBD__mysql__st_rows'
mysql.c:581: error: `XS_DBD__mysql__st_rows' previously defined here
make: *** [mysql.o] Error 1



I see in DBD::Oracle that you have dbd_st_rows in dbdimp.c. What is the procedure for being able to move a function from the XS file to the driver file and not end up with this error. Also, is there a way to implement dbd_st_rows so that it might be able to return something larger than an int, because the value imp_sth->row_num is a my_ulonglong, and could be a much larger number than what int can hold. In the current version, ST(0), the return value, takes a SV* (sv_2mortal). How is it that the mysql.xs file can return a SV*, but dbd_st_rows is defined returning an int? What would you suggest for me to be able to improve this issue?


thanks much!

Patrick

Patrick Galbraith Senior Software Developer
[EMAIL PROTECTED] http://www.mysql.com

"Whatever action a great man performs, common men follow. Whatever standards he sets by exemplary acts, all the world pursues" -- Bhagavad Gita



Reply via email to