mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
remove unnecessary data from search_info
This commit is contained in:
parent
779d94312f
commit
09f749da96
@ -1102,7 +1102,6 @@ backsql_add( Operation *op, SlapReply *rs )
|
|||||||
bsi.bsi_e = &p;
|
bsi.bsi_e = &p;
|
||||||
rs->sr_err = backsql_init_search( &bsi, &pdn,
|
rs->sr_err = backsql_init_search( &bsi, &pdn,
|
||||||
LDAP_SCOPE_BASE,
|
LDAP_SCOPE_BASE,
|
||||||
SLAP_NO_LIMIT, SLAP_NO_LIMIT,
|
|
||||||
(time_t)(-1), NULL, dbh, op, rs, slap_anlist_no_attrs,
|
(time_t)(-1), NULL, dbh, op, rs, slap_anlist_no_attrs,
|
||||||
( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) );
|
( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) );
|
||||||
if ( rs->sr_err != LDAP_SUCCESS ) {
|
if ( rs->sr_err != LDAP_SUCCESS ) {
|
||||||
|
@ -436,8 +436,6 @@ typedef struct backsql_srch_info {
|
|||||||
* is used */
|
* is used */
|
||||||
#define BACKSQL_SCOPE_BASE_LIKE ( LDAP_SCOPE_BASE | 0x1000 )
|
#define BACKSQL_SCOPE_BASE_LIKE ( LDAP_SCOPE_BASE | 0x1000 )
|
||||||
Filter *bsi_filter;
|
Filter *bsi_filter;
|
||||||
int bsi_slimit,
|
|
||||||
bsi_tlimit;
|
|
||||||
time_t bsi_stoptime;
|
time_t bsi_stoptime;
|
||||||
|
|
||||||
backsql_entryID *bsi_id_list,
|
backsql_entryID *bsi_id_list,
|
||||||
|
@ -76,7 +76,6 @@ backsql_bind( Operation *op, SlapReply *rs )
|
|||||||
|
|
||||||
bsi.bsi_e = &e;
|
bsi.bsi_e = &e;
|
||||||
rc = backsql_init_search( &bsi, &op->o_req_ndn, LDAP_SCOPE_BASE,
|
rc = backsql_init_search( &bsi, &op->o_req_ndn, LDAP_SCOPE_BASE,
|
||||||
SLAP_NO_LIMIT, SLAP_NO_LIMIT,
|
|
||||||
(time_t)(-1), NULL, dbh, op, rs, anlist,
|
(time_t)(-1), NULL, dbh, op, rs, anlist,
|
||||||
BACKSQL_ISF_GET_ENTRY );
|
BACKSQL_ISF_GET_ENTRY );
|
||||||
if ( rc != LDAP_SUCCESS ) {
|
if ( rc != LDAP_SUCCESS ) {
|
||||||
|
@ -60,9 +60,7 @@ backsql_compare( Operation *op, SlapReply *rs )
|
|||||||
* Get the entry
|
* Get the entry
|
||||||
*/
|
*/
|
||||||
bsi.bsi_e = &e;
|
bsi.bsi_e = &e;
|
||||||
rc = backsql_init_search( &bsi, &op->o_req_ndn,
|
rc = backsql_init_search( &bsi, &op->o_req_ndn, LDAP_SCOPE_BASE,
|
||||||
LDAP_SCOPE_BASE,
|
|
||||||
SLAP_NO_LIMIT, SLAP_NO_LIMIT,
|
|
||||||
(time_t)(-1), NULL, dbh, op, rs, anlist,
|
(time_t)(-1), NULL, dbh, op, rs, anlist,
|
||||||
( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) );
|
( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) );
|
||||||
switch ( rc ) {
|
switch ( rc ) {
|
||||||
|
@ -115,7 +115,6 @@ backsql_delete( Operation *op, SlapReply *rs )
|
|||||||
bsi.bsi_e = &d;
|
bsi.bsi_e = &d;
|
||||||
rs->sr_err = backsql_init_search( &bsi, &op->o_req_ndn,
|
rs->sr_err = backsql_init_search( &bsi, &op->o_req_ndn,
|
||||||
LDAP_SCOPE_BASE,
|
LDAP_SCOPE_BASE,
|
||||||
SLAP_NO_LIMIT, SLAP_NO_LIMIT,
|
|
||||||
(time_t)(-1), NULL, dbh, op, rs, slap_anlist_no_attrs,
|
(time_t)(-1), NULL, dbh, op, rs, slap_anlist_no_attrs,
|
||||||
( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) );
|
( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) );
|
||||||
switch ( rs->sr_err ) {
|
switch ( rs->sr_err ) {
|
||||||
@ -223,7 +222,6 @@ backsql_delete( Operation *op, SlapReply *rs )
|
|||||||
e_id = bsi.bsi_base_id;
|
e_id = bsi.bsi_base_id;
|
||||||
rs->sr_err = backsql_init_search( &bsi, &pdn,
|
rs->sr_err = backsql_init_search( &bsi, &pdn,
|
||||||
LDAP_SCOPE_BASE,
|
LDAP_SCOPE_BASE,
|
||||||
SLAP_NO_LIMIT, SLAP_NO_LIMIT,
|
|
||||||
(time_t)(-1), NULL, dbh, op, rs, slap_anlist_no_attrs,
|
(time_t)(-1), NULL, dbh, op, rs, slap_anlist_no_attrs,
|
||||||
BACKSQL_ISF_GET_ENTRY );
|
BACKSQL_ISF_GET_ENTRY );
|
||||||
if ( rs->sr_err != LDAP_SUCCESS ) {
|
if ( rs->sr_err != LDAP_SUCCESS ) {
|
||||||
|
@ -569,8 +569,6 @@ backsql_db_close(
|
|||||||
int
|
int
|
||||||
backsql_connection_destroy( Backend *bd, Connection *c )
|
backsql_connection_destroy( Backend *bd, Connection *c )
|
||||||
{
|
{
|
||||||
backsql_info *bi = (backsql_info*)bd->be_private;
|
|
||||||
|
|
||||||
char opbuf[ OPERATION_BUFFER_SIZE ];
|
char opbuf[ OPERATION_BUFFER_SIZE ];
|
||||||
Operation* op = (Operation *)opbuf;
|
Operation* op = (Operation *)opbuf;
|
||||||
|
|
||||||
|
@ -65,7 +65,6 @@ backsql_modify( Operation *op, SlapReply *rs )
|
|||||||
bsi.bsi_e = &m;
|
bsi.bsi_e = &m;
|
||||||
rs->sr_err = backsql_init_search( &bsi, &op->o_req_ndn,
|
rs->sr_err = backsql_init_search( &bsi, &op->o_req_ndn,
|
||||||
LDAP_SCOPE_BASE,
|
LDAP_SCOPE_BASE,
|
||||||
SLAP_NO_LIMIT, SLAP_NO_LIMIT,
|
|
||||||
(time_t)(-1), NULL, dbh, op, rs,
|
(time_t)(-1), NULL, dbh, op, rs,
|
||||||
slap_anlist_all_attributes,
|
slap_anlist_all_attributes,
|
||||||
( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) );
|
( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) );
|
||||||
|
@ -74,7 +74,6 @@ backsql_modrdn( Operation *op, SlapReply *rs )
|
|||||||
bsi.bsi_e = &r;
|
bsi.bsi_e = &r;
|
||||||
rs->sr_err = backsql_init_search( &bsi, &op->o_req_ndn,
|
rs->sr_err = backsql_init_search( &bsi, &op->o_req_ndn,
|
||||||
LDAP_SCOPE_BASE,
|
LDAP_SCOPE_BASE,
|
||||||
SLAP_NO_LIMIT, SLAP_NO_LIMIT,
|
|
||||||
(time_t)(-1), NULL, dbh, op, rs,
|
(time_t)(-1), NULL, dbh, op, rs,
|
||||||
slap_anlist_all_attributes,
|
slap_anlist_all_attributes,
|
||||||
( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) );
|
( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) );
|
||||||
@ -171,7 +170,6 @@ backsql_modrdn( Operation *op, SlapReply *rs )
|
|||||||
e_id = bsi.bsi_base_id;
|
e_id = bsi.bsi_base_id;
|
||||||
rs->sr_err = backsql_init_search( &bsi, &pndn,
|
rs->sr_err = backsql_init_search( &bsi, &pndn,
|
||||||
LDAP_SCOPE_BASE,
|
LDAP_SCOPE_BASE,
|
||||||
SLAP_NO_LIMIT, SLAP_NO_LIMIT,
|
|
||||||
(time_t)(-1), NULL, dbh, op, rs,
|
(time_t)(-1), NULL, dbh, op, rs,
|
||||||
slap_anlist_all_attributes,
|
slap_anlist_all_attributes,
|
||||||
BACKSQL_ISF_GET_ENTRY );
|
BACKSQL_ISF_GET_ENTRY );
|
||||||
@ -226,7 +224,6 @@ backsql_modrdn( Operation *op, SlapReply *rs )
|
|||||||
bsi.bsi_e = &n;
|
bsi.bsi_e = &n;
|
||||||
rs->sr_err = backsql_init_search( &bsi, new_npdn,
|
rs->sr_err = backsql_init_search( &bsi, new_npdn,
|
||||||
LDAP_SCOPE_BASE,
|
LDAP_SCOPE_BASE,
|
||||||
SLAP_NO_LIMIT, SLAP_NO_LIMIT,
|
|
||||||
(time_t)(-1), NULL, dbh, op, rs,
|
(time_t)(-1), NULL, dbh, op, rs,
|
||||||
slap_anlist_all_attributes,
|
slap_anlist_all_attributes,
|
||||||
( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) );
|
( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) );
|
||||||
@ -455,7 +452,6 @@ backsql_modrdn( Operation *op, SlapReply *rs )
|
|||||||
bsi.bsi_e = &r;
|
bsi.bsi_e = &r;
|
||||||
rs->sr_err = backsql_init_search( &bsi, &new_ndn,
|
rs->sr_err = backsql_init_search( &bsi, &new_ndn,
|
||||||
LDAP_SCOPE_BASE,
|
LDAP_SCOPE_BASE,
|
||||||
SLAP_NO_LIMIT, SLAP_NO_LIMIT,
|
|
||||||
(time_t)(-1), NULL, dbh, op, rs,
|
(time_t)(-1), NULL, dbh, op, rs,
|
||||||
slap_anlist_all_attributes,
|
slap_anlist_all_attributes,
|
||||||
( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) );
|
( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) );
|
||||||
|
@ -184,7 +184,6 @@ backsql_operational(
|
|||||||
|
|
||||||
rc = backsql_init_search( &bsi, &rs->sr_entry->e_nname,
|
rc = backsql_init_search( &bsi, &rs->sr_entry->e_nname,
|
||||||
LDAP_SCOPE_BASE,
|
LDAP_SCOPE_BASE,
|
||||||
SLAP_NO_LIMIT, SLAP_NO_LIMIT,
|
|
||||||
(time_t)(-1), NULL, dbh, op, rs, NULL,
|
(time_t)(-1), NULL, dbh, op, rs, NULL,
|
||||||
BACKSQL_ISF_GET_ID );
|
BACKSQL_ISF_GET_ID );
|
||||||
if ( rc != LDAP_SUCCESS ) {
|
if ( rc != LDAP_SUCCESS ) {
|
||||||
|
@ -164,7 +164,7 @@ int backsql_destroy_schema_map( backsql_info *si );
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
int backsql_init_search( backsql_srch_info *bsi,
|
int backsql_init_search( backsql_srch_info *bsi,
|
||||||
struct berval *nbase, int scope, int slimit, int tlimit,
|
struct berval *nbase, int scope,
|
||||||
time_t stoptime, Filter *filter, SQLHDBC dbh,
|
time_t stoptime, Filter *filter, SQLHDBC dbh,
|
||||||
Operation *op, SlapReply *rs, AttributeName *attrs,
|
Operation *op, SlapReply *rs, AttributeName *attrs,
|
||||||
unsigned flags );
|
unsigned flags );
|
||||||
|
@ -109,8 +109,6 @@ backsql_init_search(
|
|||||||
backsql_srch_info *bsi,
|
backsql_srch_info *bsi,
|
||||||
struct berval *nbase,
|
struct berval *nbase,
|
||||||
int scope,
|
int scope,
|
||||||
int slimit,
|
|
||||||
int tlimit,
|
|
||||||
time_t stoptime,
|
time_t stoptime,
|
||||||
Filter *filter,
|
Filter *filter,
|
||||||
SQLHDBC dbh,
|
SQLHDBC dbh,
|
||||||
@ -127,8 +125,6 @@ backsql_init_search(
|
|||||||
BER_BVZERO( &bsi->bsi_base_id.eid_dn );
|
BER_BVZERO( &bsi->bsi_base_id.eid_dn );
|
||||||
BER_BVZERO( &bsi->bsi_base_id.eid_ndn );
|
BER_BVZERO( &bsi->bsi_base_id.eid_ndn );
|
||||||
bsi->bsi_scope = scope;
|
bsi->bsi_scope = scope;
|
||||||
bsi->bsi_slimit = slimit;
|
|
||||||
bsi->bsi_tlimit = tlimit;
|
|
||||||
bsi->bsi_filter = filter;
|
bsi->bsi_filter = filter;
|
||||||
bsi->bsi_dbh = dbh;
|
bsi->bsi_dbh = dbh;
|
||||||
bsi->bsi_op = op;
|
bsi->bsi_op = op;
|
||||||
@ -1827,7 +1823,6 @@ backsql_search( Operation *op, SlapReply *rs )
|
|||||||
bsi.bsi_e = &base_entry;
|
bsi.bsi_e = &base_entry;
|
||||||
rs->sr_err = backsql_init_search( &bsi, &op->o_req_ndn,
|
rs->sr_err = backsql_init_search( &bsi, &op->o_req_ndn,
|
||||||
op->ors_scope,
|
op->ors_scope,
|
||||||
op->ors_slimit, op->ors_tlimit,
|
|
||||||
stoptime, op->ors_filter,
|
stoptime, op->ors_filter,
|
||||||
dbh, op, rs, op->ors_attrs,
|
dbh, op, rs, op->ors_attrs,
|
||||||
( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) );
|
( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) );
|
||||||
@ -2079,7 +2074,6 @@ backsql_search( Operation *op, SlapReply *rs )
|
|||||||
rc = backsql_init_search( &bsi2,
|
rc = backsql_init_search( &bsi2,
|
||||||
&e->e_nname,
|
&e->e_nname,
|
||||||
LDAP_SCOPE_BASE,
|
LDAP_SCOPE_BASE,
|
||||||
SLAP_NO_LIMIT, SLAP_NO_LIMIT,
|
|
||||||
(time_t)(-1), NULL,
|
(time_t)(-1), NULL,
|
||||||
dbh, op, rs, NULL,
|
dbh, op, rs, NULL,
|
||||||
BACKSQL_ISF_GET_ENTRY );
|
BACKSQL_ISF_GET_ENTRY );
|
||||||
@ -2217,9 +2211,7 @@ next_entry:;
|
|||||||
}
|
}
|
||||||
|
|
||||||
next_entry2:;
|
next_entry2:;
|
||||||
if ( op->ors_slimit != SLAP_NO_LIMIT
|
if ( --op->ors_slimit == -1 ) {
|
||||||
&& rs->sr_nentries >= op->ors_slimit )
|
|
||||||
{
|
|
||||||
rs->sr_err = LDAP_SIZELIMIT_EXCEEDED;
|
rs->sr_err = LDAP_SIZELIMIT_EXCEEDED;
|
||||||
goto send_results;
|
goto send_results;
|
||||||
}
|
}
|
||||||
@ -2335,7 +2327,6 @@ backsql_entry_get(
|
|||||||
rc = backsql_init_search( &bsi,
|
rc = backsql_init_search( &bsi,
|
||||||
ndn,
|
ndn,
|
||||||
LDAP_SCOPE_BASE,
|
LDAP_SCOPE_BASE,
|
||||||
SLAP_NO_LIMIT, SLAP_NO_LIMIT,
|
|
||||||
(time_t)(-1), NULL,
|
(time_t)(-1), NULL,
|
||||||
dbh, op, &rs, at ? anlist : NULL,
|
dbh, op, &rs, at ? anlist : NULL,
|
||||||
BACKSQL_ISF_GET_ENTRY );
|
BACKSQL_ISF_GET_ENTRY );
|
||||||
|
Loading…
Reference in New Issue
Block a user