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

Re: back-sql writes binding improperly



Pierangelo

I note that it appears that your RDBMS requires the column size to
be set when values of SQL_CHAR type are used.

FYI, freetds also wants the column size set for SQL_VARCHAR.

It would be easier to find these things if openldap examined the output from SQLBindParameter. Freetds was returning a failure code with the 0-length column.

Would you accept patches along these lines for the bindparameter calls?

				rc = SQLBindParameter( sth, pno + 2 - po,
					SQL_PARAM_INPUT,
					SQL_C_CHAR, SQL_CHAR,
					0, 0, at_val->bv_val,
					at_val->bv_len, 0 );
				
				if ( rc != SQL_SUCCESS ) {
					Debug( LDAP_DEBUG_TRACE,
						"   backsql_modify_internal(): "
						"add_proc param bind failed\n",
						0, 0, 0 );
					backsql_PrintErrors( bi->db_env,
							dbh, sth, rc );

					if ( BACKSQL_FAIL_IF_NO_MAPPING( bi ) ) {
						rs->sr_err = LDAP_OTHER;
						rs->sr_text = "SQL-backend error";
						goto done;
					}
				}


Brad