mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-02-16 17:18:16 -05:00
finish the prefious fixes... it is really hard to commit a truly good patch without even a chance to check if it is compilable ;)
This commit is contained in:
parent
2941993d8f
commit
358835218a
3 changed files with 42 additions and 35 deletions
|
|
@ -80,7 +80,7 @@ backsql_entryID* backsql_dn2id(backsql_info *bi,backsql_entryID *id,SQLHDBC dbh,
|
|||
|
||||
if ((rc=backsql_BindParamStr(sth,1,toBind,
|
||||
BACKSQL_MAX_DN_LEN)) != SQL_SUCCESS)
|
||||
// end TimesTen
|
||||
/* end TimesTen*/
|
||||
{
|
||||
Debug(LDAP_DEBUG_TRACE,"backsql_dn2id(): error binding dn parameter:\n",0,0,0);
|
||||
backsql_PrintErrors(SQL_NULL_HENV,dbh,sth,rc);
|
||||
|
|
@ -162,10 +162,11 @@ int backsql_get_attr_vals(backsql_at_map_rec *at,backsql_srch_info *bsi)
|
|||
{
|
||||
backsql_entry_addattr(bsi->e,row.col_names[i],row.cols[i],/*row.col_prec[i]*/
|
||||
strlen(row.cols[i]));
|
||||
// Debug(LDAP_DEBUG_TRACE,"prec=%d\n",(int)row.col_prec[i],0,0);
|
||||
/* Debug(LDAP_DEBUG_TRACE,"prec=%d\n",(int)row.col_prec[i],0,0);*/
|
||||
}
|
||||
// else
|
||||
// Debug(LDAP_DEBUG_TRACE,"NULL value in this row for attribute '%s'\n",row.col_names[i],0,0);
|
||||
/* else
|
||||
Debug(LDAP_DEBUG_TRACE,"NULL value in this row for attribute '%s'\n",row.col_names[i],0,0);
|
||||
*/
|
||||
}
|
||||
}
|
||||
backsql_FreeRow(&row);
|
||||
|
|
@ -188,7 +189,7 @@ Entry* backsql_id2entry(backsql_srch_info *bsi,Entry* e,backsql_entryID* eid)
|
|||
e->e_attrs=NULL;
|
||||
e->e_private=NULL;
|
||||
|
||||
// if (bsi->base_dn != NULL)???
|
||||
/* if (bsi->base_dn != NULL)???*/
|
||||
|
||||
e->e_id=eid->id;
|
||||
e->e_dn=ch_strdup(bsi->c_eid->dn);
|
||||
|
|
@ -201,7 +202,7 @@ Entry* backsql_id2entry(backsql_srch_info *bsi,Entry* e,backsql_entryID* eid)
|
|||
{
|
||||
if (!strcasecmp(*c_at_name,"objectclass") || !strcasecmp(*c_at_name,"0.10"))
|
||||
{
|
||||
//backsql_entry_addattr(bsi->e,"objectclass",bsi->oc->name,strlen(bsi->oc->name));
|
||||
/*backsql_entry_addattr(bsi->e,"objectclass",bsi->oc->name,strlen(bsi->oc->name));*/
|
||||
continue;
|
||||
}
|
||||
at=backsql_at_with_name(bsi->oc,*c_at_name);
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ int backsql_load_schema_map(backsql_info *si,SQLHDBC dbh)
|
|||
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);
|
||||
Debug(LDAP_DEBUG_TRACE,"sel_expr_u='%s'\n", at_row.cols[8],0,0); // TimesTen
|
||||
Debug(LDAP_DEBUG_TRACE,"sel_expr_u='%s'\n", at_row.cols[8],0,0); /* TimesTen*/
|
||||
at_map=(backsql_at_map_rec*)ch_calloc(1,sizeof(backsql_at_map_rec));
|
||||
at_map->name=ch_strdup(at_row.cols[0]);
|
||||
at_map->sel_expr=ch_strdup(at_row.cols[1]);
|
||||
|
|
@ -234,13 +234,14 @@ backsql_oc_map_rec* backsql_oc_with_name(backsql_info *si,char* objclass)
|
|||
{
|
||||
backsql_oc_map_rec tmp,*res;
|
||||
|
||||
// Debug(LDAP_DEBUG_TRACE,"==>oc_with_name(): searching for objectclass with name='%s'\n",objclass,0,0);
|
||||
/* Debug(LDAP_DEBUG_TRACE,"==>oc_with_name(): searching for objectclass with name='%s'\n",objclass,0,0);*/
|
||||
tmp.name=objclass;
|
||||
res=(backsql_oc_map_rec*)avl_find(si->oc_by_name,&tmp,(AVL_CMP)backsql_cmp_oc_name);
|
||||
// if (res!=NULL)
|
||||
// Debug(LDAP_DEBUG_TRACE,"<==oc_with_name(): found name='%s', id=%d\n",res->name,res->id,0);
|
||||
// else
|
||||
// Debug(LDAP_DEBUG_TRACE,"<==oc_with_name(): not found\n",0,0,0);
|
||||
/* if (res!=NULL)
|
||||
Debug(LDAP_DEBUG_TRACE,"<==oc_with_name(): found name='%s', id=%d\n",res->name,res->id,0);
|
||||
else
|
||||
Debug(LDAP_DEBUG_TRACE,"<==oc_with_name(): not found\n",0,0,0);
|
||||
*/
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
@ -248,13 +249,14 @@ backsql_oc_map_rec* backsql_oc_with_id(backsql_info *si,unsigned long id)
|
|||
{
|
||||
backsql_oc_map_rec tmp,*res;
|
||||
|
||||
// Debug(LDAP_DEBUG_TRACE,"==>oc_with_id(): searching for objectclass with id='%d'\n",id,0,0);
|
||||
/* Debug(LDAP_DEBUG_TRACE,"==>oc_with_id(): searching for objectclass with id='%d'\n",id,0,0);*/
|
||||
tmp.id=id;
|
||||
res=(backsql_oc_map_rec*)avl_find(si->oc_by_id,&tmp,(AVL_CMP)backsql_cmp_oc_id);
|
||||
// if (res!=NULL)
|
||||
// Debug(LDAP_DEBUG_TRACE,"<==oc_with_name(): found name='%s', id=%d\n",res->name,res->id,0);
|
||||
// else
|
||||
// Debug(LDAP_DEBUG_TRACE,"<==oc_with_name(): not found\n",0,0,0);
|
||||
/* if (res!=NULL)
|
||||
Debug(LDAP_DEBUG_TRACE,"<==oc_with_name(): found name='%s', id=%d\n",res->name,res->id,0);
|
||||
else
|
||||
Debug(LDAP_DEBUG_TRACE,"<==oc_with_name(): not found\n",0,0,0);
|
||||
*/
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
@ -262,15 +264,17 @@ backsql_at_map_rec* backsql_at_with_name(backsql_oc_map_rec* objclass,char* attr
|
|||
{
|
||||
backsql_at_map_rec tmp,*res;
|
||||
|
||||
//Debug(LDAP_DEBUG_TRACE,"==>at_with_name(): searching for attribute with name='%s' (for objectclass '%s')\n",
|
||||
// attr,objclass->name,0);
|
||||
/*Debug(LDAP_DEBUG_TRACE,"==>at_with_name(): searching for attribute with name='%s' (for objectclass '%s')\n",
|
||||
attr,objclass->name,0);
|
||||
*/
|
||||
tmp.name=attr;
|
||||
res=(backsql_at_map_rec*)avl_find(objclass->attrs,&tmp,(AVL_CMP)backsql_cmp_attr);
|
||||
//if (res!=NULL)
|
||||
//Debug(LDAP_DEBUG_TRACE,"<==at_with_name(): found name='%s', sel_expr='%s'\n",
|
||||
// res->name,res->sel_expr,0);
|
||||
//else
|
||||
// Debug(LDAP_DEBUG_TRACE,"<==at_with_name(): not found\n",0,0,0);
|
||||
/*if (res!=NULL)
|
||||
Debug(LDAP_DEBUG_TRACE,"<==at_with_name(): found name='%s', sel_expr='%s'\n",
|
||||
res->name,res->sel_expr,0);
|
||||
else
|
||||
Debug(LDAP_DEBUG_TRACE,"<==at_with_name(): not found\n",0,0,0);
|
||||
*/
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
@ -291,7 +295,7 @@ int backsql_free_attr(backsql_at_map_rec *at)
|
|||
ch_free(at->query);
|
||||
ch_free(at);
|
||||
if (at->sel_expr_u)
|
||||
ch_free(at->sel_expr_u); // TimesTen
|
||||
ch_free(at->sel_expr_u); /* TimesTen */
|
||||
Debug(LDAP_DEBUG_TRACE,"<==free_attr()\n",0,0,0);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -378,11 +378,11 @@ int backsql_oc_get_candidates(backsql_oc_map_rec *oc,backsql_srch_info *bsi)
|
|||
SQLHSTMT sth;
|
||||
RETCODE rc;
|
||||
backsql_entryID base_id,*res,*c_id;
|
||||
//Entry *e;
|
||||
/*Entry *e;*/
|
||||
BACKSQL_ROW_NTS row;
|
||||
int i;
|
||||
int j;
|
||||
char temp_base_dn[BACKSQL_MAX_DN_LEN+1]; // TimesTen
|
||||
char temp_base_dn[BACKSQL_MAX_DN_LEN+1]; /* TimesTen*/
|
||||
|
||||
Debug(LDAP_DEBUG_TRACE,"==>backsql_oc_get_candidates(): oc='%s'\n",oc->name,0,0);
|
||||
bsi->oc=oc;
|
||||
|
|
@ -492,10 +492,10 @@ SQL_SUCCESS)
|
|||
if (row.is_null[i]>0)
|
||||
{
|
||||
backsql_entry_addattr(e,row.col_names[i],row.cols[i],row.col_prec[i]);
|
||||
// Debug(LDAP_DEBUG_TRACE,"prec=%d\n",(int)row.col_prec[i],0,0);
|
||||
Debug(LDAP_DEBUG_TRACE,"prec=%d\n",(int)row.col_prec[i],0,0);
|
||||
}
|
||||
// else
|
||||
// Debug(LDAP_DEBUG_TRACE,"NULL value in this row for attribute '%s'\n",row.col_names[i],0,0);
|
||||
else
|
||||
Debug(LDAP_DEBUG_TRACE,"NULL value in this row for attribute '%s'\n",row.col_names[i],0,0);
|
||||
}
|
||||
*/
|
||||
|
||||
|
|
@ -571,14 +571,16 @@ int backsql_search(BackendDB *be,Connection *conn,Operation *op,
|
|||
backsql_init_search(&srch_info,bi,(char*)nbase,scope,slimit,tlimit,stoptime,filter,dbh,
|
||||
be,conn,op,attrs);
|
||||
|
||||
//for each objectclass we try to construct query which gets IDs
|
||||
//of entries matching LDAP query filter and scope (or at least candidates),
|
||||
//and get the IDs
|
||||
/*for each objectclass we try to construct query which gets IDs
|
||||
*of entries matching LDAP query filter and scope (or at least candidates),
|
||||
*and get the IDs
|
||||
*/
|
||||
avl_apply(bi->oc_by_name,(AVL_APPLY)backsql_oc_get_candidates,&srch_info,0,AVL_INORDER);
|
||||
|
||||
nentries=0;
|
||||
//now we load candidate entries (only those attrubutes mentioned in attrs and filter),
|
||||
//test it against full filter and then send to client
|
||||
/*now we load candidate entries (only those attrubutes mentioned in attrs and filter),
|
||||
*test it against full filter and then send to client
|
||||
*/
|
||||
for(eid=srch_info.id_list;eid!=NULL;eid=eid->next)
|
||||
{
|
||||
/* check for abandon */
|
||||
|
|
|
|||
Loading…
Reference in a new issue