Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
38ef55f0
Commit
38ef55f0
authored
Sep 02, 2010
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Call readCurrent for internal nodes when making updates.
parent
6a2b9187
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
0 deletions
+47
-0
src/BTrees/BTreeTemplate.c
src/BTrees/BTreeTemplate.c
+4
-0
src/BTrees/tests/testBTrees.py
src/BTrees/tests/testBTrees.py
+43
-0
No files found.
src/BTrees/BTreeTemplate.c
View file @
38ef55f0
...
...
@@ -639,6 +639,10 @@ _BTree_set(BTree *self, PyObject *keyarg, PyObject *value,
BTREE_SEARCH
(
min
,
self
,
key
,
goto
Error
);
d
=
self
->
data
+
min
;
#ifdef PERSISTENT
PER_READCURRENT
(
self
,
goto
Error
);
#endif
if
(
SameType_Check
(
self
,
d
->
child
))
status
=
_BTree_set
(
BTREE
(
d
->
child
),
keyarg
,
value
,
unique
,
noval
);
else
{
...
...
src/BTrees/tests/testBTrees.py
View file @
38ef55f0
...
...
@@ -146,6 +146,49 @@ class Base(TestCase):
self
.
assertEqual
(
list
(
t
.
keys
(
0
,
2
,
excludemin
=
True
,
excludemax
=
True
)),
[
1
])
def
testUpdatesDoReadChecksOnInternalNodes
(
self
):
t
=
self
.
t
if
not
hasattr
(
t
,
'_firstbucket'
):
return
self
.
_populate
(
t
,
1000
)
store
=
MappingStorage
()
db
=
DB
(
store
)
conn
=
db
.
open
()
conn
.
root
.
t
=
t
transaction
.
commit
()
read
=
[]
def
readCurrent
(
ob
):
read
.
append
(
ob
)
conn
.
__class__
.
readCurrent
(
conn
,
ob
)
return
1
conn
.
readCurrent
=
readCurrent
try
:
add
=
t
.
add
remove
=
t
.
remove
except
AttributeError
:
def
add
(
i
):
t
[
i
]
=
i
def
remove
(
i
):
del
t
[
i
]
# Modifying a thing
remove
(
100
)
self
.
assert_
(
t
in
read
)
del
read
[:]
add
(
100
)
self
.
assert_
(
t
in
read
)
del
read
[:]
transaction
.
abort
()
conn
.
cacheMinimize
()
# list(t)
# self.assert_(100 in t)
# self.assert_(not read)
class
MappingBase
(
Base
):
""" Tests common to mappings (buckets, btrees) """
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment