[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: backsql_get_attr_vals()



Thanks Nikos!

I recall that I had some troubles with this and *non-binary* values, but after all, it could be a driver
glitch to report wrong length for varchar fields... Honestly, this needs testing with all databases
supported...

WBW, Dmitry


Nikos Mavroyanopoulos wrote:

> Hello,
>  I've been trying to use openldap with binary fields in our database using the backend for sql,
> and unixodbc. It seems that the following in entry-id.c in function backsql_get_attr_vals(),
> makes the whole thing non binary safe:
>        backsql_entry_addattr(bsi->e,row.col_names[i],row.cols[i], strlen(row.cols[i]));
>                                                                     ^^^^^^^^^^^^^
> (this is after SQLFetch())
>
> However this strlen() can be avoided by using:
>        backsql_entry_addattr(bsi->e,row.col_names[i],row.cols[i], row.is_null[i]);
>
> Which is defined to return the character length in odbc (this is the last parameter in SQLBindCol()).
>
> thank you for your fine work in back-sql!
>
> --
> Nikos Mavroyanopoulos