Content preview: On Tue, 2015-05-19 at 17:05 +0100, Howard Chu wrote: > Timur
Kristóf wrote: > > On Mon, 2015-05-18 at 23:03 +0200, Hallvard Breien Furuseth
wrote: > > > On 12/05/15 19:36, Howard Chu wrote: > > > > Dmytro Milinevskyy
wrote: > > > > > Basically I need to have an opportunity to call mdb_get
while > > > > > in > > > > > write > > > > > transaction. > > > > > The sequence
is smth like: > > > > > - txn = mdb_txn_begin(flags=0) > > > > > for i in
0..x: > > > > > - v = mdb_get(txn, i) > > > > > - mdb_put(txn, x+i, v) >
Post by Howard ChuPost by Timur KristófPost by Hallvard Breien Furuseth- mdb_put(txn, i, v+1) > > > > > - mdb_txn_commit(txn) > > > > > >
Will it be always valid data? > > > > > > > > Yes. > > > > > > ...No.
I expect he means v = the MDB_val returned by mdb_get(). > > > mdb_put()
can modify the data it points at. > > Since he's using "v+1" in his example
I assumed he's making a local > copy of > the returned values. Anyway, the
plain answer to the question in the > Subject > is Yes. > > > > See the MDB_val
documentation in ldmb.h: > > > * Values returned from the database are valid
only until a > > > subsequent > > > * update operation, or the end of the
transaction. Do not > > > modify or > > > * free them, they commonly point
into the database itself. > > > What exactly does a subsequent update operation
mean? Overwriting > > the > > value of the same key, > > If we meant "same
key" we would have said so. [...]
Content analysis details: (-2.7 points, 5.0 required)
pts rule name description
---- ---------------------- --------------------------------------------------
0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
(timur.kristof[at]gmail.com)
-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low
trust
[209.85.212.174 listed in list.dnswl.org]
-0.0 SPF_PASS SPF: sender matches SPF record
-1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
[score: 0.0000]
-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's
domain
0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid
-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
Cc: Hallvard Breien Furuseth <***@usit.uio.no>,
Dmytro Milinevskyy <***@forgetbox.com>, openldap-***@openldap.org
X-BeenThere: openldap-***@openldap.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: OpenLDAP development discussion list <openldap-devel.openldap.org>
List-Unsubscribe: <http://www.openldap.org/lists/mm/options/openldap-devel>,
<mailto:openldap-devel-***@openldap.org?subject=unsubscribe>
List-Archive: <http://www.openldap.org/lists/openldap-devel/>
List-Post: <mailto:openldap-***@openldap.org>
List-Help: <mailto:openldap-devel-***@openldap.org?subject=help>
List-Subscribe: <http://www.openldap.org/lists/mm/listinfo/openldap-devel>,
<mailto:openldap-devel-***@openldap.org?subject=subscribe>
Errors-To: openldap-devel-***@openldap.org
Sender: "openldap-devel" <openldap-devel-***@openldap.org>
X-Spam-Score: -2.7 (--)
X-Spam-Report: Spam detection software, running on the system "gauss.openldap.net", has
identified this incoming email as possible spam. The original message
has been attached to this so you can view it (if it isn't spam) or label
similar future email. If you have any questions, see
the administrator of that system for details.
Content preview: On Tue, 2015-05-19 at 17:05 +0100, Howard Chu wrote: > Timur
Kristóf wrote: > > On Mon, 2015-05-18 at 23:03 +0200, Hallvard Breien Furuseth
wrote: > > > On 12/05/15 19:36, Howard Chu wrote: > > > > Dmytro Milinevskyy
wrote: > > > > > Basically I need to have an opportunity to call mdb_get
while > > > > > in > > > > > write > > > > > transaction. > > > > > The sequence
is smth like: > > > > > - txn = mdb_txn_begin(flags=0) > > > > > for i in
0..x: > > > > > - v = mdb_get(txn, i) > > > > > - mdb_put(txn, x+i, v) >
Post by Howard ChuPost by Timur KristófPost by Hallvard Breien Furuseth- mdb_put(txn, i, v+1) > > > > > - mdb_txn_commit(txn) > > > > > >
Will it be always valid data? > > > > > > > > Yes. > > > > > > ...No.
I expect he means v = the MDB_val returned by mdb_get(). > > > mdb_put()
can modify the data it points at. > > Since he's using "v+1" in his example
I assumed he's making a local > copy of > the returned values. Anyway, the
plain answer to the question in the > Subject > is Yes. > > > > See the MDB_val
documentation in ldmb.h: > > > * Values returned from the database are valid
only until a > > > subsequent > > > * update operation, or the end of the
transaction. Do not > > > modify or > > > * free them, they commonly point
into the database itself. > > > What exactly does a subsequent update operation
mean? Overwriting > > the > > value of the same key, > > If we meant "same
key" we would have said so. [...]
Content analysis details: (-2.7 points, 5.0 required)
pts rule name description
---- ---------------------- --------------------------------------------------
-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low
trust
[209.85.212.174 listed in list.dnswl.org]
0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
(timur.kristof[at]gmail.com)
-0.0 SPF_PASS SPF: sender matches SPF record
-1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
[score: 0.0000]
-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's
domain
0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid
-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
Post by Howard ChuPost by Timur KristófPost by Hallvard Breien FurusethPost by Dmytro MilinevskyyBasically I need to have an opportunity to call mdb_get while
in
write
transaction.
- txn = mdb_txn_begin(flags=0)
- v = mdb_get(txn, i)
- mdb_put(txn, x+i, v)
- mdb_put(txn, i, v+1)
- mdb_txn_commit(txn)
Will it be always valid data?
Yes.
...No. I expect he means v = the MDB_val returned by mdb_get().
mdb_put() can modify the data it points at.
Since he's using "v+1" in his example I assumed he's making a local copy of
the returned values. Anyway, the plain answer to the question in the Subject
is Yes.
Post by Timur KristófPost by Hallvard Breien Furuseth* Values returned from the database are valid only until a subsequent
* update operation, or the end of the transaction. Do not modify or
* free them, they commonly point into the database itself.
What exactly does a subsequent update operation mean? Overwriting the
value of the same key,
If we meant "same key" we would have said so.
Okay, thanks for the clarification!
Post by Howard ChuPost by Timur Kristófor any mdb_put or mdb_cursor_put operation at
all, regardless of which key they touch?