Commit d3de8c33 authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

cleanup error messages

parent 9d481974
......@@ -216,7 +216,7 @@ backsql_load_schema_map( backsql_info *si, SQLHDBC dbh )
backsql_oc_map_rec *oc_map;
backsql_at_map_rec *at_map;
Debug( LDAP_DEBUG_TRACE, "==>load_schema_map()\n", 0, 0, 0 );
Debug( LDAP_DEBUG_TRACE, "==>backsql_load_schema_map()\n", 0, 0, 0 );
/*
* TimesTen : See if the ldap_entries.dn_ru field exists in the schema
......@@ -240,18 +240,18 @@ backsql_load_schema_map( backsql_info *si, SQLHDBC dbh )
rc = backsql_Prepare( dbh, &oc_sth, si->oc_query, 0 );
if ( rc != SQL_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, "load_schema_map(): "
Debug( LDAP_DEBUG_TRACE, "backsql_load_schema_map(): "
"error preparing oc_query: '%s'\n",
si->oc_query, 0, 0 );
backsql_PrintErrors( si->db_env, dbh, oc_sth, rc );
return LDAP_OTHER;
}
Debug( LDAP_DEBUG_TRACE, "load_schema_map(): at_query '%s'\n",
Debug( LDAP_DEBUG_TRACE, "backsql_load_schema_map(): at_query '%s'\n",
si->at_query, 0, 0 );
rc = backsql_Prepare( dbh, &at_sth, si->at_query, 0 );
if ( rc != SQL_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, "load_schema_map(): "
Debug( LDAP_DEBUG_TRACE, "backsql_load_schema_map(): "
"error preparing at_query: '%s'\n",
si->at_query, 0, 0 );
backsql_PrintErrors( si->db_env, dbh, at_sth, rc );
......@@ -260,7 +260,7 @@ backsql_load_schema_map( backsql_info *si, SQLHDBC dbh )
rc = backsql_BindParamID( at_sth, 1, &oc_id );
if ( rc != SQL_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, "load_schema_map(): "
Debug( LDAP_DEBUG_TRACE, "backsql_load_schema_map(): "
"error binding param for at_query: \n", 0, 0, 0 );
backsql_PrintErrors( si->db_env, dbh, at_sth, rc );
return LDAP_OTHER;
......@@ -268,7 +268,7 @@ backsql_load_schema_map( backsql_info *si, SQLHDBC dbh )
rc = SQLExecute( oc_sth );
if ( rc != SQL_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, "load_schema_map(): "
Debug( LDAP_DEBUG_TRACE, "backsql_load_schema_map(): "
"error executing oc_query: \n", 0, 0, 0 );
backsql_PrintErrors( si->db_env, dbh, oc_sth, rc );
return LDAP_OTHER;
......@@ -286,7 +286,7 @@ backsql_load_schema_map( backsql_info *si, SQLHDBC dbh )
oc_map->bom_oc = oc_find( oc_row.cols[ 1 ] );
if ( oc_map->bom_oc == NULL ) {
Debug( LDAP_DEBUG_TRACE, "load_schema_map(): "
Debug( LDAP_DEBUG_TRACE, "backsql_load_schema_map(): "
"objectClass '%s' is not defined in schema\n",
oc_row.cols[ 1 ], 0, 0 );
return LDAP_OTHER; /* undefined objectClass ? */
......@@ -327,7 +327,7 @@ backsql_load_schema_map( backsql_info *si, SQLHDBC dbh )
return LDAP_OTHER;
}
oc_id = oc_map->bom_id;
Debug( LDAP_DEBUG_TRACE, "load_schema_map(): "
Debug( LDAP_DEBUG_TRACE, "backsql_load_schema_map(): "
"objectClass '%s': keytbl='%s' keycol='%s'\n",
BACKSQL_OC_NAME( oc_map ),
oc_map->bom_keytbl.bv_val, oc_map->bom_keycol.bv_val );
......@@ -348,13 +348,13 @@ backsql_load_schema_map( backsql_info *si, SQLHDBC dbh )
BACKSQL_IS_ADD( oc_map->bom_expect_return ),
BACKSQL_IS_DEL( oc_map->bom_expect_return ), 0 );
Debug( LDAP_DEBUG_TRACE, "load_schema_map(): "
Debug( LDAP_DEBUG_TRACE, "backsql_load_schema_map(): "
"autoadding 'objectClass' and 'ref' mappings\n",
0, 0, 0 );
backsql_add_sysmaps( oc_map );
rc = SQLExecute( at_sth );
if ( rc != SQL_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, "load_schema_map(): "
Debug( LDAP_DEBUG_TRACE, "backsql_load_schema_map(): "
"error executing at_query: \n", 0, 0, 0 );
backsql_PrintErrors( SQL_NULL_HENV, dbh, at_sth, rc );
return LDAP_OTHER;
......@@ -367,26 +367,28 @@ backsql_load_schema_map( backsql_info *si, SQLHDBC dbh )
struct berval bv;
struct berbuf bb = BB_NULL;
Debug( LDAP_DEBUG_TRACE, "********'%s'\n",
at_row.cols[ 0 ], 0, 0 );
Debug( LDAP_DEBUG_TRACE,
"name='%s',sel_expr='%s' from='%s'",
"attributeType:\n"
"\tname='%s'\n"
"\tsel_expr='%s'\n"
"\tfrom='%s'\n",
at_row.cols[ 0 ], at_row.cols[ 1 ],
at_row.cols[ 2 ] );
Debug( LDAP_DEBUG_TRACE,
"join_where='%s',add_proc='%s'",
at_row.cols[ 3 ], at_row.cols[ 4 ], 0 );
Debug( LDAP_DEBUG_TRACE, "delete_proc='%s'\n",
at_row.cols[ 5 ], 0, 0 );
"\tjoin_where='%s'\n"
"\tadd_proc='%s'\n"
"\tdelete_proc='%s'\n",
at_row.cols[ 3 ], at_row.cols[ 4 ],
at_row.cols[ 5 ]);
/* TimesTen */
Debug( LDAP_DEBUG_TRACE, "sel_expr_u='%s'\n",
Debug( LDAP_DEBUG_TRACE, "\tsel_expr_u='%s'\n",
at_row.cols[ 8 ], 0, 0 );
at_map = (backsql_at_map_rec *)ch_calloc( 1,
sizeof( backsql_at_map_rec ) );
rc = slap_str2ad( at_row.cols[ 0 ],
&at_map->bam_ad, &text );
if ( rc != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, "load_schema_map(): "
Debug( LDAP_DEBUG_TRACE, "backsql_load_schema_map(): "
"attribute '%s' for objectClass '%s' "
"is not defined in schema: %s\n",
at_row.cols[ 0 ],
......@@ -426,7 +428,7 @@ backsql_load_schema_map( backsql_info *si, SQLHDBC dbh )
at_map->bam_expect_return = strtol( at_row.cols[ 7 ],
NULL, 0 );
backsql_make_attr_query( oc_map, at_map );
Debug( LDAP_DEBUG_TRACE, "load_schema_map(): "
Debug( LDAP_DEBUG_TRACE, "backsql_load_schema_map(): "
"preconstructed query '%s'\n",
at_map->bam_query, 0, 0 );
at_map->bam_next = NULL;
......@@ -456,7 +458,7 @@ backsql_load_schema_map( backsql_info *si, SQLHDBC dbh )
SQLFreeStmt( at_sth, SQL_DROP );
SQLFreeStmt( oc_sth, SQL_DROP );
si->bsql_flags |= BSQLF_SCHEMA_LOADED;
Debug( LDAP_DEBUG_TRACE, "<==load_schema_map()\n", 0, 0, 0 );
Debug( LDAP_DEBUG_TRACE, "<==backsql_load_schema_map()\n", 0, 0, 0 );
return LDAP_SUCCESS;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment