[merge] backport 3.17 fixes stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Mon, 24 Nov 2014 18:43:51 +0100
branchstable
changeset 10052 76e895a380ea
parent 9983 84738d495ffd (current diff)
parent 10051 be6517c6adf7 (diff)
child 10053 079b5279a2cd
[merge] backport 3.17 fixes
.hgtags
__pkginfo__.py
cubicweb.spec
debian/changelog
server/sources/native.py
--- a/.hgtags	Wed Sep 24 17:35:59 2014 +0200
+++ b/.hgtags	Mon Nov 24 18:43:51 2014 +0100
@@ -359,3 +359,6 @@
 d915013567429b481cb2c367071e36451c07a226 cubicweb-version-3.18.6
 d915013567429b481cb2c367071e36451c07a226 cubicweb-debian-version-3.18.6-1
 d915013567429b481cb2c367071e36451c07a226 cubicweb-centos-version-3.18.6-1
+cda4b066933f216abe185786f5458176894bdaf0 cubicweb-version-3.17.18
+cda4b066933f216abe185786f5458176894bdaf0 cubicweb-debian-version-3.17.18-1
+cda4b066933f216abe185786f5458176894bdaf0 cubicweb-centos-version-3.17.18-1
--- a/debian/changelog	Wed Sep 24 17:35:59 2014 +0200
+++ b/debian/changelog	Mon Nov 24 18:43:51 2014 +0100
@@ -40,6 +40,12 @@
 
  -- Julien Cristau <julien.cristau@logilab.fr>  Fri, 10 Jan 2014 17:14:18 +0100
 
+cubicweb (3.17.18-1) unstable; urgency=low
+
+  * new upstream release
+
+ -- Aurelien Campeas <aurelien.campeas@logilab.fr>  Mon, 24 Nov 2014 17:41:24 +0100
+
 cubicweb (3.17.17-1) unstable; urgency=low
 
   * new upstream release
--- a/server/sources/native.py	Wed Sep 24 17:35:59 2014 +0200
+++ b/server/sources/native.py	Mon Nov 24 18:43:51 2014 +0100
@@ -762,6 +762,9 @@
                         raise UniqueTogetherError(session, cstrname=mo.group(0))
                     # sqlite
                     mo = re.search('columns (.*) are not unique', arg)
+                    if mo is None:
+                        # sqlite > 3.7
+                        mo = re.search('UNIQUE constraint failed: (.*)', arg)
                     if mo is not None: # sqlite in use
                         # we left chop the 'cw_' prefix of attribute names
                         rtypes = [c.strip()[3:]
@@ -1698,6 +1701,8 @@
     Tables are saved in chunks in different files in order to prevent
     a too high memory consumption.
     """
+    blocksize = 100
+
     def __init__(self, source):
         """
         :param: source an instance of the system source
@@ -1782,10 +1787,7 @@
         sql = 'SELECT * FROM %s' % table
         columns, rows_iterator = self._get_cols_and_rows(sql)
         self.logger.info('number of rows: %d', rowcount)
-        if table.startswith('cw_'): # entities
-            blocksize = 2000
-        else: # relations and metadata
-            blocksize = 10000
+        blocksize = self.blocksize
         if rowcount > 0:
             for i, start in enumerate(xrange(0, rowcount, blocksize)):
                 rows = list(itertools.islice(rows_iterator, blocksize))