Hi all,
I was away for a bit - I will add this to 4.004, due end of week.
Thanks!
Patrick
Scott T. Hildreth wrote:
On Tue, 2007-03-13 at 13:13 +0000, Tim Bunce wrote:
On Thu, Mar 08, 2007 at 12:23:17PM -0600, Scott T. Hildreth wrote:
On Wed, 2007-03-07 at 16:58 -0600, Scott T. Hildreth wrote:
mysql Ver 12.21 Distrib 4.0.15, for suse-linux (i686)
... So my client is not >= to SQL_STATE_VERSION, but dbdimp.c
still has do_error accepting a sqlstate param,
void do_error(SV* h, int rc, const char* what, const char* sqlstate)
causing this compile error,
dbdimp.c:1269: error: conflicting types for `mysql_dr_error'
dbdimp.h:288: error: previous declaration of `mysql_dr_error'
dbdimp.c: In function `mysql_st_fetch':
dbdimp.c:3419: error: too few arguments to function `mysql_dr_error'
dbdimp.c:3583: error: too few arguments to function `mysql_dr_error'
dbdimp.c: In function `mysql_st_FETCH_internal':
dbdimp.c:3915: error: too few arguments to function `mysql_dr_error'
dbdimp.c:3929: error: too few arguments to function `mysql_dr_error'
dbdimp.c: In function `mysql_bind_ph':
dbdimp.c:4244: error: too few arguments to function `mysql_dr_error'
dbdimp.c:4271: error: too few arguments to function `mysql_dr_error'
dbdimp.c:4283: error: too few arguments to function `mysql_dr_error'
dbdimp.c: In function `mysql_db_reconnect':
dbdimp.c:4445: error: too few arguments to function `mysql_dr_error'
make: *** [dbdimp.o] Error 1
Well I put the below #if's around all the do_error calls in dbdimp.c
and got dbdimp.c to compile. Now mysql.xs needs these #if's. Before
I add them, I wanted know if there is a better way of doing this or
is this the right way to fix the error?
I think the best fix is possibly just:
--- ./dbdimp.h.orig 2007-03-13 13:12:20.000000000 +0000
+++ ./dbdimp.h 2007-03-13 13:12:32.000000000 +0000
@@ -282,11 +282,7 @@
#endif
#include <dbd_xsh.h>
-#if MYSQL_VERSION_ID >= SQL_STATE_VERSION
void do_error (SV* h, int rc, const char *what, const char *sqlstate);
-#else
-void do_error (SV* h, int rc, const char *what);
-#endif
SV *dbd_db_fieldlist (MYSQL_RES* res);
void dbd_preparse (imp_sth_t *imp_sth, SV *statement);
but I'm not in a position to test it.
Could you try that on a freshly unpacked distribution with the old client?
That worked. I had to remove the #if's from dbdimp.c where the
"too few arguments" occurred (shown above). The same tests fail. I
looked at some of them and this is due to the older client being used.
This approach is to remove all the MYSQL_VERSION_ID checking and mine
was to add it everywhere. I tend to over do things. :-)
Tim.
--
Patrick Galbraith, Senior Programmer
Grazr - Easy feed grazing and sharing
http://www.grazr.com
Satyam Eva Jayate - Truth Alone Triumphs
Mundaka Upanishad