author | wc2so1 <wc2so1@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 26 Jan 2004 17:07:56 +0000 (17:07 +0000) | ||
committer | wc2so1 <wc2so1@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 26 Jan 2004 17:07:56 +0000 (17:07 +0000) | ||
commit | 03c3823fd879c10ce28f4bcd8c1c719dac80f84c | |
tree | 6055be96337f973eb33f5d79a2ffd20da9fe77cc | tree | snapshot |
parent | 52501f22699c6e6415693e168d53449b89036c62 | commit | diff |
1 Added an explicit close to the Indexer class. This was handled
by garbage collection before.
2 Added an MKBackendError exception that gets thrown on some metakit errors.
Should there be a general rdbms exception?
3 Added a sanity check when creating metakit tables in __getview
There are some test cases that create columns of the same name
with different metakit types. This can cause crashing issues with
older version of metakit. We catch these before hand and raise
an exception.
4 metakit db's cannot be weakref'd so this was removed
5 fixed a metakit.append, metakit must append lists, objects or
dictionaries, it can't handle scalars.
sv.append(int(entry))
became
sv.append((int(entry),))
6 To make it easier to compare to the other backends
Class.keyname is changed to Class.key
7 Fixed Class.lookup, sometimes it would claim that a valid
row was not valid (an _isdel row _property of 0 would
be reported as 1) This is because metakit's view.find
operation was returning bad results. This should be
view.select or view.find on a single property.
8 calling create with no parameters raises a value error
I'm not sure if this is appropriate, but it fixes
a regression test :)
9 The get method was only converting results for commited
values. uncommited values were not being converted
using the metakit conversion table
10 Added a check to the Class.__init__ to raise a ValueError
if the database already has a class of the same name.
11 Boolean and Number types can now have null values. This
is a backwards incompatible fix in that old databases
won't work correctly.
The fix is simple. For a boolean column, 0 is now None
1 is False (returns 0)
2 is True (returns 1)
For a numeric column, 0 is now None
values 0 get returned as value-1
values < 0 get returned as value
Set the BACKWARDS_COMPATIBLE flag to False to enable this fix.
12 Enumerated READ and READWRITE for the getview and getindexedview
These will probably be removed because they are not used
Known Current Bugs:
It is currently is not possible to retire an id with name X
and add a new unretired property with name X.
Confused? Here is the regression test:
self.assertRaises(ValueError, self.db.user.create)
newid = self.db.user.create(username="spam")
self.assertEqual(self.db.user.lookup('spam'), newid)
self.db.commit()
self.assertEqual(self.db.user.lookup('spam'), newid)
self.db.user.retire(newid)
self.assertRaises(KeyError, self.db.user.lookup, 'spam')
# use the key again now that the old is retired (metakit FAILS!!)
newid2 = self.db.user.create(username="spam")
self.assertNotEqual(newid, newid2)
# try to restore old node. this shouldn't succeed!
self.assertRaises(KeyError, self.db.user.restore, newid)
self.assertRaises(TypeError, self.db.issue.lookup, 'fubar')
Boolean and number values will not return None (now fixed but
breaks backwards compatibility)
This causes some regression tests to fix, namely:
def testPasswordUnset(self):
x = password.Password('x')
nid = self.db.user.create(username='foo', password=x)
self.db.user.set(nid, assignable=None)
self.assertEqual(self.db.user.get(nid, "assignable"), None)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2062 57a73879-2fb5-44c3-a270-3262357dd7e2
by garbage collection before.
2 Added an MKBackendError exception that gets thrown on some metakit errors.
Should there be a general rdbms exception?
3 Added a sanity check when creating metakit tables in __getview
There are some test cases that create columns of the same name
with different metakit types. This can cause crashing issues with
older version of metakit. We catch these before hand and raise
an exception.
4 metakit db's cannot be weakref'd so this was removed
5 fixed a metakit.append, metakit must append lists, objects or
dictionaries, it can't handle scalars.
sv.append(int(entry))
became
sv.append((int(entry),))
6 To make it easier to compare to the other backends
Class.keyname is changed to Class.key
7 Fixed Class.lookup, sometimes it would claim that a valid
row was not valid (an _isdel row _property of 0 would
be reported as 1) This is because metakit's view.find
operation was returning bad results. This should be
view.select or view.find on a single property.
8 calling create with no parameters raises a value error
I'm not sure if this is appropriate, but it fixes
a regression test :)
9 The get method was only converting results for commited
values. uncommited values were not being converted
using the metakit conversion table
10 Added a check to the Class.__init__ to raise a ValueError
if the database already has a class of the same name.
11 Boolean and Number types can now have null values. This
is a backwards incompatible fix in that old databases
won't work correctly.
The fix is simple. For a boolean column, 0 is now None
1 is False (returns 0)
2 is True (returns 1)
For a numeric column, 0 is now None
values 0 get returned as value-1
values < 0 get returned as value
Set the BACKWARDS_COMPATIBLE flag to False to enable this fix.
12 Enumerated READ and READWRITE for the getview and getindexedview
These will probably be removed because they are not used
Known Current Bugs:
It is currently is not possible to retire an id with name X
and add a new unretired property with name X.
Confused? Here is the regression test:
self.assertRaises(ValueError, self.db.user.create)
newid = self.db.user.create(username="spam")
self.assertEqual(self.db.user.lookup('spam'), newid)
self.db.commit()
self.assertEqual(self.db.user.lookup('spam'), newid)
self.db.user.retire(newid)
self.assertRaises(KeyError, self.db.user.lookup, 'spam')
# use the key again now that the old is retired (metakit FAILS!!)
newid2 = self.db.user.create(username="spam")
self.assertNotEqual(newid, newid2)
# try to restore old node. this shouldn't succeed!
self.assertRaises(KeyError, self.db.user.restore, newid)
self.assertRaises(TypeError, self.db.issue.lookup, 'fubar')
Boolean and number values will not return None (now fixed but
breaks backwards compatibility)
This causes some regression tests to fix, namely:
def testPasswordUnset(self):
x = password.Password('x')
nid = self.db.user.create(username='foo', password=x)
self.db.user.set(nid, assignable=None)
self.assertEqual(self.db.user.get(nid, "assignable"), None)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2062 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/backends/back_metakit.py | diff | blob | history |