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
aac4cd4b
Commit
aac4cd4b
authored
May 23, 2008
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug Fixed: Packing failed for databases containing cross-database references.
parent
835eddf8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
23 deletions
+31
-23
NEWS.txt
NEWS.txt
+2
-0
src/ZODB/serialize.py
src/ZODB/serialize.py
+8
-23
src/ZODB/tests/PackableStorage.py
src/ZODB/tests/PackableStorage.py
+21
-0
No files found.
NEWS.txt
View file @
aac4cd4b
...
...
@@ -5,6 +5,8 @@ Whats new in ZODB 3.8.1
Bugs Fixed:
- (beta 4) Packing failed for databases containing cross-database references.
- (beta 3) Cross-database references to databases with empty names
weren't constructed properly.
...
...
src/ZODB/serialize.py
View file @
aac4cd4b
...
...
@@ -605,17 +605,14 @@ class ObjectReader:
obj
.
__setstate__
(
state
)
oid_loaders
=
{
'w'
:
lambda
oid
:
None
,
}
def
referencesf
(
p
,
oids
=
None
):
"""Return a list of object ids found in a pickle
A list may be passed in, in which case, information is
appended to it.
Weak references are not included.
Only ordinary internal references are included.
Weak and multi-database references are not included.
"""
refs
=
[]
...
...
@@ -636,16 +633,10 @@ def referencesf(p, oids=None):
elif
isinstance
(
reference
,
str
):
oid
=
reference
else
:
try
:
reference_type
,
args
=
reference
except
ValueError
:
# weakref
continue
else
:
oid
=
oid_loaders
[
reference_type
](
*
args
)
assert
isinstance
(
reference
,
list
)
continue
if
oid
:
oids
.
append
(
oid
)
oids
.
append
(
oid
)
return
oids
...
...
@@ -678,15 +669,9 @@ def get_refs(a_pickle):
elif
isinstance
(
reference
,
str
):
data
=
reference
,
None
else
:
try
:
reference_type
,
args
=
reference
except
ValueError
:
# weakref
continue
else
:
data
=
oid_klass_loaders
[
reference_type
](
*
args
)
assert
isinstance
(
reference
,
list
)
continue
if
data
:
result
.
append
(
data
)
result
.
append
(
data
)
return
result
src/ZODB/tests/PackableStorage.py
View file @
aac4cd4b
...
...
@@ -38,6 +38,8 @@ from ZODB.POSException import ConflictError, StorageError
from
ZODB.tests.MTStorage
import
TestThread
import
ZODB.tests.util
ZERO
=
'
\
0
'
*
8
...
...
@@ -311,6 +313,24 @@ class PackableStorage(PackableStorageBase):
pass
it
.
close
()
def
checkPackWithMultiDatabaseReferences
(
self
):
databases
=
{}
db
=
DB
(
self
.
_storage
,
databases
=
databases
,
database_name
=
''
)
otherdb
=
ZODB
.
tests
.
util
.
DB
(
databases
=
databases
,
database_name
=
'o'
)
conn
=
db
.
open
()
root
=
conn
.
root
()
root
[
1
]
=
C
()
transaction
.
commit
()
del
root
[
1
]
transaction
.
commit
()
root
[
2
]
=
conn
.
get_connection
(
'o'
).
root
()
transaction
.
commit
()
db
.
pack
(
time
.
time
()
+
1
)
assert
(
len
(
self
.
_storage
)
==
1
)
class
PackableUndoStorage
(
PackableStorageBase
):
def
checkPackAllRevisions
(
self
):
...
...
@@ -705,3 +725,4 @@ class ElapsedTimer:
def
elapsed_millis
(
self
):
return
int
((
time
.
time
()
-
self
.
start_time
)
*
1000
)
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