[sqlite] Fix integrity error parsing
authorChristophe de Vienne <christophe@unlish.com>
Tue, 07 Apr 2015 17:08:53 +0200
changeset 10329 f92823a66f18
parent 10328 d7ff46d958f4
child 10332 da1cb2b12fe1
[sqlite] Fix integrity error parsing Up to sqlite 3.7, integrity error message may be in the singular form if only one column is in the unique index. Closes #5224632
server/sources/native.py
--- a/server/sources/native.py	Mon Apr 06 21:46:52 2015 +0200
+++ b/server/sources/native.py	Tue Apr 07 17:08:53 2015 +0200
@@ -736,7 +736,7 @@
                     if mo is not None:
                         raise UniqueTogetherError(cnx, cstrname=mo.group(0))
                     # old sqlite
-                    mo = re.search('columns (.*) are not unique', arg)
+                    mo = re.search('columns? (.*) (?:is|are) not unique', arg)
                     if mo is not None: # sqlite in use
                         # we left chop the 'cw_' prefix of attribute names
                         rtypes = [c.strip()[3:]