]> git.donarmstrong.com Git - dak.git/commitdiff
Merge branch 'master' into dbtests
authorTorsten Werner <twerner@debian.org>
Thu, 3 Mar 2011 22:49:50 +0000 (23:49 +0100)
committerTorsten Werner <twerner@debian.org>
Thu, 3 Mar 2011 22:49:50 +0000 (23:49 +0100)
Conflicts:
tests/dbtest_contents.py

config/debian/dak.conf
daklib/dbconn.py
tests/dbtest_contents.py

index bc9da6d8d64548b8adfb6a8fd574b48d58f8469b..97aaa01db26d46c381fe25a0a0237d65d715689e 100644 (file)
@@ -458,6 +458,8 @@ DB
   PoolSize 17;
   // MaxOverflow shouldn't exceed postgresql.conf's max_connections - PoolSize
   MaxOverflow 13;
+  // should be false for encoding == SQL_ASCII
+  Unicode "false"
 };
 
 Archive
index 3806e31e2d09c9922c58014e9c0462d13e0a368b..5bff4186df00dba323e449a482bc90c1f6eba93a 100755 (executable)
@@ -3306,14 +3306,17 @@ class DBConn(object):
             connstr = "postgres:///%s" % cnf["DB::Name"]
             if cnf["DB::Port"] and cnf["DB::Port"] != "-1":
                 connstr += "?port=%s" % cnf["DB::Port"]
-        if not cnf.has_key('DB::PoolSize'):
-            cnf['DB::PoolSize'] = '5'
-        if not cnf.has_key('DB::MaxOverflow'):
-            cnf['DB::MaxOverflow'] = '10'
-
-        self.db_pg   = create_engine(connstr, echo=self.debug,
-            pool_size=int(cnf['DB::PoolSize']),
-            max_overflow=int(cnf['DB::MaxOverflow']))
+
+        engine_args = { 'echo': self.debug }
+        if cnf.has_key('DB::PoolSize'):
+            engine_args['pool_size'] = int(cnf['DB::PoolSize'])
+        if cnf.has_key('DB::MaxOverflow'):
+            engine_args['max_overflow'] = int(cnf['DB::MaxOverflow'])
+        if sa_major_version == '0.6' and cnf.has_key('DB::Unicode') and \
+            cnf['DB::Unicode'] == 'false':
+            engine_args['use_native_unicode'] = False
+
+        self.db_pg   = create_engine(connstr, **engine_args)
         self.db_meta = MetaData()
         self.db_meta.bind = self.db_pg
         self.db_smaker = sessionmaker(bind=self.db_pg,
index 49db68489e0e084f6dba79e8acbdf379140381cd..b651204216345d681f7c0548eb15c37001d73250 100755 (executable)
@@ -156,6 +156,8 @@ class ContentsTestCase(DBDakTestCase):
             cw.output_filename())
         # test delete cascading
         self.session.delete(self.binary['hello_2.2-1_i386'])
+        # test unicode support
+        self.binary['hello_2.2-1_i386'].contents.append(BinContents(file = '\xc3\xb6'))
         self.session.commit()
 
     def test_scan_contents(self):