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

Re: back-sql with binary values from mysql DBs (ITS#3113)

Note that ;binary means that the value is BER encoded
instead of string encoded.  It's use here is probably

At 12:51 AM 4/26/2004, bnasri@yahoo.com wrote:
>Full_Name: Babak Nasri
>Version: 2.2.10
>OS: linux 2.4.22  on debian dist
>URL: ftp://ftp.openldap.org/incoming/
>Submission from: (NULL) (
>Returning binary values from a mysql table bound to openldap back-sql through
>iODBC the type was lost somewhere and the value was treated hexdumped as
>Work around I deployed in my installation was some minor changes in entry_id.c
>->  backsql_get_attr_vals and sql-wrap.c -> backsql_BindRowAsStrings.
>In BindRowAsString I just changed the colname before binding the col using
>   if ( col_type == SQL_LONGVARCHAR || col_type == SQL_LONGVARBINARY) {
>       ber_str2bv( strcat(colname,";binary"), 0, 1, &row->col_names[ i - 1 ] );
>       ....
>And In backsql_get_attr_vals I checked back for having that phrase in colname
>and converted the hexdump string to the corresponding binary value
>(hex_to_bytes) just before calling      backsql_entry_addattr.
>This has shown up to be a work around for that issue but I am not sure if it
>applies to general thread to be considered in the head.