Re: [Fwd: Re: [gnome-db]API reference]



On 14 May 2001 06:14:31 -0300, Cleber Rodrigues Rosa Junior wrote:
> > > >> hmm, it may be due to an unsupported data type. Coudl you tell us the types
> > > >> of the fields in that table?
> > > > 
> > > blob and tinyblob
> > >
> > Cleber, can you have a look at the MySQL provider to see how it's
> > managing these data types? I think this can be the problem.
> >  
> 
> 
> This is the snippet of code that might be causing this (it's in
> gda-mysql-connection.c, line 338):
> 
>   case FIELD_TYPE_TINY_BLOB:
>               case FIELD_TYPE_MEDIUM_BLOB: return GDA_TypeVarbin;
>               case FIELD_TYPE_LONG_BLOB:
>               case FIELD_TYPE_BLOB: return GDA_TypeLongvarbin;
> 
> How should we deal with them? Should all TINY_BLOB return GDA_TypeVarbin
> and LONG_BLOB return GDA_TypeLongvarbin ??? Or are new GDA types the
> best solution?
> 
ok, I've seen that in fill_field_values (gda-mysql-recordset.c), it wasn't managing
the FIELD_TYPE*_BLOB types. So, I've added this:

case FIELD_TYPE_TINY_BLOB :
case FIELD_TYPE_MEDIUM_BLOB :
case FIELD_TYPE_LONG_BLOB :
case FIELD_TYPE_BLOB :
     gda_server_field_set_varbin(field,
         (gpointer) mysql_recset->array[fieldidx],
           field->defined_length);
     break;

I don't know if this will fix the problem (don't have a MySQL database
to test it), so please, try it yourselves (this is on CVS now).

Also, I'm not sure if it's correct to just use field->defined_length for
the size, since field->defined_length is the length of the column, not
the length of this specific field. Any idea?

cheers

-- 
Rodrigo Moya <rodrigo gnome-db org> <rodrigo ximian com>
http://www.gnome-db.org/





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]