summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 696b92e)
raw | patch | inline | side by side (parent: 696b92e)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 12 Nov 2003 03:42:13 +0000 (03:42 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 12 Nov 2003 03:42:13 +0000 (03:42 +0000) |
- fixes for metakit for the new db unit tests
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1980 57a73879-2fb5-44c3-a270-3262357dd7e2
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1980 57a73879-2fb5-44c3-a270-3262357dd7e2
diff --git a/doc/installation.txt b/doc/installation.txt
index eaceb3652611c66e434c8a230f0701cd8bcfe766..741254b4d3dbc59b5808f1b7b95ef8b2aa947f19 100644 (file)
--- a/doc/installation.txt
+++ b/doc/installation.txt
Installing Roundup
==================
-:Version: $Revision: 1.63 $
+:Version: $Revision: 1.64 $
.. contents::
**mysql**
Backend for popular RDBMS MySQL. According to benchmarks, this backend works
much faster than any of \*dbm ones, but slightly slower than metakit and
- sqlite. A good scalability is not a property of this backend for now,
- though. For more info on backend installation see doc/mysql.txt.
+ sqlite. For more info on backend installation see doc/mysql.txt.
+**postgresql**
+ Backend for popular RDBMS PostgreSQL. According to benchmarks, this
+ backend works much faster than any of \*dbm ones and mysql, but slightly
+ slower than metakit and sqlite.
+ For more info on backend installation see doc/postgresql.txt.
**metakit**
This backend is implemented over the metakit_ storage system, using Mk4Py as
the interface. It scales much better than the dbm backends.
diff --git a/doc/mysql.txt b/doc/mysql.txt
index 13fdb47d31d74a69bdb21a1625a27f3c84ee8cf5..9e5c5ab4c4fa211346c88826d462c84a70f0bafb 100644 (file)
--- a/doc/mysql.txt
+++ b/doc/mysql.txt
MySQL Backend
=============
-:version: $Revision: 1.5 $
+:version: $Revision: 1.6 $
This notes detail the MySQL backend for the Roundup issue tracker.
if you have no other choice)
2. Python MySQL interface - http://sourceforge.net/projects/mysql-python
+:Note: the InnoDB implementation has a bug that Roundup tickles. See
+ http://bugs.mysql.com/bug.php?id=1810
Running the MySQL tests
=======================
index 737d08d3faa6883cfae26f3d8c1af95c8aa668a7..a612f8b145598c1fb39c779f2ff801e7591dd569 100755 (executable)
-# $Id: back_metakit.py,v 1.51 2003-10-07 11:58:57 anthonybaxter Exp $
+# $Id: back_metakit.py,v 1.52 2003-11-12 03:42:12 richard Exp $
'''
Metakit backend for Roundup, originally by Gordon McMillan.
if tblid == -1:
tblid = self.tables.append(name=tablenm)
if creator is None:
- creator = self.getuid()
+ creator = int(self.getuid())
else:
try:
creator = int(creator)
if not row.creation:
row.creation = int(time.time())
if not row.creator:
- row.creator = self.db.getuid()
+ row.creator = int(self.db.getuid())
self.db.dirty = 1
if self.do_journal:
if not isinstance(prop, hyperdb.String):
raise TypeError, "%s is not a String" % propname
+ # TODO: metakit needs to be able to cope with the key property
+ # *changing*, which it can't do at present. At the moment, it
+ # creates the key prop index once, with no record of the name of
+ # the property for the index.
+
# first setkey for this run
self.keyname = propname
iv = self.db._db.view('_%s' % self.classname)
else:
d = {}
for id in ids.keys():
- d[int(id)] = 1
+ if id is None:
+ d[0] = 1
+ else:
+ d[int(id)] = 1
ids = d
prop = self.ruprops[propname]
view = self.getview()
index 2993b4ba07a1394713e3b9414a457042820ecf49..1bf33f6a726eba1d1a4752016b775f31cbe9c14a 100644 (file)
class Database(Database):
arg = '%s'
- # backend for MySQL to use
- mysql_backend = 'InnoDB'
- #mysql_backend = 'BDB' # much slower, only use if you have no choice
+ # Backend for MySQL to use.
+ # InnoDB is faster, but has a bug in its rollback machinery that causes
+ # some selects in subsequent transactions to fail. BDB does not have
+ # this bug, but is apparently much slower.
+ #mysql_backend = 'InnoDB'
+ mysql_backend = 'BDB'
def sql_open_connection(self):
db = getattr(self.config, 'MYSQL_DATABASE')
index f5cb69b7e4a09e8a3c9a915129a117184f01a921..1e7db1914849d97c13af7234ca9833e0dd28c81a 100644 (file)
-# $Id: rdbms_common.py,v 1.68 2003-11-12 01:00:58 richard Exp $
+# $Id: rdbms_common.py,v 1.69 2003-11-12 03:42:12 richard Exp $
''' Relational database (SQL) backend common code.
Basics:
'propspec' consists of keyword args propname=nodeid or
propname={nodeid:1, }
'propname' must be the name of a property in this class, or a
- KeyError is raised. That property must be a Link or Multilink
- property, or a TypeError is raised.
+ KeyError is raised. That property must be a Link or
+ Multilink property, or a TypeError is raised.
Any node in this class whose 'propname' property links to any of the
nodeids will be returned. Used by the full text indexing, which knows
for prop, values in propspec:
if not isinstance(props[prop], hyperdb.Link):
continue
+ if type(values) is type({}) and len(values) == 1:
+ values = values.keys()[0]
if type(values) is type(''):
allvalues += (values,)
where.append('_%s = %s'%(prop, a))
diff --git a/test/db_test_base.py b/test/db_test_base.py
index 01209546ecb8a3c40ac2509e35433586bb629d60..97c01cb7c6d921517a92691b828bef26b7d2119c 100644 (file)
--- a/test/db_test_base.py
+++ b/test/db_test_base.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: db_test_base.py,v 1.6 2003-11-11 11:19:18 richard Exp $
+# $Id: db_test_base.py,v 1.7 2003-11-12 03:42:13 richard Exp $
-import unittest, os, shutil, errno, imp, sys, time
+import unittest, os, shutil, errno, imp, sys, time, pprint
from roundup.hyperdb import String, Password, Link, Multilink, Date, \
Interval, DatabaseError, Boolean, Number, Node
got = self.db.issue.find(status='1')
got.sort()
self.assertEqual(got, ids)
+ got = self.db.issue.find(status={'1':1})
+ got.sort()
+ self.assertEqual(got, ids)
# none
self.assertEqual(self.db.issue.find(status='4'), [])
+ self.assertEqual(self.db.issue.find(status={'4':1}), [])
# should match first and third
got = self.db.issue.find(assignedto=None)
got.sort()
self.assertEqual(got, ids)
+ got = self.db.issue.find(assignedto={None:1})
+ got.sort()
+ self.assertEqual(got, ids)
# should match first three
got = self.db.issue.find(status='1', nosy='2')
ids.append(oddid)
ids.sort()
self.assertEqual(got, ids)
+ got = self.db.issue.find(status={'1':1}, nosy={'2':1})
+ got.sort()
+ self.assertEqual(got, ids)
# none
self.assertEqual(self.db.issue.find(status='4', nosy='3'), [])
+ self.assertEqual(self.db.issue.find(status={'4':1}, nosy={'3':1}), [])
def testStringFind(self):
ids = []
self.assertEqual(self.db.a.lookup('apple'), aid)
self.db.commit(); self.db.close()
- # change the key to fooz
+ # change the key to fooz on a
self.init_amodkey()
self.assertEqual(self.db.a.get(aid, 'name'), 'apple')
self.assertEqual(self.db.a.get(aid, 'fooz'), None)