Hi,

first of all, thanks for the complete test kit. This amount of
information makes it a lot simpler to find out what's wrong.

I didn't run the code, but I suspect the problem is here:

                                case DBI_TYPE_INTEGER:
                                     printf("\tint\tfield %d %s (type %d) = 
%d\n", fields, dbi_result_get_field_name(result, fields), 
dbi_result_get_field_type_idx(result, fields), dbi_result_get_int_idx(result, 
fields));


and here:

[EMAIL PROTECTED]:/data/development$ ./sample "select COUNT(*) from CODERS"
DBI version = libdbi v0.8.3
Query: select COUNT(*) from CODERS
Next row:
        int     field 1 COUNT(*) (type 1) = 0

Your code assumes that the count is returned as an int (a 4 byte
integer on linux). However, as MySQL can handle far larger row
numbers, I assume the return value is long long (8 byte) instead. In
that case you'd have to retrieve the value with
dbi_result_get_longlong_idx(). If you need to find out at runtime, you
may use the dbi_result_get_field_attrib() functions and check the
size of the returned value (defined in dbi.h as DBI_INTEGER_SIZEx).

regards,
Markus

-- 
Markus Hoenicka
[EMAIL PROTECTED]
(Spam-protected email: replace the quadrupeds with "mhoenicka")
http://www.mhoenicka.de


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users

Reply via email to