From d1824b14ae78b128fb9ff6cf73d2ec4a0e756a90 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Thu, 25 May 2006 16:58:41 +0000 Subject: [PATCH] fix NOOP return code (ITS#4563; I'll check and confirm it later; NOOP support might be broken) --- servers/slapd/back-sql/add.c | 5 +++++ servers/slapd/back-sql/delete.c | 5 +++++ servers/slapd/back-sql/modify.c | 5 +++++ servers/slapd/back-sql/modrdn.c | 4 ++++ 4 files changed, 19 insertions(+) diff --git a/servers/slapd/back-sql/add.c b/servers/slapd/back-sql/add.c index 078df583a1..eb24f67b92 100644 --- a/servers/slapd/back-sql/add.c +++ b/servers/slapd/back-sql/add.c @@ -1461,6 +1461,7 @@ done:; SQLUSMALLINT CompletionType = SQL_ROLLBACK; if ( rs->sr_err == LDAP_SUCCESS && !op->o_noop ) { + assert( e == NULL ); CompletionType = SQL_COMMIT; } @@ -1503,6 +1504,10 @@ done:; } } + if ( op->o_noop && rs->sr_err == LDAP_SUCCESS ) { + rs->sr_err = LDAP_X_NO_OPERATION; + } + send_ldap_result( op, rs ); slap_graduate_commit_csn( op ); diff --git a/servers/slapd/back-sql/delete.c b/servers/slapd/back-sql/delete.c index a6656a8984..7f010fb083 100644 --- a/servers/slapd/back-sql/delete.c +++ b/servers/slapd/back-sql/delete.c @@ -441,6 +441,7 @@ backsql_delete( Operation *op, SlapReply *rs ) SQLUSMALLINT CompletionType = SQL_ROLLBACK; if ( rs->sr_err == LDAP_SUCCESS && !op->o_noop ) { + assert( e == NULL ); CompletionType = SQL_COMMIT; } @@ -462,6 +463,10 @@ done:; } } + if ( op->o_noop && rs->sr_err == LDAP_SUCCESS ) { + rs->sr_err = LDAP_X_NO_OPERATION; + } + send_ldap_result( op, rs ); Debug( LDAP_DEBUG_TRACE, "<==backsql_delete()\n", 0, 0, 0 ); diff --git a/servers/slapd/back-sql/modify.c b/servers/slapd/back-sql/modify.c index a3a93d9837..df1c95341e 100644 --- a/servers/slapd/back-sql/modify.c +++ b/servers/slapd/back-sql/modify.c @@ -168,6 +168,7 @@ do_transact:; * Commit only if all operations succeed */ if ( rs->sr_err == LDAP_SUCCESS && !op->o_noop ) { + assert( e == NULL ); CompletionType = SQL_COMMIT; } @@ -188,6 +189,10 @@ done:; } } + if ( op->o_noop && rs->sr_err == LDAP_SUCCESS ) { + rs->sr_err = LDAP_X_NO_OPERATION; + } + send_ldap_result( op, rs ); slap_graduate_commit_csn( op ); diff --git a/servers/slapd/back-sql/modrdn.c b/servers/slapd/back-sql/modrdn.c index 1c81cead29..67940a58ba 100644 --- a/servers/slapd/back-sql/modrdn.c +++ b/servers/slapd/back-sql/modrdn.c @@ -491,6 +491,10 @@ done:; SQLTransact( SQL_NULL_HENV, dbh, CompletionType ); } + if ( op->o_noop && rs->sr_err == LDAP_SUCCESS ) { + rs->sr_err = LDAP_X_NO_OPERATION; + } + send_ldap_result( op, rs ); slap_graduate_commit_csn( op ); -- 2.39.5