cubicweb #1055133 SQL Server support : string concatenation issue [resolved]

We've seen the follwing in the CW logs of an instance running on sql server:

14:58:32 - (cubicweb.sources.system) CRITICAL: sql: 'SELECT _A.cw_eid, _TT.cw_eid, (%(162023056)s || SUBSTRING(_A.cw_cardinality, %(162024208)s, %(162024160)s)),  _A.cw_eid, _A.cw_eid, _A.cw_composite, _TT.cw_name, _R.cw_eid, _R.cw_name\nFROM cw_CWEType AS _TT, cw_CWRType AS _R, cw_CWRelation AS _A\nWHERE _A.cw_from_entity=%(x)s  AND _A.cw_relation_type=_R.cw_eid AND _A.cw_to_entity=_TT.cw_eid\nORDER BY 9'
args: {'162024208': 1, 'x': 34, '162023056': 'i18ncard_', '162024160': 1}
dbms message: '42000'
2010-06-11 14:58:32 - (cubicweb.sources.system) CRITICAL: transaction has been rollbacked
2010-06-11 14:58:32 - (cubicweb.repository) ERROR: unexpected error while executing Any A,TT,"i18ncard_"+SUBSTRING(C,1,1),A,A, K,TTN,R,RN ORDERBY RN WHERE A is  CWRelation, A from_entity S, S eid %(x)s, A composite K, A cardinality C, A relation_type R, R name RN, A to_entity TT, TT name TTN with {'x': 34}
Traceback (most recent call last):
 File "\\xxx.local\PYL001A\Labo\Pylos\cubicweb\server\repository.py", line 594, in execute
   build_descr)
 File "\\xxx.local\PYL001A\Labo\Pylos\cubicweb\server\querier.py", line 667, in execute
   results = plan.execute()
 File "\\xxx.local\PYL001A\Labo\Pylos\cubicweb\server\querier.py", line 190, in execute
   result = step.execute()
 File "\\xxx.local\PYL001A\Labo\Pylos\cubicweb\server\ssplanner.py", line 425, in execute
   inputmap)
 File "\\xxx.local\PYL001A\Labo\Pylos\cubicweb\server\sources\native.py", line 445, in syntax_tree_search
   cursor = self.doexec(session, sql, args)
 File "\\xxx.local\PYL001A\Labo\Pylos\cubicweb\server\sources\native.py", line 627, in doexec
   cursor.execute(str(query), args)
 File "\\xxx.local\PYL001A\Labo\Pylos\logilab\database\sqlserver.py", line 111, in execute
   self._cursor.execute(final_sql , args)
ProgrammingError: ('42000', "[42000] [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near '|'. (102) (SQLExecDirectW); [42000] [Microsoft][SQL Server Native Client 10.0][SQL Server]Statement(s) could not be prepared. (8180)")
priorityimportant
typebug
done in3.8.5
load left0.000
closed by<not specified>