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
94b2c942
Commit
94b2c942
authored
Mar 23, 2005
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tentative fix.
parent
5a09264e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
6 deletions
+17
-6
branches/bug1734/src/BTrees/MergeTemplate.c
branches/bug1734/src/BTrees/MergeTemplate.c
+10
-1
branches/bug1734/src/BTrees/tests/testConflict.py
branches/bug1734/src/BTrees/tests/testConflict.py
+4
-5
branches/bug1734/src/ZODB/POSException.py
branches/bug1734/src/ZODB/POSException.py
+3
-0
No files found.
branches/bug1734/src/BTrees/MergeTemplate.c
View file @
94b2c942
...
...
@@ -70,7 +70,9 @@ merge_error(int p1, int p2, int p3, int reason)
* However, it's not OK for s2 and s3 to, between them, end up deleting all
* the keys. This is a higher-level constraint, due to that the caller of
* bucket_merge() doesn't have enough info to unlink the resulting empty
* bucket from its BTree correctly.
* bucket from its BTree correctly. It's also not OK if s2 or s3 are empty,
* because the transaction that emptied the bucket unlinked the bucket from
* the tree, and nothing we do here can get it linked back in again.
*
* Key insertion: s2 or s3 can add a new key, provided the other transaction
* doesn't insert the same key. It's not OK even if they insert the same
...
...
@@ -115,6 +117,13 @@ bucket_merge(Bucket *s1, Bucket *s2, Bucket *s3)
if
(
i3
.
next
(
&
i3
)
<
0
)
goto
err
;
/* If either "after" bucket was empty, punt. */
if
(
i2
.
position
<
0
||
i3
.
position
<
0
)
{
merge_error
(
i1
.
position
,
i2
.
position
,
i3
.
position
,
12
);
goto
err
;
}
/* Consult zodb/btrees/interfaces.py for the meaning of the last
* argument passed to merge_error().
*/
...
...
branches/bug1734/src/BTrees/tests/testConflict.py
View file @
94b2c942
...
...
@@ -178,7 +178,7 @@ class MappingBase(Base):
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge insert from empty'
)
def
testMergeEmptyAndFill
(
self
):
def
test
Fail
MergeEmptyAndFill
(
self
):
base
,
b1
,
b2
,
bm
,
e1
,
e2
,
items
=
self
.
_setupConflict
()
b1
.
clear
()
...
...
@@ -186,7 +186,7 @@ class MappingBase(Base):
b2
.
update
(
e2
)
bm
.
update
(
e2
)
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge insert from empty'
)
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge insert from empty'
,
should_fail
=
1
)
def
testMergeEmpty
(
self
):
base
,
b1
,
b2
,
bm
,
e1
,
e2
,
items
=
self
.
_setupConflict
()
...
...
@@ -275,7 +275,7 @@ class SetTests(Base):
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge insert from empty'
)
def
testMergeEmptyAndFill
(
self
):
def
test
Fail
MergeEmptyAndFill
(
self
):
base
,
b1
,
b2
,
bm
,
e1
,
e2
,
items
=
self
.
_setupConflict
()
b1
.
clear
()
...
...
@@ -283,7 +283,7 @@ class SetTests(Base):
b2
.
update
(
e2
)
bm
.
update
(
e2
)
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge insert from empty'
)
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge insert from empty'
,
should_fail
=
1
)
def
testMergeEmpty
(
self
):
base
,
b1
,
b2
,
bm
,
e1
,
e2
,
items
=
self
.
_setupConflict
()
...
...
@@ -810,7 +810,6 @@ class NastyConfict(Base, TestCase):
self
.
assert_
(
str
(
detail
).
startswith
(
'database conflict error'
))
transaction
.
abort
()
else
:
print
list
(
copy
.
items
())
self
.
fail
(
"expected ConflictError"
)
...
...
branches/bug1734/src/ZODB/POSException.py
View file @
94b2c942
...
...
@@ -187,6 +187,9 @@ class BTreesConflictError(ConflictError):
# 11; conflicting changes in an internal BTree node
'Conflicting changes in an internal BTree node'
,
# 12; i2 or i3 was empty
'Empty bucket in a transaction'
,
]
def
__init__
(
self
,
p1
,
p2
,
p3
,
reason
):
...
...
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