cubicweb #517292 crash on query [rejected]

"Any P WHERE P eid 1136, T concerns P, T eid A"

sometimes this works, sometimes not, as below

trace:

 File "/home/auc/src/fcw/cubes/comet/views/forms.py", line 192, in cell_call
   {'t' : subject_eid, 'p' : object.eid}):
 File "/home/auc/src/fcw/cubicweb/dbapi.py", line 309, in execute
   return self.cursor.execute(*args, **kwargs)
 File "/home/auc/src/fcw/cubicweb/dbapi.py", line 796, in execute
   rset = Cursor.execute(self, operation, parameters, eid_key, build_descr)
 File "/home/auc/src/fcw/cubicweb/dbapi.py", line 666, in execute
   parameters, eid_key, build_descr)
 File "/home/auc/src/fcw/cubicweb/server/repository.py", line 611, in execute
   build_descr)
 File "/home/auc/src/fcw/cubicweb/server/querier.py", line 647, in execute
   self._planner.build_plan(plan)
 File "/home/auc/src/fcw/cubicweb/server/ssplanner.py", line 36, in build_plan
   for step in build_plan(plan, plan.rqlst):
 File "/home/auc/src/fcw/cubicweb/server/ssplanner.py", line 45, in build_select_plan
   plan.preprocess(rqlst)
 File "/home/auc/src/fcw/cubicweb/server/querier.py", line 196, in preprocess
   self._insert_security(union, noinvariant)
 File "/home/auc/src/fcw/cubicweb/server/querier.py", line 208, in _insert_security
   localchecks, restricted = self._check_permissions(select)
 File "/home/auc/src/fcw/cubicweb/server/querier.py", line 302, in _check_permissions
   varkwargs = var_kwargs(rqlst.where, self.args)
 File "/home/auc/src/fcw/cubicweb/server/querier.py", line 52, in var_kwargs
   varkwargs[rel.children[0].name] = typed_eid(cmp.children[0].eval(args))
ValueError: invalid literal for int() with base 10: 'A'
prioritynormal
typebug
done in<not specified>
load0.000
load left0.000
closed by<not specified>