Commit 9a23fabd authored by Gregory P. Smith's avatar Gregory P. Smith

Undo revision 58533 58534 fixes. Those were a workaround for

a problem introduced by 58385.
parent 9e8c5cb2
...@@ -360,12 +360,11 @@ class bsdTableDB : ...@@ -360,12 +360,11 @@ class bsdTableDB :
unique = 0 unique = 0
while not unique: while not unique:
# Generate a random 64-bit row ID string # Generate a random 64-bit row ID string
# (note: this code has <64 bits of randomness # (note: might have <64 bits of true randomness
# but it's plenty for our database id needs!) # but it's plenty for our database id needs!)
# We must ensure that no null bytes are in the id value.
blist = [] blist = []
for x in xrange(_rowid_str_len): for x in xrange(_rowid_str_len):
blist.append(random.randint(1,255)) blist.append(random.randint(0,255))
newid = struct.pack('B'*_rowid_str_len, *blist) newid = struct.pack('B'*_rowid_str_len, *blist)
# Guarantee uniqueness by adding this key to the database # Guarantee uniqueness by adding this key to the database
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment